Customer
Customer management, archival, and per-customer statistics
Display a listing of customers#
GET /api/v1/customers
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters#
| Name |
In |
Type |
Required |
Description |
search |
query |
string |
no |
|
per_page |
query |
string |
no |
|
Responses#
| Status |
Description |
| 200 |
For non-paginated data, return as before |
Example request#
curl -X GET "https://app.encryptinvoice.com/api/v1/customers" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Store a newly created customer#
POST /api/v1/customers
Requires authentication (Bearer token) and the X-Organization-Id header.
Request body#
| Field |
Type |
Required |
Description |
name |
string |
yes |
|
email |
string |
no |
|
phone |
string |
no |
|
website |
string |
no |
|
tax_number |
string |
no |
|
address_line1 |
string |
no |
|
address_line2 |
string |
no |
|
city |
string |
no |
|
state |
string |
no |
|
postal_code |
string |
no |
|
country |
string |
no |
|
billing_subdivision_code |
string |
no |
ISO 3166-2 subdivision code for the billing address (e.g. CA-QC). Validated against the country_subdivisions reference table. (#635) |
shipping_subdivision_code |
string |
no |
ISO 3166-2 subdivision code for the shipping address (e.g. CA-QC). Validated against the country_subdivisions reference table. (#635) |
notes |
string |
no |
|
language |
string |
no |
Customer locale defaults (#844) and e-invoicing network identifier (#928). Scheme and value only make sense together; either both or neither. |
currency |
string |
no |
|
einvoicing_identifier_scheme |
string |
no |
|
einvoicing_identifier_value |
string |
no |
|
Responses#
| Status |
Description |
| 201 |
For non-paginated data, return as before |
| 422 |
|
| 403 |
|
Example request#
curl -X POST "https://app.encryptinvoice.com/api/v1/customers" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"email": "string",
"phone": "string",
"website": "string",
"tax_number": "string",
"address_line1": "string",
"address_line2": "string",
"city": "string",
"state": "string",
"postal_code": "string",
"country": "string",
"billing_subdivision_code": "string",
"shipping_subdivision_code": "string",
"notes": "string",
"language": "string",
"currency": "string",
"einvoicing_identifier_scheme": "string",
"einvoicing_identifier_value": "string"
}'
Display the specified customer#
GET /api/v1/customers/{id}
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters#
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
Responses#
| Status |
Description |
| 200 |
For non-paginated data, return as before |
Example request#
curl -X GET "https://app.encryptinvoice.com/api/v1/customers/{id}" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Update the specified customer#
PUT /api/v1/customers/{id}
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters#
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
Request body#
| Field |
Type |
Required |
Description |
name |
string |
no |
|
email |
string |
no |
|
phone |
string |
no |
|
website |
string |
no |
|
tax_number |
string |
no |
|
address_line1 |
string |
no |
|
address_line2 |
string |
no |
|
city |
string |
no |
|
state |
string |
no |
|
postal_code |
string |
no |
|
country |
string |
no |
|
billing_subdivision_code |
string |
no |
ISO 3166-2 subdivision code for the billing address (e.g. CA-QC). Validated against the country_subdivisions reference table. (#635) |
shipping_subdivision_code |
string |
no |
ISO 3166-2 subdivision code for the shipping address (e.g. CA-QC). Validated against the country_subdivisions reference table. (#635) |
notes |
string |
no |
|
language |
string |
no |
Customer locale defaults (#844) and e-invoicing network identifier (#928). Scheme and value only make sense together; either both or neither. |
currency |
string |
no |
|
einvoicing_identifier_scheme |
string |
no |
|
einvoicing_identifier_value |
string |
no |
|
Responses#
| Status |
Description |
| 200 |
For non-paginated data, return as before |
| 422 |
|
| 403 |
|
Example request#
curl -X PUT "https://app.encryptinvoice.com/api/v1/customers/{id}" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"email": "string",
"phone": "string",
"website": "string",
"tax_number": "string",
"address_line1": "string",
"address_line2": "string",
"city": "string",
"state": "string",
"postal_code": "string",
"country": "string",
"billing_subdivision_code": "string",
"shipping_subdivision_code": "string",
"notes": "string",
"language": "string",
"currency": "string",
"einvoicing_identifier_scheme": "string",
"einvoicing_identifier_value": "string"
}'
Remove the specified customer#
DELETE /api/v1/customers/{id}
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters#
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
Responses#
| Status |
Description |
| 200 |
For non-paginated data, return as before |
Example request#
curl -X DELETE "https://app.encryptinvoice.com/api/v1/customers/{id}" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Get customer's invoices#
GET /api/v1/customers/{id}/invoices
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters#
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
status |
query |
string |
no |
|
per_page |
query |
string |
no |
|
Responses#
| Status |
Description |
| 200 |
For non-paginated data, return as before |
Example request#
curl -X GET "https://app.encryptinvoice.com/api/v1/customers/{id}/invoices" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Get customer's quotes#
GET /api/v1/customers/{id}/quotes
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters#
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
status |
query |
string |
no |
|
per_page |
query |
string |
no |
|
Responses#
| Status |
Description |
| 200 |
For non-paginated data, return as before |
Example request#
curl -X GET "https://app.encryptinvoice.com/api/v1/customers/{id}/quotes" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Customer statement of account#
GET /api/v1/customers/{id}/statement
Requires authentication (Bearer token) and the X-Organization-Id header.
Opening balance, invoice/payment/credit-note entries and closing balance for the period (start_date/end_date required), in the organization currency. (#847)
Parameters#
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
start_date |
query |
string |
yes |
|
end_date |
query |
string |
yes |
|
Responses#
| Status |
Description |
| 200 |
For non-paginated data, return as before |
| 422 |
|
Example request#
curl -X GET "https://app.encryptinvoice.com/api/v1/customers/{id}/statement" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Get customer statistics#
GET /api/v1/customers/{id}/statistics
Requires authentication (Bearer token) and the X-Organization-Id header.
Parameters#
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
Responses#
| Status |
Description |
| 200 |
For non-paginated data, return as before |
Example request#
curl -X GET "https://app.encryptinvoice.com/api/v1/customers/{id}/statistics" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Validate the customer's e-invoicing identifier on the network#
GET /api/v1/customers/{id}/validate-network
Requires authentication (Bearer token) and the X-Organization-Id header.
Looks up the customer's stored einvoicing_identifier_scheme/einvoicing_identifier_value on the e-invoicing network of the provider resolved for the customer's country, and persists a successful verification (einvoicing_identifier_verified). Returns 422 when the customer has no identifier stored, when no country can be resolved (the customer country, billing country, or a country-specific identifier scheme all absent), or when the resolved provider (e.g. FNE clearance countries) does not support participant lookup. When the customer has no stored country it is inferred from a country-specific identifier scheme (e.g. 0208 → BE). A verified: false result never clears an earlier successful verification, because provider transport errors are indistinguishable from a genuine not-found. (#928) (#954)
Parameters#
| Name |
In |
Type |
Required |
Description |
id |
path |
integer |
yes |
|
Responses#
| Status |
Description |
| 422 |
|
| 200 |
For non-paginated data, return as before |
Example request#
curl -X GET "https://app.encryptinvoice.com/api/v1/customers/{id}/validate-network" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"