Basket

Manage your shopping cart! Retrieve information about items in your shopping cart before checkout.


GET/basket

Find basket

Retrieve detailed information about a specific basket, including its total value, merchant details and monthly installment payment schedule.

Query parameters

  • Name
    basketId
    Type
    integer
    Description

    The ID of the basket.

  • Name
    api-version
    Type
    string
    Description

    The requested API version. The parameter is optional. Default value: 1.0.

Headers

  • Name
    X-Application-ID
    Type
    string
    Description

    The ID of the application making the request. This header parameter is required for authentication and identification purposes.

  • Name
    Ocp-Apim-Subscription-Key
    Type
    string
    Description

    A unique identifier related to the registered merchant in the snappi API environment, available within the application's details.

Response attributes

  • Name
    basket
    Type
    object
    Description

    The details of the basket including items and pricing:

    • id (integer): The ID of the basket.
    • dateCreated (date-time): The date the basket was created.
    • basketValue (double): The total value of the basket.
    • merchantId (integer): The ID of the merchant.
    • merchantName (string): The name of the merchant.
    • requestId (string(uuid)): The ID of the request.
    • orderIdentifier (string): The identifier of the order.
    • bnplAmount (double): The Buy Now Pay Later amount.
    • basketProducts (array): The list of products in the basket, including:
      • Product Number (string): The product number.
      • name (string): The name of the product.
      • quantity (double): The quantity of the product.
      • Quantity Units (string): The units of measurement.
      • Unit Price (double): The price per unit.
      • Tax Rate (double): The tax rate.
      • Total Amount (double): The total amount.
      • Total Discount Amount (double): The total discount amount.
      • Total Tax Amount (double): The total tax amount.
      • Product URL (string): The URL of the product.
      • Product Image URL (string): The URL of the product image.
    • Merchant Data (string): Data associated with the merchant.
    • phoneNumber (string): The phone number associated with the order.
    • email (string): The email address associated with the order.
    • merchantCode (string): The code associated with the merchant.
    • merchantApplication: The application associated with the merchant, including:
      • applicationId (string(uuid)): The unique identifier for the application.
      • successCallbackUrl (string): The URL for successful payment.
      • failCallbackUrl (string): The URL for failed payment.
      • created (date-time): The date and time the basket was created.
      • successRedirectURI (string): The URI for successful redirection.
      • failureRedirectURI (string): The URI for failed redirection.
    • expirationDate (date-time): The date the basket expires.
    • qrCodeData (byte): The data encoded in the QR code.
    • qrCodeDataLink (string): The link to the QR code data.
  • Name
    Monthly installments
    Type
    array
    Description

    The monthly installments for the basket, including:

    • paymentDay (date-time): The day of the month the payment is due.
    • paymentAmount (double): The amount of the payment.
    • originalDueDate (date-time): The original due date of the payment.
  • Name
    message
    Type
    string
    Description

    A message associated with the basket.

  • Name
    errors
    Type
    array
    Description

    An array of errors associated with the basket.

  • Name
    field
    Type
    string
    Description

    The field associated with the error.

  • Name
    message
    Type
    string
    Description

    The message associated with the error.

  • Name
    type
    Type
    string
    Description

    The type or category of the response, indicating the nature or classification of the information provided.

  • Name
    title
    Type
    string
    Description

    The title of the response, providing a brief summary or heading for the information being returned.

  • Name
    status
    Type
    integer
    Description

    The status of the response, indicating the success or failure of the request or operation.

  • Name
    detail
    Type
    string
    Description

    A detailed description or explanation of the response, providing additional context or information.

  • Name
    instance
    Type
    string
    Description

    The specific instance or occurrence to which the response pertains, providing a unique identifier or reference.

Request

GET
/basket
curl -X GET /basket \
  -H 'Accept: application/json' \
  -H 'X-Application-ID: string' \
  -H 'Ocp-Apim-Subscription-Key: string' 

Response examples

{
"basket": {
"id": 0,
"dateCreated": "",
"basketValue": 0,
"merchantId": 0,
"merchantName": "",
"requestId": "",
"orderIdentifier": "",
"bnplAmount": 0,
"basketProducts": [
  {
    "Product Number": "",
    "name": "",
    "quantity": 0,
    "Quantity Units": "",
    "Unit Price": 0,
    "Tax Rate": 0,
    "Total Amount": 0,
    "Total Discount Amount": 0,
    "Total Tax Amount": 0,
    "Product URL": "",
    "Product Image URL": ""
  }
],
"Merchant Data": "",
"phoneNumber": "",
"email": "",
"merchantCode": "",
"merchantApplication": {
  "applicationId": "",
  "successCallbackUrl": "",
  "failCallbackUrl": "",
  "created": "",
  "successRedirectURI": "",
  "failureRedirectURI": ""
},
"expirationDate": "",
"qrCodeData": "",
"qrCodeDataLink": ""
},
"monthlyInstallments": [
{
  "paymentDay": "",
  "paymentAmount": 0,
  "originalDueDate": ""
}
]
}

Responses

StatusDescriptionNotes
200OKThe basket along with its monthly installments.
400Bad RequestBasketId cannot be equal or less than 0.
404Not FoundThe basket with the given id was not found. / X-Application-ID not found.
500Internal ErrorThe MIME type in the Accept HTTP header is not acceptable.

POST/createbasket

Create a new basket

Generate a new basket in the Pay Later platform.

Query parameters

  • Name
    api-version
    Type
    string
    Description

    The requested API version. The parameter is optional. Default value: 1.0.

Headers

  • Name
    X-Application-ID
    Type
    string
    Description

    The ID of the application making the request. This header parameter is required for authentication and identification purposes.

  • Name
    Ocp-Apim-Subscription-Key
    Type
    string
    Description

    A unique identifier related to the registered merchant in the snappi API environment, available within the application's details.

Body parameters

  • Name
    basketValue
    Type
    double
    Description

    The total value of the basket.

  • Name
    requestId
    Type
    string(uuid)
    Description

    The unique identifier for the request.

  • Name
    orderIdentifier
    Type
    string
    Description

    The unique identifier for the order.

  • Name
    basketProducts
    Type
    array
    Description

    An array containing the details of the products in the basket. Each element in the array should include information such as product name, price, quantity and any applicable discounts:

    • Product Number (string): The Product Number parameter is used to specify the number associated with a product. It serves as a unique identifier for the specific product in the basket.
    • name (string): The name of the product.
    • quantity (double): The quantity parameter represents the quantity of a specific product in the basket. It indicates the number of units of the product included in the basket.
    • Quantity Units (string): The Quantity Units parameter represents the units of measurement for the quantity of a product. It specifies the measurement units used to quantify the quantity of the product in the basket.
    • Unit Price (double): The price per unit of a product. It indicates the cost of a single unit of the product in the basket.
    • Tax Rate (double): The tax rate applied to the items in the basket.
    • Total Amount (double): The total amount of the basket, including taxes and discounts.
    • Total Discount Amount (double): The total amount of discounts applied to the basket. It includes any promotional discounts, coupon codes, or other deductions from the original basket value.
    • Total Tax Amount (double): The total amount of tax applied to the basket. It includes any applicable sales tax, value-added tax (VAT), or other taxes charged on the products or services in the basket.
    • Product URL (string): The URL of the product's webpage.
    • Product Image URL (string): The URL of the product image.
  • Name
    Merchant Data
    Type
    string
    Description

    The Merchant Data parameter refers to additional data or information related to the merchant. It can include various details about the merchant, such as business information, contact details, or other relevant data.

  • Name
    phoneNumber
    Type
    string
    Description

    The Phone Number parameter is used to specify the phone number of the user. It should be a valid phone number.

  • Name
    email
    Type
    string
    Description

    The email parameter is used to specify the email address of the user. It should be a valid email address.

Response attributes

  • Name
    requestId
    Type
    string
    Description

    The unique identifier for the request.

  • Name
    basketId
    Type
    integer
    Description

    The unique identifier the basket.

  • Name
    qrCodeData
    Type
    string
    Description

    The data encoded in the QR code.

  • Name
    message
    Type
    string
    Description

    The message in the response.

  • Name
    errors
    Type
    string
    Description

    This parameter indicates any errors that occurred during the execution of the API request. It provides information about the specific error types, such as validation errors or server errors.

    • field (string): The name of the field that caused the error.
    • message (string): The error message associated with the field.
  • Name
    type
    Type
    string
    Description

    The type or category of the response, indicating the nature or classification of the information provided.

  • Name
    title
    Type
    string
    Description

    The title of the response, providing a brief summary or heading for the information being returned.

  • Name
    status
    Type
    integer
    Description

    The status of the response, indicating the success or failure of the request or operation.

  • Name
    detail
    Type
    string
    Description

    A detailed description or explanation of the response, providing additional context or information.

  • Name
    instance
    Type
    string
    Description

    The specific instance or occurrence to which the response pertains, providing a unique identifier or reference.

Request

POST
/createbasket
curl -X POST /createbasket \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Application-ID: string' \
-H 'Ocp-Apim-Subscription-Key: string 
-d '{
"basketValue": 0,
"requestId": "string",
"orderIdentifier": "string",
"basketProducts": [
{
"Product Number": "string",
"name": "string",
"quantity": 0,
"Quantity Units": "string",
"Unit Price": 0,
"Tax Rate": 0,
"Total Amount": 0,
"Total Discount Amount": 0,
"Total Tax Amount": 0,
"Product URL": "string",
"Product Image URL": "string"
}
],
"Merchant Data": "string",
"phoneNumber": "string",
"email": "string"
}'

Response examples

{
"requestId": "",
"basketId": 0,
"qrCodeData": "",
"redirectUrl": ""
}

Responses

StatusDescriptionNotes
201CreatedThe created basket.
400Bad RequestInvalid request parameters. / Basket's merchant or merchant's application was not found. / basketValue does not comply with merchant's BNPL limits. / X-Application-ID not found.
500Internal ErrorInternal server error.