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. |
cursor | string | No | query | Opaque cursor for the next page of results. Omit to fetch the first page. |
Example response
{
"clientId": "00000000-0000-0000-0000-000000000000",
"creditAccountId": "00000000-0000-0000-0000-000000000000",
"creditBatches": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"creditAccountId": "00000000-0000-0000-0000-000000000000",
"startingBalance": 0,
"currentBalance": 0,
"createdAt": "2024-01-01T00:00:00.000Z",
"expiresOn": "2024-01-01T00:00:00.000Z"
}
],
"pageInfo": {
"perPage": 0,
"cursor": "string",
"total": 0,
"hasMore": true
}
}Response fields
| Field | Type | Description |
|---|---|---|
clientId | uuid | Identifier of the client. |
creditAccountId | uuid | Identifier of the credit account, when filtered. |
creditBatches | object[] | Array of credit batch records for the current page. |
creditBatches.id | uuid | Identifier of the credit batch. |
creditBatches.name | string | Name of the credit batch. |
creditBatches.creditAccountId | uuid | Identifier of the credit account the batch belongs to. |
creditBatches.startingBalance | number | Credits originally issued in the batch. |
creditBatches.currentBalance | number | Credits remaining in the batch. |
creditBatches.createdAt | ISO 8601 timestamp | Timestamp when the batch was created. |
creditBatches.expiresOn | ISO 8601 timestamp | Date when the batch expires. |
pageInfo | object | Cursor-based pagination metadata for the result set. |
pageInfo.perPage | integer | Number of records returned per page. |
pageInfo.cursor | string | Opaque cursor to pass on the next request. Present when hasMore is true. |
pageInfo.total | integer | Total number of records matching the query. |
pageInfo.hasMore | boolean | Whether additional pages of results are available. |