API Documentation · v1.0

Customers

Introduction

Through the API you can list, create, update, and delete contacts (historically called customers in the API). The product UI calls them contacts; the API still exposes /customers and also accepts /contacts as an alias for the same resources.

A contact can only be deleted if there are no invoices attached to it.

List Customers

Endpoint: GET api/1.0/customers
Alias: GET api/1.0/contacts

Parameters

Parameter Type Status Description
page integer optional Page number for the paginated result set.
query string optional Filter by contact name or company name.

Example Request

curl -X GET "https://addrow.io/api/1.0/customers" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json"

Example Responses

Status 200

{
    "current_page": 1,
    "data": [
        {
            "id": "WzV2zk",
            "name": "John Doe",
            "company_name": "Company A",
            "address": "Street 1",
            "zipcode": "1234 AB",
            "city": "Arnhem",
            "country": "NL",
            "country_label": "Nederland",
            "phone": "+31612345678",
            "email": "johndoe@companya.com"
        }
    ],
    "first_page_url": "https:\/\/addrow.io\/api\/1.0\/customers?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https:\/\/addrow.io\/api\/1.0\/customers?page=1",
    "next_page_url": null,
    "path": "https:\/\/addrow.io\/api\/1.0\/customers",
    "per_page": 15,
    "prev_page_url": null,
    "to": 2,
    "total": 2
}

Status 401

{
    "message": "Unauthenticated."
}

Create Customer

Endpoint POST api/1.0/customers

Parameters

Parameter Type Status Description
name string required The name of the customer.
company_name string optional The name of the company.
email string required The email of the customer.
phone string optional The phone number of the customer.
address string optional The address of the customer.
city string optional The city of the customer's address.
zipcode string optional the zipcode of the customer's address.
country string optional The country code (two letter) of the customer's address.

Example Request

curl -X POST "https://addrow.io/api/1.0/customers" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"name":"Jane Doe","company_name":"Jane Doe Inc.","email":"janedoe@email.com","phone":"+31612345678","address":"221b Baker St","city":"London","zipcode":"NW1 6XE","country":"UK"}'

Example Responses

Status 200

{
    "data": {
        "id": "WzV2zk",
        "name": "Jane Doe",
        "company_name": "Jane Doe Inc.",
        "address": "221b Baker St",
        "zipcode": "NW1 6XE",
        "city": "London",
        "country": "UK",
        "country_label": "United Kingdom",
        "phone": "+31612345678",
        "email": "janedoe@email.com"
    }
}

Status 401

{
    "message": "Unauthenticated."
}

Update Customer

Endpoint PATCH api/1.0/customers/{id}

Parameters

Parameter Type Status Description
name string required The name of the customer.
company_name string optional The name of the company.
email string required The email of the customer.
phone string optional The phone number of the customer.
address string optional The address of the customer.
city string optional The city of the customer's address.
zipcode string optional the zipcode of the customer's address.
country string optional The country code (two letter) of the customer's address.

Example Request

curl -X PATCH "https://addrow.io/api/1.0/customers/{id}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"name":"Jane Doe","company_name":"Jane Doe Inc.","email":"janedoe@email.com","phone":"+31612345678","address":"221b Baker St","city":"London","zipcode":"NW1 6XE","country":"UK"}'

Example Responses

Status 200

{
    "data": {
        "id": "WzV2zk",
        "name": "Jane Doe",
        "company_name": "Jane Doe Inc.",
        "address": "221b Baker St",
        "zipcode": "NW1 6XE",
        "city": "London",
        "country": "UK",
        "country_label": "United Kingdom",
        "phone": "+31612345678",
        "email": "janedoe@email.com"
    }
}

Status 401

{
    "message": "Unauthenticated."
}

Delete Customer

A contact can only be deleted if there are no invoices attached to it.

Endpoint DELETE api/1.0/customers/{id}
Alias: DELETE api/1.0/contacts/{id}

Example Request

curl -X DELETE "https://addrow.io/api/1.0/customers/{id}" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json"

Example Responses

Status 200

{
    "message": "Contact has been deleted"
}

Status 401

{
    "message": "Unauthenticated."
}