HomeGuidesRecipesAPI ExplorerForumSupport
Partner Portal
Partner Portal

Manage contacts

Learn how to manage the counterpart's contact information.

Overview

Counterparts of type organization can have contact information associated with them. The contact information can be used to pay the invoices issued by those counterparts.

Add a contact to a counterpart

To add a contact to a counterpart, call POST /counterparts/{counterpart_id}/contacts:

curl -X POST 'https://api.sandbox.monite.com/v1/counterparts/{counterpart_id}/contacts' \
     -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 '{
         "first_name": "Mary",
         "last_name": "O Brien",
         "email": "[email protected]",
         "phone": "5551235476",
         "address": {
            "country": "DE",
            "city": "Berlin",
            "postal_code": "10115",
            "state": "BE",
            "line1": "Flughafenstrasse 52",
            "line2": "Additional information"
          },
          "title": "Ms."
     }'

The successful response returns the information about the contact:

{
  "first_name": "Mary",
  "last_name": "O Brien",
  "email": "[email protected]",
  "phone": "5551235476",
  "address": {
    "country": "DE",
    "city": "Berlin",
    "postal_code": "10115",
    "state": "BE",
    "line1": "Flughafenstrasse 52",
    "line2": "Additional information"
  },
  "title": "Ms.",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "counterpart_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "is_default": false
}

Set the default contact

Once the contacts are added to the counterpart, select a default contact by calling POST /counterparts/{counterpart_id}/contacts/{contact_id}/make_default:

curl -X POST 'https://api.sandbox.monite.com/v1/counterparts/3fa8...f66afa6/contacts/9d2b4c8f...83c49a4/make_default' \
     -H 'X-Monite-Version: 2024-01-31' \
     -H 'X-Monite-Entity-Id: ENTITY_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN'

The successful response contains information about the contact marked as default:

{
  "first_name": "Mary",
  "last_name": "O Brien",
  "email": "[email protected]",
  "phone": "5551235476",
  "address": {
    "country": "DE",
    "city": "Berlin",
    "postal_code": "10115",
    "state": "BE",
    "line1": "Flughafenstrasse 52",
    "line2": "Additional information"
  },
  "title": "Ms.",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "counterpart_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "is_default": true
}

List all contacts

To get information about all contacts associated with the specified counterpart, call
GET /counterparts/{counterpart_id}/contacts.

Retrieve a contact

To get information about a specific contact associated with the specified counterpart, call
GET /counterparts/{counterpart_id}/contacts/{contact_id}.

Edit a contact

To edit an existing contact of the specified counterpart, call
PATCH /counterparts/{counterpart_id}/contacts/{contact_id}.

Delete a contact

To delete an existing contact from the list of contacts associated with the specified counterpart, call
DELETE /counterparts/{counterpart_id}/contacts/{contact_id}. Only non-default contacts can be deleted.