POST
/
cart
/
checkout
curl -X POST 'https://api.henrylabs.ai/v0/cart/checkout' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'x-user-id: user123'
{
  "success": true,
  "status": "success",
  "message": "Checkout initiated successfully",
  "data": {
    "checkout_url": "https://checkout.henrylabs.ai?session=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c2VyMTIzIiwiY2FydElkIjoiY2FydDQ1NiIsImV4cCI6MTcwMjQ5MTYwMH0.xyzabc123"
  }
}

Overview

This endpoint initiates the checkout process for all items in a user’s cart. It returns a secure checkout URL where users can complete their purchase with shipping and payment information.

Authentication

x-api-key
string
required
Your API key for authentication
x-user-id
string
required
Unique identifier for the user

Response

success
boolean
Indicates if the request was successful
status
string
Status of the request
message
string
Descriptive message about the operation
data
object
Response data containing the checkout URL
curl -X POST 'https://api.henrylabs.ai/v0/cart/checkout' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'x-user-id: user123'
{
  "success": true,
  "status": "success",
  "message": "Checkout initiated successfully",
  "data": {
    "checkout_url": "https://checkout.henrylabs.ai?session=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c2VyMTIzIiwiY2FydElkIjoiY2FydDQ1NiIsImV4cCI6MTcwMjQ5MTYwMH0.xyzabc123"
  }
}

Checkout Flow

After receiving the checkout URL:
  1. Redirect the user to the provided checkout_url
  2. User completes checkout by entering shipping and payment information
  3. Order is processed automatically by Henry
  4. User is redirected back to your success or failure URL (configured in your account settings)
  5. Webhook notification is sent with order status (if configured)
The checkout URL expires after 30 minutes. If expired, you’ll need to generate a new checkout URL by calling this endpoint again.
The cart remains intact if the user doesn’t complete the checkout. They can return later and initiate checkout again with the same items.

Authorizations

x-api-key
string
header
required

Headers

x-user-id
string
required

Response

200
application/json

Checkout initiated successfully

The response is of type object.