Skip to main content
POST
/
checkout
/
guest
/
addresses
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 address = await client.checkout.guest.addresses.create({
  addressLine1: '350 5th Ave',
  city: 'New York',
  countryCode: 'US',
  email: '[email protected]',
  fullName: 'John Doe',
  phoneNumber: '+1234567890',
  postalCode: '10001',
  stateOrProvince: 'New York',
});

console.log(address.id);
{
  "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",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "isDefault": true
}

Authorizations

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

Supabase access token for authentication.

Headers

x-user-id
string

Required when authenticating with API key

Body

application/json
fullName
string
required

Full name

Minimum string length: 1
Example:

"John Doe"

email
string<email>
required

Email

phoneNumber
string
required

Phone number

Minimum string length: 1
Example:

"+1234567890"

addressLine1
string
required

Address line 1

Minimum string length: 1
Example:

"350 5th Ave"

countryCode
string
required

Country code

Required string length: 2
Example:

"US"

city
string
required

City

Minimum string length: 1
Example:

"New York"

stateOrProvince
string
required

State or province

Minimum string length: 1
Example:

"New York"

postalCode
string
required

Postal code

Minimum string length: 1
Example:

"10001"

addressLine2
string | null

Address line 2

Example:

"Apt 1"

Response

Guest address created successfully

fullName
string
required

Full name

Minimum string length: 1
Example:

"John Doe"

email
string<email>
required

Email

phoneNumber
string
required

Phone number

Minimum string length: 1
Example:

"+1234567890"

addressLine1
string
required

Address line 1

Minimum string length: 1
Example:

"350 5th Ave"

countryCode
string
required

Country code

Required string length: 2
Example:

"US"

city
string
required

City

Minimum string length: 1
Example:

"New York"

stateOrProvince
string
required

State or province

Minimum string length: 1
Example:

"New York"

postalCode
string
required

Postal code

Minimum string length: 1
Example:

"10001"

addressLine2
string | null

Address line 2

Example:

"Apt 1"

id
string<uuid>
isDefault
boolean