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
  }
}'

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

account_id
string
required

account_id corresponding to an account

Body

application/json
pricePlanId
string

Id of the price plan, Required for ENTITLEMENT_GRANT, ASSOCIATION purchase

quantity
integer
rateCardQuantities
object
idempotencyKey
string
purchasePlanOverride
object

entitlements override options for purchase of a price plan for an account

associationOverride
object
walletTopupDetails
object

Information related to wallet topup purchase

effectiveFrom
string
effectiveUntil
string
expiryDate
string
type
enum<string>

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

Available options:
ENTITLEMENT_GRANT,
ASSOCIATION,
WALLET_TOPUP,
PREPAID

Response

200 - application/json
id
string
required
accountId
string
required
pricePlanId
string

Id of the price plan, Required for ENTITLEMENT_GRANT, ASSOCIATION purchase

quantity
integer
rateCardQuantities
object
idempotencyKey
string
pricePlanVersion
integer
purchasePlanOverride
object
associationOverride
object
walletTopupDetails
object

Information related to wallet topup purchase

createdAt
string
required
updatedAt
string
effectiveFrom
string
effectiveUntil
string
expiryDate
string
price
number
invoiceId
string
invoiceCurrency
string
status
enum<string>
required

Status of the purchase

Available options:
SUCCESS,
FAILURE,
PENDING,
IN_PROGRESS,
PROPOSAL_ACTIVE,
PROPOSAL_APPROVED,
PROPOSAL_DECLINED,
PROPOSAL_EXPIRED
type
enum<string>
required

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

Available options:
ENTITLEMENT_GRANT,
ASSOCIATION,
WALLET_TOPUP,
PREPAID
comment
string