Updates an existing customer record, including the password, shipping and billing details, tax exemption and custom field values. Identify the customer by ID or login.
Before you begin#
- The API token needs
Customer_Update, either assigned directly under Functions or through a group. See Create an API token. - Requests must be signed if the token requires it. See Make a signed request with HMAC.
- You need the customer’s
Customer_ID,Customer_LoginorEdit_Customer(the login).
Example requests#
Update a customer#
Updates the shipping and billing details of the customer with this login, marks them tax exempt and sets a custom field.
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "Customer_Update",
"Customer_Login": "{{Customer_Login}}",
"Customer_PasswordEmail": "[email protected]",
"Customer_Password": "miva@123",
"Customer_ShipResidential": 1,
"Customer_ShipFirstName": "Jane",
"Customer_ShipLastName": "Doe",
"Customer_ShipEmail": "[email protected]",
"Customer_ShipCompany": "Miva, Inc",
"Customer_ShipPhone": "555-555-5555",
"Customer_ShipFax": "555-555-5555",
"Customer_ShipAddress1": "123 abc",
"Customer_ShipAddress2": "apt 123",
"Customer_ShipCity": "San Diego",
"Customer_ShipState": "CA",
"Customer_ShipZip": "92127",
"Customer_ShipCountry": "US",
"Customer_BillFirstName": "Jane",
"Customer_BillLastName": "Doe",
"Customer_BillEmail": "[email protected]",
"Customer_BillCompany": "Miva, Inc",
"Customer_BillPhone": "555-555-5555",
"Customer_BillFax": "555-555-5555",
"Customer_BillAddress1": "123 abc",
"Customer_BillAddress2": "apt 123",
"Customer_BillCity": "San Diego",
"Customer_BillState": "CA",
"Customer_BillZip": "92127",
"Customer_BillCountry": "US",
"Customer_Tax_Exempt": 1,
"Customer_BusinessAccount": "",
"CustomField_Values": {
"customfields": {
"sales_rep": "John Smith"
}
}
}
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
customer_idedit_customercustomer_login |
Number String String |
One of these | The customer id The customer login The customer login |
Customer_PasswordEmail |
String | No | Forgot Password Email. This is also used as the email address to log into the account. |
Customer_Password |
String | No | Customer Password. This password will get encrypted when the record is created. |
Customer_ShipResidential |
Boolean | No | Boolean flag used to determine if commercial or residential rates are returned. |
Customer_ShipFirstName |
String | No | Shipping First Name to assign to a customer. |
Customer_ShipLastName |
String | No | Shipping Last Name to assign to a customer. |
Customer_ShipEmail |
String | No | Shipping Email address to assign to a customer. |
Customer_ShipCompany |
String | No | Shipping Company name to assign to a customer. |
Customer_ShipPhone |
String | No | Shipping Phone Number to assign to a customer. |
Customer_ShipFax |
String | No | Shipping Fax Number to assign to a customer. |
Customer_ShipAddress1 |
String | No | Shipping Address 1 to assign to a customer. |
Customer_ShipAddress2 |
String | No | Shipping Address 2 to assign to a customer. |
Customer_ShipCity |
String | No | Shipping City to assign to a customer. |
Customer_ShipState |
String | No | Shipping State to assign to a customer. 2 digit state code. |
Customer_ShipZip |
String | No | Shipping Zip Code to assign to a customer. |
Customer_ShipCountry |
String | No | Shipping Country to assign to a customer. 2 digit country code. |
Customer_BillFirstName |
String | No | Billing First Name to assign to a customer. |
Customer_BillLastName |
String | No | Billing Last Name to assign to a customer. |
Customer_BillEmail |
String | No | Billing Email Address to assign to a customer. |
Customer_BillCompany |
String | No | Billing Company to assign to a customer. |
Customer_BillPhone |
String | No | Billing Phone Number to assign to a customer. |
Customer_BillFax |
String | No | Billing Fax Number to assign to a customer. |
Customer_BillAddress1 |
String | No | Billing Address 1 to assign to a customer. |
Customer_BillAddress2 |
String | No | Billing Address 2 to assign to a customer. |
Customer_BillCity |
String | No | Billing City to assign to a customer. |
Customer_BillState |
String | No | Billing State to assign to a customer. 2 digit state code. |
Customer_BillZip |
String | No | Billing Zip Code to assign to a customer. |
Customer_BillCountry |
String | No | Billing Country to assign to a customer. 2 digit country code. |
Customer_Tax_Exempt |
Boolean | No | Flag to determine if customer is tax exempt. |
Customer_BusinessAccount |
String | No | Title of the business account to assign the customer to. An empty value removes the customer from its business account. |
CustomField_Values |
Object | Object keyed by custom field module code (for example customfields). Each module’s value is an object of custom field code and value pairs. |
Example response#
{
"success": 1
}
Response parameters#
| Parameter | Type | Description |
|---|---|---|
success |
Boolean | Value of 1 or 0 if the update was successful. |
Error responses#
| Error Code | Error Message | Error Description |
|---|---|---|
| #Error# | Unable to load customer: One of Edit_Customer, Customer_ID or Customer_Login must be specified | Missing one of the 3 required customer identifiers. |
Related functions#
| Function | Use it to |
|---|---|
Customer_Insert |
Create a customer |
Customer_Delete |
Delete a customer |
CustomerList_Load_Query |
Find a customer and check the current values |
CustomerAddress_Update |
Change one of the customer’s saved addresses |
BusinessAccountCustomer_Update_Assigned |
Assign the customer to a business account |
Try in Postman#
In the Miva: JSON API: Authenticated collection, open Customers > Customer_Update. See Set Up Postman.