Introduction
APIs
- Authentication
- Customers
- Accounts
- Aliases
- Event Schemas
- Usage Meters
- AddOns
- Licenses
- Feature
- (Deprecated) Price Plans
- Price Plan V2
- Settings
- Price Experimentation
- Jobs
- Event Ingestion
- Entitlements
- Event Management
- Metrics
- Credits
- Invoices
- Payments
- Wallet
- InvoiceGroups
- Alerts
- Reports
Credits
Grant credit
Grant credit
POST
/
credits
curl --request POST \
--url https://api.togai.com/credits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"creditRequests": [
{
"accountId": "ACC001",
"purpose": "Prepaid Credit",
"effectiveFrom": "2023-02-04",
"effectiveUntil": "2024-02-04",
"creditAmount": 1000,
"priority": 1
}
]
}'
[
{
"id": "creds.1znQx9jiIXw.r44fc",
"customerId": "7VcRw9xZDIqsC5E",
"accountId": "ACC001",
"purpose": "Prepaid Credit",
"effectiveFrom": "2020-07-04",
"effectiveUntil": "2021-07-04",
"status": "ACTIVE",
"creditAmount": 1000,
"creditUnit": "USD",
"holdAmount": 500,
"consumedAmount": 400,
"priority": 1,
"createdAt": "2020-07-04T12:00:00.000Z"
},
{
"id": "creds.1znQ46jiIXw.r24fc",
"customerId": "7VcRw9xZDIqsC5E",
"accountId": "ACC001",
"purpose": "Prepaid Credit",
"effectiveFrom": "2020-08-04",
"effectiveUntil": "2021-08-04",
"status": "ACTIVE",
"creditAmount": 1000,
"creditUnit": "USD",
"holdAmount": 500,
"consumedAmount": 400,
"priority": 1,
"createdAt": "2020-08-04T12:00:00.000Z"
}
]
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Payload to grant credits
payload to create credits
Response
200
application/json
Response for List credits request
The response is of type object
.
curl --request POST \
--url https://api.togai.com/credits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"creditRequests": [
{
"accountId": "ACC001",
"purpose": "Prepaid Credit",
"effectiveFrom": "2023-02-04",
"effectiveUntil": "2024-02-04",
"creditAmount": 1000,
"priority": 1
}
]
}'
[
{
"id": "creds.1znQx9jiIXw.r44fc",
"customerId": "7VcRw9xZDIqsC5E",
"accountId": "ACC001",
"purpose": "Prepaid Credit",
"effectiveFrom": "2020-07-04",
"effectiveUntil": "2021-07-04",
"status": "ACTIVE",
"creditAmount": 1000,
"creditUnit": "USD",
"holdAmount": 500,
"consumedAmount": 400,
"priority": 1,
"createdAt": "2020-07-04T12:00:00.000Z"
},
{
"id": "creds.1znQ46jiIXw.r24fc",
"customerId": "7VcRw9xZDIqsC5E",
"accountId": "ACC001",
"purpose": "Prepaid Credit",
"effectiveFrom": "2020-08-04",
"effectiveUntil": "2021-08-04",
"status": "ACTIVE",
"creditAmount": 1000,
"creditUnit": "USD",
"holdAmount": 500,
"consumedAmount": 400,
"priority": 1,
"createdAt": "2020-08-04T12:00:00.000Z"
}
]
Assistant
Responses are generated using AI and may contain mistakes.