Manage addresses
Learn how to manage the counterpart's addresses.
Overview
Counterparts that represent an entity's vendors or suppliers must have their address information associated with them.
Add an address to a counterpart
To add an address to a counterpart, call POST /counterparts/{counterpart_id}/addresses
:
curl -X POST 'https://api.sandbox.monite.com/v1/counterparts/{counterpart_id}/addresses' \
-H 'X-Monite-Version: 2023-06-04' \
-H 'X-Monite-Entity-Id: ENTITY_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"country": "DE",
"city": "Berlin",
"postal_code": "10115",
"state": "BE",
"line1": "Flughafenstrasse 52",
"line2": "Additional information"
}'
The successful response returns the information about the address:
{
"country": "DE",
"city": "Berlin",
"postal_code": "10115",
"state": "BE",
"line1": "Flughafenstrasse 52",
"line2": "Addition information",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"is_default": true,
"counterpart_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
Set the default address
Once the addresses are added to the counterpart, select a default address by calling POST /counterparts/{counterpart_id}/addresses/{address_id}/make_default
:
curl -X POST 'https://api.sandbox.monite.com/v1/counterparts/3fa8...f66afa6/addresses/9d2b4c8f...83c49a4/make_default' \
-H 'X-Monite-Version: 2023-06-04' \
-H 'X-Monite-Entity-Id: ENTITY_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d ''
The successful response contains information about the address marked as default:
{
"country": "DE",
"city": "Berlin",
"postal_code": "10115",
"state": "BE",
"line1": "Flughafenstrasse 52",
"line2": "Additional information",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"is_default": true,
"counterpart_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
List all addresses
To get information about all addresses associated with the specified counterpart, call
GET /counterparts/{counterpart_id}/addresses
.
Retrieve an address
To get information about a specific address associated with the specified counterpart, call
GET /counterparts/{counterpart_id}/addresses/{address_id}
.
Edit an address
To edit an existing address of the specified counterpart, call
PATCH /counterparts/{counterpart_id}/addresses/{address_id}
.
Delete an address
Only non-default addresses can be deleted. To delete an existing address from the list of addresses associated with the specified counterpart, call
DELETE /counterparts/{counterpart_id}/addresses/{addresses_id}
.
Updated 19 days ago