Preview a team bill
Preview a team bill. Changes nothing (read scope is enough). Like every POST it takes an Idempotency-Key; use a fresh key per preview, because a reused key replays the cached (possibly stale) preview. Computes one payee's bill in one currency and returns a compact review, warnings, reviewToken and draftInput (the explicit sources to copy into the draft). Owner/Admin only (Managers and Members receive 403 before any record lookup); Agency plan (`teamPayouts`, 402 with requiredPlan agency otherwise). Requires the `read` scope. Requires an Idempotency-Key. 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
Header Parameters
Caller-generated UUID/ULID. Same key + same body replays the original response; the key also derives the durable operation identity, so a retried payment, reversal or draft is never applied twice.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/team-payouts/bills/preview" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "payeeId": "79417842-2e1e-4110-a361-89b9f39b36ed", "currency": "str", "serviceFrom": "2019-08-24", "serviceTo": "2019-08-24" }'{ "data": { "payeeId": "79417842-2e1e-4110-a361-89b9f39b36ed", "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b", "currency": "string", "serviceFrom": "2019-08-24", "serviceTo": "2019-08-24", "reviewToken": "stringstringstringstringstringstringstringstringstringstringstri", "readyToDraft": true, "totals": { "subtotal": "string", "adjustmentTotal": "string", "total": "string", "carriedCredit": "string", "totalSeconds": 0, "totalHours": "string" }, "lineCount": 0, "timeEntryCount": 0, "linesTruncated": true, "lines": [ { "kind": "TIME", "timeEntryId": "6a7dee89-c31f-4c7b-93f4-7db10a7547a6", "fixedAgreementId": "b9d78c40-2611-4801-9d13-6d49ed8a3178", "period": { "from": "2019-08-24", "to": "2019-08-24" }, "selection": "default", "workDate": "2019-08-24", "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8", "projectName": "string", "taskId": "e6e9d88a-9b63-468a-aec3-b7a11de27af8", "durationSeconds": 0, "hours": "string", "hourlyRate": "string", "quantity": "string", "unitPrice": "string", "amount": "string", "description": "string" } ], "byProject": [ { "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8", "projectName": "string", "lineCount": 0, "durationSeconds": 0, "hours": "string", "amount": "string" } ], "missingRateCount": 0, "missingRates": [ { "timeEntryId": "6a7dee89-c31f-4c7b-93f4-7db10a7547a6", "workDate": "2019-08-24", "description": "string", "durationSeconds": 0 } ], "otherCurrencies": [ { "currency": "string", "count": 0 } ], "excludedTime": [ { "reason": "before_start", "count": 0, "durationSeconds": 0 } ], "overlappingDrafts": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "number": "string", "sourceCount": 0 } ], "nonbillableChoices": { "count": 0, "truncated": true, "missingRateCount": 0, "otherCurrencies": [ { "currency": "string", "count": 0 } ], "items": [ { "timeEntryId": "6a7dee89-c31f-4c7b-93f4-7db10a7547a6", "workDate": "2019-08-24", "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8", "durationSeconds": 0, "hourlyRate": "string", "amount": "string", "description": "string", "selected": true } ] }, "draftInput": { "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" } ] } }, "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" }}Archive a fixed-pay agreement
Irreversible: coverage ends before the archive day — today in the workspace payout calendar, or the day after the last period an approved bill already covers, if that is later; the response's archivedOn is that effective day. Complete earlier periods stay payable. Archiving an archived agreement changes nothing. Body: {} or empty. Owner/Admin only (Managers and Members receive 403 before any record lookup); Agency plan (`teamPayouts`, 402 with requiredPlan agency otherwise). Requires the `write` scope. Requires an Idempotency-Key. Money values are exact decimal strings; dates are ISO calendar dates.
Approve a draft bill
Finalize a DRAFT: assigns its TB- number, freezes lines and identities, and locks the billed time. Approval does not pay. Re-approving an approved bill changes nothing. Owner/Admin only (Managers and Members receive 403 before any record lookup); Agency plan (`teamPayouts`, 402 with requiredPlan agency otherwise). Requires the `write` scope. Requires an Idempotency-Key. Money values are exact decimal strings; dates are ISO calendar dates.