HomeGuidesRecipesAPI ExplorerForumSupport
Partner Portal
Partner Portal

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. Monite allows you to create multiple addresses for a counterpart.

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: 2024-01-31' \
     -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 including the ID:

{
  "country": "DE",
  "city": "Berlin",
  "postal_code": "10115",
  "state": "BE",
  "line1": "Flughafenstrasse 52",
  "line2": "Addition information",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "counterpart_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

After creating a new counterpart address, Monite stores all available counterpart addresses in array. You can also update the counterpart's default billing and shipping addresses using the counterpart address ID issued after creating a counterpart. For more information, see Edit Counterpart Information.

πŸ“˜

Counterparts can use the same counterpart address for the default_shipping_address_id and default_billing_address_id fields.

List all addresses

To get information about all addresses associated with the specified counterpart, call
GET /counterparts/{counterpart_id}/addresses as shown:

curl -X GET 'https://api.sandbox.monite.com/v1/counterparts/{counterpart_id}/addresses' \
     -H 'X-Monite-Version: 2024-01-31' \
     -H 'X-Monite-Entity-Id: ENTITY_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \

The successful response returns an array of all counterpart 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}.

πŸ“˜

Monite does not allow deletion of a counterpart's default billing or shipping address. Attempting to delete this address will return an error.