Docs
API Reference

Invoices

Generate invoices with deposits, balances, and discounts

Invoices are billable documents you send to customers after work is done. They share the same line-item structure as quotes (services + inventory items + discount) but add deposit and balance tracking, payment status, and due dates.

Endpoints

  • GET/organisations/{orgId}/invoices — List invoices (paginated)
  • POST/organisations/{orgId}/invoices — Create invoice
  • GET/organisations/{orgId}/invoices/{invoiceId} — Get invoice
  • PUT/organisations/{orgId}/invoices/{invoiceId} — Update invoice
  • DELETE/organisations/{orgId}/invoices/{invoiceId} — Delete invoice

List supports customerId, ticketId, and paid (true/false) filters.

Auto-incrementing index

Like quotes, invoice index is auto-assigned by the server. Override it only if you have a strict accounting reason — letting Servicebay manage the sequence keeps it contiguous.

Marking as paid

paid, depositPaid, and balancePaid are simple boolean flags. Update them with a PUT once the customer settles up — for example { "paid": true, "paidDate": "2026-04-20T00:00:00Z" }.

GET
/organisations/{orgId}/invoices
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

Query Parameters

limit?integer

Maximum number of items to return (max 100)

Range1 <= value <= 100
Default50
startAfter?string

Cursor for pagination - ID of the last item from previous page

customerId?string
ticketId?string
paid?boolean

Response Body

application/json

curl -X GET "https://example.com/organisations/string/invoices"
{  "success": true,  "data": {    "invoices": [      {        "id": "string",        "index": 0,        "ticketId": "string",        "customerId": "string",        "customerName": "string",        "title": "string",        "message": "string",        "terms": "string",        "paymentAdvice": "string",        "totalPrice": 0,        "depositRequested": true,        "depositAmount": 0,        "depositPaid": true,        "balanceAmount": 0,        "balancePaid": true,        "paid": true,        "sent": true,        "remindersEnabled": true,        "dueDate": "2019-08-24T14:15:22Z",        "depositDueDate": "2019-08-24T14:15:22Z",        "balanceDueDate": "2019-08-24T14:15:22Z",        "invoiceDate": "2019-08-24T14:15:22Z",        "createdOn": "2019-08-24T14:15:22Z",        "sentDate": "2019-08-24T14:15:22Z",        "paidDate": "2019-08-24T14:15:22Z",        "viewedByCustomer": true,        "viewedDate": "2019-08-24T14:15:22Z",        "services": [          {            "id": "string",            "title": "string",            "description": "string",            "price": 0,            "quantity": 0,            "taxRateId": "string"          }        ],        "inventoryItems": [          {            "id": "string",            "title": "string",            "description": "string",            "price": 0,            "quantity": 0,            "taxRateId": "string"          }        ],        "discount": {          "type": "percentage",          "value": 0,          "reason": "string"        }      }    ],    "pagination": {      "limit": 0,      "hasMore": true,      "nextCursor": "string"    }  }}
POST
/organisations/{orgId}/invoices
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/organisations/string/invoices" \  -H "Content-Type: application/json" \  -d '{    "customerId": "string"  }'
{  "success": true,  "data": {    "id": "string",    "index": 0,    "ticketId": "string",    "customerId": "string",    "customerName": "string",    "title": "string",    "message": "string",    "terms": "string",    "paymentAdvice": "string",    "totalPrice": 0,    "depositRequested": true,    "depositAmount": 0,    "depositPaid": true,    "balanceAmount": 0,    "balancePaid": true,    "paid": true,    "sent": true,    "remindersEnabled": true,    "dueDate": "2019-08-24T14:15:22Z",    "depositDueDate": "2019-08-24T14:15:22Z",    "balanceDueDate": "2019-08-24T14:15:22Z",    "invoiceDate": "2019-08-24T14:15:22Z",    "createdOn": "2019-08-24T14:15:22Z",    "sentDate": "2019-08-24T14:15:22Z",    "paidDate": "2019-08-24T14:15:22Z",    "viewedByCustomer": true,    "viewedDate": "2019-08-24T14:15:22Z",    "services": [      {        "id": "string",        "title": "string",        "description": "string",        "price": 0,        "quantity": 0,        "taxRateId": "string"      }    ],    "inventoryItems": [      {        "id": "string",        "title": "string",        "description": "string",        "price": 0,        "quantity": 0,        "taxRateId": "string"      }    ],    "discount": {      "type": "percentage",      "value": 0,      "reason": "string"    }  }}
{  "success": false,  "error": "An error occurred"}
GET
/organisations/{orgId}/invoices/{invoiceId}
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

invoiceId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/organisations/string/invoices/string"
{  "success": true,  "data": {    "id": "string",    "index": 0,    "ticketId": "string",    "customerId": "string",    "customerName": "string",    "title": "string",    "message": "string",    "terms": "string",    "paymentAdvice": "string",    "totalPrice": 0,    "depositRequested": true,    "depositAmount": 0,    "depositPaid": true,    "balanceAmount": 0,    "balancePaid": true,    "paid": true,    "sent": true,    "remindersEnabled": true,    "dueDate": "2019-08-24T14:15:22Z",    "depositDueDate": "2019-08-24T14:15:22Z",    "balanceDueDate": "2019-08-24T14:15:22Z",    "invoiceDate": "2019-08-24T14:15:22Z",    "createdOn": "2019-08-24T14:15:22Z",    "sentDate": "2019-08-24T14:15:22Z",    "paidDate": "2019-08-24T14:15:22Z",    "viewedByCustomer": true,    "viewedDate": "2019-08-24T14:15:22Z",    "services": [      {        "id": "string",        "title": "string",        "description": "string",        "price": 0,        "quantity": 0,        "taxRateId": "string"      }    ],    "inventoryItems": [      {        "id": "string",        "title": "string",        "description": "string",        "price": 0,        "quantity": 0,        "taxRateId": "string"      }    ],    "discount": {      "type": "percentage",      "value": 0,      "reason": "string"    }  }}
{  "success": false,  "error": "An error occurred"}
PUT
/organisations/{orgId}/invoices/{invoiceId}
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

invoiceId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PUT "https://example.com/organisations/string/invoices/string" \  -H "Content-Type: application/json" \  -d '{    "customerId": "string"  }'
{  "success": true,  "data": {    "id": "string",    "index": 0,    "ticketId": "string",    "customerId": "string",    "customerName": "string",    "title": "string",    "message": "string",    "terms": "string",    "paymentAdvice": "string",    "totalPrice": 0,    "depositRequested": true,    "depositAmount": 0,    "depositPaid": true,    "balanceAmount": 0,    "balancePaid": true,    "paid": true,    "sent": true,    "remindersEnabled": true,    "dueDate": "2019-08-24T14:15:22Z",    "depositDueDate": "2019-08-24T14:15:22Z",    "balanceDueDate": "2019-08-24T14:15:22Z",    "invoiceDate": "2019-08-24T14:15:22Z",    "createdOn": "2019-08-24T14:15:22Z",    "sentDate": "2019-08-24T14:15:22Z",    "paidDate": "2019-08-24T14:15:22Z",    "viewedByCustomer": true,    "viewedDate": "2019-08-24T14:15:22Z",    "services": [      {        "id": "string",        "title": "string",        "description": "string",        "price": 0,        "quantity": 0,        "taxRateId": "string"      }    ],    "inventoryItems": [      {        "id": "string",        "title": "string",        "description": "string",        "price": 0,        "quantity": 0,        "taxRateId": "string"      }    ],    "discount": {      "type": "percentage",      "value": 0,      "reason": "string"    }  }}
{  "success": false,  "error": "An error occurred"}
DELETE
/organisations/{orgId}/invoices/{invoiceId}
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

invoiceId*string

Response Body

application/json

application/json

curl -X DELETE "https://example.com/organisations/string/invoices/string"
{  "success": true,  "data": {    "message": "Operation completed successfully"  }}
{  "success": false,  "error": "An error occurred"}

Machine-readable version: OpenAPI 3.1 spec.