Skip to main content
POST
Validate Cart

Validate Cart

Validates cart items, calculates shipping, applies discounts, and returns a cart_unique_id required for creating a payment intent. This endpoint must be called before /payment/intent.

Request

string
required
Your API key

Body Parameters

array
required
Array of cart itemsEach item should have:
  • product_id (integer): Product ID
  • quantity (integer): Quantity
  • price (integer): Price in smallest currency unit (cents)
  • least_sub_variant_id (string): Variant ID if applicable
string
required
Currency code (e.g., “USD”)
object
Shipping address for physical products
  • first_name (string)
  • last_name (string)
  • email (string)
  • phone (string)
  • address (string)
  • city (string)
  • state (string)
  • zip_code (string)
  • country_code (string)
array
Array of coupon codes to apply
string
Customer’s country code for regional pricing

Response

Example

Notes

  • The cart_unique_id is valid for 24 hours
  • Save this ID and pass it to /payment/intent
  • Prices are validated against the database to prevent tampering
  • Currency conversion is applied automatically if multicurrency is enabled