Clients are the businesses or individuals you bill. Every invoice, quote, and recurring invoice must be linked to a client. You can also track credit balances and send statements per client.
List clients
GET /client
Returns all active (non-archived) clients for your account.
curl https://rebill-api-896466068278.africa-south1.run.app/client \ -H "Authorization: Bearer sk_your_secret_key"
Response:
{
"clients": [
{
"id": "xyz789",
"name": "Acme Corp",
"surname": "",
"email": "[email protected]",
"phone": "+27821234567",
"credit_amount": 0,
"billing_address": null,
"shipping_address": null,
"custom_fields": {}
}
]
}Get a client
GET /client/:id
Returns a single client by ID.
Client object
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier |
| public_id | string | Short ID used in public-facing statement links |
| name | string | First name or company name |
| surname | string | Last name (if an individual) |
| string | Email address | |
| phone | string | Phone number in E.164 format (+27821234567) |
| billing_address | object | Billing address (see Address object) |
| shipping_address | object | Shipping address (see Address object) |
| custom_fields | object | Key-value pairs of custom fields |
| credit_amount | integer | Current credit balance in cents |
| has_password | boolean | Whether the client's statement portal is password-protected |
| invoice_prefix | string | Custom prefix for invoice numbers generated for this client |
| invoice_count | integer | Total number of invoices for this client |
Address object
| Field | Type | Description |
|---|---|---|
| street_1 | string | Street address line 1 |
| street_2 | string | Street address line 2 |
| city | string | City |
| province | string | Province or state |
| postal_code | string | Postal code |
| country | string | Country |
Create a client
POST /client
| Field | Required | Type | Description |
|---|---|---|---|
| name | Yes | string | First name or company name |
| Yes | string | Valid email address | |
| surname | No | string | Last name |
| phone | No | string | E.164 format (e.g. +27821234567) |
| billing_address | No | object | Billing address |
| shipping_address | No | object | Shipping address |
| invoice_prefix | No | string | Custom prefix for this client's invoice numbers |
curl -X POST https://rebill-api-896466068278.africa-south1.run.app/client \
-H "Authorization: Bearer sk_your_secret_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp",
"email": "[email protected]",
"phone": "+27821234567",
"billing_address": {
"street_1": "12 Main Road",
"city": "Cape Town",
"province": "Western Cape",
"postal_code": "8001",
"country": "South Africa"
}
}'Response (201 Created):
{
"id": "xyz789"
}Update a client
PUT /client/:id
Updates a client. Accepts the same fields as create. Fields you omit will be cleared; send the full object.
Delete a client
DELETE /client/:id
Permanently deletes a client. Returns 200 OK on success.
List invoices for a client
GET /client/:id/invoice
Returns all invoices for a specific client. Accepts the same include_paid and include_cancelled query parameters as GET /invoice.
List quotes for a client
GET /client/:id/quote
Returns all quotes for a specific client. Accepts the same include_accepted, include_declined, include_expired, and include_converted query parameters as GET /quote.