How to Modify Customer Account
This call needs the customer's Authorization token. Send only the fields you want to change; omitted fields keep their current value. The birthday in demographics cannot be changed once it is set.
The field the brand authenticates with — the email address on an email brand, the phone number on a phone number brand (see the brand's customer authentication settings) — is changed through a verification flow, described below, because the customer has to prove they own the new value.
PUT /customer-accounts/{customer_account_id}
Request
| Attribute | Type | Example Value | Description |
|---|---|---|---|
Authorization HTTP header |
string | "Bearer {customer_account_token}" |
JWT Token of Customer Account |
first_name |
varchar | "John" |
Customer's first name |
last_name |
varchar | "Doe" |
Customer's last name |
optin_status_email |
tinyint (optional) | 1 |
How the opt-in for marketing emails is handled depends on the Brand's opt-in settings. More information can be found in the "Opt-in" section of the 'How to view/edit basic information about my Brand' knowledge base article. |
optin_status_sms |
tinyint (optional) | 2 |
Customer's opt-in status for marketing SMS. Values: 1 confirmed, 2 disabled, 3 pending. |
optin_status_pn |
tinyint (optional) | 3 |
Customer's opt-in status for marketing push notifications. Values: 1 confirmed, 2 disabled, 3 pending. |
demographics |
Demographic resource (optional) | Can be required depending on the Brand's customer demographic data settings. | |
phone_number |
varchar | "+15852826524" |
On an email brand the phone number can be changed here directly. If the brand has the Unique phone number flag on, check the new number with POST /customers/check-phone-number first, as in the Customer Sign-Up Flow. On a phone number brand, passing a new value here starts the verification flow described below instead. |
email |
varchar | "jon.doe@gmail.com" |
On a phone number brand the email can be changed here directly; check it with POST /customers/check-email first, because it must be unique. On an email brand, passing a new value here starts the verification flow described below instead. |
{
"method": "put",
"url": "https://api-public-demo.menu.app/api/customer-accounts/{customer_account_id}",
"headers": {
"X-Request-ID": "69da3547-204b-4093-a225-54e084c24215",
"Application": "f3a90488ffee32c3acb6fcd0ca417cf6",
"Api-Version": "<current-release-version>",
"Content-Type": "application/json",
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXRSZWZyZXNoVFRMIjoyNjI4MDAwLCJpc3MiOiJodHRwczovL2FwaS1wdWJsaWMtcGxheWdyb3VuZC5tZW51LmFwcC9hcGkvY3VzdG9tZXJzL2xvZ2luIiwiaWF0IjoxNjkzMjA0MTQ3LCJleHAiOjE2OTMyMDc3NDcsIm5iZiI6MTY5MzIwNDE0NywianRpIjoiM0RiTngwVlB6VmpTTlJkdyIsInN1YiI6IjUwOTA5NjUiLCJwcnYiOiJjYzMyOTIxYTE1NDgwYTExN2Q5YmJjNzJjMGUxMjU2YTY4NTI0NThiIiwiYXBwbGljYXRpb25faWQiOjIwMTUsInNlc3Npb25faWQiOjI4MzQyfQ.1J3_OlydWh32BUNAySZ6Qbj1K0q-_w4KfFnra2X9FbM"
},
"body": {
"first_name": "Jonathan",
"optin_status_email": "2"
}
}
Response
{
"status": "OK",
"code": 200,
"data": {
"customer_account": {
"id": "0ff757dd-9b8a-4750-89ad-03ff531ae923",
"type_id": 1,
"reference_type": "CustomerAccount",
"first_name": "Jonathan",
"last_name": "Doe",
"email": "john.doe@gmail.com",
"phone_number": "",
"locale": "en-US",
"state": 1,
"demographics": [],
"optin_status_email": 2,
"optin_status_pn": 3,
"has_pending_email_change": false,
"has_pending_phone_number_change": false,
"is_social": false,
"social_login": null,
"updated_at": "2023-08-28 06:37:34",
"created_at": "2023-08-24 15:33:27"
}
}
}
How to modify customer's email in a brand that is using Email customer auth method
The customer has to prove they own the new email address, so the change happens in two steps. Passing the new email in the update call sends a one-time code to that address; the account keeps the old email until the code is confirmed.
PUT /customer-accounts/{customer_account_id}
Request
| Attribute | Type | Example Value | Description |
|---|---|---|---|
Authorization HTTP header |
string | "Bearer {customer_account_token}" |
JWT Token of Customer Account |
email |
varchar | "john.doa@gmail.com" |
Customer's new email address |
{
"method": "put",
"url": "https://api-public-demo.menu.app/api/customer-accounts/{customer_account_id}",
"headers": {
"X-Request-ID": "69da3547-204b-4093-a225-54e084c24215",
"Application": "f3a90488ffee32c3acb6fcd0ca417cf6",
"Api-Version": "<current-release-version>",
"Content-Type": "application/json",
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXRSZWZyZXNoVFRMIjoyNjI4MDAwLCJpc3MiOiJodHRwczovL2FwaS1wdWJsaWMtcGxheWdyb3VuZC5tZW51LmFwcC9hcGkvY3VzdG9tZXJzL2xvZ2luIiwiaWF0IjoxNjkzMjA0MTQ3LCJleHAiOjE2OTMyMDc3NDcsIm5iZiI6MTY5MzIwNDE0NywianRpIjoiM0RiTngwVlB6VmpTTlJkdyIsInN1YiI6IjUwOTA5NjUiLCJwcnYiOiJjYzMyOTIxYTE1NDgwYTExN2Q5YmJjNzJjMGUxMjU2YTY4NTI0NThiIiwiYXBwbGljYXRpb25faWQiOjIwMTUsInNlc3Npb25faWQiOjI4MzQyfQ.1J3_OlydWh32BUNAySZ6Qbj1K0q-_w4KfFnra2X9FbM"
},
"body": {
"email": "john.doe@yahoo.com"
}
}
Response
{
"status": "OK",
"code": 200,
"data": {
"customer_account": {
"id": "0ff757dd-9b8a-4750-89ad-03ff531ae923",
"type_id": 1,
"reference_type": "CustomerAccount",
"first_name": "Jonathan",
"last_name": "Doe",
"email": "john.doe@gmail.com",
"phone_number": "",
"locale": "en-US",
"state": 1,
"demographics": [],
"optin_status_email": 2,
"optin_status_pn": 3,
"has_pending_email_change": false,
"has_pending_phone_number_change": false,
"is_social": false,
"social_login": null,
"updated_at": "2023-08-28 06:37:34",
"created_at": "2023-08-24 15:33:27"
}
}
}
To complete the change, pass the code the customer received by email to:
customer-accounts/{customer_account_id}/verify-email-update
Request
| Attribute | Type | Example Value | Description |
|---|---|---|---|
Authorization HTTP header |
string | "Bearer {customer_account_token}" |
JWT Token of Customer Account |
confirmation_code |
varchar | "053631" |
One-time code that was sent to the customer's new email address |
{
"method": "put",
"url": "https://api-public-demo.menu.app/api/customer-accounts/{customer_account_id}/verify-email-update",
"headers": {
"X-Request-ID": "69da3547-204b-4093-a225-54e084c24215",
"Application": "f3a90488ffee32c3acb6fcd0ca417cf6",
"Api-Version": "<current-release-version>",
"Content-Type": "application/json",
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXRSZWZyZXNoVFRMIjoyNjI4MDAwLCJpc3MiOiJodHRwczovL2FwaS1wdWJsaWMtcGxheWdyb3VuZC5tZW51LmFwcC9hcGkvY3VzdG9tZXJzL2xvZ2luIiwiaWF0IjoxNjkzMjA0MTQ3LCJleHAiOjE2OTMyMDc3NDcsIm5iZiI6MTY5MzIwNDE0NywianRpIjoiM0RiTngwVlB6VmpTTlJkdyIsInN1YiI6IjUwOTA5NjUiLCJwcnYiOiJjYzMyOTIxYTE1NDgwYTExN2Q5YmJjNzJjMGUxMjU2YTY4NTI0NThiIiwiYXBwbGljYXRpb25faWQiOjIwMTUsInNlc3Npb25faWQiOjI4MzQyfQ.1J3_OlydWh32BUNAySZ6Qbj1K0q-_w4KfFnra2X9FbM"
},
"body": {
"confirmation_code": "625789"
}
}
Response
{
"status": "OK",
"code": 200,
"data": {
"customer_account": {
"id": "0ff757dd-9b8a-4750-89ad-03ff531ae923",
"type_id": 1,
"reference_type": "CustomerAccount",
"first_name": "Jonathan",
"last_name": "Doe",
"email": "john.doe@yahoo.com",
"phone_number": "",
"locale": "en-US",
"state": 1,
"demographics": [],
"optin_status_email": 2,
"optin_status_pn": 3,
"has_pending_email_change": false,
"has_pending_phone_number_change": false,
"is_social": false,
"social_login": null,
"updated_at": "2023-08-28 06:54:56",
"created_at": "2023-08-24 15:33:27"
}
}
}
How to modify customer's phone number in a brand that is using Phone number customer auth method
The customer has to prove they own the new phone number, so the change happens in two steps. Passing the new number in the update call sends a one-time code to it by SMS; the account keeps the old number until the code is confirmed.
PUT /customer-accounts/{customer_account_id}
Request
| Attribute | Type | Example Value | Description |
|---|---|---|---|
Authorization HTTP header |
string | "Bearer {customer_account_token}" |
JWT Token of Customer Account |
phone_number |
varchar | "+15852826525" |
Customer's new phone number |
{
"method": "put",
"url": "https://api-public-demo.menu.app/api/customer-accounts/{customer_account_id}",
"headers": {
"X-Request-ID": "69da3547-204b-4093-a225-54e084c24215",
"Application": "f3a90488ffee32c3acb6fcd0ca417cf6",
"Api-Version": "<current-release-version>",
"Content-Type": "application/json",
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXRSZWZyZXNoVFRMIjoyNjI4MDAwLCJpc3MiOiJodHRwczovL2FwaS1wdWJsaWMtcGxheWdyb3VuZC5tZW51LmFwcC9hcGkvY3VzdG9tZXJzL2xvZ2luIiwiaWF0IjoxNjkzMjA3MjA1LCJleHAiOjE2OTMyMTA4MDUsIm5iZiI6MTY5MzIwNzIwNSwianRpIjoiZUNUNGlZcVZKTGFmdlNIYSIsInN1YiI6IjUwOTA5NzYiLCJwcnYiOiJjYzMyOTIxYTE1NDgwYTExN2Q5YmJjNzJjMGUxMjU2YTY4NTI0NThiIiwiYXBwbGljYXRpb25faWQiOjIxNDQsInNlc3Npb25faWQiOjI4MzUwfQ.0WWTS1RxwPELOPIHV6MAB-XYQCsG7ocS1XvRvc5Vc6w"
},
"body": {
"phone_number": "+15852826525"
}
}
Response
{
"status": "OK",
"code": 200,
"data": {
"customer_account": {
"id": "8100bab1-267e-41ae-8592-c229253b0129",
"type_id": 1,
"reference_type": "CustomerAccount",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@gmail.com",
"phone_number": "+15852826524",
"locale": "en-US",
"state": 1,
"demographics": [],
"optin_status_email": 3,
"optin_status_pn": 3,
"has_pending_email_change": false,
"has_pending_phone_number_change": true,
"is_social": false,
"social_login": null,
"updated_at": "2023-08-25 12:10:33",
"created_at": "2023-08-25 12:10:33"
}
}
}
To complete the change, pass the code the customer received by SMS to:
customer-accounts/{customer_account_id}/verify-phone-number-update
Request
| Attribute | Type | Example Value | Description |
|---|---|---|---|
Authorization HTTP header |
string | "Bearer {customer_account_token}" |
JWT Token of Customer Account |
confirmation_code |
varchar | "053631" |
One-time code that was sent to the customer's new phone number |
{
"method": "put",
"url": "https://api-public-demo.menu.app/api/customer-accounts/{customer_account_id}/verify-phone-number-update",
"headers": {
"X-Request-ID": "69da3547-204b-4093-a225-54e084c24215",
"Application": "f3a90488ffee32c3acb6fcd0ca417cf6",
"Api-Version": "<current-release-version>",
"Content-Type": "application/json",
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXRSZWZyZXNoVFRMIjoyNjI4MDAwLCJpc3MiOiJodHRwczovL2FwaS1wdWJsaWMtcGxheWdyb3VuZC5tZW51LmFwcC9hcGkvY3VzdG9tZXJzL2xvZ2luIiwiaWF0IjoxNjkzMjA3MjA1LCJleHAiOjE2OTMyMTA4MDUsIm5iZiI6MTY5MzIwNzIwNSwianRpIjoiZUNUNGlZcVZKTGFmdlNIYSIsInN1YiI6IjUwOTA5NzYiLCJwcnYiOiJjYzMyOTIxYTE1NDgwYTExN2Q5YmJjNzJjMGUxMjU2YTY4NTI0NThiIiwiYXBwbGljYXRpb25faWQiOjIxNDQsInNlc3Npb25faWQiOjI4MzUwfQ.0WWTS1RxwPELOPIHV6MAB-XYQCsG7ocS1XvRvc5Vc6w"
},
"body": {
"confirmation_code": "554523"
}
}
Response
{
"status": "OK",
"code": 200,
"data": {
"customer_account": {
"id": "8100bab1-267e-41ae-8592-c229253b0129",
"type_id": 1,
"reference_type": "CustomerAccount",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@gmail.com",
"phone_number": "+15852826525",
"locale": "en-US",
"state": 1,
"demographics": [],
"optin_status_email": 3,
"optin_status_pn": 3,
"has_pending_email_change": false,
"has_pending_phone_number_change": false,
"is_social": false,
"social_login": null,
"updated_at": "2023-08-28 07:29:58",
"created_at": "2023-08-25 12:10:33"
}
}
}
