Introduction
APIs
- Authentication
- Customers
- Accounts
- GETList accounts of customer
- POSTCreate an account
- GETGet an account
- DELDelete an account
- PATCHUpdate an account
- Account Aliases
- (Deprecated) Plan Associations
- (Deprecated) Purchases
- (Deprecated) Proposals
- Schedules
- GET
- Aliases
- Event Schemas
- Usage Meters
- AddOns
- Licenses
- Feature
- (Deprecated) Price Plans
- Price Plan V2
- Settings
- Price Experimentation
- Jobs
- Event Ingestion
- Entitlements
- Event Management
- Metrics
- Credits
- Invoices
- Payments
- Wallet
- InvoiceGroups
- Alerts
- Reports
(Deprecated) Proposals
(DEPRECATED) Propose a purchase of a plan
This API let’s you to create a proposal of a billing/entitlement plan for an account
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"
}
]
}
}'
{
"id": "purchase.20rvWRxQcQK.0ZwPG",
"accountId": "account2394",
"pricePlanId": "pp.20rqb4MK9ia.TD0eG",
"createdAt": "2023-07-26T12:36:56.58015Z",
"type": "ASSOCIATION",
"status": "PROPOSAL_ACTIVE",
"paymentMode": "PREPAID",
"associationOverride": {
"pricingCycleConfig": {
"interval": "MONTHLY",
"startOffset": {
"dayOffset": "2",
"monthOffset": "NIL"
},
"gracePeriod": 3,
"anniversaryCycle": false
}
},
"updatedAt": "2023-07-26T12:36:56.58015Z",
"effectiveFrom": "2023-06-30",
"effectiveUntil": "2023-08-30",
"comment": "Proposal Approved"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
account_id corresponding to an account
Maximum length:
50
Example:
"ACC00001"
Body
application/json
Payload to initiate a proposal
Create a purchase for an account
Response
200
application/json
Response to create proposal request
Represents a Purchase
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"
}
]
}
}'
{
"id": "purchase.20rvWRxQcQK.0ZwPG",
"accountId": "account2394",
"pricePlanId": "pp.20rqb4MK9ia.TD0eG",
"createdAt": "2023-07-26T12:36:56.58015Z",
"type": "ASSOCIATION",
"status": "PROPOSAL_ACTIVE",
"paymentMode": "PREPAID",
"associationOverride": {
"pricingCycleConfig": {
"interval": "MONTHLY",
"startOffset": {
"dayOffset": "2",
"monthOffset": "NIL"
},
"gracePeriod": 3,
"anniversaryCycle": false
}
},
"updatedAt": "2023-07-26T12:36:56.58015Z",
"effectiveFrom": "2023-06-30",
"effectiveUntil": "2023-08-30",
"comment": "Proposal Approved"
}
Assistant
Responses are generated using AI and may contain mistakes.