API Documentation - Version 1.0
Customers
Introduction
Through the API, you are able to list your customers. You can also add a new customer, edit or delete one. A customer can only be deleted if there are no invoices attached to the customer.
List Customers
Endpoint: GET api/1.0/customers
Parameters
Parameter | Type | Status | Description |
---|---|---|---|
page | integer | optional | Parameter to paginate the result set. |
Example Request
url -X GET -G "https://addrow.io/api/1.0/customers" \
-H "Authorization: Bearer {token}"
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": "[email protected]"
}
],
"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. |
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":"[email protected]","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": "[email protected]"
}
}
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. |
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":"[email protected]","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": "[email protected]"
}
}
Status 401
{
"message": "Unauthenticated."
}
Delete Customer
A customer can only be deleted if there are no invoices attached to the customer.
Endpoint DELETE api/1.0/customers/{id}
Example Request
curl -X DELETE "https://addrow.io/api/1.0/customers/1" \
-H "Authorization: Bearer {token}"
Example Responses
Status 200
{
"message": "Customer has been deleted"
}
Status 401
{
"message": "Unauthenticated."
}