Skip to main content
PUT
/
v1
/
companies
/
{company_id}
/
forecast
Update Forecast Settings
curl --request PUT \
  --url https://nueborder.com/api/v1/v1/companies/{company_id}/forecast \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "carbonPrice": 15,
  "discount": 0.1,
  "importRegion": "EU",
  "reportingPeriod": "Q1",
  "year": 2023,
  "yoyChange": 0.05
}
'
import requests

url = "https://nueborder.com/api/v1/v1/companies/{company_id}/forecast"

payload = {
"carbonPrice": 15,
"discount": 0.1,
"importRegion": "EU",
"reportingPeriod": "Q1",
"year": 2023,
"yoyChange": 0.05
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
carbonPrice: 15,
discount: 0.1,
importRegion: 'EU',
reportingPeriod: 'Q1',
year: 2023,
yoyChange: 0.05
})
};

fetch('https://nueborder.com/api/v1/v1/companies/{company_id}/forecast', 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://nueborder.com/api/v1/v1/companies/{company_id}/forecast",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'carbonPrice' => 15,
'discount' => 0.1,
'importRegion' => 'EU',
'reportingPeriod' => 'Q1',
'year' => 2023,
'yoyChange' => 0.05
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://nueborder.com/api/v1/v1/companies/{company_id}/forecast"

payload := strings.NewReader("{\n \"carbonPrice\": 15,\n \"discount\": 0.1,\n \"importRegion\": \"EU\",\n \"reportingPeriod\": \"Q1\",\n \"year\": 2023,\n \"yoyChange\": 0.05\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "<api-key>")
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.put("https://nueborder.com/api/v1/v1/companies/{company_id}/forecast")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"carbonPrice\": 15,\n \"discount\": 0.1,\n \"importRegion\": \"EU\",\n \"reportingPeriod\": \"Q1\",\n \"year\": 2023,\n \"yoyChange\": 0.05\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://nueborder.com/api/v1/v1/companies/{company_id}/forecast")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"carbonPrice\": 15,\n \"discount\": 0.1,\n \"importRegion\": \"EU\",\n \"reportingPeriod\": \"Q1\",\n \"year\": 2023,\n \"yoyChange\": 0.05\n}"

response = http.request(request)
puts response.read_body
{
  "message": "Operation completed successfully",
  "status": 200
}
{
"message": "The JSON payload is invalid",
"status": 400
}
{
"message": "An internal server error occurred",
"status": 500
}

Authorizations

Authorization
string
header
required

Provide your Bearer token in the format: Bearer <your_api_key>

Path Parameters

company_id
string
required

Unique identifier of the company

Body

application/json

Forecast settings configuration

Forecast Setting defines configuration parameters.

carbonPrice
number

Carbon price.

Example:

15

discount
number

Discount rate.

Example:

0.1

importRegion
enum<string>

Region for the settings.

Available options:
EU
Example:

"EU"

reportingPeriod
string

Reporting period.

Example:

"Q1"

year
integer

Year for the settings.

Example:

2023

yoyChange
number

Year-over-year change.

Example:

0.05

Response

Forecast settings updated successfully

A standard successful API response.

message
string

A detailed success message.

Example:

"Operation completed successfully"

status
integer

HTTP status code.

Example:

200