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

Show Credit Batches

Returns a paginated list of credit batches for a specified client and credit account

Returns a paginated list of credit batches for a specified client and credit account.

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

Example request

curl "https://example.thoughtindustries.com/incoming/v2/clients/:id/creditBatches" \
  -H 'Authorization: Bearer YOUR_API_KEY'

Parameters

NameTypeRequiredLocationDescription
idstringYespathThe id identifier.
clientIduuidYesqueryUnique identifier of the client whose credit batches to retrieve.
creditAccountIduuidNoqueryFilters results to credit batches belonging to the specified credit account.
pageintegerNoqueryPage number to retrieve for paginated results.

Example response

{
  "data": {
    "APICreditBatchesByClientAndCreditAccount": {
      "clientId": "00000000-0000-0000-0000-000000000000",
      "creditAccountId": "00000000-0000-0000-0000-000000000000",
      "creditBatches": [
        {
          "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
        }
      ],
      "pageInfo": {
        "perPage": 0,
        "cursor": "string",
        "total": 0,
        "hasMore": true
      }
    }
  }
}

Response fields

FieldTypeDescription
clientIduuidUnique identifier of the client associated with the returned credit batches.
creditAccountIduuidUnique identifier of the credit account associated with the returned credit batches.
creditBatchesCreditBatch[]Array of credit batch objects belonging to the client and credit account.
creditBatches.iduuidUnique identifier of the credit batch.
creditBatches.namestringDisplay name of the credit batch.
creditBatches.expiresOnISO 8601 timestampDate and time when the credit batch expires, in ISO 8601 format.
creditBatches.startingBalancenumberTotal number of credits originally issued in the batch.
creditBatches.currentBalancenumberNumber of credits remaining in the batch after allocations and usage.
creditBatches.clientIduuidUnique identifier of the client that owns this credit batch.
creditBatches.statusCreditBatchStatusCurrent status of the credit batch (e.g., active).
creditBatches.createdAtISO 8601 timestampDate and time when the credit batch was created, in ISO 8601 format.
creditBatches.updatedAtISO 8601 timestampDate and time when the credit batch was last updated, in ISO 8601 format.
creditBatches.creditAccountIduuidUnique identifier of the credit account this batch belongs to.
creditBatches.allocatedCreditsnumberNumber of credits from this batch that have been allocated.
pageInfoCursorPageInfoPagination metadata for the result set.
pageInfo.perPageintegerNumber of credit batches returned per page.
pageInfo.cursorstringCursor value used to retrieve the next page of results.
pageInfo.totalintegerTotal number of credit batches matching the query.
pageInfo.hasMorebooleanIndicates whether additional pages of results are available.