- Postman collection
- Vault
- Blog
Authentication
Customers
Accounts
- GETList accounts of customer
- POSTCreate an account
- GETGet an account
- DELDelete an account
- PATUpdate an account
- POSTAdd Aliases to account
- POSTRemove Aliases to account
- POSTDissociate or associate a price plan with an account
- GETGet all purchases for an account
- POSTInitiate a purchase
- GETGet a specific purchase of an account
- GETList all proposals of an account
- POSTPropose a purchase of a plan
- GETGet proposal information
- POSTEdit schedules of an account.
- GETList pricing schedules of an account
- POSTApprove or decline a purchase of a billing plan
- GET
Event Schemas
Usage Meters
AddOns
Licenses
Feature
Price Plans
Settings
Price Experimentation
Migrations
Event Ingestion
Entitlements
Event Management
Metrics
Credits
Invoices
InvoiceGroups
APIs
Edit schedules of an account.
curl --request POST \
--url https://api.togai.com/accounts/{account_id}/edit_schedules \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"edits": [
{
"mode": "ASSOCIATE",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"effectiveFrom": "2022-07-04",
"effectiveUntil": "2022-10-04"
},
{
"mode": "DISASSOCIATE",
"effectiveFrom": "2022-08-04",
"effectiveUntil": "2022-09-04"
}
]
}'
{
"accountId": "G234DZZKBKACATFFGVGEMERFI",
"accountName": "ACME Enterprise - Account2",
"pricingSchedules": [
{
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"startDate": "2022-12-02T00:00:00Z",
"endDate": "9999-01-01T00:00:00Z"
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
account_id corresponding to an account
Body
Mode of request to create dis/association
ASSOCIATE
, DISASSOCIATE
Id of the price plan if association request
Date of effectiveness of the association.
- Expected only if the account already has a price plan associated with it.
Date until which the association must be effective.
- Expected only if effectiveFrom is present.
Represents configurations related to pricing cycle
Interval field allow you to define the billing interval you would like to set
WEEKLY
, MONTHLY
, QUARTERLY
, HALF_YEARLY
, ANNUALLY
Represents the start of pricing cycle in terms of
- dayOffset - number of days from beginning of week / month and
- monthOffset - number of months from beginning of interval (quarter, half-year or year) Note: If a day with offset doesn't exist for a month, closest previous day is considered Examples: WEEKLY -
- {dayOffset: 1, monthOffset: NIL} - First day of every week (Monday)
- {dayOffset: 3, monthOffset: NIL} - 3rd day of every week (Wednesday)
- {dayOffset: LAST, monthOffset: NIL} - Last day of every week (Sunday) MONTHLY -
- {dayOffset: 1, monthOffset: NIL} - First day of every month
- {dayOffset: 12, monthOffset: NIL} - 12th of every month
- {dayOffset: 28, monthOffset: NIL} - 28th of every month. i.e, 28th of Jan, 28th of Feb, ...
- {dayOffset: 30, monthOffset: NIL} - 30th of every month. i.e, 28th of Jan, 28th of Feb, ...
- {dayOffset: LAST, monthOffset: NIL} - Last day of every month. i.e, 31st of Jan, 28th of Feb, ... QUARTERLY
- {dayOffset: 15, monthOffset: FIRST} - 15th Jan, 15th Apr, 15th Jul and 15th Oct
- {dayOffset: 15, monthOffset: 2} - 15th Feb, 15th May, 15th Aug and 15th Nov
- {dayOffset: 15, monthOffset: LAST} - 15th Mar, 15th Jun, 15th Sep and 15th Dec
- {dayOffset: LAST, monthOffset: FIRST} - 31st Jan, 30th Apr, 30th Jul and 31th Oct HALF_YEARLY
- {dayOffset: 15, monthOffset: FIRST} - 15th Jan and 15th Jul
- {dayOffset: 15, monthOffset: 4} - 15th Apr and 15th Oct
- {dayOffset: 15, monthOffset: LAST} - 15th Jun and 15th Dec ANNUALLY
- {dayOffset: 15, monthOffset: FIRST} - 15th Jan
- {dayOffset: 15, monthOffset: 1} - 15th Jan
- {dayOffset: LAST, monthOffset: 2} - 29th Feb on Leap year, 28th otherwise
- {dayOffset: 15, monthOffset: 8} - 15th Aug
- {dayOffset: 15, monthOffset: LAST} - 15th Dec
If interval is WEEKLY, min: "1" and max: "7" as strings. Spl. string allowed: LAST Otherwise, min: "1" and max: "31" as strings. Spl. string allowed: LAST
min: "1" and max: "12". Spl. string allowed: FIRST / LAST. For QUARTERLY only 1 - 3 is allowed and for HALF_YEARLY 1 - 6. This being an optional field, shouldn't be passed for MONTHLY.
Togai allows you to ingest past dated events that will be processed by a pricing cycle till the end grace period. For example: Pricing cycle is Monthly from 1st to 30th and gracePeriod is 5 days which next month 1 to 5th date, you can ingest past dated events during this grace period.
Togai calculates the startOffsets based on the date of association instead of requiring from the user and these offsets will be applied as an override if this flag is enabled. Examples: WEEKLY -
- 23/10/2023 (Monday) - {dayOffset: 1, monthOffset: NIL}
- 25/10/2023 (Wednesday) - {dayOffset: 3, monthOffset: NIL}
- 29/10/2023 (Sunday) - {dayOffset: 7, monthOffset: NIL} MONTHLY -
- 1st Oct - {dayOffset: 1, monthOffset: NIL}
- 12th Oct - {dayOffset: 12, monthOffset: NIL}
- 28th Oct - {dayOffset: 28, monthOffset: NIL}
- 30th Oct - {dayOffset: 30, monthOffset: NIL}
- 31th Oct - {dayOffset: 31, monthOffset: NIL} QUARTERLY
- 15th Jan, 15th Apr, 15th Jul and 15th Oct - {dayOffset: 15, monthOffset: 1}
- 15th Feb, 15th May, 15th Aug and 15th Nov - {dayOffset: 15, monthOffset: 2}
- 15th Mar, 15th Jun, 15th Sep and 15th Dec - {dayOffset: 15, monthOffset: 3} HALF_YEARLY
- 15th Jan and 15th Jul - {dayOffset: 15, monthOffset: 1}
- 15th Apr and 15th Oct - {dayOffset: 15, monthOffset: 4}
- 15th Jun and 15th Dec - {dayOffset: 15, monthOffset: 6} ANNUALLY
- 15th Jan - {dayOffset: 15, monthOffset: 1}
- 29th Feb on Leap year - {dayOffset: 29, monthOffset: 2}
- 28th Feb - {dayOffset: 28, monthOffset: 2}
- 15th Aug - {dayOffset: 15, monthOffset: 8}
- 15th Dec - {dayOffset: 15, monthOffset: 12}
Name your rate card, this will be displayed in the Togai App
A tag string to group usageRateCards
Contains all rate related configurations
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
Rate cards can have single or multiple slab up to 100.
FLAT
, PER_UNIT
, PACKAGE
A tag string to group rate cards
If IN_ADVANCE, the fixed fee will be invoiced in the previous billing cycle. If IN_ARREARS, the fixed fee will be invoiced in the current billing cycle.
IN_ADVANCE
, IN_ARREARS
Name your rate card, this will be used in invoice
Contains all rate related configurations
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
Rate cards can have single or multiple slab up to 100.
FLAT
, PER_UNIT
, PACKAGE
Represents the number of pricing cycles after which the rate card will be charged
Represents the offset for pricing cycles after which the rate card will be charged
Unique Identifier of the attached Feature
Name to be displayed during invoice
A tag string to group rate cards
Maximum quantity allowed for the feature, if not specified, unlimited quantity is allowed
Contains all rate related configurations
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
Rate cards can have single or multiple slab up to 100.
FLAT
, PER_UNIT
, PACKAGE
Represents the billing config of the entitlement overage rate card. If not specified interval:1 and startOffset:0 is taken as default value
Represents the number of pricing cycles after which the rate card will be billed
Represents the offset for pricing cycles after which the rate card will be billed
Unique Identifier of the attached AddOn
Name of the attached AddOn
A tag string to group fixedFeeRateCards
If IN_ADVANCE, the fixed fee will be invoiced in the previous billing cycle. If IN_ARREARS, the fixed fee will be invoiced in the current billing cycle.
IN_ADVANCE
, IN_ARREARS
Fixed fee applies either for a one-time occurrence or for each cycle.
ONE_TIME
, RECURRING
Represents the number of pricing cycles after which the rate card will be charged
Represents the offset for pricing cycles after which the rate card will be charged
Unique Identifier of the attached AddOn
Name of the attached AddOn
A tag string to group licenseRateCards
If IN_ADVANCE, the fixed fee will be invoiced in the previous billing cycle. If IN_ARREARS, the fixed fee will be invoiced in the current billing cycle.
IN_ADVANCE
, IN_ARREARS
Max allowed quantity for a particular license in a price plan
Action to be taken when the license maxQuantity is breached:
DO_NOTHING
: Refrain from granting any new licenses.
DO_NOTHING
Contains all rate related configurations
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
Rate cards can have single or multiple slab up to 100.
FLAT
, PER_UNIT
, PACKAGE
NONE
, CREDITS
, PAYMENT
rate details for a price plan
Contains all rate related configurations
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
Rate cards can have single or multiple slab up to 100.
FLAT
, PER_UNIT
, PACKAGE
A tag string to group creditGrantRateCard
Grant details of Credit Grant Rate Card
Expiry type of grant
PRICING_CYCLE
, NO_EXPIRY
, CUSTOM
Amount to be credited
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
The amount of credit that needs to be credited
FLAT
, PER_UNIT
, PACKAGE
If IN_ADVANCE, the fixed fee will be invoiced in the previous billing cycle. If IN_ARREARS, the fixed fee will be invoiced in the current billing cycle.
IN_ADVANCE
, IN_ARREARS
Credit grant applies either for a one-time occurrence or for each cycle.
ONE_TIME
, RECURRING
Represents the number of pricing cycles after which the rate card will be charged
Represents the offset for pricing cycles after which the rate card will be charged
If this flag is true, current pricing cycle of the account on the date of association will continue rather
than the configurations of the newly associated price plan. Pricing cycle overrides specified using
pricePlanDetailsOverride
will take precedence over precedence over the pricing cycle configurations of
the new price plan that the account needs to migrate to. PricingCycleInterval of the existing plan and
the new plan must be same for this to work. We'll return a 400 BadRequest
otherwise.
Examples:
- Ongoing plan (1st Oct to 30th Oct) - {dayOffset: 1, monthOffset: NIL} New association (15th Oct to 15th Nov) of different price plan with retainStartOffsets option true will use the same pricing cycle configuration {dayOffset: 1, monthOffset: NIL} rather than using the pricing cycle configuration of the new price plan that the account needs to migrate to.
- Ongoing plan (1st Oct to 30th Oct) - {dayOffset: 1, monthOffset: NIL}
New association (1st Nov to 30th Nov) of different price plan with retainStartOffsets option true will
throw a
400 BadRequest
as no existing price plan configuration found on date of association
Response
Identifier of the account
Name of the Account
Represents configurations related to pricing cycle
Interval field allow you to define the billing interval you would like to set
WEEKLY
, MONTHLY
, QUARTERLY
, HALF_YEARLY
, ANNUALLY
Represents the start of pricing cycle in terms of
- dayOffset - number of days from beginning of week / month and
- monthOffset - number of months from beginning of interval (quarter, half-year or year) Note: If a day with offset doesn't exist for a month, closest previous day is considered Examples: WEEKLY -
- {dayOffset: 1, monthOffset: NIL} - First day of every week (Monday)
- {dayOffset: 3, monthOffset: NIL} - 3rd day of every week (Wednesday)
- {dayOffset: LAST, monthOffset: NIL} - Last day of every week (Sunday) MONTHLY -
- {dayOffset: 1, monthOffset: NIL} - First day of every month
- {dayOffset: 12, monthOffset: NIL} - 12th of every month
- {dayOffset: 28, monthOffset: NIL} - 28th of every month. i.e, 28th of Jan, 28th of Feb, ...
- {dayOffset: 30, monthOffset: NIL} - 30th of every month. i.e, 28th of Jan, 28th of Feb, ...
- {dayOffset: LAST, monthOffset: NIL} - Last day of every month. i.e, 31st of Jan, 28th of Feb, ... QUARTERLY
- {dayOffset: 15, monthOffset: FIRST} - 15th Jan, 15th Apr, 15th Jul and 15th Oct
- {dayOffset: 15, monthOffset: 2} - 15th Feb, 15th May, 15th Aug and 15th Nov
- {dayOffset: 15, monthOffset: LAST} - 15th Mar, 15th Jun, 15th Sep and 15th Dec
- {dayOffset: LAST, monthOffset: FIRST} - 31st Jan, 30th Apr, 30th Jul and 31th Oct HALF_YEARLY
- {dayOffset: 15, monthOffset: FIRST} - 15th Jan and 15th Jul
- {dayOffset: 15, monthOffset: 4} - 15th Apr and 15th Oct
- {dayOffset: 15, monthOffset: LAST} - 15th Jun and 15th Dec ANNUALLY
- {dayOffset: 15, monthOffset: FIRST} - 15th Jan
- {dayOffset: 15, monthOffset: 1} - 15th Jan
- {dayOffset: LAST, monthOffset: 2} - 29th Feb on Leap year, 28th otherwise
- {dayOffset: 15, monthOffset: 8} - 15th Aug
- {dayOffset: 15, monthOffset: LAST} - 15th Dec
If interval is WEEKLY, min: "1" and max: "7" as strings. Spl. string allowed: LAST Otherwise, min: "1" and max: "31" as strings. Spl. string allowed: LAST
min: "1" and max: "12". Spl. string allowed: FIRST / LAST. For QUARTERLY only 1 - 3 is allowed and for HALF_YEARLY 1 - 6. This being an optional field, shouldn't be passed for MONTHLY.
Togai allows you to ingest past dated events that will be processed by a pricing cycle till the end grace period. For example: Pricing cycle is Monthly from 1st to 30th and gracePeriod is 5 days which next month 1 to 5th date, you can ingest past dated events during this grace period.
Togai calculates the startOffsets based on the date of association instead of requiring from the user and these offsets will be applied as an override if this flag is enabled. Examples: WEEKLY -
- 23/10/2023 (Monday) - {dayOffset: 1, monthOffset: NIL}
- 25/10/2023 (Wednesday) - {dayOffset: 3, monthOffset: NIL}
- 29/10/2023 (Sunday) - {dayOffset: 7, monthOffset: NIL} MONTHLY -
- 1st Oct - {dayOffset: 1, monthOffset: NIL}
- 12th Oct - {dayOffset: 12, monthOffset: NIL}
- 28th Oct - {dayOffset: 28, monthOffset: NIL}
- 30th Oct - {dayOffset: 30, monthOffset: NIL}
- 31th Oct - {dayOffset: 31, monthOffset: NIL} QUARTERLY
- 15th Jan, 15th Apr, 15th Jul and 15th Oct - {dayOffset: 15, monthOffset: 1}
- 15th Feb, 15th May, 15th Aug and 15th Nov - {dayOffset: 15, monthOffset: 2}
- 15th Mar, 15th Jun, 15th Sep and 15th Dec - {dayOffset: 15, monthOffset: 3} HALF_YEARLY
- 15th Jan and 15th Jul - {dayOffset: 15, monthOffset: 1}
- 15th Apr and 15th Oct - {dayOffset: 15, monthOffset: 4}
- 15th Jun and 15th Dec - {dayOffset: 15, monthOffset: 6} ANNUALLY
- 15th Jan - {dayOffset: 15, monthOffset: 1}
- 29th Feb on Leap year - {dayOffset: 29, monthOffset: 2}
- 28th Feb - {dayOffset: 28, monthOffset: 2}
- 15th Aug - {dayOffset: 15, monthOffset: 8}
- 15th Dec - {dayOffset: 15, monthOffset: 12}
Name your rate card, this will be displayed in the Togai App
A tag string to group usageRateCards
Contains all rate related configurations
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
Rate cards can have single or multiple slab up to 100.
FLAT
, PER_UNIT
, PACKAGE
A tag string to group rate cards
If IN_ADVANCE, the fixed fee will be invoiced in the previous billing cycle. If IN_ARREARS, the fixed fee will be invoiced in the current billing cycle.
IN_ADVANCE
, IN_ARREARS
Name your rate card, this will be used in invoice
Contains all rate related configurations
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
Rate cards can have single or multiple slab up to 100.
FLAT
, PER_UNIT
, PACKAGE
Represents the number of pricing cycles after which the rate card will be charged
Represents the offset for pricing cycles after which the rate card will be charged
Unique Identifier of the attached Feature
Name to be displayed during invoice
A tag string to group rate cards
Maximum quantity allowed for the feature, if not specified, unlimited quantity is allowed
Contains all rate related configurations
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
Rate cards can have single or multiple slab up to 100.
FLAT
, PER_UNIT
, PACKAGE
Represents the billing config of the entitlement overage rate card. If not specified interval:1 and startOffset:0 is taken as default value
Represents the number of pricing cycles after which the rate card will be billed
Represents the offset for pricing cycles after which the rate card will be billed
Unique Identifier of the attached AddOn
Name of the attached AddOn
A tag string to group fixedFeeRateCards
If IN_ADVANCE, the fixed fee will be invoiced in the previous billing cycle. If IN_ARREARS, the fixed fee will be invoiced in the current billing cycle.
IN_ADVANCE
, IN_ARREARS
Fixed fee applies either for a one-time occurrence or for each cycle.
ONE_TIME
, RECURRING
Represents the number of pricing cycles after which the rate card will be charged
Represents the offset for pricing cycles after which the rate card will be charged
Unique Identifier of the attached AddOn
Name of the attached AddOn
A tag string to group licenseRateCards
If IN_ADVANCE, the fixed fee will be invoiced in the previous billing cycle. If IN_ARREARS, the fixed fee will be invoiced in the current billing cycle.
IN_ADVANCE
, IN_ARREARS
Max allowed quantity for a particular license in a price plan
Action to be taken when the license maxQuantity is breached:
DO_NOTHING
: Refrain from granting any new licenses.
DO_NOTHING
Contains all rate related configurations
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
Rate cards can have single or multiple slab up to 100.
FLAT
, PER_UNIT
, PACKAGE
NONE
, CREDITS
, PAYMENT
rate details for a price plan
Contains all rate related configurations
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
Rate cards can have single or multiple slab up to 100.
FLAT
, PER_UNIT
, PACKAGE
A tag string to group creditGrantRateCard
Grant details of Credit Grant Rate Card
Expiry type of grant
PRICING_CYCLE
, NO_EXPIRY
, CUSTOM
Amount to be credited
Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. For more understanding read Rate Cards
TIERED
, VOLUME
The amount of credit that needs to be credited
FLAT
, PER_UNIT
, PACKAGE
If IN_ADVANCE, the fixed fee will be invoiced in the previous billing cycle. If IN_ARREARS, the fixed fee will be invoiced in the current billing cycle.
IN_ADVANCE
, IN_ARREARS
Credit grant applies either for a one-time occurrence or for each cycle.
ONE_TIME
, RECURRING
Represents the number of pricing cycles after which the rate card will be charged
Represents the offset for pricing cycles after which the rate card will be charged
curl --request POST \
--url https://api.togai.com/accounts/{account_id}/edit_schedules \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"edits": [
{
"mode": "ASSOCIATE",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"effectiveFrom": "2022-07-04",
"effectiveUntil": "2022-10-04"
},
{
"mode": "DISASSOCIATE",
"effectiveFrom": "2022-08-04",
"effectiveUntil": "2022-09-04"
}
]
}'
{
"accountId": "G234DZZKBKACATFFGVGEMERFI",
"accountName": "ACME Enterprise - Account2",
"pricingSchedules": [
{
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"startDate": "2022-12-02T00:00:00Z",
"endDate": "9999-01-01T00:00:00Z"
}
]
}