Skip to main content

Customers

A customer represents a person or business you issue invoices to. Every invoice must be linked to a customer. Deleting a customer is a soft-delete — the record is archived (deleted: true) and no longer appears in list results by default, but historical invoices retain full customer details. Base URL: https://invoice.horizonpay.co/api/v1

The customer object

string
Unique identifier for the customer. Prefixed with cus_.
string
String literal "customer".
string
Full legal or trade name of the customer.
string | null
Contact email address. Used when sending invoice emails directly to this customer.
string | null
Phone number in any format.
string | null
Tax identifier (VAT number, EIN, GSTIN, ABN, etc.). No format validation is applied — store whatever format the customer uses.
object
Billing address.
boolean
true when the customer has been archived. Archived customers no longer appear in list results unless include_deleted=true is passed.
string
ISO 8601 datetime at which the customer was created.

Endpoints

List all customers belonging to your workspace. Results are cursor-paginated, newest first.Required scope: clients:read

Query parameters

string
Free-text search across name, email, and tax ID. Partial matches are supported.
string
Pagination cursor returned as next_cursor from a previous response. Omit to start from the beginning.
integer
Maximum number of customers to return. Defaults to 20; maximum is 100.
boolean
When true, archived (soft-deleted) customers are included in results. Defaults to false.

Request

Response

Pass the returned next_cursor value as the cursor query parameter on your next request to retrieve the following page. When next_cursor is null, you have reached the last page.
Create a new customer. Only name is required; all other fields are optional.Required scope: clients:writeOptionally send an Idempotency-Key header to safely retry the request without creating duplicates.

Body parameters

string
required
Full name or business name. Minimum 1 character.
string
Contact email. Must be a valid email address if provided.
string
Phone number in any format.
string
Tax identifier (VAT, EIN, GSTIN, ABN, etc.).
object
Billing address object.

Request

Response 201 Created

Retrieve a single customer by ID.Required scope: clients:readThe :id path parameter accepts either the cus_-prefixed public ID or the underlying UUID.

Request

Response 200 OK

Update one or more fields on an existing customer. Only the fields you include are changed; omitted fields retain their current values.Required scope: clients:write

Body parameters

All fields are optional. Include only those you want to change.
string
New name for the customer.
string
New email address. Pass an empty string "" to clear the field.
string
New phone number.
string
New tax identifier.
object
Partial or full address update. Only keys you include are updated within the address object.

Request

Response 200 OK

Soft-delete (archive) a customer. The record is not destroyed — all historical invoices retain their customer references. The customer will no longer appear in list results unless you pass include_deleted=true.Required scope: clients:writeThis action mirrors Stripe’s deleted: true convention. Archived customers still appear when you retrieve them by ID or pass include_deleted=true to the list endpoint.

Request

Response 200 OK

The archived customer object is returned, with deleted: true.

Error responses