curl --request POST \
--url https://api.togai.com/accounts/{account_id}/purchases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pricePlanId": "pp.20dINmd0lBg.05sKa",
"type": "ENTITLEMENT_GRANT",
"quantity": 1,
"purchasePlanOverrides": {
"rateValues": [
{
"CurrencyRateValue": {
"currency": "USD",
"rate": 10
}
},
{
"CurrencyRateValue": {
"currency": "INR",
"rate": 150
}
}
],
"entitlementRateCards": [
{
"EntitlementRateCard": {
"featureId": "feature.1zYnCiM9Bpg.lv25y",
"featureCredits": 100,
"expiryDurationSeconds": 1000
}
}
]
}
}
'{
"id": "purchase.1zYnCiM9Bpg.lv25y",
"accountId": "G234DZZKBKACATFFGVGEMERFI",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"quantity": 1,
"idempotencyKey": "AAAAAABBBEEEDDSS23",
"pricePlanVersion": 1,
"purchasePlanOverrides": {
"rateValues": [
{
"CurrencyRateValue": {
"currency": "USD",
"rate": 10
}
},
{
"CurrencyRateValue": {
"currency": "INR",
"rate": 150
}
}
],
"entitlementRateCards": [
{
"EntitlementRateCard": {
"featureId": "feature.1zYnCiM9Bpg.lv25y",
"featureCredits": 100,
"expiryDurationSeconds": 1000
}
}
]
},
"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>"
}Purchases
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.20dINmd0lBg.05sKa",
"type": "ENTITLEMENT_GRANT",
"quantity": 1,
"purchasePlanOverrides": {
"rateValues": [
{
"CurrencyRateValue": {
"currency": "USD",
"rate": 10
}
},
{
"CurrencyRateValue": {
"currency": "INR",
"rate": 150
}
}
],
"entitlementRateCards": [
{
"EntitlementRateCard": {
"featureId": "feature.1zYnCiM9Bpg.lv25y",
"featureCredits": 100,
"expiryDurationSeconds": 1000
}
}
]
}
}
'{
"id": "purchase.1zYnCiM9Bpg.lv25y",
"accountId": "G234DZZKBKACATFFGVGEMERFI",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"quantity": 1,
"idempotencyKey": "AAAAAABBBEEEDDSS23",
"pricePlanVersion": 1,
"purchasePlanOverrides": {
"rateValues": [
{
"CurrencyRateValue": {
"currency": "USD",
"rate": 10
}
},
{
"CurrencyRateValue": {
"currency": "INR",
"rate": 150
}
}
],
"entitlementRateCards": [
{
"EntitlementRateCard": {
"featureId": "feature.1zYnCiM9Bpg.lv25y",
"featureCredits": 100,
"expiryDurationSeconds": 1000
}
}
]
},
"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
Maximum string length:
50Example:
"ACC00001"
Body
application/json
Payload to initiate a purchase
Create a purchase for an account
Id of the price plan
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
Specifies whether this purchase is for granting entitlements or for an association. If left null, ENTITLEMENT_GRANT is taken as default
Available options:
ENTITLEMENT_GRANT, ASSOCIATION Response
Response for initiation of a purchase of entitlement plan for an account
Represents a Purchase
Minimum string length:
1Minimum string length:
1Status of the purchase
Available options:
SUCCESS, FAILURE, PENDING, IN_PROGRESS, PROPOSAL_ACTIVE, PROPOSAL_APPROVED, PROPOSAL_DECLINED, PROPOSAL_EXPIRED Available options:
ENTITLEMENT_GRANT, ASSOCIATION Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
