CustomerClient#getCustomer(customerId, options);
Customers represent registered users of your storefront. The following operations allow you to retrieve and manage the current customer’s data.
Note
|
To operate on a customer, the user must be authenticated and their access token must be provided to the function call. |
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
Provide a customer id to fetch |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a Customer.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
Provide a customer id to update |
|
✅ |
The new customer data |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a Customer.
const data: Customer {
id: 'CUSTOMER_ID',
username: 'test@customer.com',
email: 'test@customer.com',
fullName: 'Test Customer'
};
const customer = await customerClient.updateCustomer('CUSTOMER_ID', data, { accessToken });
console.log(customer);
Retrieves a page of customer addresses.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The customer’s ID |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
A page of Customer Addresses.
Retrieves a single customer address by customer Id and customer address Id.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The customer’s ID |
|
|
✅ |
The address' ID |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
An Customer Address.
Adds a new customer address to an existing customer.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The customer’s ID |
|
✅ |
The new address |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
An Customer Address.
Updates an existing customer address.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The customer’s ID |
|
|
✅ |
The address' ID |
|
✅ |
The new address |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
An Customer Address.
Retrieves the order history for a customer.
Parameter | Type | Required? | Description |
---|---|---|---|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
A page of Orders.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The order’s ID or number |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
An Order.