curl --request POST \
--url https://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Optimistic growth",
"color": "SCENARIO_COLOR_ORANGE"
}
'import requests
url = "https://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios"
payload = {
"name": "Optimistic growth",
"color": "SCENARIO_COLOR_ORANGE"
}
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({name: 'Optimistic growth', color: 'SCENARIO_COLOR_ORANGE'})
};
fetch('https://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios', 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://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios",
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([
'name' => 'Optimistic growth',
'color' => 'SCENARIO_COLOR_ORANGE'
]),
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://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios"
payload := strings.NewReader("{\n \"name\": \"Optimistic growth\",\n \"color\": \"SCENARIO_COLOR_ORANGE\"\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://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Optimistic growth\",\n \"color\": \"SCENARIO_COLOR_ORANGE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios")
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 \"name\": \"Optimistic growth\",\n \"color\": \"SCENARIO_COLOR_ORANGE\"\n}"
response = http.request(request)
puts response.read_body{
"cash_flow_scenario": {
"id": "6c1e9a72-4d3b-4f8e-8a1c-2b6d7e9f0a3b",
"name": "Optimistic growth",
"color": "SCENARIO_COLOR_ORANGE",
"parent_id": "019259fb-8731-767a-b8fd-9206aa052e3d",
"is_main": false
}
}Create a cash flow scenario
OAuth scope: cash_flow_category.write
Creates a new cash flow scenario for the authenticated organization.
The new scenario is initialized with a copy of every target from its parent scenario (the organization’s main scenario, when parent_id is omitted). Reparenting an existing scenario is not supported.
curl --request POST \
--url https://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Optimistic growth",
"color": "SCENARIO_COLOR_ORANGE"
}
'import requests
url = "https://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios"
payload = {
"name": "Optimistic growth",
"color": "SCENARIO_COLOR_ORANGE"
}
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({name: 'Optimistic growth', color: 'SCENARIO_COLOR_ORANGE'})
};
fetch('https://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios', 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://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios",
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([
'name' => 'Optimistic growth',
'color' => 'SCENARIO_COLOR_ORANGE'
]),
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://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios"
payload := strings.NewReader("{\n \"name\": \"Optimistic growth\",\n \"color\": \"SCENARIO_COLOR_ORANGE\"\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://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Optimistic growth\",\n \"color\": \"SCENARIO_COLOR_ORANGE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://thirdparty.qonto.com/v1/thirdparty/cash_flow_scenarios")
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 \"name\": \"Optimistic growth\",\n \"color\": \"SCENARIO_COLOR_ORANGE\"\n}"
response = http.request(request)
puts response.read_body{
"cash_flow_scenario": {
"id": "6c1e9a72-4d3b-4f8e-8a1c-2b6d7e9f0a3b",
"name": "Optimistic growth",
"color": "SCENARIO_COLOR_ORANGE",
"parent_id": "019259fb-8731-767a-b8fd-9206aa052e3d",
"is_main": false
}
}Authorizations
Bearer authorization header: Bearer <token>, where <token> is the access token received from the authorization server at the end of the OAuth 2.0 flow.
Headers
Required only for Sandbox API requests; to get one, please sign up to the Developer Portal.
Body
Display name of the new scenario. Must be non-empty and unique for the organization.
Color key used to display the scenario. Defaults to SCENARIO_COLOR_ORANGE when omitted. SCENARIO_COLOR_GREY is reserved for the main scenario and cannot be assigned here.
SCENARIO_COLOR_ORANGE, SCENARIO_COLOR_GREEN, SCENARIO_COLOR_RED, SCENARIO_COLOR_PURPLE, SCENARIO_COLOR_CYAN, SCENARIO_COLOR_YELLOW, SCENARIO_COLOR_PEACH, SCENARIO_COLOR_PURPLE_LIGHT, SCENARIO_COLOR_PINK ID of the scenario to derive from. Defaults to the organization's main scenario when omitted.
Response
Returns the created cash flow scenario.
A cash flow scenario. Scenarios group per-category monthly targets under a
named projection. Every organization has exactly one main scenario
(is_main: true), which cannot be deleted. Additional scenarios can be
created, updated, and deleted.
Show child attributes
Show child attributes
Was this page helpful?