Schedules
Update pricing rules of a account schedule
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
- GETList rate cards
- POSTBulk rate card operations on a schedule
- POSTBulk edit schedules of an account
- GETList pricing schedules of an account
- GETGet list of errors of a acc schedule
- DELDiscard schedules of an account
- POSTFinalize schedules of an account
- GETList pricing rules of a account schedule
- PUTUpdate pricing rules of a account schedule
- GET
- 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
Schedules
Update pricing rules of a account schedule
Update pricing rules of a account schedule
PUT
/
v2
/
schedules
/
{schedule_id}
/
pricing_rules
curl --request PUT \
--url https://api.togai.com/v2/schedules/{schedule_id}/pricing_rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"pricingRules": [
{
"name": "<string>",
"order": 123,
"invoiceTiming": "IN_ADVANCE",
"condition": "<string>",
"computation": "<string>",
"action": {
"type": "ADD",
"target": "<string>",
"id": "<string>",
"description": "<string>",
"metadata": {}
}
}
]
}'
{
"data": [
{
"id": "um.1zYnCiM9Bpg.lv25y",
"name": "Rule 1",
"version": 1,
"order": 1,
"computation": "{\"+\": [{\"var\": \"revenue.urc.um.21lmjsfcXPs.d929R\"}, {\"var\": \"usage.urc.um.21lmjObpMV6.9XeFl\"}]}\n",
"condition": "{\">\": [{\"+\": [{\"var\": \"revenue.urc.um.21lmjObpMV6.9XeFl\"}, {\"var\": \"usage.urc.um.21lmjObpMV6.9XeFl\"}]}, 100]}\n",
"action": {
"type": "UPDATE",
"target": "revenue.ff.addon.21ERXMFJ83s.9EM5S"
}
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Body
application/json
Payload to update pricing rules
Name of the pricing rule
Order of the pricing rule
JSON logic to be computed
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 .
Available options:
IN_ADVANCE
, IN_ARREARS
JSON logic condition deciding whether to compute this pricing rule or not
Response
200 - application/json
Response for create/list pricing rules request
Required range:
x > 1
Required range:
x > 1
JSON logic to be computed
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 .
Available options:
IN_ADVANCE
, IN_ARREARS
JSON logic condition deciding whether to compute this pricing rule or not
curl --request PUT \
--url https://api.togai.com/v2/schedules/{schedule_id}/pricing_rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"pricingRules": [
{
"name": "<string>",
"order": 123,
"invoiceTiming": "IN_ADVANCE",
"condition": "<string>",
"computation": "<string>",
"action": {
"type": "ADD",
"target": "<string>",
"id": "<string>",
"description": "<string>",
"metadata": {}
}
}
]
}'
{
"data": [
{
"id": "um.1zYnCiM9Bpg.lv25y",
"name": "Rule 1",
"version": 1,
"order": 1,
"computation": "{\"+\": [{\"var\": \"revenue.urc.um.21lmjsfcXPs.d929R\"}, {\"var\": \"usage.urc.um.21lmjObpMV6.9XeFl\"}]}\n",
"condition": "{\">\": [{\"+\": [{\"var\": \"revenue.urc.um.21lmjObpMV6.9XeFl\"}, {\"var\": \"usage.urc.um.21lmjObpMV6.9XeFl\"}]}, 100]}\n",
"action": {
"type": "UPDATE",
"target": "revenue.ff.addon.21ERXMFJ83s.9EM5S"
}
}
]
}