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.
GET
https://example.thoughtindustries.com/incoming/v2/clients/:id/creditBatchesExample request
curl "https://example.thoughtindustries.com/incoming/v2/clients/:id/creditBatches" \
-H 'Authorization: Bearer YOUR_API_KEY'Parameters
| Name | Type | Required | Location | Description |
|---|---|---|---|---|
id | string | Yes | path | The id identifier. |
clientId | uuid | Yes | query | Unique identifier of the client whose credit batches to retrieve. |
creditAccountId | uuid | No | query | Filters results to credit batches belonging to the specified credit account. |
page | integer | No | query | Page 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
| Field | Type | Description |
|---|---|---|
clientId | uuid | Unique identifier of the client associated with the returned credit batches. |
creditAccountId | uuid | Unique identifier of the credit account associated with the returned credit batches. |
creditBatches | CreditBatch[] | Array of credit batch objects belonging to the client and credit account. |
creditBatches.id | uuid | Unique identifier of the credit batch. |
creditBatches.name | string | Display name of the credit batch. |
creditBatches.expiresOn | ISO 8601 timestamp | Date and time when the credit batch expires, in ISO 8601 format. |
creditBatches.startingBalance | number | Total number of credits originally issued in the batch. |
creditBatches.currentBalance | number | Number of credits remaining in the batch after allocations and usage. |
creditBatches.clientId | uuid | Unique identifier of the client that owns this credit batch. |
creditBatches.status | CreditBatchStatus | Current status of the credit batch (e.g., active). |
creditBatches.createdAt | ISO 8601 timestamp | Date and time when the credit batch was created, in ISO 8601 format. |
creditBatches.updatedAt | ISO 8601 timestamp | Date and time when the credit batch was last updated, in ISO 8601 format. |
creditBatches.creditAccountId | uuid | Unique identifier of the credit account this batch belongs to. |
creditBatches.allocatedCredits | number | Number of credits from this batch that have been allocated. |
pageInfo | CursorPageInfo | Pagination metadata for the result set. |
pageInfo.perPage | integer | Number of credit batches returned per page. |
pageInfo.cursor | string | Cursor value used to retrieve the next page of results. |
pageInfo.total | integer | Total number of credit batches matching the query. |
pageInfo.hasMore | boolean | Indicates whether additional pages of results are available. |