Update Credit Batch
Updates an existing credit batch by ID, allowing you to modify its name, expiration date, or current balance
Updates an existing credit batch by ID, allowing you to modify its name, expiration date, or current balance.
PUT
https://example.thoughtindustries.com/incoming/v2/clients/creditBatches/:idExample request
curl -X PUT "https://example.thoughtindustries.com/incoming/v2/clients/creditBatches/:id" \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"expiresOn": "string",
"currentBalance": 0
}'Parameters
| Name | Type | Required | Location | Description |
|---|---|---|---|---|
id | uuid | Yes | path | The id identifier. |
name | string | No | body | Display name for the credit batch. |
expiresOn | ISO 8601 timestamp | No | body | Date and time when the credit batch expires, in ISO 8601 format. |
currentBalance | integer | No | body | Number of credits currently available in the batch. |
Example response
{
"data": {
"UpdateCreditBatch": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"expiresOn": "2024-01-01T00:00:00.000Z",
"startingBalance": 0,
"currentBalance": 0,
"clientId": "00000000-0000-0000-0000-000000000000",
"status": "active",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z",
"creditAccountId": "00000000-0000-0000-0000-000000000000",
"allocatedCredits": 0
}
}
}Response fields
| Field | Type | Description |
|---|---|---|
id | uuid | Unique identifier of the credit batch. |
name | string | Display name of the credit batch. |
expiresOn | ISO 8601 timestamp | Date and time when the credit batch expires, in ISO 8601 format. |
startingBalance | number | Number of credits originally allocated to the batch at creation. |
currentBalance | number | Number of credits currently remaining in the batch. |
clientId | uuid | Unique identifier of the client that owns this credit batch. |
status | CreditBatchStatus | Current status of the credit batch (for example, active). |
createdAt | ISO 8601 timestamp | Date and time when the credit batch was created, in ISO 8601 format. |
updatedAt | ISO 8601 timestamp | Date and time when the credit batch was last modified, in ISO 8601 format. |
creditAccountId | uuid | Unique identifier of the credit account this batch belongs to. |
allocatedCredits | number | Number of credits from this batch that have been allocated to learners. |