Skip to main content
POST
/
checkout
/
session
/
confirm
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.checkout.session.confirmCheckout({
  'x-session-token': 'x-session-token',
});

console.log(response.message);
{
  "success": true,
  "status": "<string>",
  "message": "<string>",
  "data": {
    "id": "<string>",
    "status": "<string>",
    "statusMessage": "<string>",
    "subtotal": "<string>",
    "tax": "<string>",
    "shipping": "<string>",
    "grandTotal": "<string>",
    "currency": "<string>",
    "products": [
      {
        "productName": "<string>",
        "quantity": 123,
        "productMetadata": {}
      }
    ],
    "shippingDetails": {
      "fullName": "John Doe",
      "email": "[email protected]",
      "phoneNumber": "+1234567890",
      "addressLine1": "350 5th Ave",
      "countryCode": "US",
      "city": "New York",
      "stateOrProvince": "New York",
      "postalCode": "10001",
      "addressLine2": "Apt 1"
    },
    "cardLast4": "<string>"
  }
}

Authorizations

x-api-key
string
header
required
x-access-token
string
header
required

Supabase access token for authentication.

Headers

x-session-token
string
required
x-user-id
string

Required for authenticating with an API key

Body

application/json
shippingDetails
object

Response

Order placed successfully

success
boolean
required
status
string
required
message
string
required
data
object