curl --request POST \
--url https://api.henrylabs.ai/v1/cart/purchase \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cartId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"buyer": {
"name": {
"firstName": "John",
"middleName": "A.",
"lastName": "Doe"
},
"email": "johnadoe@example.com",
"phone": "+1234567890",
"shippingAddress": {
"line1": "123 Main St",
"line2": "Apt 4B",
"city": "Anytown",
"province": "CA",
"postalCode": "12345",
"countryCode": "US"
},
"card": {
"nameOnCard": {
"firstName": "John",
"middleName": "A.",
"lastName": "Doe"
},
"details": {
"cardNumber": "4111111111111111",
"expiryMonth": "12",
"expiryYear": "2025",
"cvv": "123"
},
"billingAddress": {
"line1": "123 Main St",
"line2": "Apt 4B",
"city": "Anytown",
"province": "CA",
"postalCode": "12345",
"countryCode": "US"
}
}
},
"selectedShippingOption": {
"id": "express",
"value": "Express Shipping"
},
"coupons": [
"SUMMER21",
"FREESHIP"
]
}
'{
"refId": "<string>",
"status": "pending",
"products": [
{
"status": "pending",
"link": "<string>",
"quantity": 123,
"merchant": "<string>",
"host": "<string>",
"variant": "<string>",
"metadata": {}
}
],
"details": {
"hasAccount": true,
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"card": {
"nameOnCard": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"details": {},
"billingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"line2": "<string>"
}
},
"email": "<string>",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"shippingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"line2": "<string>"
},
"settings": {
"collectEmail": true,
"collectAddress": true,
"collectPhone": true
}
},
"result": {
"items": [
{
"productLink": "<string>",
"confirmationNumber": "<string>",
"costs": {
"total": {
"value": 123,
"currency": "USD"
},
"subtotal": {
"value": 123,
"currency": "USD"
},
"tax": {
"value": 123,
"currency": "USD"
},
"shipping": {
"value": 123,
"currency": "USD"
},
"discount": {
"value": 123,
"currency": "USD"
}
},
"shippingOption": {
"id": "<string>",
"name": "<string>",
"cost": {
"value": 123,
"currency": "USD"
},
"timeEstimate": "<string>",
"minDate": "<string>",
"maxDate": "<string>"
},
"appliedCoupon": {
"code": "<string>",
"savedAmount": {
"value": 123,
"currency": "USD"
}
},
"metadata": {}
}
],
"costs": {
"subtotal": {
"value": 123,
"currency": "USD"
},
"commissionFee": {
"value": 123,
"currency": "USD"
},
"total": {
"value": 123,
"currency": "USD"
}
}
},
"error": {}
}Initiate the purchase process for a cart.
curl --request POST \
--url https://api.henrylabs.ai/v1/cart/purchase \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cartId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"buyer": {
"name": {
"firstName": "John",
"middleName": "A.",
"lastName": "Doe"
},
"email": "johnadoe@example.com",
"phone": "+1234567890",
"shippingAddress": {
"line1": "123 Main St",
"line2": "Apt 4B",
"city": "Anytown",
"province": "CA",
"postalCode": "12345",
"countryCode": "US"
},
"card": {
"nameOnCard": {
"firstName": "John",
"middleName": "A.",
"lastName": "Doe"
},
"details": {
"cardNumber": "4111111111111111",
"expiryMonth": "12",
"expiryYear": "2025",
"cvv": "123"
},
"billingAddress": {
"line1": "123 Main St",
"line2": "Apt 4B",
"city": "Anytown",
"province": "CA",
"postalCode": "12345",
"countryCode": "US"
}
}
},
"selectedShippingOption": {
"id": "express",
"value": "Express Shipping"
},
"coupons": [
"SUMMER21",
"FREESHIP"
]
}
'{
"refId": "<string>",
"status": "pending",
"products": [
{
"status": "pending",
"link": "<string>",
"quantity": 123,
"merchant": "<string>",
"host": "<string>",
"variant": "<string>",
"metadata": {}
}
],
"details": {
"hasAccount": true,
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"card": {
"nameOnCard": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"details": {},
"billingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"line2": "<string>"
}
},
"email": "<string>",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"shippingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"line2": "<string>"
},
"settings": {
"collectEmail": true,
"collectAddress": true,
"collectPhone": true
}
},
"result": {
"items": [
{
"productLink": "<string>",
"confirmationNumber": "<string>",
"costs": {
"total": {
"value": 123,
"currency": "USD"
},
"subtotal": {
"value": 123,
"currency": "USD"
},
"tax": {
"value": 123,
"currency": "USD"
},
"shipping": {
"value": 123,
"currency": "USD"
},
"discount": {
"value": 123,
"currency": "USD"
}
},
"shippingOption": {
"id": "<string>",
"name": "<string>",
"cost": {
"value": 123,
"currency": "USD"
},
"timeEstimate": "<string>",
"minDate": "<string>",
"maxDate": "<string>"
},
"appliedCoupon": {
"code": "<string>",
"savedAmount": {
"value": 123,
"currency": "USD"
}
},
"metadata": {}
}
],
"costs": {
"subtotal": {
"value": 123,
"currency": "USD"
},
"commissionFee": {
"value": 123,
"currency": "USD"
},
"total": {
"value": 123,
"currency": "USD"
}
}
},
"error": {}
}Unique identifier for the cart
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"3fa85f64-5717-4562-b3fc-2c963f66afa6"
Show child attributes
Override quantity for a specific product URL
Show child attributes
Settings for what information to collect
Show child attributes
Additional metadata for the request
Show child attributes
Cart purchase queued successfully, use refId to check status and retrieve results
^[a-zA-Z]{3}-ref_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}$pending, processing, complete, cancelled Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?