Skip to main content
PATCH
/
checkout
/
guest
/
addresses
/
{id}
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.update(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);

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

Path Parameters

id
string<uuid>
required

Body

application/json
fullName
string

Full name

Minimum string length: 1
Example:

"John Doe"

email
string<email>

Email

phoneNumber
string

Phone number

Minimum string length: 1
Example:

"+1234567890"

addressLine1
string

Address line 1

Minimum string length: 1
Example:

"350 5th Ave"

addressLine2
string | null

Address line 2

Example:

"Apt 1"

countryCode
string

Country code

Required string length: 2
Example:

"US"

city
string

City

Minimum string length: 1
Example:

"New York"

stateOrProvince
string

State or province

Minimum string length: 1
Example:

"New York"

postalCode
string

Postal code

Minimum string length: 1
Example:

"10001"

Response

Guest address updated 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