Customer
The Customer API lets storefront JavaScript register a customer, sign a customer in and out, and work with the signed-in customer's profile, addresses, and newsletter subscription.
All Ajax API requests should use locale-aware URLs to give visitors a consistent experience.
Authentication
Customer session. Registration, sign-in, the password reset email, the password reset, the sign-in verification code, the newsletter subscription, and the login settings are open to anonymous visitors. Every other endpoint on this page needs a signed-in customer. The session is a cookie that the browser sends automatically after a successful sign_up or sign_in. Without it, the request returns 401:
{
"errors": [
"Sign in to continue store operations."
]
}
CSRF token. Every request other than GET must carry an X-CSRF-Token header whose value is the CSRF-TOKEN cookie. The cookie is readable from JavaScript, so the examples below take it with this helper:
function getCsrfToken() {
const entry = document.cookie.split('; ').find((item) => item.startsWith('CSRF-TOKEN='));
return entry ? decodeURIComponent(entry.slice('CSRF-TOKEN='.length)) : '';
}
Without the header, the request returns 406 with {"errors":["CSRF token verify fails"]}.
Bot protection. Registration, sign-in, the password reset email, and the password reset are covered by the store's bot protection. When the server asks for a challenge, it returns 400 with {"errors":["{\"errors\":[\"empty token\"]}"]}. Submit the request again with the bot protection token in the token field and version set to v3. In a Shoplazza theme, the spz-privacy-token component fills both fields for you. In your own request, read the token from the bot protection service configured for the store (Google reCAPTCHA v3).
Request format. Endpoints on this page that send data take an application/x-www-form-urlencoded body. The examples below build it with URLSearchParams.
Create a customer account
POST /{locale}/api/customers/sign_up
Create a customer account. A successful request also starts a customer session, so the customer is signed in afterwards.
Example request
const body = new URLSearchParams({
password: 'your-password',
first_name: 'Jane',
last_name: 'Doe',
newsletter: 'true'
});
fetch(window.SHOPLAZZA.routes.root + '/api/customers/sign_up', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
},
body: body
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The email address of the account.
The password of the account.
The first name of the customer.
The last name of the customer.
Whether the customer subscribes to marketing emails.
The bot protection token. Required when the store's bot protection asks for a challenge.
The bot protection version, v3. Required together with token.
Response
- Schema
- Example
customer object
idstringID of the customer.
emailstringEmail address of the customer.
first_namestringFirst name of the customer or recipient.
last_namestringLast name of the customer or recipient.
phonestringnullablePhone number of the customer.
tagsundefined[]Tags attached to the object.
namestringFull name of the customer.
notestringnullableNote attached to the object.
contactstringContact of the customer, either an email address or a phone number.
contact_typestringContact type, either email or phone.
created_bystringlocation_idstringregistered_atstringTime when the customer completed registration.
noted_atstringnullablecreated_atstringCreation time, in ISO-8601 format.
sourcestringWhere the customer record came from.
free_taxbooleanWhether the customer is exempt from taxes.
subscribedbooleanWhether the customer is subscribed to marketing messages.
registeredbooleanWhether the customer has registered an account.
customer_extra_info object
Additional statistics about the customer.
finished_order_countnumberNumber of completed orders placed by the customer.
finished_order_totalstringTotal amount of the completed orders placed by the customer.
countrystringnullablecountry_codestringnullableprovincestringnullableProvince or state of the address.
province_codestringnullableProvince or state code.
currency_codestringCurrency code of the order, for example
USD.purchase_product_countnumberNumber of products the customer has purchased.
store_customer_idstringcustomer_rolestringnullableextstringnullablefirst_order_atstringnullableTime when the customer placed the first order.
last_order_atstringnullableTime when the customer placed the last order.
{
"customer": {
"id": "04f268c8-fea5-4386-abd7-c4fade761257",
"first_name": "Jane",
"last_name": "Doe",
"phone": null,
"tags": [],
"name": "Jane Doe",
"note": null,
"contact_type": "email",
"created_by": "default",
"location_id": "",
"registered_at": "2026-09-03T02:48:07Z",
"noted_at": null,
"created_at": "2026-09-03T02:48:08Z",
"source": "sign_up",
"free_tax": false,
"subscribed": true,
"registered": true,
"customer_extra_info": {
"finished_order_count": 0,
"finished_order_total": "0.0",
"country": null,
"country_code": null,
"province": null,
"province_code": null,
"currency_code": "USD",
"purchase_product_count": 0,
"store_customer_id": "",
"customer_role": null,
"ext": null,
"first_order_at": null,
"last_order_at": null
}
}
}
Sign a customer in
POST /{locale}/api/customers/sign_in
Sign a customer in with an email address and a password, and start a customer session.
Example request
const body = new URLSearchParams({
password: 'your-password'
});
fetch(window.SHOPLAZZA.routes.root + '/api/customers/sign_in', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
},
body: body
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The email address of the account.
The password of the account.
The bot protection token. Required when the store's bot protection asks for a challenge.
The bot protection version, v3. Required together with token.
Response
- Schema
- Example
customer object
idstringID of the customer.
emailstringEmail address of the customer.
first_namestringFirst name of the customer or recipient.
last_namestringLast name of the customer or recipient.
phonestringPhone number of the customer.
tagsundefined[]Tags attached to the object.
namestringFull name of the customer.
notestringnullableNote attached to the object.
contactstringContact of the customer, either an email address or a phone number.
contact_typestringContact type, either email or phone.
created_bystringlocation_idstringregistered_atstringTime when the customer completed registration.
noted_atstringnullablecreated_atstringCreation time, in ISO-8601 format.
sourcestringWhere the customer record came from.
free_taxstringnullableWhether the customer is exempt from taxes.
subscribedbooleanWhether the customer is subscribed to marketing messages.
registeredbooleanWhether the customer has registered an account.
customer_extra_info object
Additional statistics about the customer.
finished_order_countnumberNumber of completed orders placed by the customer.
finished_order_totalstringTotal amount of the completed orders placed by the customer.
countrystringcountry_codestringprovincestringProvince or state of the address.
province_codestringProvince or state code.
currency_codestringCurrency code of the order, for example
USD.purchase_product_countnumberNumber of products the customer has purchased.
store_customer_idstringcustomer_rolestringnullableextstringnullablefirst_order_atstringTime when the customer placed the first order.
last_order_atstringTime when the customer placed the last order.
{
"customer": {
"id": "9fe44049-abab-4fed-ab3d-1bf4ffee8ef5",
"first_name": "Jane",
"last_name": "Doe",
"phone": "+1 555-0100",
"tags": [],
"name": "Jane Doe",
"note": null,
"contact_type": "email",
"created_by": "default",
"location_id": "",
"registered_at": "2026-09-03T01:03:32Z",
"noted_at": null,
"created_at": "2026-09-02T14:13:31Z",
"source": "order_create_c",
"free_tax": null,
"subscribed": false,
"registered": true,
"customer_extra_info": {
"finished_order_count": 2,
"finished_order_total": "33.0",
"country": "United States",
"country_code": "US",
"province": "California",
"province_code": "US-CA",
"currency_code": "USD",
"purchase_product_count": 4,
"store_customer_id": "",
"customer_role": null,
"ext": null,
"first_order_at": "2026-09-03T02:19:44Z",
"last_order_at": "2026-09-03T02:32:31Z"
}
}
}
Sign a customer out
POST /{locale}/api/customers/sign_out
End the current customer session. Requires a signed-in customer and takes no parameters.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/sign_out', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
}
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Response
- Schema
- Example
{}
Send a password reset email
POST /{locale}/api/customers/password_reset_email
Send a password reset email to a customer. The email carries the verification code that PATCH /{locale}/api/customers/password_reset expects.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/password_reset_email', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
},
body: body
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The email address of the account.
Response
- Schema
- Example
{}
Reset a customer's password
PATCH /{locale}/api/customers/password_reset
Set a new password for a customer with the verification code from the password reset email.
Example request
const body = new URLSearchParams({
code: '123456',
password: 'your-new-password',
confirm_password: 'your-new-password'
});
fetch(window.SHOPLAZZA.routes.root + '/api/customers/password_reset', {
method: 'PATCH',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
},
body: body
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The email address of the account.
The verification code from the password reset email.
The new password.
The new password again. Must match password.
The bot protection token. Required when the store's bot protection asks for a challenge.
The bot protection version, v3. Required together with token.
Response
- Schema
- Example
{}
Send a sign-in verification code
POST /{locale}/api/customers/login_email
Send a sign-in verification code to a customer's email address, for flows that let a customer sign in with a code instead of a password.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/login_email', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
},
body: body
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The email address that receives the code.
Response
- Schema
- Example
{}
Get the store's social sign-in options
GET /{locale}/api/customers/login_settings
Get the social sign-in providers the store offers on its login page. Takes no parameters. login_setting is null when the store offers none.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/login_settings')
.then((response) => response.json())
.then((data) => {
// do something...
});
Response
- Schema
- Example
login_setting object
googlebooleanWhether sign-in with Google is enabled.
applebooleanWhether sign-in with Apple is enabled.
facebookbooleanWhether sign-in with Facebook is enabled.
{
"login_setting": {
"google": true,
"apple": true,
"facebook": true
}
}
Get the signed-in customer's profile
GET /{locale}/api/customers/show
Get the profile of the signed-in customer. Requires a signed-in customer and takes no parameters.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/show')
.then((response) => response.json())
.then((data) => {
// do something...
});
Response
- Schema
- Example
customer object
idstringID of the customer.
emailstringEmail address of the customer.
first_namestringFirst name of the customer or recipient.
last_namestringLast name of the customer or recipient.
phonestringPhone number of the customer.
tagsundefined[]Tags attached to the object.
namestringFull name of the customer.
notestringnullableNote attached to the object.
contactstringContact of the customer, either an email address or a phone number.
contact_typestringContact type, either email or phone.
created_bystringlocation_idstringregistered_atstringTime when the customer completed registration.
noted_atstringnullablecreated_atstringCreation time, in ISO-8601 format.
sourcestringWhere the customer record came from.
free_taxstringnullableWhether the customer is exempt from taxes.
subscribedbooleanWhether the customer is subscribed to marketing messages.
registeredbooleanWhether the customer has registered an account.
customer_extra_info object
Additional statistics about the customer.
finished_order_countnumberNumber of completed orders placed by the customer.
finished_order_totalstringTotal amount of the completed orders placed by the customer.
countrystringnullablecountry_codestringnullableprovincestringnullableProvince or state of the address.
province_codestringnullableProvince or state code.
currency_codestringCurrency code of the order, for example
USD.purchase_product_countnumberNumber of products the customer has purchased.
store_customer_idstringcustomer_rolestringnullableextstringnullablefirst_order_atstringnullableTime when the customer placed the first order.
last_order_atstringnullableTime when the customer placed the last order.
{
"customer": {
"id": "9fe44049-abab-4fed-ab3d-1bf4ffee8ef5",
"first_name": "Jane",
"last_name": "Doe",
"phone": "+1 555-0100",
"tags": [],
"name": "Jane Doe",
"note": null,
"contact_type": "email",
"created_by": "default",
"location_id": "",
"registered_at": "2026-09-03T01:03:32Z",
"noted_at": null,
"created_at": "2026-09-02T14:13:31Z",
"source": "newsletter",
"free_tax": null,
"subscribed": true,
"registered": true,
"customer_extra_info": {
"finished_order_count": 0,
"finished_order_total": "0.0",
"country": null,
"country_code": null,
"province": null,
"province_code": null,
"currency_code": "USD",
"purchase_product_count": 0,
"store_customer_id": "",
"customer_role": null,
"ext": null,
"first_order_at": null,
"last_order_at": null
}
}
}
Update the signed-in customer's profile
PATCH /{locale}/api/customers/update
Update the name and the email address of the signed-in customer. Requires a signed-in customer. Send email together with the name fields.
Example request
const body = new URLSearchParams({
first_name: 'Jane',
last_name: 'Doe'
});
fetch(window.SHOPLAZZA.routes.root + '/api/customers/update', {
method: 'PATCH',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
},
body: body
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The email address of the account.
The first name of the customer.
The last name of the customer.
Response
- Schema
- Example
customer object
emailstringEmail address of the customer.
first_namestringFirst name of the customer or recipient.
last_namestringLast name of the customer or recipient.
phonestringPhone number of the customer.
idstringID of the customer.
contact_typestringContact type, either email or phone.
contactstringContact of the customer, either an email address or a phone number.
namestringFull name of the customer.
tagsundefined[]Tags attached to the object.
notestringnullableNote attached to the object.
created_bystringlocation_idstringregistered_atstringTime when the customer completed registration.
noted_atstringnullablecreated_atstringCreation time, in ISO-8601 format.
sourcestringWhere the customer record came from.
free_taxstringnullableWhether the customer is exempt from taxes.
subscribedbooleanWhether the customer is subscribed to marketing messages.
registeredbooleanWhether the customer has registered an account.
customer_extra_info object
Additional statistics about the customer.
finished_order_countnumberNumber of completed orders placed by the customer.
finished_order_totalstringTotal amount of the completed orders placed by the customer.
countrystringnullablecountry_codestringnullableprovincestringnullableProvince or state of the address.
province_codestringnullableProvince or state code.
currency_codestringCurrency code of the order, for example
USD.purchase_product_countnumberNumber of products the customer has purchased.
store_customer_idstringcustomer_rolestringnullableextstringnullablefirst_order_atstringnullableTime when the customer placed the first order.
last_order_atstringnullableTime when the customer placed the last order.
{
"customer": {
"first_name": "Jane",
"last_name": "Doe",
"phone": "+1 555-0100",
"id": "9fe44049-abab-4fed-ab3d-1bf4ffee8ef5",
"contact_type": "email",
"name": "Jane Doe",
"tags": [],
"note": null,
"created_by": "default",
"location_id": "",
"registered_at": "2026-09-03T01:03:32Z",
"noted_at": null,
"created_at": "2026-09-02T14:13:31Z",
"source": "newsletter",
"free_tax": null,
"subscribed": true,
"registered": true,
"customer_extra_info": {
"finished_order_count": 0,
"finished_order_total": "0.0",
"country": null,
"country_code": null,
"province": null,
"province_code": null,
"currency_code": "USD",
"purchase_product_count": 0,
"store_customer_id": "",
"customer_role": null,
"ext": null,
"first_order_at": null,
"last_order_at": null
}
}
}
Subscribe an email address to marketing emails
POST /{locale}/api/customers/newsletters
Subscribe an email address to the store's marketing emails. Open to anonymous visitors.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/newsletters', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
},
body: body
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The email address to subscribe.
Response
- Schema
- Example
ID of the customer that was subscribed.
{
"id": "9fe44049-abab-4fed-ab3d-1bf4ffee8ef5"
}
List a customer's addresses
GET /{locale}/api/customers/addresses
List the addresses of the signed-in customer. Requires a signed-in customer.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/addresses?per_page=40')
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The number of addresses to return.
Response
- Schema
- Example
- Array [
- ]
Number of addresses returned.
addresses object[]
List of the customer addresses.
ID of the address.
First name of the customer or recipient.
Last name of the customer or recipient.
Phone number associated with the address.
Email address associated with the address.
Country name of the address.
ISO country code of the address.
Province or state of the address.
Province or state code.
Area or district of the address.
City of the address.
Company name of the address.
Postal or ZIP code.
Gender of the recipient.
Area code of the phone number.
Street address of the recipient.
Primary street address.
Whether this is the customer's default address.
Creation time, in ISO-8601 format.
{
"count": 1,
"addresses": [
{
"id": "f4892e84-0d09-4370-8144-37a21a01f2f6",
"first_name": "Jane",
"last_name": "Doe",
"phone": null,
"country": "United States",
"country_code": "US",
"province": "California",
"province_code": "US-CA",
"area": null,
"city": "Los Angeles",
"company": null,
"zip": "90001",
"gender": null,
"phone_area_code": null,
"address": "123 Main St",
"address1": "123 Main St",
"is_default": true,
"created_at": "2026-09-03T01:07:23Z"
}
]
}
Create an address
POST /{locale}/api/customers/addresses
Add an address to the signed-in customer's address book. Requires a signed-in customer. Send country and country_code together.
Example request
const body = new URLSearchParams({
first_name: 'Jane',
last_name: 'Doe',
address: '123 Main St',
address1: 'Apt 4',
city: 'Los Angeles',
province: 'California',
province_code: 'CA',
country: 'United States',
country_code: 'US',
zip: '90001',
is_default: '1'
});
fetch(window.SHOPLAZZA.routes.root + '/api/customers/addresses', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
},
body: body
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The first name of the recipient.
The last name of the recipient.
The first line of the street address.
The second line of the street address, such as an apartment number.
The city.
The name of the province or state.
The code of the province or state, such as CA.
The name of the country, such as United States.
The two-letter code of the country, such as US.
The postal code.
The email address of the recipient.
Whether this becomes the default address, 1 or 0.
Response
- Schema
- Example
address object
idstringID of the address.
first_namestringFirst name of the customer or recipient.
last_namestringLast name of the customer or recipient.
phonestringnullablePhone number associated with the address.
emailstringEmail address associated with the address.
countrystringCountry name of the address.
country_codestringISO country code of the address.
provincestringProvince or state of the address.
province_codestringProvince or state code.
areastringnullableArea or district of the address.
citystringCity of the address.
companystringnullableCompany name of the address.
zipstringPostal or ZIP code.
genderstringnullableGender of the recipient.
phone_area_codestringnullableArea code of the phone number.
addressstringStreet address of the recipient.
address1stringPrimary street address.
is_defaultbooleanWhether this is the customer's default address.
created_atstringCreation time, in ISO-8601 format.
{
"address": {
"id": "f4892e84-0d09-4370-8144-37a21a01f2f6",
"first_name": "Jane",
"last_name": "Doe",
"phone": null,
"country": "United States",
"country_code": "US",
"province": "California",
"province_code": "US-CA",
"area": null,
"city": "Los Angeles",
"company": null,
"zip": "90001",
"gender": null,
"phone_area_code": null,
"address": "123 Main St",
"address1": "123 Main St",
"is_default": true,
"created_at": "2026-09-03T01:07:23Z"
}
}
Get an address
GET /{locale}/api/customers/addresses/{address_id}
Get one address of the signed-in customer. Requires a signed-in customer.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/addresses/f4892e84-0d09-4370-8144-37a21a01f2f6')
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The id of the address.
Response
- Schema
- Example
address object
idstringID of the address.
first_namestringFirst name of the customer or recipient.
last_namestringLast name of the customer or recipient.
phonestringnullablePhone number associated with the address.
emailstringEmail address associated with the address.
countrystringCountry name of the address.
country_codestringISO country code of the address.
provincestringProvince or state of the address.
province_codestringProvince or state code.
areastringnullableArea or district of the address.
citystringCity of the address.
companystringnullableCompany name of the address.
zipstringPostal or ZIP code.
genderstringnullableGender of the recipient.
phone_area_codestringnullableArea code of the phone number.
addressstringStreet address of the recipient.
address1stringPrimary street address.
is_defaultbooleanWhether this is the customer's default address.
created_atstringCreation time, in ISO-8601 format.
{
"address": {
"id": "f4892e84-0d09-4370-8144-37a21a01f2f6",
"first_name": "Jane",
"last_name": "Doe",
"phone": null,
"country": "United States",
"country_code": "US",
"province": "California",
"province_code": "US-CA",
"area": null,
"city": "Los Angeles",
"company": null,
"zip": "90001",
"gender": null,
"phone_area_code": null,
"address": "123 Main St",
"address1": "123 Main St",
"is_default": true,
"created_at": "2026-09-03T01:07:23Z"
}
}
Update an address
PATCH /{locale}/api/customers/addresses/{address_id}
Update one address of the signed-in customer. Requires a signed-in customer. Send country and country_code together.
Example request
const body = new URLSearchParams({
first_name: 'Jane',
last_name: 'Doe',
address: '456 Oak Ave',
city: 'Los Angeles',
province: 'California',
province_code: 'CA',
country: 'United States',
country_code: 'US',
zip: '90002'
});
fetch(window.SHOPLAZZA.routes.root + '/api/customers/addresses/f4892e84-0d09-4370-8144-37a21a01f2f6', {
method: 'PATCH',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': getCsrfToken()
},
body: body
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The id of the address.
The first name of the recipient.
The last name of the recipient.
The first line of the street address.
The city.
The name of the province or state.
The code of the province or state, such as CA.
The name of the country, such as United States.
The two-letter code of the country, such as US.
The postal code.
Response
- Schema
- Example
address object
idstringID of the address.
first_namestringFirst name of the customer or recipient.
last_namestringLast name of the customer or recipient.
countrystringCountry name of the address.
country_codestringISO country code of the address.
provincestringProvince or state of the address.
province_codestringProvince or state code.
citystringCity of the address.
zipstringPostal or ZIP code.
emailstringEmail address associated with the address.
genderstringnullableGender of the recipient.
phonestringnullablePhone number associated with the address.
areastringnullableArea or district of the address.
companystringnullableCompany name of the address.
phone_area_codestringnullableArea code of the phone number.
addressstringStreet address of the recipient.
address1stringPrimary street address.
is_defaultbooleanWhether this is the customer's default address.
created_atstringCreation time, in ISO-8601 format.
{
"address": {
"id": "f4892e84-0d09-4370-8144-37a21a01f2f6",
"first_name": "Jane",
"last_name": "Doe",
"country": "United States",
"country_code": "US",
"province": "California",
"province_code": "US-CA",
"city": "Los Angeles",
"zip": "90001",
"gender": null,
"phone": null,
"area": null,
"company": null,
"phone_area_code": null,
"address": "123 Main St",
"address1": "123 Main St",
"is_default": true,
"created_at": "2026-09-03T01:07:23Z"
}
}
Delete an address
DELETE /{locale}/api/customers/addresses/{address_id}
Delete one address of the signed-in customer. Requires a signed-in customer.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/addresses/f4892e84-0d09-4370-8144-37a21a01f2f6', {
method: 'DELETE',
headers: {
'X-CSRF-Token': getCsrfToken()
}
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The id of the address.
Response
- Schema
- Example
{}
Set the default address
POST /{locale}/api/customers/addresses/{address_id}/default
Make one address the default address of the signed-in customer. Requires a signed-in customer.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/addresses/f4892e84-0d09-4370-8144-37a21a01f2f6/default', {
method: 'POST',
headers: {
'X-CSRF-Token': getCsrfToken()
}
})
.then((response) => response.json())
.then((data) => {
// do something...
});
Request parameters
The id of the address.
Response
- Schema
- Example
{}
Get the store's address form settings
GET /{locale}/api/customers/address_settings
Get how the store's address form is configured: how the name fields are laid out, which optional fields are shown or hidden, and which contact fields are required. Requires a signed-in customer and takes no parameters.
Example request
fetch(window.SHOPLAZZA.routes.root + '/api/customers/address_settings')
.then((response) => response.json())
.then((data) => {
// do something...
});
Response
- Schema
- Example
Display setting of the email field in the address form.
How the name fields are laid out in the address form.
Display setting of the phone field in the address form.
Display setting of the company field in the address form, for example hidden.
Display setting of the street address field in the address form.
Which name field is required, for example last_name.
How contact fields are collected in the address form.
{
"name": "separate",
"phone": "+1 555-0100",
"company": "hidden",
"address1": "123 Main St",
"name_requirement": "last_name",
"contact_details": "multiple"
}