API ReferenceLast reviewed: Fri Dec 12 2025 00:00:00 GMT+0000 (Coordinated Universal Time)
Invoices
Create and manage invoices
Invoices
Create and manage invoices.
GET Get All Invoices
GET /query?action=invoice
Returns a paginated list of invoices. Supports optional filters:
| Filter | Description |
|---|---|
| customer_id | Limit to a specific customer |
| status | Invoice status (e.g., Pending, Sent, Paid) |
| due_before | Invoices due before date (YYYY-MM-DD) |
| due_after | Invoices due after date (YYYY-MM-DD) |
GET Get Single Invoice
GET /query/invoice/{id}
Returns a single invoice by unique ID. If not found, returns 404.
POST Create Invoice
POST /query?action=invoice
Body:
json
1{
2 "x_login": "...",
3 "x_tran_key": "...",
4 "invoice": {
5 "invoice_number": "INV-2024-001",
6 "due_date": "2024-12-31",
7 "notes": "Thank you for your business",
8 "discount": 0,
9 "tax": 10.50,
10 "shipping": 5.00,
11 "amount": 635.50,
12 "customer_id": 123,
13 "items": [
14 {
15 "title": "Web Design",
16 "description": "Homepage design",
17 "quantity": 1,
18 "unit_price": 500.00
19 },
20 {
21 "title": "Hosting",
22 "quantity": 12,
23 "unit_price": 10.00
24 }
25 ]
26 }
27}Note:
- Provide
customer_idto associate the invoice with an existing customer. - If
customer_idis omitted, include a fullcustomerobject to create a new customer.
Create Invoice
POST /query?action=invoice
Body:
json
1{
2 "x_login": "...",
3 "x_tran_key": "...",
4 "invoice": {
5 "invoice_number": "INV-2024-001",
6 "due_date": "2024-12-31",
7 "notes": "Thank you for your business",
8 "discount": 0,
9 "tax": 10.50,
10 "shipping": 5.00,
11 "amount": 635.50,
12 "customer_id": 123, // Optional: use existing customer
13 // Alternatively provide full customer payload to create new
14 // "customer": {
15 // "customer_information": {
16 // "firstname": "John",
17 // "lastname": "Doe",
18 // "email": "john@example.com"
19 // }
20 // },
21 "items": [
22 {
23 "title": "Web Design",
24 "description": "Homepage design",
25 "quantity": 1,
26 "unit_price": 500.00
27 },
28 {
29 "title": "Hosting",
30 "quantity": 12,
31 "unit_price": 10.00
32 }
33 ]
34 }
35}Note: Provide customer_id to associate with an existing customer. If customer_id is omitted, include a full customer object to create a new customer.
PUT Update Invoice
PUT /query?action=invoice
Body:
json
1{
2 "x_login": "...",
3 "x_tran_key": "...",
4 "_method": "PUT",
5 "invoice": {
6 "uniqueID": 456,
7 "notes": "Updated notes",
8 "status": "Sent"
9 }
10}DELETE Delete Invoice
DELETE /query?action=invoice&invoiceID={id}
Example:
bash
1DELETE /query?action=invoice&invoiceID=456