Skip to main content
POST
/
cart
/
{cartId}
/
details
JavaScript
import HenrySDK from '@henrylabs/sdk';

const client = new HenrySDK({
  apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted
});

const response = await client.cart.checkout.details('crt_sa2aEsCz9PRM', {
  buyer: {
    shippingAddress: {
      line1: '123 Main St',
      line2: 'Apt 4B',
      city: 'Anytown',
      province: 'CA',
      postalCode: '12345',
      countryCode: 'US',
    },
  },
  coupons: ['SUMMER21', 'FREESHIP'],
  mode: 'async',
});

console.log(response.data);
{
  "success": true,
  "status": "<string>",
  "message": "<string>",
  "data": {
    "jobs": [
      {
        "refId": "<string>",
        "status": "pending",
        "result": {
          "items": [
            {
              "shippingOptions": [
                {
                  "id": "<string>",
                  "name": "<string>",
                  "cost": {
                    "value": 123,
                    "currency": "USD"
                  },
                  "timeEstimate": "<string>",
                  "minDate": "<string>",
                  "maxDate": "<string>"
                }
              ],
              "costs": {
                "subtotal": {
                  "value": 123,
                  "currency": "USD"
                },
                "total": {
                  "value": 123,
                  "currency": "USD"
                },
                "tax": {
                  "value": 123,
                  "currency": "USD"
                },
                "shipping": {
                  "value": 123,
                  "currency": "USD"
                },
                "discount": {
                  "value": 123,
                  "currency": "USD"
                }
              },
              "coupons": [
                {
                  "code": "<string>",
                  "available": true,
                  "savedAmount": {
                    "value": 123,
                    "currency": "USD"
                  }
                }
              ]
            }
          ]
        },
        "error": {}
      }
    ],
    "metadata": {}
  }
}

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"

coupons
string[]

List of coupon codes applied to the cart

Example:
["SUMMER21", "FREESHIP"]
metadata
object

Additional metadata for the request

Response

Cart detail jobs queued successfully, use refIds to check status and retrieve results

success
boolean
required
status
string
required
message
string
required
data
object
required