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": {}
}
]
}
'import requests
url = "https://api.togai.com/v2/accounts/{account_id}/finalize_schedules"
payload = {
"mergeSchedules": True,
"preActions": [
{
"type": "GRANT_LICENSE",
"config": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mergeSchedules: true, preActions: [{type: 'GRANT_LICENSE', config: {}}]})
};
fetch('https://api.togai.com/v2/accounts/{account_id}/finalize_schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.togai.com/v2/accounts/{account_id}/finalize_schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mergeSchedules' => true,
'preActions' => [
[
'type' => 'GRANT_LICENSE',
'config' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.togai.com/v2/accounts/{account_id}/finalize_schedules"
payload := strings.NewReader("{\n \"mergeSchedules\": true,\n \"preActions\": [\n {\n \"type\": \"GRANT_LICENSE\",\n \"config\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.togai.com/v2/accounts/{account_id}/finalize_schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mergeSchedules\": true,\n \"preActions\": [\n {\n \"type\": \"GRANT_LICENSE\",\n \"config\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/v2/accounts/{account_id}/finalize_schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mergeSchedules\": true,\n \"preActions\": [\n {\n \"type\": \"GRANT_LICENSE\",\n \"config\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"accountId": "<string>",
"pricePlanId": "<string>",
"version": 123,
"deferredRevenue": true,
"pricePlanInfo": {
"name": "<string>",
"description": "<string>"
},
"accountScheduleInfo": {
"supportedCurrencies": [
"<string>"
],
"pricingCycleConfig": {
"gracePeriod": 3,
"startOffset": {
"dayOffset": "<string>",
"monthOffset": "<string>"
},
"anniversaryCycle": true
},
"pricingRules": [
{
"id": "<string>",
"name": "<string>",
"version": 2,
"order": 2,
"computation": "<string>",
"action": {
"target": "<string>",
"id": "<string>",
"description": "<string>",
"metadata": {}
},
"condition": "<string>"
}
]
},
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"allowOngoingCycleUpdates": true,
"isOverridden": true
}
],
"nextToken": "<string>",
"previousToken": "<string>"
}Schedules
Finalize schedules of an account
Finalize schedules of an account
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": {}
}
]
}
'import requests
url = "https://api.togai.com/v2/accounts/{account_id}/finalize_schedules"
payload = {
"mergeSchedules": True,
"preActions": [
{
"type": "GRANT_LICENSE",
"config": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mergeSchedules: true, preActions: [{type: 'GRANT_LICENSE', config: {}}]})
};
fetch('https://api.togai.com/v2/accounts/{account_id}/finalize_schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.togai.com/v2/accounts/{account_id}/finalize_schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mergeSchedules' => true,
'preActions' => [
[
'type' => 'GRANT_LICENSE',
'config' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.togai.com/v2/accounts/{account_id}/finalize_schedules"
payload := strings.NewReader("{\n \"mergeSchedules\": true,\n \"preActions\": [\n {\n \"type\": \"GRANT_LICENSE\",\n \"config\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.togai.com/v2/accounts/{account_id}/finalize_schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mergeSchedules\": true,\n \"preActions\": [\n {\n \"type\": \"GRANT_LICENSE\",\n \"config\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/v2/accounts/{account_id}/finalize_schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mergeSchedules\": true,\n \"preActions\": [\n {\n \"type\": \"GRANT_LICENSE\",\n \"config\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"accountId": "<string>",
"pricePlanId": "<string>",
"version": 123,
"deferredRevenue": true,
"pricePlanInfo": {
"name": "<string>",
"description": "<string>"
},
"accountScheduleInfo": {
"supportedCurrencies": [
"<string>"
],
"pricingCycleConfig": {
"gracePeriod": 3,
"startOffset": {
"dayOffset": "<string>",
"monthOffset": "<string>"
},
"anniversaryCycle": true
},
"pricingRules": [
{
"id": "<string>",
"name": "<string>",
"version": 2,
"order": 2,
"computation": "<string>",
"action": {
"target": "<string>",
"id": "<string>",
"description": "<string>",
"metadata": {}
},
"condition": "<string>"
}
]
},
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"allowOngoingCycleUpdates": true,
"isOverridden": true
}
],
"nextToken": "<string>",
"previousToken": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
account_id corresponding to an account
Maximum string length:
50Example:
"ACC00001"
Body
application/json
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
Show child attributes
⌘I
