Skip to main content
POST
JavaScript

Authorizations

x-api-key
string
header
required

Path Parameters

cartId
string
required

Unique identifier for the cart

Example:

"crt_sa2aEsCz9PRM"

Body

application/json
buyer
object
required
mode
enum<string>

Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.

Available options:
async,
sync
Example:

"async"

overrideProducts
object

Per-product overrides keyed by product URL. Items with quantity null or 0 are excluded.

Example:
checkoutDetailsRefIds
string[]

Beta (card issuance; contact support@henrylabs.ai for access). For apps using issued checkout: the refIds from cart.checkout.details, one per merchant, quoted for this cart and shipping address within the last 30 minutes. Henry Labs sizes a card from each quote's total plus padding, charges buyer.card for it, and checks out on that card. Required for issued checkout; ignored otherwise. A quote that's missing, still running, failed, expired, or no longer matches the cart or address is refused (400 / 404 / 409) before anything is charged.

Required array length: 1 - 20 elements
Minimum string length: 1
Example:
capCents
integer

Beta (card issuance; contact support@henrylabs.ai for access). For issued checkout on a single-merchant cart: set the card's cap yourself instead of quote total plus padding. Rounded up to whole dollars; must cover the quoted total and stay within your app's per-card maximum.

Required range: x <= 9007199254740991
Example:

3000

allowTestCards
boolean

Allow a production purchase to run with a test card (a number from Stripe's testing docs, e.g. 4242424242424242 or 4111111111111111). Default false: the purchase is refused at once with TEST_CARD, or INVALID_CARD_NUMBER for a number that fails the Luhn check. When true, the checkout runs and settles as failed with CARD_DECLINED once the merchant declines, without fallbacks or retries. Sandbox apps ignore this.

Example:

false

settings
object

Settings for what information to collect

metadata
object

Additional metadata for the request

Response

Cart purchase queued successfully, use refId to check status and retrieve results

refId
string
required
Pattern: ^[a-zA-Z]{3}-ref_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}$
status
enum<string>
required

pending / processing while the purchase runs. It then settles: complete (every item bought), partially_complete (some items bought — see products[].status), failed (nothing bought — see error), or cancelled (stopped by Cart Purchase Cancel before anything was bought). An order can stay processing for up to an hour before it settles.

Available options:
pending,
processing,
complete,
partially_complete,
failed,
cancelled
products
object[]
required
details
object
required
result
object
error
object

Why items failed, once the order has settled as failed or partially_complete. Absent while the purchase runs and when every item was bought.