curl --request PUT \
--url https://api.demo.fuelboss.net/v1/contracts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"reference": "<string>",
"externalReference": "<string>",
"supplierEntities": [
"<string>"
],
"ports": [
"<string>"
],
"counterpartCompanies": [
"<string>"
],
"counterpartEntities": [
"<string>"
],
"startDateUtc": "2023-11-07T05:31:56Z",
"endDateUtc": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.demo.fuelboss.net/v1/contracts"
payload = {
"name": "<string>",
"reference": "<string>",
"externalReference": "<string>",
"supplierEntities": ["<string>"],
"ports": ["<string>"],
"counterpartCompanies": ["<string>"],
"counterpartEntities": ["<string>"],
"startDateUtc": "2023-11-07T05:31:56Z",
"endDateUtc": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
reference: '<string>',
externalReference: '<string>',
supplierEntities: ['<string>'],
ports: ['<string>'],
counterpartCompanies: ['<string>'],
counterpartEntities: ['<string>'],
startDateUtc: '2023-11-07T05:31:56Z',
endDateUtc: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.demo.fuelboss.net/v1/contracts', 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.demo.fuelboss.net/v1/contracts",
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([
'name' => '<string>',
'reference' => '<string>',
'externalReference' => '<string>',
'supplierEntities' => [
'<string>'
],
'ports' => [
'<string>'
],
'counterpartCompanies' => [
'<string>'
],
'counterpartEntities' => [
'<string>'
],
'startDateUtc' => '2023-11-07T05:31:56Z',
'endDateUtc' => '2023-11-07T05:31:56Z'
]),
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.demo.fuelboss.net/v1/contracts"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"externalReference\": \"<string>\",\n \"supplierEntities\": [\n \"<string>\"\n ],\n \"ports\": [\n \"<string>\"\n ],\n \"counterpartCompanies\": [\n \"<string>\"\n ],\n \"counterpartEntities\": [\n \"<string>\"\n ],\n \"startDateUtc\": \"2023-11-07T05:31:56Z\",\n \"endDateUtc\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.demo.fuelboss.net/v1/contracts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"externalReference\": \"<string>\",\n \"supplierEntities\": [\n \"<string>\"\n ],\n \"ports\": [\n \"<string>\"\n ],\n \"counterpartCompanies\": [\n \"<string>\"\n ],\n \"counterpartEntities\": [\n \"<string>\"\n ],\n \"startDateUtc\": \"2023-11-07T05:31:56Z\",\n \"endDateUtc\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.demo.fuelboss.net/v1/contracts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"externalReference\": \"<string>\",\n \"supplierEntities\": [\n \"<string>\"\n ],\n \"ports\": [\n \"<string>\"\n ],\n \"counterpartCompanies\": [\n \"<string>\"\n ],\n \"counterpartEntities\": [\n \"<string>\"\n ],\n \"startDateUtc\": \"2023-11-07T05:31:56Z\",\n \"endDateUtc\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"contractReference": "<string>",
"lastChangedAtUtc": "2023-11-07T05:31:56Z"
}{
"contractReference": "<string>",
"lastChangedAtUtc": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"trace_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"trace_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"trace_id": "<string>"
}Creates or updates a contract
Creates a new contract or updates an existing one based on the contract reference.
curl --request PUT \
--url https://api.demo.fuelboss.net/v1/contracts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"reference": "<string>",
"externalReference": "<string>",
"supplierEntities": [
"<string>"
],
"ports": [
"<string>"
],
"counterpartCompanies": [
"<string>"
],
"counterpartEntities": [
"<string>"
],
"startDateUtc": "2023-11-07T05:31:56Z",
"endDateUtc": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.demo.fuelboss.net/v1/contracts"
payload = {
"name": "<string>",
"reference": "<string>",
"externalReference": "<string>",
"supplierEntities": ["<string>"],
"ports": ["<string>"],
"counterpartCompanies": ["<string>"],
"counterpartEntities": ["<string>"],
"startDateUtc": "2023-11-07T05:31:56Z",
"endDateUtc": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
reference: '<string>',
externalReference: '<string>',
supplierEntities: ['<string>'],
ports: ['<string>'],
counterpartCompanies: ['<string>'],
counterpartEntities: ['<string>'],
startDateUtc: '2023-11-07T05:31:56Z',
endDateUtc: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.demo.fuelboss.net/v1/contracts', 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.demo.fuelboss.net/v1/contracts",
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([
'name' => '<string>',
'reference' => '<string>',
'externalReference' => '<string>',
'supplierEntities' => [
'<string>'
],
'ports' => [
'<string>'
],
'counterpartCompanies' => [
'<string>'
],
'counterpartEntities' => [
'<string>'
],
'startDateUtc' => '2023-11-07T05:31:56Z',
'endDateUtc' => '2023-11-07T05:31:56Z'
]),
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.demo.fuelboss.net/v1/contracts"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"externalReference\": \"<string>\",\n \"supplierEntities\": [\n \"<string>\"\n ],\n \"ports\": [\n \"<string>\"\n ],\n \"counterpartCompanies\": [\n \"<string>\"\n ],\n \"counterpartEntities\": [\n \"<string>\"\n ],\n \"startDateUtc\": \"2023-11-07T05:31:56Z\",\n \"endDateUtc\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.demo.fuelboss.net/v1/contracts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"externalReference\": \"<string>\",\n \"supplierEntities\": [\n \"<string>\"\n ],\n \"ports\": [\n \"<string>\"\n ],\n \"counterpartCompanies\": [\n \"<string>\"\n ],\n \"counterpartEntities\": [\n \"<string>\"\n ],\n \"startDateUtc\": \"2023-11-07T05:31:56Z\",\n \"endDateUtc\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.demo.fuelboss.net/v1/contracts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"externalReference\": \"<string>\",\n \"supplierEntities\": [\n \"<string>\"\n ],\n \"ports\": [\n \"<string>\"\n ],\n \"counterpartCompanies\": [\n \"<string>\"\n ],\n \"counterpartEntities\": [\n \"<string>\"\n ],\n \"startDateUtc\": \"2023-11-07T05:31:56Z\",\n \"endDateUtc\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"contractReference": "<string>",
"lastChangedAtUtc": "2023-11-07T05:31:56Z"
}{
"contractReference": "<string>",
"lastChangedAtUtc": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"trace_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"trace_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"trace_id": "<string>"
}Authorizations
Access token obtained from the /oauth/token endpoint using your client credentials.
Body
Request body for creating or updating a contract. The contract is identified by its reference.
Contract name.
Unique reference for the contract, used as contractReference on nominations.
External reference for the contract in your own systems.
Contract type.
Possible values:
term— Term contract.spot— Spot contract.
term, spot Company entity references of the supplier entities covered by the contract (from Get Company Entities).
UN/LOCODEs of the ports covered by the contract.
Identifiers of the counterpart companies covered by the contract (from Get Companies).
References of the counterpart entities covered by the contract (from Get Counterpart Entities).
Price type.
Possible values:
floating— Floating price.fixed— Fixed price.
floating, fixed Start of the contract validity period (UTC).
End of the contract validity period (UTC).