Creates a new customer account with a login, password, shipping and billing details and custom field values. The response returns the new customer record.
Before you begin#
- The API token needs
Customer_Insert, 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.
Example requests#
Create a customer#
Creates a customer with a login, password and matching shipping and billing addresses.
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "Customer_Insert",
"Customer_Login": "test1234",
"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": "92101",
"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": "92101",
"Customer_BillCountry": "US",
"Customer_Tax_Exempt": 0,
"Customer_BusinessAccount": "",
"CustomField_Values": {}
}
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
Customer_Login |
String | No | Login to assign to a customer |
Customer_PasswordEmail |
String | Yes | Forgot Password Email. This is also used as the email address to log into the account |
Customer_Password |
String | Yes | 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 | Name of the business account the customer will be assigned |
CustomField_Values |
Object | Object containing custom field modules |
Example response#
{
"id": 24993,
"account_id": 1431,
"login": "test1234",
"pw_email": "[email protected]",
"ship_id": 13046,
"ship_res": true,
"ship_fname": "Jane",
"ship_lname": "Doe",
"ship_email": "[email protected]",
"ship_comp": "Miva, Inc",
"ship_phone": "555-555-5555",
"ship_fax": "555-555-5555",
"ship_addr1": "123 abc",
"ship_addr2": "apt 123",
"ship_city": "San Diego",
"ship_state": "CA",
"ship_zip": "92101",
"ship_cntry": "US",
"bill_id": 13047,
"bill_fname": "Jane",
"bill_lname": "Doe",
"bill_email": "[email protected]",
"bill_comp": "Miva, Inc",
"bill_phone": "555-555-5555",
"bill_fax": "555-555-5555",
"bill_addr1": "123 abc",
"bill_addr2": "apt 123",
"bill_city": "San Diego",
"bill_state": "CA",
"bill_zip": "92101",
"bill_cntry": "US",
"note_count": 0,
"dt_created": 1645482414,
"dt_login": 0,
"credit": 0,
"formatted_credit": "$0.00"
}
Response parameters#
| Parameter | Type | Description |
|---|---|---|
id |
Number | Customer Id |
account_id |
Number | Business Account Id |
login |
String | Customer Login |
pw_email |
String | Forgot Password Email |
ship_id |
Number | Address Book Shipping Address ID |
ship_res |
Boolean | Customer Ship Residential Flag |
ship_fname |
String | Shipping First Name |
ship_lname |
String | Shipping Last Name |
ship_email |
String | Shipping Email Address |
ship_comp |
String | Shipping Company |
ship_phone |
String | Shipping Phone Number |
ship_fax |
String | Shipping Fax Number |
ship_addr1 |
String | Shipping Address 1 |
ship_addr2 |
String | Shipping Address 2 |
ship_city |
String | Shipping City |
ship_state |
String | Shipping State. 2 digit state code |
ship_zip |
String | Shipping Zip Code |
ship_cntry |
String | Shipping Country. 2 digit country code |
bill_id |
Number | Billing Address ID |
bill_fname |
String | Billing First Name |
bill_lname |
String | Billing Last Name |
bill_email |
String | Billing Email Address |
bill_comp |
String | Billing Company |
bill_phone |
String | Billing Phone Number |
bill_fax |
String | Billing Fax Number |
bill_addr1 |
String | Billing Address 1 |
bill_addr2 |
String | Billing Address 2 |
bill_city |
String | Billing City |
bill_state |
String | Billing State. 2 digit state code |
bill_zip |
String | Billing Zip Code |
bill_cntry |
String | Billing Country. 2 digit country code |
note_count |
Number | Number of Notes assigned to customer record |
dt_created |
Unix TS | Unix timestamp of the date account was created |
dt_login |
Unix TS | Date Time of Last Login |
credit |
Number | Customer Account Credit |
formatted_credit |
String | Formatted Customer Account Credit |
Related functions#
| Function | Use it to |
|---|---|
Customer_Update |
Change a customer |
Customer_Delete |
Delete a customer |
CustomerList_Load_Query |
List and search customers |
CustomerAddress_Insert |
Add another address to the customer |
PriceGroupCustomer_Update_Assigned |
Assign the customer to a price group |
Try in Postman#
In the Miva: JSON API: Authenticated collection, open Customers > Customer_Insert. See Set Up Postman.