Create Credit Account
Creates a credit account for the specified client
Creates a credit account for the specified client.
POST
https://example.thoughtindustries.com/incoming/v2/clients/:id/creditAccountsExample request
curl -X POST "https://example.thoughtindustries.com/incoming/v2/clients/:id/creditAccounts" \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"batchDaysUntilExpire": 0,
"clientId": "00000000-0000-0000-0000-000000000000",
"startingBalance": 0,
"minimumBatchAmount": 0
}'Parameters
| Name | Type | Required | Location | Description |
|---|---|---|---|---|
id | string | Yes | path | The id identifier. |
batchDaysUntilExpire | integer | No | body | Number of days until a credit batch expires after being issued. |
clientId | uuid | No | body | Unique identifier of the client to associate with this credit account. |
startingBalance | number | Yes | body | Initial credit balance assigned to the account at creation. |
minimumBatchAmount | integer | No | body | Minimum number of credits that must be included in a single credit batch. |
notifyEmails | string[] | Yes | body | List of email addresses to notify when account activity occurs (e.g. low balance). |
type | CreditAccountType | No | body | Classification of the credit account (e.g. client). |
name | string | Yes | body | Display name for the credit account. |
creditBatchName | string | No | body | Label applied to credit batches issued under this account. |
licenseIds | string[] | Yes | body | List of license IDs to associate with this credit account. |
Example response
{
"data": {
"APICreateCreditAccount": {
"id": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000",
"sublicenses": [
{
"id": "00000000-0000-0000-0000-000000000000",
"deleted": true
}
],
"currentBalance": 0,
"status": "active",
"notifyEmails": [
"string"
],
"batchDaysUntilExpire": 0,
"minimumBatchAmount": 0,
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z",
"type": "client",
"name": "string"
}
}
}Response fields
| Field | Type | Description |
|---|---|---|
id | uuid | Unique identifier of the newly created credit account. |
clientId | uuid | Unique identifier of the client that owns this credit account. |
sublicenses | Sublicense[] | List of sublicenses associated with this credit account. |
sublicenses.id | uuid | Unique identifier of the sublicense. |
sublicenses.deleted | boolean | Indicates whether the sublicense has been deleted. |
currentBalance | number | Current number of credits available in the account. |
status | CreditAccountStatus | Current status of the credit account (e.g. active). |
notifyEmails | string[] | Email addresses configured to receive account activity notifications. |
batchDaysUntilExpire | integer | Number of days after issuance before a credit batch expires. |
minimumBatchAmount | integer | Minimum number of credits required per credit batch. |
createdAt | ISO 8601 timestamp | Date and time the credit account was created, in ISO 8601 format. |
updatedAt | ISO 8601 timestamp | Date and time the credit account was last updated, in ISO 8601 format. |
type | CreditAccountType | Classification of the credit account (e.g. client). |
name | string | Display name of the credit account. |