Skip to content
Hoursmith Docs
APIReferenceTeam payouts

Approve a bill and record its payment

Approve a bill and record its payment. One transaction: approve (if still a draft) and record a transfer that ALREADY HAPPENED outside Hoursmith. No money moves. The Idempotency-Key derives the durable operation identity, so a retry never records twice. 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.

POST
/team-payouts/bills/{id}/approve-and-pay

Authorization

BearerAuth
AuthorizationBearer <token>

Personal Access Token. Mint at Settings → API. Token shape: hsk_<env>_<prefix12>_<secret32>.

In: header

Path Parameters

id*string

Header Parameters

Idempotency-Key*string

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/497f6eca-6276-4993-bfeb-53cbbbba6f08/approve-and-pay" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": 1,    "payment": {      "currency": "str",      "settlementMode": "FULL",      "paidDate": "2019-08-24"    }  }'
{  "data": {    "bill": {      "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"      }    },    "payment": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "payeeId": "79417842-2e1e-4110-a361-89b9f39b36ed",      "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",      "currency": "string",      "amount": "string",      "paidDate": "2019-08-24",      "method": "string",      "savedMethodId": "string",      "reference": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z",      "status": "RECORDED",      "reversedAt": "2019-08-24T14:15:22Z",      "reversalReason": "string",      "settlementCurrency": "string",      "settlementAmount": "string",      "exchangeRate": "string",      "settlementMode": "string",      "allocations": [        {          "billId": "b9de0a53-2363-44cf-9760-a7ddf29fedb4",          "number": "string",          "currency": "string",          "amount": "string",          "cashAmount": "string",          "cashCurrency": "string",          "links": {            "app": "string",            "payee": "string",            "project": "string",            "task": "string"          }        }      ],      "links": {        "app": "string",        "payee": "string",        "project": "string",        "task": "string"      },      "bills": [        {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "number": "string",          "currency": "string",          "status": "DRAFT",          "total": "string",          "amountPaid": "string",          "remaining": "string",          "paymentStatus": "UNPAID",          "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"  }}
Was this page helpful?