Replace a draft bill
Replace a draft bill. Whole-draft replacement from a fresh preview (reviewToken + expectedRevision). Draft only; the payee cannot change. A replay after success is a safe 409. Owner/Admin only (Managers and Members receive 403 before any record lookup); Agency plan (`teamPayouts`, 402 with requiredPlan agency otherwise). Requires the `write` scope. Money values are exact decimal strings; dates are ISO calendar dates.
Authorization
BearerAuth Personal Access Token. Mint at Settings → API. Token shape: hsk_<env>_<prefix12>_<secret32>.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Whole-draft replacement: restate every source and adjustment from a fresh preview.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/team-payouts/bills/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{ "payeeId": "79417842-2e1e-4110-a361-89b9f39b36ed", "currency": "str", "serviceFrom": "2019-08-24", "serviceTo": "2019-08-24", "timeEntryIds": [ "88e2079a-754b-4802-8e04-5e86496fedc2" ], "reviewToken": "stringstringstringstringstringstringstringstringstringstringstri", "issueDate": "2019-08-24", "dueDate": "2019-08-24", "expectedRevision": 1 }'{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "number": "string", "status": "DRAFT", "paymentStatus": "UNPAID", "revision": 0, "payeeId": "79417842-2e1e-4110-a361-89b9f39b36ed", "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b", "payeeName": "string", "currency": "string", "subtotal": "string", "adjustmentTotal": "string", "total": "string", "amountPaid": "string", "remaining": "string", "serviceFrom": "2019-08-24", "serviceTo": "2019-08-24", "issueDate": "2019-08-24", "dueDate": "2019-08-24", "lineGroupBy": "itemized", "note": "string", "lineCount": 0, "timeEntryCount": 0, "totalSeconds": 0, "totalHours": "string", "approvedAt": "2019-08-24T14:15:22Z", "voidReason": "string", "deletedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "payments": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "paidDate": "2019-08-24", "amount": "string", "currency": "string", "settledAmount": "string", "reversedAt": "2019-08-24T14:15:22Z" } ], "draftSources": { "payeeId": "79417842-2e1e-4110-a361-89b9f39b36ed", "currency": "string", "serviceFrom": "2019-08-24", "serviceTo": "2019-08-24", "timeEntryIds": [ "88e2079a-754b-4802-8e04-5e86496fedc2" ], "nonbillableTimeEntryIds": [ "98b923b1-d24d-4c10-a446-705627eced82" ], "fixedAgreementIds": [ "47027305-58a9-4e47-bfdc-3e6fd86b69c6" ], "adjustments": [ { "kind": "BONUS", "description": "string", "amount": "string", "quantity": "string", "unitPrice": "string", "correctionBillId": "58b60bd1-ffcd-4f41-b990-29e4c3d54169", "creditId": "ab154ac2-8f85-4580-8849-80b7ce246d18" } ] }, "links": { "app": "string", "payee": "string" } }, "warnings": [ "string" ]}{ "error": { "code": "unauthenticated", "message": "string", "fields": { "property1": "string", "property2": "string" }, "requiredPlan": "studio", "feature": "string", "requestId": "string" }}{ "error": { "code": "unauthenticated", "message": "string", "fields": { "property1": "string", "property2": "string" }, "requiredPlan": "studio", "feature": "string", "requestId": "string" }}{ "error": { "code": "unauthenticated", "message": "string", "fields": { "property1": "string", "property2": "string" }, "requiredPlan": "studio", "feature": "string", "requestId": "string" }}{ "error": { "code": "unauthenticated", "message": "string", "fields": { "property1": "string", "property2": "string" }, "requiredPlan": "studio", "feature": "string", "requestId": "string" }}{ "error": { "code": "unauthenticated", "message": "string", "fields": { "property1": "string", "property2": "string" }, "requiredPlan": "studio", "feature": "string", "requestId": "string" }}{ "error": { "code": "unauthenticated", "message": "string", "fields": { "property1": "string", "property2": "string" }, "requiredPlan": "studio", "feature": "string", "requestId": "string" }}{ "error": { "code": "unauthenticated", "message": "string", "fields": { "property1": "string", "property2": "string" }, "requiredPlan": "studio", "feature": "string", "requestId": "string" }}get Team Bill
Read-only. Owner/Admin tokens with read scope only. Studio+ retains finalized bills and recorded payment history after Agency downgrade; drafts require Agency. Generic member endpoints never expose compensation. Dates are ISO calendar transport values; money is a decimal string. Links require an authenticated Owner/Admin app session. Unknown and repeated query parameters return 422.
get Team Payment
Read-only. Owner/Admin tokens with read scope only. Studio+ retains finalized bills and recorded payment history after Agency downgrade; drafts require Agency. Generic member endpoints never expose compensation. Dates are ISO calendar transport values; money is a decimal string. Links require an authenticated Owner/Admin app session. Unknown and repeated query parameters return 422.