curl --request POST \
--url https://api.togai.com/accounts/{account_id}/purchases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pricePlanId": "pp.20txw0FrqjQ.byM8V",
"type": "ENTITLEMENT_GRANT",
"rateCardQuantities": {
"feature.20txvOAhiIS.m3X3d": 1.2
}
}
'{
"id": "purchase.1zYnCiM9Bpg.lv25y",
"accountId": "G234DZZKBKACATFFGVGEMERFI",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"quantity": 1,
"idempotencyKey": "AAAAAABBBEEEDDSS23",
"pricePlanVersion": 1,
"purchasePlanOverride": {
"billingEntitlementRateCards": [
{
"featureId": "feature.20jxa18BdUW.d4XQw",
"featureConfigs": [
{
"featureCreditLimit": 100,
"effectiveUntil": "P20D"
}
],
"invoiceTiming": "IN_ADVANCE",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "PER_UNIT",
"slabConfig": {}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 1,
"slabRateConfig": {}
}
]
}
],
"displayName": "feature1"
}
]
},
"type": "ENTITLEMENT_GRANT",
"status": "SUCCESS",
"createdAt": "2020-01-01T00:00:00Z",
"updatedAt": "2020-01-01T00:00:00Z"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}(Deprecated) Purchases
(DEPRECATED) Initiate a purchase
This API let’s you to initiate a purchase for an account
POST
/
accounts
/
{account_id}
/
purchases
curl --request POST \
--url https://api.togai.com/accounts/{account_id}/purchases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pricePlanId": "pp.20txw0FrqjQ.byM8V",
"type": "ENTITLEMENT_GRANT",
"rateCardQuantities": {
"feature.20txvOAhiIS.m3X3d": 1.2
}
}
'{
"id": "purchase.1zYnCiM9Bpg.lv25y",
"accountId": "G234DZZKBKACATFFGVGEMERFI",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"quantity": 1,
"idempotencyKey": "AAAAAABBBEEEDDSS23",
"pricePlanVersion": 1,
"purchasePlanOverride": {
"billingEntitlementRateCards": [
{
"featureId": "feature.20jxa18BdUW.d4XQw",
"featureConfigs": [
{
"featureCreditLimit": 100,
"effectiveUntil": "P20D"
}
],
"invoiceTiming": "IN_ADVANCE",
"ratePlan": {
"pricingModel": "TIERED",
"slabs": [
{
"order": 1,
"startAfter": 0,
"priceType": "PER_UNIT",
"slabConfig": {}
}
]
},
"rateValues": [
{
"currency": "USD",
"slabRates": [
{
"order": 1,
"rate": 1,
"slabRateConfig": {}
}
]
}
],
"displayName": "feature1"
}
]
},
"type": "ENTITLEMENT_GRANT",
"status": "SUCCESS",
"createdAt": "2020-01-01T00:00:00Z",
"updatedAt": "2020-01-01T00:00:00Z"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Authorizations
Path Parameters
Body
application/json
Payload to initiate a purchase
Create a purchase for an account
Response
Response for initiation of a purchase of entitlement plan for an account
Represents a Purchase
