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

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.

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

Example 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

NameTypeRequiredLocationDescription
idstringYespathThe id identifier.
clientIduuidNobodyUUID of the client to associate with this credit batch.
startingBalancenumberYesbodyInitial number of credits to assign to the batch.
creditAccountIduuidNobodyUUID of the credit account to link to this batch.
namestringNobodyDisplay name for the credit batch.
expiresOnISO 8601 timestampNobodyDate and time at which the credit batch expires, in ISO 8601 format.

Example response

{
  "data": {
    "CreateCreditBatch": {
      "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 newly created credit batch.
namestringDisplay name of the credit batch.
expiresOnISO 8601 timestampDate and time at which the credit batch expires, in ISO 8601 format.
startingBalancenumberNumber of credits assigned to the batch at creation.
currentBalancenumberNumber of credits currently remaining in the batch.
clientIduuidUUID of the client associated with this credit batch.
statusCreditBatchStatusCurrent status of the credit batch (e.g., active).
createdAtISO 8601 timestampDate and time the credit batch was created, in ISO 8601 format.
updatedAtISO 8601 timestampDate and time the credit batch was last updated, in ISO 8601 format.
creditAccountIduuidUUID of the credit account linked to this batch.
allocatedCreditsnumberNumber of credits from this batch that have been allocated.