Accounts
Get all purchases for an account
Get Purchase information for an account using account_id and price_plan_id
GET
/
accounts
/
{account_id}
/
purchases
curl --request GET \
--url https://api.togai.com/accounts/{account_id}/purchases \
--header 'Authorization: <authorization>'
{
"data": [
{
"id": "purchase.1zYnCiM9Bpg.lv25y",
"pricePlanId": "pp.20dINmd0lBg.05sKa",
"pricePlanName": "Entitlement Plan",
"quantity": 1,
"pricePlanVersion": 1,
"status": "SUCCESS",
"idempotencyKey": "AAAAABBBBDDDD7730",
"createdAt": "2020-01-01T00:00:00Z",
"updatedAt": "2020-01-01T00:00:00Z"
},
{
"id": "purchase.20txx14r0m8.VKxaB",
"pricePlanId": "pp.20txw0FrqjQ.byM8V",
"pricePlanName": "pp_feature_purchase",
"pricePlanVersion": 1,
"status": "SUCCESS",
"purchasePlan": {
"rateDetails": null,
"entitlementRateCards": null,
"billingEntitlementRateCards": [
{
"featureId": "feature.20txvOAhiIS.m3X3d",
"featureConfigs": [
{
"effectiveUntil": "P20D",
"featureCreditLimit": 100,
"effectiveFrom": "PT0S"
}
],
"invoiceTiming": "IN_ADVANCE",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "PER_UNIT",
"slabConfig": null
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 1,
"slabRateConfig": null
}
]
}
],
"displayName": "feature1"
}
]
},
"createdAt": "2023-07-31T15:49:25.007848Z",
"quantity": null,
"rateCardQuantities": {
"feature.20txvOAhiIS.m3X3d": 1.2
},
"price": 120,
"invoiceCurrency": "USD",
"updatedAt": "2023-07-31T15:51:35.093598Z"
}
]
}
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
account_id
string
requiredaccount_id corresponding to an account
Response
200 - application/json
data
object[]
nextToken
string
context
object
curl --request GET \
--url https://api.togai.com/accounts/{account_id}/purchases \
--header 'Authorization: <authorization>'
{
"data": [
{
"id": "purchase.1zYnCiM9Bpg.lv25y",
"pricePlanId": "pp.20dINmd0lBg.05sKa",
"pricePlanName": "Entitlement Plan",
"quantity": 1,
"pricePlanVersion": 1,
"status": "SUCCESS",
"idempotencyKey": "AAAAABBBBDDDD7730",
"createdAt": "2020-01-01T00:00:00Z",
"updatedAt": "2020-01-01T00:00:00Z"
},
{
"id": "purchase.20txx14r0m8.VKxaB",
"pricePlanId": "pp.20txw0FrqjQ.byM8V",
"pricePlanName": "pp_feature_purchase",
"pricePlanVersion": 1,
"status": "SUCCESS",
"purchasePlan": {
"rateDetails": null,
"entitlementRateCards": null,
"billingEntitlementRateCards": [
{
"featureId": "feature.20txvOAhiIS.m3X3d",
"featureConfigs": [
{
"effectiveUntil": "P20D",
"featureCreditLimit": 100,
"effectiveFrom": "PT0S"
}
],
"invoiceTiming": "IN_ADVANCE",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "PER_UNIT",
"slabConfig": null
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 1,
"slabRateConfig": null
}
]
}
],
"displayName": "feature1"
}
]
},
"createdAt": "2023-07-31T15:49:25.007848Z",
"quantity": null,
"rateCardQuantities": {
"feature.20txvOAhiIS.m3X3d": 1.2
},
"price": 120,
"invoiceCurrency": "USD",
"updatedAt": "2023-07-31T15:51:35.093598Z"
}
]
}