Addresses
Use these methods to manage client addresses.
GET[host]/api/v2/addresses |
|
GET[host]/api/v2/addresses/{addressId} |
|
POST[host]/api/v2/addresses |
|
PUT[host]/api/v2/addresses/{addressId} PATCH[host]/api/v2/addresses/{addressId} |
|
DELETE[host]/api/v2/addresses/{addressId} |
Get a list of client addresses
Use this method to obtain a list of client addresses.
Note
If such a request is made by an admin user that is only permitted to view clients with certain tags, a response includes only addresses of clients marked with these tags.
To obtain detailed information about a specific client address, use a separate method to get client address details.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameters are available for this method:
- address
The client address.
- clientId
The client identifier.
- postcode
The client postal code.
- type
The type of a client address. Possible values:
residential
billing
mailing
The following sorting parameter is available for this method:
- createTime
The date and time when a client address was specified.
Refer to the Query parameters section of the Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/addresses
curl --location -g --request GET 'https://host.name/api/v2/addresses?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[address]=47 W 13th St, New York, NY 10011, USA&filter[clientId]=1&filter[postcode]=0200 - 9729&filter[type]=residential' \
--header 'Authorization: Bearer <token>'
Response
A response includes an array of Address objects providing information about the client addresses matching the request parameters.
Get client address details
Use this method to obtain detailed information about a specified client address.
To obtain a list of all client addresses, use a separate method to get a list of client address.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- addressId required
The client address identifier.
GET[host]/api/v2/addresses/{addressId}
curl --location --request GET 'https://host.name/api/v2/addresses/1' \
--header 'Authorization: Bearer <token>'
Response
A response includes an Address object providing information about the specified client address.
Add a client address
Use this method to add a new client address.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters when adding a new address:
- countryCode integer required
The numeric country code.
- type string required
The type of a client address. Possible values:
residential
billing
mailing
- clientId integer required
The client identifier.
- address string
The client street address.
- city string
The city name.
- postcode string
The postal code.
- state string
The name of a state.
POST[host]/api/v2/addresses
curl --location --request POST 'https://host.name/api/v2/addresses' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"countryCode": 1,
"type": "residential",
"clientId": 1,
"address": "47 W 13th St, New York, NY 10011, USA",
"city": "New York",
"postcode": "0200 - 9729",
"state": "New York"
}'
Response
A response includes an Address object providing information about the added client address.
Update a client address
Use this method to update a specified client address.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- addressId required
The client address identifier.
Body:
The following field values can be updated for a specified client address:
- address string
The client street address.
- city string
The city name.
- countryCode integer required
The numeric country code.
- postcode string
The postal code.
- state string
The name of a state.
- type string required
The type of a client address. Possible values:
residential
billing
mailing
PUT[host]/api/v2/addresses/{addressId}
curl --location --request PUT 'https://host.name/api/v2/addresses/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"address": "47 W 13th St, New York, NY 10011, USA",
"city": "New York",
"countryCode": 1,
"postcode": "0200 - 9729",
"state": "New York",
"type": "residential"
}'
Response
A response includes an Address object providing information about the updated client address.
Delete a client address
Use this method to remove a specified client address.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- addressId required
The client address identifier.
DELETE[host]/api/v2/addresses/{addressId}
curl --location --request DELETE 'https://host.name/api/v2/addresses/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.