Skip to main content
POST
/
checkout
/
single-network-token
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.createSingleProductToken({
  cardDetails: {
    billingAddress: '123 Main Street, Apt 4B',
    cardCvv: '123',
    cardExp: '12/29',
    cardHolder: 'John Doe',
    cardNumber: '4242424242424242',
    email: '[email protected]',
    phoneNumber: '+12125551234',
    zipCode: '10001',
  },
  productDetails: {
    name: "Men's Trail Runners",
    price: '100',
    productLink:
      'https://www.on.com/en-us/products/cloud-6-versa-m-3mf1004/mens/black-eclipse-shoes-3MF10040106',
    quantity: 1,
  },
  shippingDetails: {
    addressLine1: '350 5th Ave',
    city: 'New York',
    countryCode: 'US',
    email: '[email protected]',
    fullName: 'John Doe',
    phoneNumber: '+1234567890',
    postalCode: '10001',
    stateOrProvince: 'New York',
  },
  'x-user-id': 'x-user-id',
});

console.log(response.message);
{
  "success": true,
  "status": "<string>",
  "message": "<string>",
  "data": {
    "id": "<string>",
    "status": "<string>",
    "statusMessage": "<string>",
    "orderAmount": "<string>",
    "currency": "<string>",
    "productName": "<string>",
    "quantity": 123,
    "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"
    },
    "productMetadata": {}
  }
}

Authorizations

x-api-key
string
header
required

Headers

x-user-id
string
required

Body

application/json
shippingDetails
object
required
productDetails
object
required
cardDetails
object
required
region
string
Required string length: 2

Response

Order created successfully

success
boolean
required
status
string
required
message
string
required
data
object