Checkout Totals
POST/checkout
Generates information for the checkout page including taxes, totals, and shipping price. This endpoint will return up-to-date price. If the price changed, the user should be notified. The returned inventory is always equal to the requested quantity, and it is not reserved. Inventory check will be done at the time of order placement only.
Request
- application/json
Body
required
- Array [
- ]
shipping_address object
Customer first name.
Customer last name.
The street address of the shipping address.
An optional additional field for the street address of the shipping address.
The city, town, or village of the shipping address.
The two-letter code (ISO 3166-1 format) for the country of the shipping address.
Full name.
The two-letter abbreviation of the region of the shipping address.
The phone number at the shipping address.
The postal code (zip, postcode, Eircode, …) of the shipping address.
products object[]required
Possible values: >= 1
ID of the product
ID of the product variant.
Possible values: >= 1
Quantity of the product variant in the cart
payment object
Possible values: [stripe
]
Request a payment intent
Possible values: [CAD
, USD
, GBP
, AUD
, EUR
]
The currency to return values in.
Responses
- 200
- 400
- 401
- 404
- 5XX
Success
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- Array [
- ]
- ]
- Array [
- ]
data object
The price of all products in the cart, in target currency (ex. USD).
The amount of taxes to be paid, in target currency (ex. USD).
shipping object[]required
The amount of shipping services to be paid, in dollars.
Label to show to the user to indicate the shipping type.
Code that indicates the shipping type.
Merchant name.
products object[]required
Products in this shipment.
ID of the product
ID of the product variant.
Possible values: >= 1
Quantity of the product variant.
The total amount for the order, in target currency (ex. USD).
The total amount of duties for the order, in target currency (ex. USD).
line_items object[]required
Public ID of the product.
The ID of the product variant.
Available inventory for the order. If the inventory is 0, the product is out of stock.
Product price, in dollars.
Purchase quantity requested from the endpoint
Product name
Possible values: [CAD
, USD
, GBP
, AUD
, EUR
]
Currency that values are returned in.
payment object
Total amount of shipping costs, in target currency (ex. USD).
{
"data": {
"subtotal": 12.5,
"tax": 1.63,
"shipping": [
{
"amount": 15,
"label": "Standard Flat Rate Shipping",
"code": "0",
"merchant_name": "Virgin Club",
"products": [
{
"public_id": "clad6pg5z00eu012gfz7hfm92",
"variant_id": "M00679529706740",
"quantity": 1
}
]
}
],
"total": 12.25,
"duties": 12.25,
"line_items": [
{
"public_id": "clad6pg5z00eu012gfz7hfm92",
"variant_id": "M00679529706740",
"inventory": 2,
"price": 12.5,
"quantity": 2,
"name": "Joelle Sweater Dress"
}
],
"currency": "USD",
"payment": {
"clientSecret": "string"
},
"shipping_total": 120.2
}
}
400 - Bad request
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- Array [
- ]
- ]
- Array [
- ]
- Array [
- ]
data object
The price of all products in the cart, in target currency (ex. USD).
The amount of taxes to be paid, in target currency (ex. USD).
shipping object[]required
The amount of shipping services to be paid, in dollars.
Label to show to the user to indicate the shipping type.
Code that indicates the shipping type.
Merchant name.
products object[]required
Products in this shipment.
ID of the product
ID of the product variant.
Possible values: >= 1
Quantity of the product variant.
The total amount for the order, in target currency (ex. USD).
The total amount of duties for the order, in target currency (ex. USD).
line_items object[]required
Public ID of the product.
The ID of the product variant.
Available inventory for the order. If the inventory is 0, the product is out of stock.
Product price, in dollars.
Purchase quantity requested from the endpoint
Product name
Possible values: [CAD
, USD
, GBP
, AUD
, EUR
]
Currency that values are returned in.
payment object
Total amount of shipping costs, in target currency (ex. USD).
errors object[]
Unique identifier for error. Can be used for tracing across services.
HTTP status code.
Unique code for specific error.
Short description what the error entails.
detail objectrequired
Useful details related to the error
{
"data": {
"subtotal": 0,
"tax": 0,
"shipping": [],
"total": 0,
"duties": 0,
"line_items": [
{
"public_id": "clad6pg5z00eu012gfz7hfm92",
"variant_id": "M00679529706740",
"inventory": 0,
"price": 0,
"quantity": 2,
"name": ""
}
],
"currency": "USD",
"payment": {
"clientSecret": "string"
},
"shipping_total": 0
},
"errors": [
{
"id": "123e4567-e89b-12d3-a456-426655440000",
"status": 400,
"code": "PRODUCT_UNAVAILABLE",
"title": "The product requested is no longer available",
"detail": {
"publicId": "clbj0i7w4041d01z60hv53mcm",
"variantId": "13833901"
}
}
]
}
401 - Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
{
"errors": [
{
"status": 401,
"detail": "",
"title": "Authentication information is missing or invalid"
}
]
}
404 - Not found
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- Array [
- ]
- ]
- Array [
- ]
- Array [
- ]
data object
The price of all products in the cart, in target currency (ex. USD).
The amount of taxes to be paid, in target currency (ex. USD).
shipping object[]required
The amount of shipping services to be paid, in dollars.
Label to show to the user to indicate the shipping type.
Code that indicates the shipping type.
Merchant name.
products object[]required
Products in this shipment.
ID of the product
ID of the product variant.
Possible values: >= 1
Quantity of the product variant.
The total amount for the order, in target currency (ex. USD).
The total amount of duties for the order, in target currency (ex. USD).
line_items object[]required
Public ID of the product.
The ID of the product variant.
Available inventory for the order. If the inventory is 0, the product is out of stock.
Product price, in dollars.
Purchase quantity requested from the endpoint
Product name
Possible values: [CAD
, USD
, GBP
, AUD
, EUR
]
Currency that values are returned in.
payment object
Total amount of shipping costs, in target currency (ex. USD).
errors object[]
Unique identifier for error. Can be used for tracing across services.
HTTP status code.
Unique code for specific error.
Short description what the error entails.
detail objectrequired
Useful details related to the error
{
"data": {
"subtotal": 0,
"tax": 0,
"shipping": [],
"total": 0,
"duties": 0,
"line_items": [
{
"public_id": "clad6pg5z00eu012gfz7hfm92",
"variant_id": "M00679529706740",
"inventory": 0,
"price": 0,
"quantity": 2,
"name": ""
}
],
"currency": "USD",
"payment": {
"clientSecret": "string"
},
"shipping_total": 0
},
"errors": [
{
"id": "123e4567-e89b-12d3-a456-426655440000",
"status": 404,
"code": "PRODUCT_DOES_NOT_EXIST",
"title": "Product does not exist",
"detail": {
"publicId": "clad6pg5z00ru012gfz7hfm92",
"variantId": "M00679529706740"
}
}
]
}
500 - Unknown error
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
{
"errors": [
{
"status": 500,
"detail": "",
"title": "Unknown error"
}
]
}