POST
/businesses/{bid}/appointments/{id}/documentOpen the draft document that bills it
POST /businesses/{bid}/appointments/{id}/document
Requires the businesses scope.
A DRAFT with the customer and one line (the title and the day, at the appointment's price), filed under externalRef: appointment:<id>. Default type: an invoice-receipt (320), a receipt (400) for a עוסק פטור. A second call returns the open draft or the issued document. Issuing is the ordinary issue call. Needs documents on top of businesses.
Path parameters
| Name | Type | Description | |
|---|---|---|---|
bid | string | required | Business id, from POST /businesses. |
id | string | required | Appointment id. |
Body (optional)
| Field | Type | Description | |
|---|---|---|---|
docType | integer | Any type the business may issue. | |
payments | array of Payment | ||
documentDate | string | Default: today. |
Response
201: { "ok": true, … }
| Field | Type | Description | |
|---|---|---|---|
ok | boolean | required | |
document | Document | required | A draft is freely mutable. An issued document is immutable forever, blocked at the database engine, not merely in application code. |
Errors: 400, 401, 403, 404, 429. Every failure answers { "error", "reason", "hint", "param", "doc_url", "retryable", "request_id" }: branch on reason, and read hint for what to change (https://docs.billos.co.il/errors.md).