Accounts & Integrations
API Reference
Customers

Customers API

Use the Customers API to create, update, list, and bulk import customer records.

Customers represent the people or businesses you invoice. Each customer can be linked to multiple accounts (invoices) and can have tags, custom fields, and communication preferences.

Endpoints

MethodPathScopeDescription
POST/customerscustomers:writeCreate a single customer.
GET/customerscustomers:readList customers with search and pagination.
GET/customers/{customer_id}customers:readFetch a customer by UUID.
PUT/customers/{customer_id}customers:writeUpdate customer fields.
DELETE/customers/{customer_id}customers:writeSoft-delete a customer.
POST/customers/bulkcustomers:writeBulk create or update customers by external_id.

Scope behavior and empty-scope full-access rules are documented in Core Concepts → Authentication.

Bulk operations use your own stable identifier (external_id) to decide whether to create a new customer or update an existing one. Use a consistent external identifier from your CRM or ERP.

Request fields

FieldTypeDescription
emailstringEmail address. Required if phone is not sent.
phonestringE.164-format phone number. Required if email is not sent.
firstNamestringCustomer first name.
lastNamestringCustomer last name.
companyNamestringCompany name for business customers.
external_idstringExternal identifier from your system, used as the primary match key for bulk operations.
tagsstring[]Optional tags (for example: ["vip"]).
custom_fieldsobjectCustom metadata object, such as {"account_type": "premium"}.
communication_preferencesobjectPreferred channels such as {"sms": true, "email": true, "voice": false}.

Create customer

cURL

curl --request POST \
  --url https://api.agilereceivables.com/api/v1/external/customers \
  --header 'X-Api-Key: sk_live_xxxxxxxxxxxxxxxxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "jane@example.com",
  "firstName": "Jane",
  "lastName": "Doe",
  "phone": "+15550001234",
  "companyName": "Acme Corp",
  "external_id": "cust-001",
  "tags": ["vip"],
  "custom_fields": { "account_type": "premium" },
  "communication_preferences": { "sms": true, "email": true, "voice": false }
}'

Response

{
  "success": true,
  "status_code": 200,
  "message": "Customer created successfully",
  "data": {
    "id": "uuid",
    "email": "jane@example.com",
    "phone": "+15550001234",
    "first_name": "Jane",
    "last_name": "Doe",
    "company_name": "Acme Corp",
    "external_id": "cust-001",
    "tags": ["vip"],
    "custom_fields": { "account_type": "premium" }
  }
}

List customers

List customers with pagination and search:

curl --request GET \
  --url 'https://api.agilereceivables.com/api/v1/external/customers?page=1&per_page=20' \
  --header 'X-Api-Key: sk_live_xxxxxxxxxxxxxxxxxxxx'

Supported query parameters:

ParamTypeDescription
searchstringSearch by customer fields such as name or contact.
tagsstringFilter by tag values.
pageintegerPage number (default: 1, min: 1).
per_pageintegerResults per page (default: 20, min: 1, max: 100).

Pagination behavior and the meta object are documented in Core Concepts → Pagination.