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) Initiate a purchase
This API let’s you to initiate a purchase for an account
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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
account_id corresponding to an account
50"ACC00001"
Body
Payload to initiate a purchase
Create a purchase for an account
Id of the price plan, Required for ENTITLEMENT_GRANT, ASSOCIATION purchase
Show child attributes
Show child attributes
entitlements override options for purchase of a price plan for an account
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Information related to wallet topup purchase
Show child attributes
Show child attributes
Specifies whether this purchase is for granting entitlements or for an association or for wallet topup or prepaid purchase. If left null, ENTITLEMENT_GRANT is taken as default
ENTITLEMENT_GRANT, ASSOCIATION, WALLET_TOPUP, PREPAID Response
Response for initiation of a purchase of entitlement plan for an account
Represents a Purchase
1Status of the purchase
SUCCESS, FAILURE, PENDING, IN_PROGRESS, PROPOSAL_ACTIVE, PROPOSAL_APPROVED, PROPOSAL_DECLINED, PROPOSAL_EXPIRED Specifies whether this purchase is for granting entitlements or for an association or for wallet topup or prepaid purchase. If left null, ENTITLEMENT_GRANT is taken as default
ENTITLEMENT_GRANT, ASSOCIATION, WALLET_TOPUP, PREPAID Id of the price plan, Required for ENTITLEMENT_GRANT, ASSOCIATION purchase
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Information related to wallet topup purchase
Show child attributes
Show child attributes
