POST
/
accounts
/
{account_id}
/
purchase_proposals
curl --request POST \
  --url https://api.togai.com/accounts/{account_id}/purchase_proposals \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "pricePlanId": "pp.20dINmd0lBg.05sKa",
  "type": "ENTITLEMENT_GRANT",
  "paymentMode": "PREPAID",
  "quantity": 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",
        "tag": "tag 1"
      }
    ]
  }
}'

Authorizations

Authorization
string
header
required

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

Maximum length: 50

Body

application/json

Create a purchase for an account

paymentMode
enum<string>
required
Available options:
PREPAID,
POSTPAID
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
associationOverride
object
effectiveFrom
string
effectiveUntil
string
expiryDate
string
idempotencyKey
string
pricePlanId
string

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

purchasePlanOverride
object

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

quantity
integer
rateCardQuantities
object
walletTopupDetails
object

Information related to wallet topup purchase

Response

200 - application/json

Represents a Purchase

accountId
string
required
Minimum length: 1
createdAt
string
required
id
string
required
paymentMode
enum<string>
required
Available options:
PREPAID,
POSTPAID
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
associationOverride
object
comment
string
effectiveFrom
string
effectiveUntil
string
expiryDate
string
idempotencyKey
string
invoiceCurrency
string
invoiceId
string
price
number
pricePlanId
string

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

Minimum length: 1
pricePlanVersion
integer
proposalResponseDate
string
purchasePlanOverride
object