Create Credit Batch
Creates a new credit batch for the specified client, setting an initial balance and optionally associating the batch with a credit account and expiration date
Creates a new credit batch for the specified client, setting an initial balance and optionally associating the batch with a credit account and expiration date.
POST
https://example.thoughtindustries.com/incoming/v2/clients/:id/creditBatchesExample request
curl -X POST "https://example.thoughtindustries.com/incoming/v2/clients/:id/creditBatches" \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"clientId": "00000000-0000-0000-0000-000000000000",
"startingBalance": 0,
"creditAccountId": "00000000-0000-0000-0000-000000000000",
"name": "string"
}'Parameters
| Name | Type | Required | Location | Description |
|---|---|---|---|---|
id | string | Yes | path | The id identifier. |
clientId | uuid | No | body | UUID of the client to associate with this credit batch. |
startingBalance | number | Yes | body | Initial number of credits to assign to the batch. |
creditAccountId | uuid | No | body | UUID of the credit account to link to this batch. |
name | string | No | body | Display name for the credit batch. |
expiresOn | ISO 8601 timestamp | No | body | Date and time at which the credit batch expires, in ISO 8601 format. |
Example response
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"startingBalance": 0,
"currentBalance": 0,
"expiresOn": "2024-01-01T00:00:00.000Z"
}Response fields
| Field | Type | Description |
|---|---|---|
id | uuid | Identifier of the created credit batch. |
name | string | Name of the credit batch. |
startingBalance | number | Credits originally issued in the batch. |
currentBalance | number | Credits remaining in the batch. |
expiresOn | ISO 8601 timestamp | Date when the batch expires. |