Basket
Manage your shopping carts! This section enables users to view the items in their basket, add new items, remove items and update quantities. It provides a seamless shopping experience by allowing users to easily manage their selections before proceeding to checkout.
Retrieve information about a basket. Obtain detailed information about the items in a basket, such as the product names, quantities and prices.
You can access all the relevant details needed for further processing, such as calculating the total price or displaying the items in a user-friendly format. This information can be used to generate an invoice, process payments or perform any other necessary operations related to the basket.
The Basket supports both authenticated and unauthenticated requests. If the user is not authenticated, the response will include only basic information about the basket. On the other hand, if the user is authenticated, the response will include more detailed information such as the user's personal details, shipping address and any applied discounts or promotional codes.
Find basket by Id
Retrieve information about a specific basket by its unique ID. Access the details of the basket, including the products added to it, the quantities of each product and any other relevant info associated with the basket. This endpoint is particularly useful for applications that require the ability to retrieve and display details of a specific basket, such as an e-commerce platform.
In order to use this endpoint, you need to provide the unique ID of the basket you want to retrieve.
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
id
- Type
- integer
- Description
The unique identifier for the basket.
- Name
basketValue
- Type
- double
- Description
The total value of the basket.
- Name
merchantId
- Type
- integer
- Description
The unique identifier for the merchant.
- Name
merchantName
- Type
- string
- Description
The name of the merchant associated with the basket.
- Name
requestId
- Type
- string(uuid)
- Description
The unique identifier for the request.
- Name
orderIdentifier
- Type
- string
- Description
The identifier of the order associated with the basket.
- Name
bnplAmount
- Type
- double
- Description
The Buy Now Pay Later amount for the basket.
- Name
basketProducts
- Type
- array
- Description
The list of products in the basket.
- Name
Product Number
- Type
- string
- Description
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
name
- Type
- string
- Description
The name parameter is used to specify a name or title associated with a particular entity, such as a product or a basket. It provides a descriptive label or identifier for the entity.
- Name
quantity
- Type
- double
- Description
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.
- Name
Quantity Units
- Type
- string
- Description
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.
- Name
Unit Price
- Type
- double
- Description
The Unit Price parameter represents the price per unit of a product. It indicates the cost of a single unit of the product in the basket.
- Name
Tax Rate
- Type
- double
- Description
The Tax Rate parameter represents the rate or percentage of tax applied to the products or services in the basket. It specifies the tax rate used to calculate the total tax amount.
- Name
Total Amount
- Type
- double
- Description
The Total Amount parameter represents the total amount associated with a specific entity, such as a basket or an order. It signifies the overall value, cost, or sum of the relevant elements or components.
- Name
Total Discount Amount
- Type
- double
- Description
The Total Discount Amount parameter represents the total amount of discounts applied to the basket. It includes any promotional discounts, coupon codes, or other deductions from the original basket value.
- Name
Total Tax Amount
- Type
- double
- Description
The Total Tax Amount parameter represents the total amount of taxes 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.
- Name
Product URL
- Type
- string
- Description
The URL of the product's webpage or landing page.
- Name
Product Image URL
- Type
- string
- Description
The Product Image URL parameter is used to specify the URL of the image associated with a product. It should be a valid URL pointing to the location of the product image.
- Name
Merchant Data
- Type
- string
- Description
Data associated with the merchant.
- Name
phoneNumber
- Type
- string
- Description
The phone number associated with the order.
- Name
email
- Type
- string
- Description
The email address associated with the order.
- Name
merchantCode
- Type
- string
- Description
The code associated with the merchant.
- Name
merchantApplication
- Type
- object
- Description
The application associated with the merchant.
- Name
applicationId
- Type
- string
- Description
The unique identifier for the application associated with the merchant.
- Name
successCallbackUrl
- Type
- string
- Description
The URL to which the merchant will be redirected after a successful payment.
- Name
failCallbackUrl
- Type
- string
- Description
The URL to which the merchant will be redirected after a failed payment.
- Name
created
- Type
- string<date-time
- Description
The date and time (timestamp) the basket was created.
- 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
curl -X GET /basket \
-H 'Accept: application/json' \
-H 'X-Application-ID: string' \
-H 'Ocp-Apim-Subscription-Key: string'
Response examples
{
"id": 0,
"basketValue": 0,
"merchantId": 0,
"merchantName": "string",
"requestId": "string",
"orderIdentifier": "string",
"bnplAmount": 0,
"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",
"merchantCode": "string",
"merchantApplication": {
"applicationId": "string",
"successCallbackUrl": "string",
"failCallbackUrl": "string",
"created": "string"
}
}
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | The basket with the given id. |
400 | Bad Request | BasketId cannot be equal or less than 0. |
404 | Not Found | The basket with the given id was not found. / X-Application-ID not found. |
500 | Internal Error | The MIME type in the Accept HTTP header is not acceptable. |
Create a basket
Create a new basket in the snappi Pay Later platform. A basket is a collection of items that a customer wishes to purchase through the application. You can add items to the basket and specify various details such as the product name, quantity, price and any additional information.
By utilizing this endpoint, you can easily integrate your application with our snappi Pay Later system, allowing your customers to conveniently select items and proceed with the Buy Now Pay Later option.
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.
- Name
Product Number
- Type
- string
- Description
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
name
- Type
- string
- Description
The name pof the user.
- Name
quantity
- Type
- double
- Description
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.
- Name
Quantity Units
- Type
- string
- Description
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.
- Name
Unit Price
- Type
- double
- Description
The price per unit of a product. It indicates the cost of a single unit of the product in the basket.
- Name
Tax Rate
- Type
- double
- Description
The tax rate applied to the items in the basket.
- Name
Total Amount
- Type
- double
- Description
The total amount of the basket, including taxes and discounts.
- Name
Total Discount Amount
- Type
- double
- Description
The total amount of discounts applied to the basket. It includes any promotional discounts, coupon codes, or other deductions from the original basket value.
- Name
Total Tax Amount
- Type
- double
- Description
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.
- Name
Product URL
- Type
- string
- Description
The URL of the product's webpage.
- Name
Product Image URL
- Type
- string
- Description
The URL of the image associated with the product.
- 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
- string
- 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.
- Name
field
- Type
- string
- Description
The name of the field that caused 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
curl -X POST /basket \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Application-ID: 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": "string",
"basketId": 0,
"qrCodeData": "string"
}
Responses
Status | Meaning | Description |
---|---|---|
201 | Created | The created basket. |
400 | Bad Request | Invalid request parameters. / Basket's merchant was not found. / basketValue does not comply with merchant's BNPL limits. / X-Application-ID not found. |
500 | Internal Error | Internal server error. |
Create a basket with QR
Create a basket and generate a plain QR code. You can integrate our system to create QR codes for various use-cases such as payments, discounts or loyalty programs. The generated QR code can be scanned by customers using a compatible device to initiate the desired action.
This feature provides a straightforward way to implement QR code functionality in your application without the need for extensive coding or complex configurations.
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 of the order associated with the basket.
- 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.
- Name
Product Number
- Type
- string
- Description
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
name
- Type
- string
- Description
The name parameter is used to specify a name or title associated with a particular entity, such as a product or a basket. It provides a descriptive label or identifier for the entity.
- Name
quantity
- Type
- double
- Description
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.
- Name
Quantity Units
- Type
- string
- Description
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.
- Name
Unit Price
- Type
- double
- Description
The Unit Price parameter represents the price per unit of a product. It indicates the cost of a single unit of the product in the basket.
- Name
Tax Rate
- Type
- double
- Description
The Tax Rate parameter represents the rate or percentage of tax applied to the products or services in the basket. It specifies the tax rate used to calculate the total tax amount.
- Name
Total Amount
- Type
- double
- Description
The Total Amount parameter represents the total amount associated with a specific entity, such as a basket or an order. It signifies the overall value, cost, or sum of the relevant elements or components.
- Name
Total Discount Amount
- Type
- double
- Description
The Total Discount Amount parameter represents the total amount of discounts applied to the basket. It includes any promotional discounts, coupon codes, or other deductions from the original basket value.
- Name
Total Tax Amount
- Type
- double
- Description
The Total Tax Amount parameter represents the total amount of taxes 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.
- Name
Product URL
- Type
- string
- Description
The Product URL parameter is used to specify the URL of the product. It should be a valid URL pointing to the location where the product can be viewed or accessed.
- Name
Product Image URL
- Type
- string
- Description
The Product Image URL parameter is used to specify the URL of the image associated with a product. It should be a valid URL pointing to the location 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 of the user.
- Name
email
- Type
- string
- Description
The email address of the user.
Response attributes
- Name
basketPostResponse
- Type
- string
- Description
The response received after posting the basket.
- Name
requestId
- Type
- string
- Description
The unique identifier for the request.
- Name
basketId
- Type
- integer
- Description
The unique identifier of the basket.
- Name
qrCodeData
- Type
- string
- Description
The data encoded in the QR code.
- Name
message
- Type
- string
- Description
The message associated with the API response.
- Name
errors
- Type
- string
- Description
A list of error objects containing details about any errors that occurred during the execution of the API request.
- Name
field
- Type
- string
- Description
The field in the request that caused the error.
- Name
message
- Type
- string
- Description
A short, descriptive message that summarizes the error that occurred during the execution of the API request.
- Name
type
- Type
- integer
- Description
The type of error that occurred during the execution of the API request. This can be used to determine the specific error that occurred.
- Name
title
- Type
- string
- Description
A short, descriptive title that summarizes the error that occurred during the execution of the API request. This title can be used as a quick reference to understand the nature of the error.
- Name
status
- Type
- integer
- Description
The HTTP status code that corresponds to the response of the API request. This code can be used to determine the success or failure of the request.
- Name
detail
- Type
- string
- Description
Additional details about the error that occurred during the execution of the API request. These details can provide more context and information about the specific error.
- Name
instance
- Type
- string
- Description
The specific instance or occurrence of the error that occurred during the execution of the API request. This can be used to track and identify the specific occurrence of the error.
Request
curl -X POST /postbasketplainqr \
-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
{
"basketPostResponse": {
"requestId": "string",
"basketId": 0,
"qrCodeData": "string"
}
}
Responses
Status | Meaning | Description |
---|---|---|
201 | Created | The created basket with the QR code. |
400 | Bad Request | Invalid request parameters. / Basket's merchant was not found. / basketValue does not comply with merchant's BNPL limits. / X-Application-ID not found. |
500 | Internal Error | Internal server error. |