{"openapi":"3.1.0","info":{"title":"Lekker Accounting API","version":"v1","description":"REST API for Lekker Accounting. Authenticate with a personal access token created in Settings \u2192 Claude (the same tokens drive the MCP connection)."},"servers":[{"url":"https://lekkeraccounting.com/api/v1"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Personal access token from Settings \u2192 Claude."}}},"paths":{"/me":{"get":{"tags":["Me"],"summary":"Inspect the current token","description":"Returns the authenticated user, the workspace the token operates on, token metadata and the user's permission names. Workspace includes invoice_allowance: monthly slots remaining, extra invoices granted by an admin (never expire, used after the monthly allowance), and when the monthly count resets.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"user":{"id":12,"name":"Thandi Mokoena","email":"thandi@example.com"},"workspace":{"id":"4d81\u2026","name":"Mokoena Consulting","invoice_allowance":{"unlimited":false,"monthly_allowance":50,"used_this_month":12,"monthly_remaining":38,"bonus_remaining":500,"total_remaining":538,"resets_on":"2026-09-01"}},"token":{"name":"Zapier integration","abilities":["read","write"],"last_used_at":"2026-07-16T08:12:00Z","expires_at":null},"permissions":["manage_clients","manage_invoices","manage_quotes"]}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}}}},"/clients":{"get":{"tags":["Clients"],"summary":"List clients","description":"Paginated list, newest first by default. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":[{"id":7,"first_name":"Thandi","last_name":"Mokoena","company_name":"Mokoena Consulting","display_name":"Mokoena Consulting","email":"accounts@mokoena.example","contact":"0821234567","region_code":"27","vat_no":"4123456789","website":null,"address":"12 Long Street","city":"Cape Town","state":"Western Cape","postal_code":"8001","country_code":"ZA","note":null,"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}],"links":{"first":"\u2026","last":"\u2026","prev":null,"next":null},"meta":{"current_page":1,"per_page":25,"total":1,"\u2026":"\u2026"}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1).","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Results per page, 1\u2013100 (default 25).","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort key. One of: `name`, `company`, `email`, `created_at`.","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"description":"`asc` or `desc` (default `desc`).","schema":{"type":"string"}},{"name":"trashed","in":"query","required":false,"description":"Soft-delete visibility: `with` includes deleted records, `only` returns deleted records exclusively.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Matches first name, last name, company name or email.","schema":{"type":"string"}}]},"post":{"tags":["Clients"],"summary":"Create a client","description":"Creates a client. Returns 201 with the created record; validation failures return 422 with per-field errors. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":7,"first_name":"Thandi","last_name":"Mokoena","company_name":"Mokoena Consulting","display_name":"Mokoena Consulting","email":"accounts@mokoena.example","contact":"0821234567","region_code":"27","vat_no":"4123456789","website":null,"address":"12 Long Street","city":"Cape Town","state":"Western Cape","postal_code":"8001","country_code":"ZA","note":null,"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string","description":"Contact first name."},"last_name":{"type":"string","description":"Contact last name."},"company_name":{"type":"string","description":"Company name \u2014 used as the display name when present."},"email":{"type":"string","description":"Billing email address."},"contact":{"type":"string","description":"Local phone number, without the country prefix."},"region_code":{"type":"string","description":"Country dialling code (international calling prefix), digits only, e.g. `27` for South Africa."},"vat_no":{"type":"string","description":"VAT registration number."},"website":{"type":"string","description":"Website URL."},"address":{"type":"string","description":"Street address."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"Province / region."},"postal_code":{"type":"string","description":"Postal code."},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 country code, e.g. `ZA` or `NA`."},"note":{"type":"string","description":"Internal note (max 1000 characters)."}},"required":["first_name","last_name"]}}}}}},"/clients/{client}":{"get":{"tags":["Clients"],"summary":"Get a client","description":"Returns a single client by id. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":7,"first_name":"Thandi","last_name":"Mokoena","company_name":"Mokoena Consulting","display_name":"Mokoena Consulting","email":"accounts@mokoena.example","contact":"0821234567","region_code":"27","vat_no":"4123456789","website":null,"address":"12 Long Street","city":"Cape Town","state":"Western Cape","postal_code":"8001","country_code":"ZA","note":null,"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"client","in":"path","required":true,"schema":{"type":"integer"}}]},"put":{"tags":["Clients"],"summary":"Update a client","description":"Full update \u2014 send every field you want kept, exactly like create. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":7,"first_name":"Thandi","last_name":"Mokoena","company_name":"Mokoena Consulting","display_name":"Mokoena Consulting","email":"accounts@mokoena.example","contact":"0821234567","region_code":"27","vat_no":"4123456789","website":null,"address":"12 Long Street","city":"Cape Town","state":"Western Cape","postal_code":"8001","country_code":"ZA","note":null,"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"client","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string","description":"Contact first name."},"last_name":{"type":"string","description":"Contact last name."},"company_name":{"type":"string","description":"Company name \u2014 used as the display name when present."},"email":{"type":"string","description":"Billing email address."},"contact":{"type":"string","description":"Local phone number, without the country prefix."},"region_code":{"type":"string","description":"Country dialling code (international calling prefix), digits only, e.g. `27` for South Africa."},"vat_no":{"type":"string","description":"VAT registration number."},"website":{"type":"string","description":"Website URL."},"address":{"type":"string","description":"Street address."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"Province / region."},"postal_code":{"type":"string","description":"Postal code."},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 country code, e.g. `ZA` or `NA`."},"note":{"type":"string","description":"Internal note (max 1000 characters)."}},"required":["first_name","last_name"]}}}}},"delete":{"tags":["Clients"],"summary":"Delete a client","description":"Soft delete \u2014 the record moves to the trash and can be restored. Returns 204 with no body. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Successful response"},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"client","in":"path","required":true,"schema":{"type":"integer"}}]}},"/clients/{id}/restore":{"post":{"tags":["Clients"],"summary":"Restore a client","description":"Restores a soft-deleted record from the trash. 404 if the id is not currently deleted. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":7,"first_name":"Thandi","last_name":"Mokoena","company_name":"Mokoena Consulting","display_name":"Mokoena Consulting","email":"accounts@mokoena.example","contact":"0821234567","region_code":"27","vat_no":"4123456789","website":null,"address":"12 Long Street","city":"Cape Town","state":"Western Cape","postal_code":"8001","country_code":"ZA","note":null,"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}]}},"/products":{"get":{"tags":["Products"],"summary":"List products","description":"Paginated list, newest first by default. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":[{"id":3,"name":"Monthly bookkeeping","code":"BOOK-M","unit_price":"1500.00","tax_rate":"15.00","description":"Bookkeeping retainer, billed monthly.","category":{"id":1,"name":"Services"},"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}],"links":{"first":"\u2026","last":"\u2026","prev":null,"next":null},"meta":{"current_page":1,"per_page":25,"total":1,"\u2026":"\u2026"}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1).","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Results per page, 1\u2013100 (default 25).","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort key. One of: `name`, `code`, `unit_price`, `created_at`.","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"description":"`asc` or `desc` (default `desc`).","schema":{"type":"string"}},{"name":"trashed","in":"query","required":false,"description":"Soft-delete visibility: `with` includes deleted records, `only` returns deleted records exclusively.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Matches name or code.","schema":{"type":"string"}}]},"post":{"tags":["Products"],"summary":"Create a product","description":"Creates a product. Returns 201 with the created record; validation failures return 422 with per-field errors. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":3,"name":"Monthly bookkeeping","code":"BOOK-M","unit_price":"1500.00","tax_rate":"15.00","description":"Bookkeeping retainer, billed monthly.","category":{"id":1,"name":"Services"},"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Product or service name."},"code":{"type":"string","description":"Your internal SKU / code."},"category":{"type":"string","description":"Category name or id. Unknown names create the category on the fly."},"unit_price":{"type":"number","description":"Unit price (\u2265 0)."},"tax_rate":{"type":"number","description":"Default tax rate percentage, 0\u2013100."},"description":{"type":"string","description":"Description (max 1000 characters)."}},"required":["name","unit_price"]}}}}}},"/products/{product}":{"get":{"tags":["Products"],"summary":"Get a product","description":"Returns a single product by id. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":3,"name":"Monthly bookkeeping","code":"BOOK-M","unit_price":"1500.00","tax_rate":"15.00","description":"Bookkeeping retainer, billed monthly.","category":{"id":1,"name":"Services"},"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"product","in":"path","required":true,"schema":{"type":"integer"}}]},"put":{"tags":["Products"],"summary":"Update a product","description":"Full update \u2014 send every field you want kept, exactly like create. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":3,"name":"Monthly bookkeeping","code":"BOOK-M","unit_price":"1500.00","tax_rate":"15.00","description":"Bookkeeping retainer, billed monthly.","category":{"id":1,"name":"Services"},"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"product","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Product or service name."},"code":{"type":"string","description":"Your internal SKU / code."},"category":{"type":"string","description":"Category name or id. Unknown names create the category on the fly."},"unit_price":{"type":"number","description":"Unit price (\u2265 0)."},"tax_rate":{"type":"number","description":"Default tax rate percentage, 0\u2013100."},"description":{"type":"string","description":"Description (max 1000 characters)."}},"required":["name","unit_price"]}}}}},"delete":{"tags":["Products"],"summary":"Delete a product","description":"Soft delete \u2014 the record moves to the trash and can be restored. Returns 204 with no body. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Successful response"},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"product","in":"path","required":true,"schema":{"type":"integer"}}]}},"/products/{id}/restore":{"post":{"tags":["Products"],"summary":"Restore a product","description":"Restores a soft-deleted record from the trash. 404 if the id is not currently deleted. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":3,"name":"Monthly bookkeeping","code":"BOOK-M","unit_price":"1500.00","tax_rate":"15.00","description":"Bookkeeping retainer, billed monthly.","category":{"id":1,"name":"Services"},"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}]}},"/invoices":{"get":{"tags":["Invoices"],"summary":"List invoices","description":"Paginated list, newest first by default. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":[{"id":42,"invoice_number":"108","status":1,"status_label":"Unpaid","invoice_date":"2026-07-01","due_date":"2026-07-31","amount":"3000.00","discount_type":0,"discount":"0.00","final_amount":"3450.00","note":null,"term":"Payment due within 30 days.","needs_review":false,"recurring_frequency":"none","recurring_day":null,"recurring_month":null,"recurring_status":false,"local_currency_amount":null,"exchange_rate":null,"custom_fields":[{"key":"reg_no","label":"Reg No","type":"text","value":"CA 123-456"}],"client":{"id":7,"display_name":"Mokoena Consulting","\u2026":"\u2026"},"currency":{"id":1,"name":"South African Rand","code":"ZAR","symbol":"R","is_custom":false},"items":[{"id":90,"product_id":3,"name":"Monthly bookkeeping","description":null,"quantity":"2.00","price":"1500.00","tax_rate":"15.00","total":"3000.00"}],"payments":[],"paid_amount":"0.00","remaining_amount":"3450.00","created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}],"links":{"first":"\u2026","last":"\u2026","prev":null,"next":null},"meta":{"current_page":1,"per_page":25,"total":1,"\u2026":"\u2026"}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1).","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Results per page, 1\u2013100 (default 25).","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort key. One of: `invoice_date`, `due_date`, `final_amount`, `status`, `created_at`.","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"description":"`asc` or `desc` (default `desc`).","schema":{"type":"string"}},{"name":"trashed","in":"query","required":false,"description":"Soft-delete visibility: `with` includes deleted records, `only` returns deleted records exclusively.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Matches the invoice number or the client's name.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by status.","schema":{"type":"integer","enum":[0,1,2,3,4]}},{"name":"client_id","in":"query","required":false,"description":"Filter by client.","schema":{"type":"integer"}},{"name":"date_from","in":"query","required":false,"description":"Invoice date on or after (YYYY-MM-DD).","schema":{"type":"string","format":"date"}},{"name":"date_to","in":"query","required":false,"description":"Invoice date on or before (YYYY-MM-DD).","schema":{"type":"string","format":"date"}}]},"post":{"tags":["Invoices"],"summary":"Create a invoice","description":"Creates a invoice. Returns 201 with the created record; validation failures return 422 with per-field errors. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":42,"invoice_number":"108","status":1,"status_label":"Unpaid","invoice_date":"2026-07-01","due_date":"2026-07-31","amount":"3000.00","discount_type":0,"discount":"0.00","final_amount":"3450.00","note":null,"term":"Payment due within 30 days.","needs_review":false,"recurring_frequency":"none","recurring_day":null,"recurring_month":null,"recurring_status":false,"local_currency_amount":null,"exchange_rate":null,"custom_fields":[{"key":"reg_no","label":"Reg No","type":"text","value":"CA 123-456"}],"client":{"id":7,"display_name":"Mokoena Consulting","\u2026":"\u2026"},"currency":{"id":1,"name":"South African Rand","code":"ZAR","symbol":"R","is_custom":false},"items":[{"id":90,"product_id":3,"name":"Monthly bookkeeping","description":null,"quantity":"2.00","price":"1500.00","tax_rate":"15.00","total":"3000.00"}],"payments":[],"paid_amount":"0.00","remaining_amount":"3450.00","created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoice_number":{"type":"string","description":"Custom invoice number (create only). Omitted or already taken \u2192 the next number in your sequence is assigned."},"client_id":{"type":"integer","description":"Client id."},"currency_id":{"type":"integer","description":"Currency id \u2014 must be enabled for your workspace (see GET /currencies)."},"banking_detail_id":{"type":"integer","description":"Banking detail shown on the PDF. Defaults to your workspace default."},"invoice_date":{"type":"string","format":"date","description":"Invoice date (YYYY-MM-DD)."},"due_date":{"type":"string","format":"date","description":"Due date \u2014 on or after the invoice date."},"discount_type":{"type":"integer","enum":[0,1,2],"description":"Discount type."},"discount":{"type":"number","description":"Discount value \u2014 an amount when fixed, a percentage when percentage."},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"Invoice status."},"note":{"type":"string","description":"Note shown on the invoice."},"term":{"type":"string","description":"Payment terms shown on the invoice."},"recurring_frequency":{"type":"string","enum":["none","monthly","yearly"],"description":"Recurring schedule. On create, a monthly or yearly value spawns a standalone recurring template from this invoice; the template (managed under Recurring Invoices) drives future drafts, and the invoice itself stays a plain document. Ignored on update."},"recurring_day":{"type":"integer","description":"Day of month (1-31) the spawned template generates on. Only used on create together with recurring_frequency."},"recurring_month":{"type":"integer","description":"Month (1-12) for yearly recurrence. Only used on create together with recurring_frequency."},"recurring_status":{"type":"boolean","description":"Legacy flag, ignored: recurring schedules now live on standalone templates. Always false on invoices returned by the API."},"local_currency_amount":{"type":"number","description":"Amount received in your default currency. Required when marking a foreign-currency invoice as paid; the exchange rate is derived from it."},"custom_fields":{"type":"object","description":"Values for the workspace's invoice custom fields (Settings \u2192 Custom Fields), keyed by field key \u2014 e.g. `{\"reg_no\": \"CA 123-456\"}`. Each value is validated against the field's type and options; required custom fields must be supplied. Responses return the stored entries as `[{key, label, type, value}]`."},"items":{"type":"array","items":{"type":"object"},"description":"Line items. Totals, tax and the final amount are computed server-side from these rows. Each item: `name` (string, required), `quantity` (number \u2265 0.01, required), `price` (number \u2265 0, required), `tax_rate` (0\u2013100, optional), `description` (optional), `product_id` (optional)."}},"required":["client_id","currency_id","invoice_date","due_date","discount_type","status","items"]}}}}}},"/invoices/{invoice}":{"get":{"tags":["Invoices"],"summary":"Get a invoice","description":"Returns a single invoice by id. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":42,"invoice_number":"108","status":1,"status_label":"Unpaid","invoice_date":"2026-07-01","due_date":"2026-07-31","amount":"3000.00","discount_type":0,"discount":"0.00","final_amount":"3450.00","note":null,"term":"Payment due within 30 days.","needs_review":false,"recurring_frequency":"none","recurring_day":null,"recurring_month":null,"recurring_status":false,"local_currency_amount":null,"exchange_rate":null,"custom_fields":[{"key":"reg_no","label":"Reg No","type":"text","value":"CA 123-456"}],"client":{"id":7,"display_name":"Mokoena Consulting","\u2026":"\u2026"},"currency":{"id":1,"name":"South African Rand","code":"ZAR","symbol":"R","is_custom":false},"items":[{"id":90,"product_id":3,"name":"Monthly bookkeeping","description":null,"quantity":"2.00","price":"1500.00","tax_rate":"15.00","total":"3000.00"}],"payments":[],"paid_amount":"0.00","remaining_amount":"3450.00","created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"invoice","in":"path","required":true,"schema":{"type":"integer"}}]},"put":{"tags":["Invoices"],"summary":"Update a invoice","description":"Full update \u2014 send every field you want kept, exactly like create. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":42,"invoice_number":"108","status":1,"status_label":"Unpaid","invoice_date":"2026-07-01","due_date":"2026-07-31","amount":"3000.00","discount_type":0,"discount":"0.00","final_amount":"3450.00","note":null,"term":"Payment due within 30 days.","needs_review":false,"recurring_frequency":"none","recurring_day":null,"recurring_month":null,"recurring_status":false,"local_currency_amount":null,"exchange_rate":null,"custom_fields":[{"key":"reg_no","label":"Reg No","type":"text","value":"CA 123-456"}],"client":{"id":7,"display_name":"Mokoena Consulting","\u2026":"\u2026"},"currency":{"id":1,"name":"South African Rand","code":"ZAR","symbol":"R","is_custom":false},"items":[{"id":90,"product_id":3,"name":"Monthly bookkeeping","description":null,"quantity":"2.00","price":"1500.00","tax_rate":"15.00","total":"3000.00"}],"payments":[],"paid_amount":"0.00","remaining_amount":"3450.00","created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"invoice","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"integer","description":"Client id."},"currency_id":{"type":"integer","description":"Currency id \u2014 must be enabled for your workspace (see GET /currencies)."},"banking_detail_id":{"type":"integer","description":"Banking detail shown on the PDF. Defaults to your workspace default."},"invoice_date":{"type":"string","format":"date","description":"Invoice date (YYYY-MM-DD)."},"due_date":{"type":"string","format":"date","description":"Due date \u2014 on or after the invoice date."},"discount_type":{"type":"integer","enum":[0,1,2],"description":"Discount type."},"discount":{"type":"number","description":"Discount value \u2014 an amount when fixed, a percentage when percentage."},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"Invoice status."},"note":{"type":"string","description":"Note shown on the invoice."},"term":{"type":"string","description":"Payment terms shown on the invoice."},"recurring_frequency":{"type":"string","enum":["none","monthly","yearly"],"description":"Recurring schedule. On create, a monthly or yearly value spawns a standalone recurring template from this invoice; the template (managed under Recurring Invoices) drives future drafts, and the invoice itself stays a plain document. Ignored on update."},"recurring_day":{"type":"integer","description":"Day of month (1-31) the spawned template generates on. Only used on create together with recurring_frequency."},"recurring_month":{"type":"integer","description":"Month (1-12) for yearly recurrence. Only used on create together with recurring_frequency."},"recurring_status":{"type":"boolean","description":"Legacy flag, ignored: recurring schedules now live on standalone templates. Always false on invoices returned by the API."},"local_currency_amount":{"type":"number","description":"Amount received in your default currency. Required when marking a foreign-currency invoice as paid; the exchange rate is derived from it."},"custom_fields":{"type":"object","description":"Values for the workspace's invoice custom fields (Settings \u2192 Custom Fields), keyed by field key \u2014 e.g. `{\"reg_no\": \"CA 123-456\"}`. Each value is validated against the field's type and options; required custom fields must be supplied. Responses return the stored entries as `[{key, label, type, value}]`."},"items":{"type":"array","items":{"type":"object"},"description":"Line items. Totals, tax and the final amount are computed server-side from these rows. Each item: `name` (string, required), `quantity` (number \u2265 0.01, required), `price` (number \u2265 0, required), `tax_rate` (0\u2013100, optional), `description` (optional), `product_id` (optional)."}},"required":["client_id","currency_id","invoice_date","due_date","discount_type","status","items"]}}}}},"delete":{"tags":["Invoices"],"summary":"Delete a invoice","description":"Soft delete \u2014 the record moves to the trash and can be restored. Returns 204 with no body. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Successful response"},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"invoice","in":"path","required":true,"schema":{"type":"integer"}}]}},"/invoices/{id}/restore":{"post":{"tags":["Invoices"],"summary":"Restore a invoice","description":"Restores a soft-deleted record from the trash. 404 if the id is not currently deleted. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":42,"invoice_number":"108","status":1,"status_label":"Unpaid","invoice_date":"2026-07-01","due_date":"2026-07-31","amount":"3000.00","discount_type":0,"discount":"0.00","final_amount":"3450.00","note":null,"term":"Payment due within 30 days.","needs_review":false,"recurring_frequency":"none","recurring_day":null,"recurring_month":null,"recurring_status":false,"local_currency_amount":null,"exchange_rate":null,"custom_fields":[{"key":"reg_no","label":"Reg No","type":"text","value":"CA 123-456"}],"client":{"id":7,"display_name":"Mokoena Consulting","\u2026":"\u2026"},"currency":{"id":1,"name":"South African Rand","code":"ZAR","symbol":"R","is_custom":false},"items":[{"id":90,"product_id":3,"name":"Monthly bookkeeping","description":null,"quantity":"2.00","price":"1500.00","tax_rate":"15.00","total":"3000.00"}],"payments":[],"paid_amount":"0.00","remaining_amount":"3450.00","created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}]}},"/quotes":{"get":{"tags":["Quotes"],"summary":"List quotes","description":"Paginated list, newest first by default. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":[{"id":17,"quote_number":"23","status":0,"status_label":"Draft","quote_date":"2026-07-01","due_date":"2026-07-15","amount":"5000.00","discount_type":2,"discount":"10.00","final_amount":"5250.00","note":null,"term":null,"custom_fields":[],"client":{"id":7,"display_name":"Mokoena Consulting","\u2026":"\u2026"},"currency":{"id":1,"code":"ZAR","\u2026":"\u2026"},"items":[{"id":31,"product_id":null,"name":"Website redesign","description":null,"quantity":"1.00","price":"5000.00","tax_rate":"15.00","total":"5000.00"}],"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}],"links":{"first":"\u2026","last":"\u2026","prev":null,"next":null},"meta":{"current_page":1,"per_page":25,"total":1,"\u2026":"\u2026"}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1).","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Results per page, 1\u2013100 (default 25).","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort key. One of: `quote_date`, `due_date`, `final_amount`, `status`, `created_at`.","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"description":"`asc` or `desc` (default `desc`).","schema":{"type":"string"}},{"name":"trashed","in":"query","required":false,"description":"Soft-delete visibility: `with` includes deleted records, `only` returns deleted records exclusively.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Matches the quote number or the client's name.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by status.","schema":{"type":"integer","enum":[0,1,2]}},{"name":"client_id","in":"query","required":false,"description":"Filter by client.","schema":{"type":"integer"}},{"name":"date_from","in":"query","required":false,"description":"Quote date on or after.","schema":{"type":"string","format":"date"}},{"name":"date_to","in":"query","required":false,"description":"Quote date on or before.","schema":{"type":"string","format":"date"}}]},"post":{"tags":["Quotes"],"summary":"Create a quote","description":"Creates a quote. Returns 201 with the created record; validation failures return 422 with per-field errors. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":17,"quote_number":"23","status":0,"status_label":"Draft","quote_date":"2026-07-01","due_date":"2026-07-15","amount":"5000.00","discount_type":2,"discount":"10.00","final_amount":"5250.00","note":null,"term":null,"custom_fields":[],"client":{"id":7,"display_name":"Mokoena Consulting","\u2026":"\u2026"},"currency":{"id":1,"code":"ZAR","\u2026":"\u2026"},"items":[{"id":31,"product_id":null,"name":"Website redesign","description":null,"quantity":"1.00","price":"5000.00","tax_rate":"15.00","total":"5000.00"}],"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quote_number":{"type":"string","description":"Custom quote number. Omitted on create (or already taken) \u2192 the next number in your sequence is assigned. On update, omitted keeps the current number."},"client_id":{"type":"integer","description":"Client id."},"currency_id":{"type":"integer","description":"Currency id \u2014 must be enabled for your workspace."},"banking_detail_id":{"type":"integer","description":"Banking detail shown on the PDF. Defaults to your workspace default."},"quote_date":{"type":"string","format":"date","description":"Quote date (YYYY-MM-DD)."},"due_date":{"type":"string","format":"date","description":"Valid-until date \u2014 on or after the quote date."},"discount_type":{"type":"integer","enum":[0,1,2],"description":"Discount type."},"discount":{"type":"number","description":"Discount value."},"status":{"type":"integer","enum":[0,1,2],"description":"Quote status."},"note":{"type":"string","description":"Note shown on the quote."},"term":{"type":"string","description":"Terms shown on the quote."},"custom_fields":{"type":"object","description":"Values for the workspace's quote custom fields (Settings \u2192 Custom Fields), keyed by field key \u2014 e.g. `{\"reg_no\": \"CA 123-456\"}`. Quote fields are managed separately from invoice fields. Each value is validated against the field's type and options; required custom fields must be supplied. Responses return the stored entries as `[{key, label, type, value}]`."},"items":{"type":"array","items":{"type":"object"},"description":"Line items. Totals, tax and the final amount are computed server-side from these rows. Each item: `name` (string, required), `quantity` (number \u2265 0.01, required), `price` (number \u2265 0, required), `tax_rate` (0\u2013100, optional), `description` (optional), `product_id` (optional)."}},"required":["client_id","currency_id","quote_date","due_date","discount_type","status","items"]}}}}}},"/quotes/{quote}":{"get":{"tags":["Quotes"],"summary":"Get a quote","description":"Returns a single quote by id. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":17,"quote_number":"23","status":0,"status_label":"Draft","quote_date":"2026-07-01","due_date":"2026-07-15","amount":"5000.00","discount_type":2,"discount":"10.00","final_amount":"5250.00","note":null,"term":null,"custom_fields":[],"client":{"id":7,"display_name":"Mokoena Consulting","\u2026":"\u2026"},"currency":{"id":1,"code":"ZAR","\u2026":"\u2026"},"items":[{"id":31,"product_id":null,"name":"Website redesign","description":null,"quantity":"1.00","price":"5000.00","tax_rate":"15.00","total":"5000.00"}],"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"quote","in":"path","required":true,"schema":{"type":"integer"}}]},"put":{"tags":["Quotes"],"summary":"Update a quote","description":"Full update \u2014 send every field you want kept, exactly like create. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":17,"quote_number":"23","status":0,"status_label":"Draft","quote_date":"2026-07-01","due_date":"2026-07-15","amount":"5000.00","discount_type":2,"discount":"10.00","final_amount":"5250.00","note":null,"term":null,"custom_fields":[],"client":{"id":7,"display_name":"Mokoena Consulting","\u2026":"\u2026"},"currency":{"id":1,"code":"ZAR","\u2026":"\u2026"},"items":[{"id":31,"product_id":null,"name":"Website redesign","description":null,"quantity":"1.00","price":"5000.00","tax_rate":"15.00","total":"5000.00"}],"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"quote","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quote_number":{"type":"string","description":"Custom quote number. Omitted on create (or already taken) \u2192 the next number in your sequence is assigned. On update, omitted keeps the current number."},"client_id":{"type":"integer","description":"Client id."},"currency_id":{"type":"integer","description":"Currency id \u2014 must be enabled for your workspace."},"banking_detail_id":{"type":"integer","description":"Banking detail shown on the PDF. Defaults to your workspace default."},"quote_date":{"type":"string","format":"date","description":"Quote date (YYYY-MM-DD)."},"due_date":{"type":"string","format":"date","description":"Valid-until date \u2014 on or after the quote date."},"discount_type":{"type":"integer","enum":[0,1,2],"description":"Discount type."},"discount":{"type":"number","description":"Discount value."},"status":{"type":"integer","enum":[0,1,2],"description":"Quote status."},"note":{"type":"string","description":"Note shown on the quote."},"term":{"type":"string","description":"Terms shown on the quote."},"custom_fields":{"type":"object","description":"Values for the workspace's quote custom fields (Settings \u2192 Custom Fields), keyed by field key \u2014 e.g. `{\"reg_no\": \"CA 123-456\"}`. Quote fields are managed separately from invoice fields. Each value is validated against the field's type and options; required custom fields must be supplied. Responses return the stored entries as `[{key, label, type, value}]`."},"items":{"type":"array","items":{"type":"object"},"description":"Line items. Totals, tax and the final amount are computed server-side from these rows. Each item: `name` (string, required), `quantity` (number \u2265 0.01, required), `price` (number \u2265 0, required), `tax_rate` (0\u2013100, optional), `description` (optional), `product_id` (optional)."}},"required":["client_id","currency_id","quote_date","due_date","discount_type","status","items"]}}}}},"delete":{"tags":["Quotes"],"summary":"Delete a quote","description":"Soft delete \u2014 the record moves to the trash and can be restored. Returns 204 with no body. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Successful response"},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"quote","in":"path","required":true,"schema":{"type":"integer"}}]}},"/quotes/{id}/restore":{"post":{"tags":["Quotes"],"summary":"Restore a quote","description":"Restores a soft-deleted record from the trash. 404 if the id is not currently deleted. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":17,"quote_number":"23","status":0,"status_label":"Draft","quote_date":"2026-07-01","due_date":"2026-07-15","amount":"5000.00","discount_type":2,"discount":"10.00","final_amount":"5250.00","note":null,"term":null,"custom_fields":[],"client":{"id":7,"display_name":"Mokoena Consulting","\u2026":"\u2026"},"currency":{"id":1,"code":"ZAR","\u2026":"\u2026"},"items":[{"id":31,"product_id":null,"name":"Website redesign","description":null,"quantity":"1.00","price":"5000.00","tax_rate":"15.00","total":"5000.00"}],"created_at":"2026-07-01T09:30:00Z","updated_at":"2026-07-01T09:30:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}]}},"/purchase-orders":{"get":{"tags":["Purchase Orders"],"summary":"List purchase-orders","description":"Paginated list, newest first by default. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":[{"id":5,"po_number":"4","status":1,"status_label":"Sent","supplier_name":"Acme Supplies","supplier_email":"orders@acme.example","supplier_phone":null,"supplier_vat_number":null,"supplier_address":null,"delivery_address":null,"reference":"Stationery Q3","order_date":"2026-07-10","expected_date":"2026-07-24","amount":"1000.00","discount_type":0,"discount":"0.00","final_amount":"1150.00","note":null,"term":null,"expense_id":null,"sent_at":"2026-07-10T11:00:00Z","currency":{"id":2,"code":"NAD","\u2026":"\u2026"},"items":[{"id":11,"product_id":null,"name":"Printer paper","description":null,"quantity":"10.00","price":"50.00","tax_rate":"15.00","total":"500.00"}],"created_at":"2026-07-10T09:30:00Z","updated_at":"2026-07-10T11:00:00Z","deleted_at":null}],"links":{"first":"\u2026","last":"\u2026","prev":null,"next":null},"meta":{"current_page":1,"per_page":25,"total":1,"\u2026":"\u2026"}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1).","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Results per page, 1\u2013100 (default 25).","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort key. One of: `order_date`, `expected_date`, `final_amount`, `status`, `created_at`.","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"description":"`asc` or `desc` (default `desc`).","schema":{"type":"string"}},{"name":"trashed","in":"query","required":false,"description":"Soft-delete visibility: `with` includes deleted records, `only` returns deleted records exclusively.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Matches the PO number, supplier name or reference.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by status.","schema":{"type":"integer","enum":[0,1,2,3,4,5]}},{"name":"date_from","in":"query","required":false,"description":"Order date on or after.","schema":{"type":"string","format":"date"}},{"name":"date_to","in":"query","required":false,"description":"Order date on or before.","schema":{"type":"string","format":"date"}}]},"post":{"tags":["Purchase Orders"],"summary":"Create a purchase order","description":"Creates a purchase order. Returns 201 with the created record; validation failures return 422 with per-field errors. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":5,"po_number":"4","status":1,"status_label":"Sent","supplier_name":"Acme Supplies","supplier_email":"orders@acme.example","supplier_phone":null,"supplier_vat_number":null,"supplier_address":null,"delivery_address":null,"reference":"Stationery Q3","order_date":"2026-07-10","expected_date":"2026-07-24","amount":"1000.00","discount_type":0,"discount":"0.00","final_amount":"1150.00","note":null,"term":null,"expense_id":null,"sent_at":"2026-07-10T11:00:00Z","currency":{"id":2,"code":"NAD","\u2026":"\u2026"},"items":[{"id":11,"product_id":null,"name":"Printer paper","description":null,"quantity":"10.00","price":"50.00","tax_rate":"15.00","total":"500.00"}],"created_at":"2026-07-10T09:30:00Z","updated_at":"2026-07-10T11:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supplier_name":{"type":"string","description":"Supplier name."},"supplier_email":{"type":"string","description":"Supplier email."},"supplier_phone":{"type":"string","description":"Supplier phone."},"supplier_vat_number":{"type":"string","description":"Supplier VAT number."},"supplier_address":{"type":"string","description":"Supplier address."},"delivery_address":{"type":"string","description":"Delivery address."},"reference":{"type":"string","description":"Your reference for this order."},"currency_id":{"type":"integer","description":"Currency id \u2014 must be enabled for your workspace."},"order_date":{"type":"string","format":"date","description":"Order date (YYYY-MM-DD)."},"expected_date":{"type":"string","format":"date","description":"Expected delivery date \u2014 on or after the order date."},"discount_type":{"type":"integer","enum":[0,1,2],"description":"Discount type."},"discount":{"type":"number","description":"Discount value."},"status":{"type":"integer","enum":[0,1,2,3,5],"description":"Order status. Billed orders are managed by converting to an expense in the app."},"note":{"type":"string","description":"Note shown on the order."},"term":{"type":"string","description":"Terms shown on the order."},"items":{"type":"array","items":{"type":"object"},"description":"Line items. Totals, tax and the final amount are computed server-side from these rows. Each item: `name` (string, required), `quantity` (number \u2265 0.01, required), `price` (number \u2265 0, required), `tax_rate` (0\u2013100, optional), `description` (optional), `product_id` (optional)."}},"required":["supplier_name","currency_id","order_date","discount_type","status","items"]}}}}}},"/purchase-orders/{purchase_order}":{"get":{"tags":["Purchase Orders"],"summary":"Get a purchase order","description":"Returns a single purchase order by id. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":5,"po_number":"4","status":1,"status_label":"Sent","supplier_name":"Acme Supplies","supplier_email":"orders@acme.example","supplier_phone":null,"supplier_vat_number":null,"supplier_address":null,"delivery_address":null,"reference":"Stationery Q3","order_date":"2026-07-10","expected_date":"2026-07-24","amount":"1000.00","discount_type":0,"discount":"0.00","final_amount":"1150.00","note":null,"term":null,"expense_id":null,"sent_at":"2026-07-10T11:00:00Z","currency":{"id":2,"code":"NAD","\u2026":"\u2026"},"items":[{"id":11,"product_id":null,"name":"Printer paper","description":null,"quantity":"10.00","price":"50.00","tax_rate":"15.00","total":"500.00"}],"created_at":"2026-07-10T09:30:00Z","updated_at":"2026-07-10T11:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"purchase_order","in":"path","required":true,"schema":{"type":"integer"}}]},"put":{"tags":["Purchase Orders"],"summary":"Update a purchase order","description":"Full update \u2014 send every field you want kept, exactly like create. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":5,"po_number":"4","status":1,"status_label":"Sent","supplier_name":"Acme Supplies","supplier_email":"orders@acme.example","supplier_phone":null,"supplier_vat_number":null,"supplier_address":null,"delivery_address":null,"reference":"Stationery Q3","order_date":"2026-07-10","expected_date":"2026-07-24","amount":"1000.00","discount_type":0,"discount":"0.00","final_amount":"1150.00","note":null,"term":null,"expense_id":null,"sent_at":"2026-07-10T11:00:00Z","currency":{"id":2,"code":"NAD","\u2026":"\u2026"},"items":[{"id":11,"product_id":null,"name":"Printer paper","description":null,"quantity":"10.00","price":"50.00","tax_rate":"15.00","total":"500.00"}],"created_at":"2026-07-10T09:30:00Z","updated_at":"2026-07-10T11:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"purchase_order","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supplier_name":{"type":"string","description":"Supplier name."},"supplier_email":{"type":"string","description":"Supplier email."},"supplier_phone":{"type":"string","description":"Supplier phone."},"supplier_vat_number":{"type":"string","description":"Supplier VAT number."},"supplier_address":{"type":"string","description":"Supplier address."},"delivery_address":{"type":"string","description":"Delivery address."},"reference":{"type":"string","description":"Your reference for this order."},"currency_id":{"type":"integer","description":"Currency id \u2014 must be enabled for your workspace."},"order_date":{"type":"string","format":"date","description":"Order date (YYYY-MM-DD)."},"expected_date":{"type":"string","format":"date","description":"Expected delivery date \u2014 on or after the order date."},"discount_type":{"type":"integer","enum":[0,1,2],"description":"Discount type."},"discount":{"type":"number","description":"Discount value."},"status":{"type":"integer","enum":[0,1,2,3,5],"description":"Order status. Billed orders are managed by converting to an expense in the app."},"note":{"type":"string","description":"Note shown on the order."},"term":{"type":"string","description":"Terms shown on the order."},"items":{"type":"array","items":{"type":"object"},"description":"Line items. Totals, tax and the final amount are computed server-side from these rows. Each item: `name` (string, required), `quantity` (number \u2265 0.01, required), `price` (number \u2265 0, required), `tax_rate` (0\u2013100, optional), `description` (optional), `product_id` (optional)."}},"required":["supplier_name","currency_id","order_date","discount_type","status","items"]}}}}},"delete":{"tags":["Purchase Orders"],"summary":"Delete a purchase order","description":"Soft delete \u2014 the record moves to the trash and can be restored. Returns 204 with no body. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Successful response"},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"purchase_order","in":"path","required":true,"schema":{"type":"integer"}}]}},"/purchase-orders/{id}/restore":{"post":{"tags":["Purchase Orders"],"summary":"Restore a purchase order","description":"Restores a soft-deleted record from the trash. 404 if the id is not currently deleted. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":5,"po_number":"4","status":1,"status_label":"Sent","supplier_name":"Acme Supplies","supplier_email":"orders@acme.example","supplier_phone":null,"supplier_vat_number":null,"supplier_address":null,"delivery_address":null,"reference":"Stationery Q3","order_date":"2026-07-10","expected_date":"2026-07-24","amount":"1000.00","discount_type":0,"discount":"0.00","final_amount":"1150.00","note":null,"term":null,"expense_id":null,"sent_at":"2026-07-10T11:00:00Z","currency":{"id":2,"code":"NAD","\u2026":"\u2026"},"items":[{"id":11,"product_id":null,"name":"Printer paper","description":null,"quantity":"10.00","price":"50.00","tax_rate":"15.00","total":"500.00"}],"created_at":"2026-07-10T09:30:00Z","updated_at":"2026-07-10T11:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}]}},"/purchase-orders/{purchase_order}/status":{"post":{"tags":["Purchase Orders"],"summary":"Transition status","description":"Moves the order through its lifecycle (draft \u2192 sent \u2192 confirmed \u2192 received / cancelled). Marking as sent stamps sent_at once. Billed orders can no longer change (422). Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":5,"po_number":"4","status":1,"status_label":"Sent","supplier_name":"Acme Supplies","supplier_email":"orders@acme.example","supplier_phone":null,"supplier_vat_number":null,"supplier_address":null,"delivery_address":null,"reference":"Stationery Q3","order_date":"2026-07-10","expected_date":"2026-07-24","amount":"1000.00","discount_type":0,"discount":"0.00","final_amount":"1150.00","note":null,"term":null,"expense_id":null,"sent_at":"2026-07-10T11:00:00Z","currency":{"id":2,"code":"NAD","\u2026":"\u2026"},"items":[{"id":11,"product_id":null,"name":"Printer paper","description":null,"quantity":"10.00","price":"50.00","tax_rate":"15.00","total":"500.00"}],"created_at":"2026-07-10T09:30:00Z","updated_at":"2026-07-10T11:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"purchase_order","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","enum":[0,1,2,3,5],"description":"The new status."}},"required":["status"]}}}}}},"/payments":{"get":{"tags":["Payments"],"summary":"List payments","description":"Paginated list, newest first by default. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":[{"id":88,"invoice_id":42,"amount":"3450.00","payment_mode":"bank_transfer","payment_date":"2026-07-15","notes":"EFT ref 99123","is_approved":false,"invoice":{"id":42,"invoice_number":"108"},"created_at":"2026-07-15T14:00:00Z","updated_at":"2026-07-15T14:00:00Z","deleted_at":null}],"links":{"first":"\u2026","last":"\u2026","prev":null,"next":null},"meta":{"current_page":1,"per_page":25,"total":1,"\u2026":"\u2026"}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1).","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Results per page, 1\u2013100 (default 25).","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort key. One of: `payment_date`, `amount`, `created_at`.","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"description":"`asc` or `desc` (default `desc`).","schema":{"type":"string"}},{"name":"trashed","in":"query","required":false,"description":"Soft-delete visibility: `with` includes deleted records, `only` returns deleted records exclusively.","schema":{"type":"string"}},{"name":"invoice_id","in":"query","required":false,"description":"Filter by invoice.","schema":{"type":"integer"}},{"name":"is_approved","in":"query","required":false,"description":"Filter by approval state.","schema":{"type":"boolean"}},{"name":"date_from","in":"query","required":false,"description":"Payment date on or after.","schema":{"type":"string","format":"date"}},{"name":"date_to","in":"query","required":false,"description":"Payment date on or before.","schema":{"type":"string","format":"date"}}]},"post":{"tags":["Payments"],"summary":"Create a payment","description":"Creates a payment. Returns 201 with the created record; validation failures return 422 with per-field errors. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":88,"invoice_id":42,"amount":"3450.00","payment_mode":"bank_transfer","payment_date":"2026-07-15","notes":"EFT ref 99123","is_approved":false,"invoice":{"id":42,"invoice_number":"108"},"created_at":"2026-07-15T14:00:00Z","updated_at":"2026-07-15T14:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoice_id":{"type":"integer","description":"The invoice this payment is against."},"amount":{"type":"number","description":"Payment amount \u2014 may not exceed the invoice's remaining balance."},"payment_mode":{"type":"string","enum":["cash","bank_transfer","card","cheque","other"],"description":"How the payment was made."},"payment_date":{"type":"string","format":"date","description":"Payment date (YYYY-MM-DD)."},"notes":{"type":"string","description":"Note (max 1000 characters)."}},"required":["invoice_id","amount","payment_mode","payment_date"]}}}}}},"/payments/{payment}":{"get":{"tags":["Payments"],"summary":"Get a payment","description":"Returns a single payment by id. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":88,"invoice_id":42,"amount":"3450.00","payment_mode":"bank_transfer","payment_date":"2026-07-15","notes":"EFT ref 99123","is_approved":false,"invoice":{"id":42,"invoice_number":"108"},"created_at":"2026-07-15T14:00:00Z","updated_at":"2026-07-15T14:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"payment","in":"path","required":true,"schema":{"type":"integer"}}]},"put":{"tags":["Payments"],"summary":"Update a payment","description":"Full update \u2014 send every field you want kept, exactly like create. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":88,"invoice_id":42,"amount":"3450.00","payment_mode":"bank_transfer","payment_date":"2026-07-15","notes":"EFT ref 99123","is_approved":false,"invoice":{"id":42,"invoice_number":"108"},"created_at":"2026-07-15T14:00:00Z","updated_at":"2026-07-15T14:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"payment","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoice_id":{"type":"integer","description":"The invoice this payment is against."},"amount":{"type":"number","description":"Payment amount \u2014 may not exceed the invoice's remaining balance."},"payment_mode":{"type":"string","enum":["cash","bank_transfer","card","cheque","other"],"description":"How the payment was made."},"payment_date":{"type":"string","format":"date","description":"Payment date (YYYY-MM-DD)."},"notes":{"type":"string","description":"Note (max 1000 characters)."}},"required":["invoice_id","amount","payment_mode","payment_date"]}}}}},"delete":{"tags":["Payments"],"summary":"Delete a payment","description":"Soft delete \u2014 the record moves to the trash and can be restored. Returns 204 with no body. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Successful response"},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"payment","in":"path","required":true,"schema":{"type":"integer"}}]}},"/payments/{id}/restore":{"post":{"tags":["Payments"],"summary":"Restore a payment","description":"Restores a soft-deleted record from the trash. 404 if the id is not currently deleted. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":88,"invoice_id":42,"amount":"3450.00","payment_mode":"bank_transfer","payment_date":"2026-07-15","notes":"EFT ref 99123","is_approved":false,"invoice":{"id":42,"invoice_number":"108"},"created_at":"2026-07-15T14:00:00Z","updated_at":"2026-07-15T14:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}]}},"/payments/{payment}/approve":{"post":{"tags":["Payments"],"summary":"Approve a payment","description":"Marks the payment as approved and recalculates the invoice status. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":88,"invoice_id":42,"amount":"3450.00","payment_mode":"bank_transfer","payment_date":"2026-07-15","notes":"EFT ref 99123","is_approved":true,"invoice":{"id":42,"invoice_number":"108"},"created_at":"2026-07-15T14:00:00Z","updated_at":"2026-07-15T14:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"payment","in":"path","required":true,"schema":{"type":"integer"}}]}},"/payments/{payment}/reject":{"post":{"tags":["Payments"],"summary":"Reject a payment","description":"Marks the payment as not approved and recalculates the invoice status. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":88,"invoice_id":42,"amount":"3450.00","payment_mode":"bank_transfer","payment_date":"2026-07-15","notes":"EFT ref 99123","is_approved":false,"invoice":{"id":42,"invoice_number":"108"},"created_at":"2026-07-15T14:00:00Z","updated_at":"2026-07-15T14:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"payment","in":"path","required":true,"schema":{"type":"integer"}}]}},"/expenses":{"get":{"tags":["Expenses"],"summary":"List expenses","description":"Paginated list, newest first by default. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":[{"id":231,"expense_number":"58","vendor_name":"CTM Office Park","vendor_tax_number":null,"amount":"2000.00","tax_amount":"300.00","total_amount":"2300.00","expense_date":"2026-07-03","description":"July office rent","reference":"RENT-JUL","source":0,"source_label":"Manual","status":2,"status_label":"Approved","has_invoice":false,"invoice_required":true,"category":{"id":4,"name":"Rent","color":"#f97316","is_active":true},"currency":{"id":1,"code":"ZAR","\u2026":"\u2026"},"created_at":"2026-07-03T08:00:00Z","updated_at":"2026-07-03T08:00:00Z","deleted_at":null}],"links":{"first":"\u2026","last":"\u2026","prev":null,"next":null},"meta":{"current_page":1,"per_page":25,"total":1,"\u2026":"\u2026"}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1).","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Results per page, 1\u2013100 (default 25).","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort key. One of: `expense_date`, `total_amount`, `vendor_name`, `created_at`.","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"description":"`asc` or `desc` (default `desc`).","schema":{"type":"string"}},{"name":"trashed","in":"query","required":false,"description":"Soft-delete visibility: `with` includes deleted records, `only` returns deleted records exclusively.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Matches vendor name, description or reference.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by status.","schema":{"type":"integer","enum":[0,1,2,3]}},{"name":"source","in":"query","required":false,"description":"Filter by source.","schema":{"type":"integer","enum":[0,1,2]}},{"name":"expense_category_id","in":"query","required":false,"description":"Filter by whole-expense or invoice-item category.","schema":{"type":"integer"}},{"name":"date_from","in":"query","required":false,"description":"Expense date on or after.","schema":{"type":"string","format":"date"}},{"name":"date_to","in":"query","required":false,"description":"Expense date on or before.","schema":{"type":"string","format":"date"}}]},"post":{"tags":["Expenses"],"summary":"Create a expense","description":"Creates a expense. Returns 201 with the created record; validation failures return 422 with per-field errors. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":231,"expense_number":"58","vendor_name":"CTM Office Park","vendor_tax_number":null,"amount":"2000.00","tax_amount":"300.00","total_amount":"2300.00","expense_date":"2026-07-03","description":"July office rent","reference":"RENT-JUL","source":0,"source_label":"Manual","status":2,"status_label":"Approved","has_invoice":false,"invoice_required":true,"category":{"id":4,"name":"Rent","color":"#f97316","is_active":true},"currency":{"id":1,"code":"ZAR","\u2026":"\u2026"},"created_at":"2026-07-03T08:00:00Z","updated_at":"2026-07-03T08:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vendor_name":{"type":"string","description":"Who was paid."},"vendor_tax_number":{"type":"string","description":"Vendor VAT / tax number."},"amount":{"type":"number","description":"Amount excluding tax."},"tax_amount":{"type":"number","description":"Tax portion (0 if none)."},"total_amount":{"type":"number","description":"Total including tax."},"expense_date":{"type":"string","format":"date","description":"Expense date (YYYY-MM-DD)."},"description":{"type":"string","description":"What the expense was for."},"reference":{"type":"string","description":"Receipt / statement reference."},"expense_category_id":{"type":"integer","description":"Category id (see GET /expense-categories)."},"currency_id":{"type":"integer","description":"Currency id."},"invoice_required":{"type":"boolean","description":"Whether a supplier invoice must still be attached."},"status":{"type":"integer","enum":[0,1,2,3],"description":"Status \u2014 defaults to Pending Review on create."}},"required":["amount","tax_amount","total_amount","expense_date"]}}}}}},"/expenses/{expense}":{"get":{"tags":["Expenses"],"summary":"Get a expense","description":"Returns a single expense by id. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":231,"expense_number":"58","vendor_name":"CTM Office Park","vendor_tax_number":null,"amount":"2000.00","tax_amount":"300.00","total_amount":"2300.00","expense_date":"2026-07-03","description":"July office rent","reference":"RENT-JUL","source":0,"source_label":"Manual","status":2,"status_label":"Approved","has_invoice":false,"invoice_required":true,"category":{"id":4,"name":"Rent","color":"#f97316","is_active":true},"currency":{"id":1,"code":"ZAR","\u2026":"\u2026"},"created_at":"2026-07-03T08:00:00Z","updated_at":"2026-07-03T08:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"expense","in":"path","required":true,"schema":{"type":"integer"}}]},"put":{"tags":["Expenses"],"summary":"Update a expense","description":"Full update \u2014 send every field you want kept, exactly like create. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":231,"expense_number":"58","vendor_name":"CTM Office Park","vendor_tax_number":null,"amount":"2000.00","tax_amount":"300.00","total_amount":"2300.00","expense_date":"2026-07-03","description":"July office rent","reference":"RENT-JUL","source":0,"source_label":"Manual","status":2,"status_label":"Approved","has_invoice":false,"invoice_required":true,"category":{"id":4,"name":"Rent","color":"#f97316","is_active":true},"currency":{"id":1,"code":"ZAR","\u2026":"\u2026"},"created_at":"2026-07-03T08:00:00Z","updated_at":"2026-07-03T08:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"expense","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vendor_name":{"type":"string","description":"Who was paid."},"vendor_tax_number":{"type":"string","description":"Vendor VAT / tax number."},"amount":{"type":"number","description":"Amount excluding tax."},"tax_amount":{"type":"number","description":"Tax portion (0 if none)."},"total_amount":{"type":"number","description":"Total including tax."},"expense_date":{"type":"string","format":"date","description":"Expense date (YYYY-MM-DD)."},"description":{"type":"string","description":"What the expense was for."},"reference":{"type":"string","description":"Receipt / statement reference."},"expense_category_id":{"type":"integer","description":"Category id (see GET /expense-categories)."},"currency_id":{"type":"integer","description":"Currency id."},"invoice_required":{"type":"boolean","description":"Whether a supplier invoice must still be attached."},"status":{"type":"integer","enum":[0,1,2,3],"description":"Status \u2014 defaults to Pending Review on create."}},"required":["amount","tax_amount","total_amount","expense_date"]}}}}},"delete":{"tags":["Expenses"],"summary":"Delete a expense","description":"Soft delete \u2014 the record moves to the trash and can be restored. Returns 204 with no body. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Successful response"},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"expense","in":"path","required":true,"schema":{"type":"integer"}}]}},"/expenses/{id}/restore":{"post":{"tags":["Expenses"],"summary":"Restore a expense","description":"Restores a soft-deleted record from the trash. 404 if the id is not currently deleted. Requires a token with the `write` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":231,"expense_number":"58","vendor_name":"CTM Office Park","vendor_tax_number":null,"amount":"2000.00","tax_amount":"300.00","total_amount":"2300.00","expense_date":"2026-07-03","description":"July office rent","reference":"RENT-JUL","source":0,"source_label":"Manual","status":2,"status_label":"Approved","has_invoice":false,"invoice_required":true,"category":{"id":4,"name":"Rent","color":"#f97316","is_active":true},"currency":{"id":1,"code":"ZAR","\u2026":"\u2026"},"created_at":"2026-07-03T08:00:00Z","updated_at":"2026-07-03T08:00:00Z","deleted_at":null}}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}]}},"/currencies":{"get":{"tags":["Reference Data"],"summary":"List currencies","description":"Currencies enabled for your workspace \u2014 valid values for every currency_id field. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":[{"id":1,"name":"South African Rand","code":"ZAR","symbol":"R","is_custom":false},{"id":2,"name":"Namibian Dollar","code":"NAD","symbol":"N$","is_custom":false}]}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}}}},"/expense-categories":{"get":{"tags":["Reference Data"],"summary":"List expense categories","description":"Active expense categories \u2014 valid values for expense_category_id. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":[{"id":4,"name":"Rent","color":"#f97316","is_active":true}]}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}}}},"/banking-details":{"get":{"tags":["Reference Data"],"summary":"List banking details","description":"Your workspace's bank accounts \u2014 valid values for banking_detail_id on invoices and quotes. Requires the `manage_invoices` permission. Requires a token with the `read` ability.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"data":[{"id":1,"name":"FNB Cheque","bank_name":"FNB","account_holder":"Mokoena Consulting","account_number":"62012345678","branch_code":"250655","swift_code":null,"iban":null,"is_default":true}]}}}},"401":{"description":"Missing or invalid token"},"403":{"description":"Token lacks the required ability or the user lacks the required permission"}}}}}}