Ecommerce: Addresses
GET /addresses
Sending GET request to this url, returns collection of ADDRESSES resources.
You can narrow down list of resources by passing proper query parameters (list of which you can find below in request params section). You can basically search by:
- name
- firstName
- lastName
- address1
- address2
- city
- zip
- province
- provinceCode
- phone
- company
- createdOn
`name` fields can be a pattern and we will try to match this phrase.
You can specify which page of results you want and how many results per page should be there. You can also specify sort-order using one or more of allowed fields (listed below in request params section).
Last but not least you can even specify which fields from resource you want to get. If you pass param `fields` with list of fields (separated by comma [,]) we will return list of resources with only those fields (we will always add resource id to ensure that you can use that data later on)
Returns status code
200
Request url
/addresses?query[name]=foo&query[createdOn][from]=2010-10-13&query[createdOn][to]=2020-03-15
Request params
Field name | Field type | Field description | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
query | hash | Used to search only resources that meets criteria. You can specify multiple parameters, then it uses AND logic.
| |||||||||||||||||||||||||||||||||||||||
fields | string | List of fields that should be returned. Id is always returned. Fields should be separated by comma | |||||||||||||||||||||||||||||||||||||||
sort | hash | Enable sorting using specified field (set as a key) and order (set as a value). You can specify multiple fields to sort by.
| |||||||||||||||||||||||||||||||||||||||
perPage | int | Number results on page | |||||||||||||||||||||||||||||||||||||||
page | int | Page number |
Example Response
[
{
"addressId": "Vt",
"countryCode": "POL",
"countryName": "Poland",
"name": "name-58da43f8c6b07",
"firstName": "firstName-58da43f8c6b19",
"lastName": "lastName-58da43f8c6b23",
"address1": "address1-58da43f8c6b2b",
"address2": "address2-58da43f8c6b34",
"city": "city-58da43f8c6b3c",
"zip": "zip-58da43f8c6b44",
"province": "province-58da43f8c6b4c",
"provinceCode": "provinceCode-58da43f8c6b55",
"phone": "0048111111111",
"company": "company-58da43f8c6b5d",
"href": "https://api.getresponse.com/v3/addresses/Vt",
"createdOn": "2017-03-28T11:07:36+0000",
"updatedOn": "2017-03-28T11:07:36+0000"
},
{
"addressId": "nQ",
"countryCode": "POL",
"countryName": "Poland",
"name": "name-58da43fc02ccc",
"firstName": "firstName-58da43fc02cd4",
"lastName": "lastName-58da43fc02cdc",
"address1": "address1-58da43fc02ce4",
"address2": "address2-58da43fc02cec",
"city": "city-58da43fc02cfc",
"zip": "zip-58da43fc02d12",
"province": "province-58da43fc02d25",
"provinceCode": "provinceCode-58da43fc02d35",
"phone": "0048111111111",
"company": "company-58da43fc02d3f",
"href": "https://api.getresponse.com/v3/addresses/nQ",
"createdOn": "2017-03-28T11:07:37+0000",
"updatedOn": "2017-03-28T11:07:38+0000"
}
]
Possible Errors
GET /addresses/{addressId}
Method returns address according to given addressId
Returns status code
200
Request url
/address/Vt?fields=name
Request params
Field name | Field type | Field description |
---|---|---|
fields | string | List of fields that should be returned. Id is always returned. Fields should be separated by comma |
Example Response
{
"addressId": "Vt",
"countryCode": "POL",
"countryName": "Poland",
"name": "name-58da43f8c6b07",
"firstName": "firstName-58da43f8c6b19",
"lastName": "lastName-58da43f8c6b23",
"address1": "address1-58da43f8c6b2b",
"address2": "address2-58da43f8c6b34",
"city": "city-58da43f8c6b3c",
"zip": "zip-58da43f8c6b44",
"province": "province-58da43f8c6b4c",
"provinceCode": "provinceCode-58da43f8c6b55",
"phone": "0048111111111",
"company": "company-58da43f8c6b5d",
"href": "https://api.getresponse.com/v3/addresses/Vt",
"createdOn": "2017-03-28T11:07:36+0000",
"updatedOn": "2017-03-28T11:07:36+0000"
}
Possible Errors
POST /addresses
Create a new address resource
Returns status code
201
Example Request Body
{
"countryCode": "POL",
"name": "loremipsum",
"firstName": "lorem",
"lastName": "ipsum",
"address1": "addr1",
"address2": "addr2",
"city": "Gdansk",
"zip": "80-111",
"province": "pomorskie",
"provinceCode": "1",
"phone": "111222333",
"company": "GetResponse"
}
Body params
Field name | Field type | Field description |
---|---|---|
countryCode (required) | string | ISO-3166-1 alpha-3 country code |
name (required) | string | Address name |
firstName | string | max 64 chars |
lastName | string | max 64 chars |
address1 | string | max 255 chars |
address2 | string | max 255 chars |
city | string | max 128 chars |
zip | string | max 64 chars, any format |
province | string | max 255 chars, any format |
provinceCode | string | max 64 chars |
phone | string | max 255 chars, any format |
company | string | max 128 chars |
Example Response
{
"addressId": "yD",
"countryCode": "POL",
"countryName": "Poland",
"name": "loremipsum",
"firstName": "lorem",
"lastName": "ipsum",
"address1": "addr1",
"address2": "addr2",
"city": "Gdansk",
"zip": "80-111",
"province": "pomorskie",
"provinceCode": "1",
"phone": "111222333",
"company": "GetResponse",
"href": "https://api.getresponse.com/v3/addresses/yD",
"createdOn": "2017-03-28T15:12:43+0000",
"updatedOn": "2017-03-28T15:12:43+0000"
}
Possible Errors
POST /addresses/{addressId}
Update existing address. You should send only those fields that need to be changed. The rest of properties will stay the same.
Returns status code
200
Example Request Body
{
"countryCode": "POL",
"name": "loremipsum",
"firstName": "lorem",
"lastName": "ipsum",
"address1": "addr1",
"address2": "addr2",
"city": "Gdansk",
"zip": "80-111",
"province": "pomorskie",
"provinceCode": "1",
"phone": "111222333",
"company": "GetResponse"
}
Body params
Field name | Field type | Field description |
---|---|---|
countryCode (required) | string | ISO-3166-1 alpha-3 country code |
name (required) | string | Address name |
firstName | string | max 64 chars |
lastName | string | max 64 chars |
address1 | string | max 255 chars |
address2 | string | max 255 chars |
city | string | max 128 chars |
zip | string | max 64 chars, any format |
province | string | max 255 chars, any format |
provinceCode | string | max 64 chars |
phone | string | max 255 chars, any format |
company | string | max 128 chars |
Example Response
{
"addressId": "yD",
"countryCode": "POL",
"countryName": "Poland",
"name": "loremipsum",
"firstName": "lorem",
"lastName": "ipsum",
"address1": "addr1",
"address2": "addr2",
"city": "Gdansk",
"zip": "80-111",
"province": "pomorskie",
"provinceCode": "1",
"phone": "111222333",
"company": "GetResponse",
"href": "https://api.getresponse.com/v3/addresses/yD",
"createdOn": "2017-03-28T15:12:43+0000",
"updatedOn": "2017-03-28T15:12:43+0000"
}