POST
/
v2
/
accounts
/
{account_id}
/
finalize_schedules
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",
          "startOffset": {
            "dayOffset": "<string>",
            "monthOffset": "<string>"
          },
          "gracePeriod": 3,
          "anniversaryCycle": true
        },
        "pricingRules": [
          {
            "id": "<string>",
            "name": "<string>",
            "version": 2,
            "invoiceTiming": "IN_ADVANCE",
            "order": 2,
            "condition": "<string>",
            "computation": "<string>",
            "action": {
              "type": "ADD",
              "target": "<string>",
              "id": "<string>",
              "description": "<string>",
              "metadata": {}
            }
          }
        ]
      },
      "isOverridden": true,
      "startDate": "2023-11-07T05:31:56Z",
      "endDate": "2023-11-07T05:31:56Z",
      "allowOngoingCycleUpdates": true
    }
  ],
  "nextToken": "<string>",
  "previousToken": "<string>"
}

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
Example:

"ACC00001"

Body

application/json

Payload to finalize account schedules

Request to finalize account schedules

mergeSchedules
boolean

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

preActions
PreAction · object[]

Pre actions to be performed before association or disassociation

Response

200 - application/json

Paginated response for pricing schedules

data
object[]
required
nextToken
string
previousToken
string