Retrieves the addresses saved to a customer account. Use it to show a customer’s address book or to find the CustomerAddress_ID you need to update or delete an address. See the List Load Query Overview guide to get started.
Before you begin#
- The API token needs
CustomerAddressList_Load_Query, 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.
Example requests#
Retrieve a customer’s addresses#
Returns every address saved to the customer with this login.
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "CustomerAddressList_Load_Query",
"Count": 0,
"Offset": 0,
"Customer_Login": "{{Customer_Login}}"
}
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
count |
Number | No | Maximum lines of data allowed to be returned in the response. This limit is used to prevent excessive amounts of data return |
filter |
String | No | A string for filtering returned data |
offset |
Number | No | Used with the Count parameter for paginating results of large datasets. Default 0 is no offset. |
sort |
String | No | The order for sorting returned data |
customer_idedit_customercustomer_login |
Number String String |
The customer id The customer login The customer login |
Example response#
{
"success": 1,
"data": {
"total_count": 1,
"start_offset": 0,
"data": [
{
"id": 1,
"cust_id": 1,
"descrip": "Work Address",
"fname": "John",
"lname": "Smith",
"email": "[email protected]",
"comp": "MIva, Inc",
"phone": "555-555-555",
"fax": "",
"addr1": "16745 W. Bernardo Dr, Fourth Floor",
"addr2": "",
"city": "San Diego",
"state": "CA",
"zip": "92127",
"cntry": "US",
"resdntl": false
}
]
}
}
Response parameters#
| Parameter | Type | Description |
|---|---|---|
total_count |
Number | total_count is the total number of records that match your search criteria. Note: this is not always the total customers returned. Based on the Count and Offset parameters passed, the number of records returned could be different than the total_count. |
start_offset |
Number | Number of the starting offset number of customers to return. Used in conjunction with the Count parameter for paginating results of large datasets. |
id |
Number | Customer Id |
cust_id |
Number | Customer Id |
descrip |
String | Address Description |
fname |
String | First Name |
lname |
String | Last Name |
email |
String | Email Address |
comp |
String | Company |
phone |
String | Phone Number |
fax |
String | Fax Number |
addr1 |
String | Address 1 |
addr2 |
String | Address 2 |
city |
String | City |
state |
String | State |
zip |
String | Zip Code |
cntry |
String | Country |
resdntl |
Boolean | Flag for Residential Address (used in shipping rates) |
Additional options#
Pagination#
Count and Offset page through results, and the response’s total_count says how many addresses match. See Pagination. List Load Query overview explains the Filter and Sort formats.
Related functions#
| Function | Use it to |
|---|---|
CustomerAddress_Insert |
Add an address to a customer |
CustomerAddress_Update |
Change a saved address |
CustomerAddress_Delete |
Delete a single address |
CustomerAddressList_Delete |
Delete several addresses at once |
CustomerList_Load_Query |
Find the customer’s ID or login |
Try in Postman#
In the Miva: JSON API: Authenticated collection, open Customers > CustomerAddressList_Load_Query. See Set Up Postman.