Cart Purchase
Initiate the purchase process for a cart. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.
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.purchase('crt_sa2aEsCz9PRM', {
buyer: {
name: {
firstName: 'John',
middleName: 'A.',
lastName: 'Doe',
},
email: 'johnadoe@example.com',
phone: '+12125551234',
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: { cardToken: 'card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof' },
billingAddress: {
line1: '123 Main St',
line2: 'Apt 4B',
city: 'Anytown',
province: 'CA',
postalCode: '12345',
countryCode: 'US',
},
},
},
mode: 'async',
});
console.log(response.details);curl --request POST \
--url https://api.henrylabs.ai/v1/cart/{cartId}/purchase \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"buyer": {
"name": {
"firstName": "John",
"middleName": "A.",
"lastName": "Doe"
},
"email": "johnadoe@example.com",
"phone": "+12125551234",
"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": {
"cardToken": "card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof"
},
"billingAddress": {
"line1": "123 Main St",
"line2": "Apt 4B",
"city": "Anytown",
"province": "CA",
"postalCode": "12345",
"countryCode": "US"
}
}
},
"mode": "async"
}
'import requests
url = "https://api.henrylabs.ai/v1/cart/{cartId}/purchase"
payload = {
"buyer": {
"name": {
"firstName": "John",
"middleName": "A.",
"lastName": "Doe"
},
"email": "johnadoe@example.com",
"phone": "+12125551234",
"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": { "cardToken": "card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof" },
"billingAddress": {
"line1": "123 Main St",
"line2": "Apt 4B",
"city": "Anytown",
"province": "CA",
"postalCode": "12345",
"countryCode": "US"
}
}
},
"mode": "async"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.henrylabs.ai/v1/cart/{cartId}/purchase",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'buyer' => [
'name' => [
'firstName' => 'John',
'middleName' => 'A.',
'lastName' => 'Doe'
],
'email' => 'johnadoe@example.com',
'phone' => '+12125551234',
'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' => [
'cardToken' => 'card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof'
],
'billingAddress' => [
'line1' => '123 Main St',
'line2' => 'Apt 4B',
'city' => 'Anytown',
'province' => 'CA',
'postalCode' => '12345',
'countryCode' => 'US'
]
]
],
'mode' => 'async'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.henrylabs.ai/v1/cart/{cartId}/purchase"
payload := strings.NewReader("{\n \"buyer\": {\n \"name\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"email\": \"johnadoe@example.com\",\n \"phone\": \"+12125551234\",\n \"shippingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n },\n \"card\": {\n \"nameOnCard\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"details\": {\n \"cardToken\": \"card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof\"\n },\n \"billingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n }\n }\n },\n \"mode\": \"async\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.henrylabs.ai/v1/cart/{cartId}/purchase")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"buyer\": {\n \"name\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"email\": \"johnadoe@example.com\",\n \"phone\": \"+12125551234\",\n \"shippingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n },\n \"card\": {\n \"nameOnCard\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"details\": {\n \"cardToken\": \"card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof\"\n },\n \"billingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n }\n }\n },\n \"mode\": \"async\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.henrylabs.ai/v1/cart/{cartId}/purchase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"buyer\": {\n \"name\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"email\": \"johnadoe@example.com\",\n \"phone\": \"+12125551234\",\n \"shippingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n },\n \"card\": {\n \"nameOnCard\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"details\": {\n \"cardToken\": \"card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof\"\n },\n \"billingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n }\n }\n },\n \"mode\": \"async\"\n}"
response = http.request(request)
puts response.read_body{
"refId": "<string>",
"status": "pending",
"products": [
{
"status": "pending",
"link": "<string>",
"quantity": 123,
"merchant": "<string>",
"host": "<string>",
"affiliateProductLink": "<string>",
"selectedOptions": [
"<string>"
],
"selectedShipping": {
"id": "<string>",
"value": "<string>"
}
}
],
"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>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<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>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<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"
}
},
"quantity": 4503599627370495,
"shipping": {
"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"
},
"serviceFee": {
"value": 123,
"currency": "USD"
},
"total": {
"value": 123,
"currency": "USD"
}
}
},
"error": {
"code": "CARD_DECLINED",
"message": "The merchant did not accept the card"
}
}{
"success": true,
"status": "<string>",
"message": "<string>"
}{
"success": true,
"status": "<string>",
"message": "<string>"
}Body
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.
1 - 20 elements1["ckd-ref_d4cdc0de-15cc-4ee1-ae01"]
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.
x <= 90071992547409913000
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.
false
Response
Cart purchase queued successfully, use refId to check status and retrieve results
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.
pending, processing, complete, partially_complete, failed, cancelled Was this page helpful?
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.purchase('crt_sa2aEsCz9PRM', {
buyer: {
name: {
firstName: 'John',
middleName: 'A.',
lastName: 'Doe',
},
email: 'johnadoe@example.com',
phone: '+12125551234',
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: { cardToken: 'card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof' },
billingAddress: {
line1: '123 Main St',
line2: 'Apt 4B',
city: 'Anytown',
province: 'CA',
postalCode: '12345',
countryCode: 'US',
},
},
},
mode: 'async',
});
console.log(response.details);curl --request POST \
--url https://api.henrylabs.ai/v1/cart/{cartId}/purchase \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"buyer": {
"name": {
"firstName": "John",
"middleName": "A.",
"lastName": "Doe"
},
"email": "johnadoe@example.com",
"phone": "+12125551234",
"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": {
"cardToken": "card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof"
},
"billingAddress": {
"line1": "123 Main St",
"line2": "Apt 4B",
"city": "Anytown",
"province": "CA",
"postalCode": "12345",
"countryCode": "US"
}
}
},
"mode": "async"
}
'import requests
url = "https://api.henrylabs.ai/v1/cart/{cartId}/purchase"
payload = {
"buyer": {
"name": {
"firstName": "John",
"middleName": "A.",
"lastName": "Doe"
},
"email": "johnadoe@example.com",
"phone": "+12125551234",
"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": { "cardToken": "card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof" },
"billingAddress": {
"line1": "123 Main St",
"line2": "Apt 4B",
"city": "Anytown",
"province": "CA",
"postalCode": "12345",
"countryCode": "US"
}
}
},
"mode": "async"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.henrylabs.ai/v1/cart/{cartId}/purchase",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'buyer' => [
'name' => [
'firstName' => 'John',
'middleName' => 'A.',
'lastName' => 'Doe'
],
'email' => 'johnadoe@example.com',
'phone' => '+12125551234',
'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' => [
'cardToken' => 'card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof'
],
'billingAddress' => [
'line1' => '123 Main St',
'line2' => 'Apt 4B',
'city' => 'Anytown',
'province' => 'CA',
'postalCode' => '12345',
'countryCode' => 'US'
]
]
],
'mode' => 'async'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.henrylabs.ai/v1/cart/{cartId}/purchase"
payload := strings.NewReader("{\n \"buyer\": {\n \"name\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"email\": \"johnadoe@example.com\",\n \"phone\": \"+12125551234\",\n \"shippingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n },\n \"card\": {\n \"nameOnCard\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"details\": {\n \"cardToken\": \"card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof\"\n },\n \"billingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n }\n }\n },\n \"mode\": \"async\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.henrylabs.ai/v1/cart/{cartId}/purchase")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"buyer\": {\n \"name\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"email\": \"johnadoe@example.com\",\n \"phone\": \"+12125551234\",\n \"shippingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n },\n \"card\": {\n \"nameOnCard\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"details\": {\n \"cardToken\": \"card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof\"\n },\n \"billingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n }\n }\n },\n \"mode\": \"async\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.henrylabs.ai/v1/cart/{cartId}/purchase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"buyer\": {\n \"name\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"email\": \"johnadoe@example.com\",\n \"phone\": \"+12125551234\",\n \"shippingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n },\n \"card\": {\n \"nameOnCard\": {\n \"firstName\": \"John\",\n \"middleName\": \"A.\",\n \"lastName\": \"Doe\"\n },\n \"details\": {\n \"cardToken\": \"card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof\"\n },\n \"billingAddress\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Apt 4B\",\n \"city\": \"Anytown\",\n \"province\": \"CA\",\n \"postalCode\": \"12345\",\n \"countryCode\": \"US\"\n }\n }\n },\n \"mode\": \"async\"\n}"
response = http.request(request)
puts response.read_body{
"refId": "<string>",
"status": "pending",
"products": [
{
"status": "pending",
"link": "<string>",
"quantity": 123,
"merchant": "<string>",
"host": "<string>",
"affiliateProductLink": "<string>",
"selectedOptions": [
"<string>"
],
"selectedShipping": {
"id": "<string>",
"value": "<string>"
}
}
],
"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>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<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>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<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"
}
},
"quantity": 4503599627370495,
"shipping": {
"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"
},
"serviceFee": {
"value": 123,
"currency": "USD"
},
"total": {
"value": 123,
"currency": "USD"
}
}
},
"error": {
"code": "CARD_DECLINED",
"message": "The merchant did not accept the card"
}
}{
"success": true,
"status": "<string>",
"message": "<string>"
}{
"success": true,
"status": "<string>",
"message": "<string>"
}