Endpoint
Authentication
Requires a developer API key in theAuthorization header.
Request Headers
| Header | Value |
|---|---|
Authorization | Bearer <api_key> |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
grantId | string | Yes | The grant whose budget to debit |
amount | number | Yes | The amount to debit (must be positive) |
description | string | No | Human-readable description of the charge |
metadata | object | No | Arbitrary metadata to attach to the transaction |
Example Request
Response — 200 OK
Response Fields
| Field | Type | Description |
|---|---|---|
remaining | number | Budget remaining after the debit |
transactionId | string | Unique transaction ID for this debit |
grantId | string | The grant that was debited |
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Missing grantId or amount not positive |
| 401 | UNAUTHORIZED | Invalid or missing API key |
| 402 | INSUFFICIENT_BUDGET | The grant’s remaining budget is less than the requested amount |