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
Get credit details
Get credit details
GET
/
credits
/
{credit_id}
curl --request GET \
--url https://api.togai.com/credits/{credit_id} \
--header 'Authorization: Bearer <token>'
{
"accountId": "ACC001",
"purpose": "PREPAID_CREDIT",
"applicableEntityIds": [
[
"umg.1znQx9jiIXw.r44fc",
"ALL_USAGE_METER_RATE_CARDS",
"ALL_FIXED_FEE_RATE_CARDS"
]
],
"effectiveFrom": "2020-07-04",
"effectiveUntil": "2021-07-04",
"creditAmount": 1000,
"priority": 1,
"grantorId": "<string>",
"idempotencyKey": "<string>",
"id": "cred.1znqBOVcai0.0tBFz",
"customerId": "7VcRw9xZDIqsC5E",
"status": "ACTIVE",
"creditUnit": "USD",
"holdAmount": 500,
"consumedAmount": 400,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"transactions": [
{
"id": "<string>",
"creditId": "<string>",
"transactionType": "CREDITED",
"invoiceId": "<string>",
"entityId": "<string>",
"amount": 200,
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Example:
"creds.1znQx9jiIXw.r44fc"
Response
200
application/json
Response for Fetch Credit Details request. This contains Credit Transactions
Payload to grant Credits
curl --request GET \
--url https://api.togai.com/credits/{credit_id} \
--header 'Authorization: Bearer <token>'
{
"accountId": "ACC001",
"purpose": "PREPAID_CREDIT",
"applicableEntityIds": [
[
"umg.1znQx9jiIXw.r44fc",
"ALL_USAGE_METER_RATE_CARDS",
"ALL_FIXED_FEE_RATE_CARDS"
]
],
"effectiveFrom": "2020-07-04",
"effectiveUntil": "2021-07-04",
"creditAmount": 1000,
"priority": 1,
"grantorId": "<string>",
"idempotencyKey": "<string>",
"id": "cred.1znqBOVcai0.0tBFz",
"customerId": "7VcRw9xZDIqsC5E",
"status": "ACTIVE",
"creditUnit": "USD",
"holdAmount": 500,
"consumedAmount": 400,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"transactions": [
{
"id": "<string>",
"creditId": "<string>",
"transactionType": "CREDITED",
"invoiceId": "<string>",
"entityId": "<string>",
"amount": 200,
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.