Customers¶
Endpoints for listing, creating, and updating customer records.
GET /customers¶
List customers with optional filtering and pagination.
Request¶
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
nonce |
query | integer (int64) | No | Client-generated unique sequential number |
searchString |
query | string | No | Search by customer code or number |
searchColumn |
query | string | No | Column to search instead of the default code/number field |
searchOperator |
query | string | No | Comparison operator: lt, lte, gt, gte, ne |
skip |
query | integer | No | Number of records to skip (pagination) |
limit |
query | integer | No | Max records to return. Max: 1000, default: 50 |
Responses¶
200 — Success¶
Returns an array of thirdParty objects (empty array if none found).
[
{
"id": 1,
"code": "C0001",
"name": "Acme Corp",
"vat_id": "PT123456789",
"email": "billing@acme.com",
"phone": "+351211234567",
"billing_address": {
"postal_address": "Rua da Liberdade 1",
"city": "Lisboa",
"zip_code": "1250-001",
"country": "PT"
}
}
]
400 — Invalid input parameters¶
POST /customers¶
Add a new customer to the system.
Request¶
POST /api/{account}/v4.0.0/customers?nonce={nonce}
Authorization: Bearer <xa-token>
Content-Type: application/json
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
nonce |
query | integer (int64) | Yes | Client-generated unique sequential number |
Request Body¶
A thirdParty object. Required field: name.
{
"name": "New Customer Ltd",
"vat_id": "PT987654321",
"email": "contact@newcustomer.com",
"phone": "+351211234567",
"billing_address": {
"postal_address": "Av. da República 45",
"city": "Porto",
"zip_code": "4000-001",
"country": "PT"
}
}
Responses¶
201 — Customer created¶
Returns an entityCreated object:
400 — Invalid input¶
Returns an apiError.
409 — Duplicate entry¶
A customer with the same identifier already exists.
PUT /customers¶
Update an existing customer record.
Request¶
PUT /api/{account}/v4.0.0/customers?nonce={nonce}
Authorization: Bearer <xa-token>
Content-Type: application/json
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
nonce |
query | integer (int64) | Yes | Client-generated unique sequential number |
Request Body¶
A thirdParty object. Include the id or code to identify the record to update.