CustomerAddress
A customer address resource instance represents one of the many addresses a customer may have.
For more information about Customers, see the Customer API Documentation
What can you do with CustomerAddress?
The FlickRocket API lets you do the following with the CustomerAddress resource. More detailed versions of these general actions may be available:
GET /api/customers/#{token}/addresses.json
Receive a list of all CustomerAddresses
GET /api/customers/#{token}/addresses/#{token}.json
Receive a single CustomerAddress
POST /api/customers/#{token}/addresses.json
Create a new CustomerAddress
PUT /api/customers/#{token}/addresses/#{token}.json
Modify an existing CustomerAddress
DELETE /api/customers/#{token}/addresses/#{token}.json
Remove a CustomerAddress from the database
PUT /api/customers/#{token}/addresses/#{token}/default.json
Sets default address for a customer
CustomerAddress Properties
address1 |
{"address1": "Heinrich-Hertz-Str. 2"} |
address2 |
{"address2": ""} |
city |
{"city": "Dortmund"} |
company |
{"company": ""} |
country |
{"country": "Germany"} |
country_name |
{"country_name": "Germany"} |
country_code |
{"country_code": "DE"} |
default |
{"default": true} |
first_name |
{"first_name": "John"} |
id |
{"id": 159501} |
last_name |
{"last_name": "Doe"} |
name |
{"name": "Test"} |
phone |
{"phone": "0231-12345678"} |
province |
{"province": ""} |
province_code |
{"province_code": ""} |
token |
{"token": "TCMJEOTSBEVTDLFU"} |
zip |
{"zip": "44227"} |
Endpoints
Receive a list of all CustomerAddresses
GET /api/customers/#{token}/addresses.json
View Response
{
"addresses": [{
"id": 105491,
"first_name": "Vorname",
"last_name": "Nachmane",
"company": "",
"address1": "Heinrich-Hertz-Str. 2",
"address2": "",
"zip": "44227",
"city": "Dortmund",
"phone": "",
"language": "de",
"token": "TNFEQBBVTEDXLUPN",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": true,
"province_code": "",
"province": "",
"name": "Vorname Nachmane"
}, {
"id": 3,
"first_name": "Test_first_name",
"last_name": "Test_last_name",
"company": "",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"token": "RSEDJYBITFASLWHP",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": false,
"province_code": "",
"province": "",
"name": "Test_first_name Test_last_name"
}]
}
Receive a single CustomerAddress
GET /api/customers/#{token}/addresses/#{token}.json
View Response
/api/customers/TNFEQBBVTEDXLUPN/addresses/RSEDJYBITFASLWHP.json
{
"customer_address": {
"id": 3,
"first_name": "Test_first_name",
"last_name": "Test_last_name",
"company": "",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"token": "RSEDJYBITFASLWHP",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": false,
"province_code": "",
"province": "",
"name": "Test_first_name Test_last_name"
}
}
Create a new CustomerAddress
POST /api/customers/#{token}/addresses.json
POST /api/customers/YLQCIUSBHVCTQUVN/addresses.json
{
"address": {
"first_name": "Test_first_name",
"last_name": "Test_last_name",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"phone": "+49 231 976765 0",
"language": "en",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"province_code": "NRW",
"province": "NRW",
"name": "Test_first_name Test_last_name"
}
}
View Response
{
"addresses": [{
"id": 147900,
"first_name": "Test_first_name",
"last_name": "Test_last_name",
"company": "Sample Company",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"phone": "+49 231 976765 0",
"language": "en",
"token": "YLQCIUSBHVCTQUVN",
"country": "United Kingdom",
"country_name": "United Kingdom",
"country_code": "GB",
"default": true,
"province_code": "IL",
"province": "IL",
"name": "Test_first_name Test_last_name"
}, {
"id": 1,
"first_name": "Test_first_name",
"last_name": "Test_last_name",
"company": "",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"token": "KFCSYIWTUQBEKXDP",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": false,
"province_code": "",
"province": "",
"name": "Test_first_name Test_last_name"
}]
}
Modify an existing CustomerAddress
PUT /api/customers/#{token}/addresses/#{token}.json
{
"address": {
"first_name": "First",
"last_name": "Last",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"token": "RSEDJYBITFASLWHP",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": false,
"province_code": "",
"province": ""
}
}
View Response
{
"customer_address": {
"id": 3,
"first_name": "First",
"last_name": "Last",
"company": "",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"token": "RSEDJYBITFASLWHP",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": false,
"province_code": "",
"province": "",
"name": "First Last"
}
}
Remove a CustomerAddress from the database
DELETE /api/customers/#{token}/addresses/#{token}.json
View Response
Sets default address for a customer
PUT /api/customers/#{token}/addresses/#{token}/default.json
View Response