latestOpenAPI 3.1.02026-08-152324681.8 MB

eddf3ef279e2

Contracts

Upsert usage records for contract obligations

Create or update usage records in batch. Items with an 'id' field are updated; items without are created. Generates revenue recognitions and invoices.

post/public/v2/contracts/{contract_id}/usage/bulk-upsert/

Path parameters

contract_idinteger required

Headers

Idempotency-Keystring

Optional. A unique value (a UUID works well) identifying this operation. If the request is repeated with the same key, the original response is replayed instead of the operation running again, so a retry cannot create a duplicate record. Results are replayable for 48 hours. Reusing a key with a different request body returns 422.

Request body

Response

OK

idinteger required
contract_idinteger required
obligation_idinteger required
usage_datestring date required
quantitystring required
ratestring nullable
amountstring required
effective_ratestring required
revenue_recognition_idinteger nullable
status'draft' | 'invoiced' | 'archived' required
invoice_statusstring nullable
memostring
created_atstring date-time required
updated_atstring date-time required