curl --request POST \
--url https://api.togai.com/v2/accounts/{account_id}/finalize_schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"mergeSchedules": true,
"preActions": [
{
"type": "GRANT_LICENSE",
"config": {}
}
]
}'{
"data": [
{
"id": "<string>",
"accountId": "<string>",
"pricePlanId": "<string>",
"version": 123,
"deferredRevenue": true,
"pricePlanInfo": {
"name": "<string>",
"description": "<string>"
},
"accountScheduleInfo": {
"supportedCurrencies": [
"<string>"
],
"pricingCycleConfig": {
"interval": "WEEKLY",
"gracePeriod": 3,
"startOffset": {
"dayOffset": "<string>",
"monthOffset": "<string>"
},
"anniversaryCycle": true
},
"pricingRules": [
{
"id": "<string>",
"name": "<string>",
"version": 2,
"order": 2,
"computation": "<string>",
"action": {
"type": "ADD",
"target": "<string>",
"id": "<string>",
"description": "<string>",
"metadata": {}
},
"invoiceTiming": "IN_ADVANCE",
"condition": "<string>"
}
]
},
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"allowOngoingCycleUpdates": true,
"isOverridden": true
}
],
"nextToken": "<string>",
"previousToken": "<string>"
}Finalize schedules of an account
curl --request POST \
--url https://api.togai.com/v2/accounts/{account_id}/finalize_schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"mergeSchedules": true,
"preActions": [
{
"type": "GRANT_LICENSE",
"config": {}
}
]
}'{
"data": [
{
"id": "<string>",
"accountId": "<string>",
"pricePlanId": "<string>",
"version": 123,
"deferredRevenue": true,
"pricePlanInfo": {
"name": "<string>",
"description": "<string>"
},
"accountScheduleInfo": {
"supportedCurrencies": [
"<string>"
],
"pricingCycleConfig": {
"interval": "WEEKLY",
"gracePeriod": 3,
"startOffset": {
"dayOffset": "<string>",
"monthOffset": "<string>"
},
"anniversaryCycle": true
},
"pricingRules": [
{
"id": "<string>",
"name": "<string>",
"version": 2,
"order": 2,
"computation": "<string>",
"action": {
"type": "ADD",
"target": "<string>",
"id": "<string>",
"description": "<string>",
"metadata": {}
},
"invoiceTiming": "IN_ADVANCE",
"condition": "<string>"
}
]
},
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"allowOngoingCycleUpdates": true,
"isOverridden": true
}
],
"nextToken": "<string>",
"previousToken": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
account_id corresponding to an account
50"ACC00001"
Payload to finalize account schedules
Request to finalize account schedules
If this flag is true, the schedules will be merged with the existing schedules of the account if possible. If this flag is false, the existing schedules will be replaced with the new schedules. Default value is false
Pre actions to be performed before association or disassociation
Show child attributes
Type of pre action to be performed
GRANT_LICENSE Configuration required for performing pre action
GRANT_LICENSE: grant one time licenses to an account before association
licenseId [Required]: Id of the license to be grantedupdateType [Required]: Type of update to be performed on the license (RELATIVE or ABSOLUTE)quantity [Required]: Quantity of license to be grantedeffectiveFrom [Optional]: Effective date from which the license will be grantedShow child attributes
Paginated response for pricing schedules
Show child attributes
Show child attributes
Represents configurations related to pricing cycle
Show child attributes
Interval field allow you to define the billing interval you would like to set
WEEKLY, MONTHLY, QUARTERLY, HALF_YEARLY, ANNUALLY 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.
3
Represents the start of pricing cycle in terms of
Show child attributes
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 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 -
Show child attributes
x >= 1x >= 1JSON logic to be computed
JSON logic to be computed
Show child attributes
ADD, UPDATE If IN_ADVANCE, the rule will be applied on rate cards with invoice timing IN_ADVANCE . If IN_ARREARS, the rule will be applied on rate cards with invoice timing IN_ARREARS .
IN_ADVANCE, IN_ARREARS JSON logic condition deciding whether to compute this pricing rule or not
Indicates whether the schedule is overridden. Note: A null value for this field does not imply that the schedule is not overridden.