Handles actions related the customer's shipping information:
/account/shipping
Show the current customer's shipping information
No parameters required (besides your API key of course).
{
"status": "ok",
"address": {
"first_name": "Timothy",
"last_name": "Lovett",
"address": "111 ok street",
"address_2": "",
"city": "Oakland",
"state": "CA",
"postal_code": "94607",
"country": "US"
},
"items": []
}
{
"status": "ok",
"address": {
"first_name": "Timothy",
"last_name": "Lovett",
"address": "111 ok street",
"address_2": "",
"city": "Oakland",
"state": "CA",
"postal_code": "94607",
"country": "US"
},
"items": [
"item_type_1": {
"label": "T-Shirt Size",
"options": [
{
"id": 1,
"name": "Medium",
"selected": true
},
{
"id": 2,
"name": "Large",
"selected": false
}
]
}
]
}
{
"status": "ok",
"address": {
"first_name": "Timothy",
"last_name": "Lovett",
"address": "111 ok street",
"address_2": "",
"city": "Oakland",
"state": "CA",
"postal_code": "94607",
"country": "US"
},
"items": [
"item_type_1": {
"label": "T-Shirt Size",
"options": [
{
"id": 1,
"name": "Medium",
"selected": false
},
{
"id": 2,
"name": "Large",
"selected": false
}
]
}
]
}
{
"status": "ok",
"address": null,
"items": []
}
{
"status": "ok",
"address": null,
"items": []
}
/account/shipping
Creates a primary address or updates the existing address on record and sets any options for the customer
Name | Type | Description |
---|---|---|
first_name |
string | Customer's first name |
last_name |
string | Customer's last name |
address |
string | Street address line 1 |
address_2 |
string | [Optional] Street address line 2 |
city |
string | City/Town |
state |
string | State/Province/Region |
postal_code |
string | Postal code |
country |
string | Country Format: XX |
item_type_x |
integer | Option Id |
{
"first_name": "Timothy",
"last_name": "Lovett",
"address": "111 ok street",
"address_2": "",
"city": "Oakland",
"state": "CA",
"postal_code": "94607",
"country": "US",
"item_type_1": 3
}
If the customer does not have an address on file all of the address fields aside from address_2
are required fields in order to update the address information.
Item types are never required but can be passed to set option values. If they are passed and contain blank data a validation error will occur.
{
"status": "ok",
"address": {
"first_name": "Timothy",
"last_name": "Lovett",
"address": "111 ok street",
"address_2": "",
"city": "Oakland",
"state": "CA",
"postal_code": "94607",
"country": "US"
},
"items": []
}
{
"status": "ok",
"address": {
"first_name": "Timothy",
"last_name": "Lovett",
"address": "111 ok street",
"address_2": "",
"city": "Oakland",
"state": "CA",
"postal_code": "94607",
"country": "CA"
},
"auto_renewal_disabled": true,
"items": []
}
{
"status": "error",
"messages": [
"First name can't be blank", "Option name can't be blank"
],
"errors": {
"first_name": ["can't be blank"],
"item_type_1": ["can't be blank"]
}
}