Skip to main content
https://.thoughtindustries.com

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.

PUThttps://example.thoughtindustries.com/incoming/v2/clients/creditBatches/:id

Example 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

NameTypeRequiredLocationDescription
iduuidYespathThe id identifier.
namestringNobodyDisplay name for the credit batch.
expiresOnISO 8601 timestampNobodyDate and time when the credit batch expires, in ISO 8601 format.
currentBalanceintegerNobodyNumber 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

FieldTypeDescription
iduuidUnique identifier of the credit batch.
namestringDisplay name of the credit batch.
expiresOnISO 8601 timestampDate and time when the credit batch expires, in ISO 8601 format.
startingBalancenumberNumber of credits originally allocated to the batch at creation.
currentBalancenumberNumber of credits currently remaining in the batch.
clientIduuidUnique identifier of the client that owns this credit batch.
statusCreditBatchStatusCurrent status of the credit batch (for example, active).
createdAtISO 8601 timestampDate and time when the credit batch was created, in ISO 8601 format.
updatedAtISO 8601 timestampDate and time when the credit batch was last modified, in ISO 8601 format.
creditAccountIduuidUnique identifier of the credit account this batch belongs to.
allocatedCreditsnumberNumber of credits from this batch that have been allocated to learners.