cURL
curl --request PUT \
--url https://app.example.com/v1/admin/finance/supplier-invoices/<id>/allocations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"allocations": [
{}
]
}'const response = await fetch("https://app.example.com/v1/admin/finance/supplier-invoices/<id>/allocations", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
body: JSON.stringify({
"allocations": [
{}
]
}),
});
const data = await response.json();import requests
response = requests.put(
"https://app.example.com/v1/admin/finance/supplier-invoices/<id>/allocations",
headers={
"Authorization": "Bearer <token>"
},
json={
"allocations": [
{}
]
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{operatorDomain}/v1/admin/finance/supplier-invoices/{id}/allocations",
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([
'allocations' => [
[
]
]
]),
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://{operatorDomain}/v1/admin/finance/supplier-invoices/{id}/allocations"
payload := strings.NewReader("{\n \"allocations\": [\n {}\n ]\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://{operatorDomain}/v1/admin/finance/supplier-invoices/{id}/allocations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allocations\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{operatorDomain}/v1/admin/finance/supplier-invoices/{id}/allocations")
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 \"allocations\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "sinv_01HZX...",
"currency": "EUR",
"totalCents": 80000,
"supplierName": "<string>",
"invoiceNumber": "<string>",
"baseCurrency": "<string>",
"status": "approved",
"issueDate": "2023-12-25",
"dueDate": "2023-12-25"
}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}Finance
Replace supplier invoice allocations
Replace the allocations linking a supplier invoice to bookings/items.
PUT
/
v1
/
admin
/
finance
/
supplier-invoices
/
{id}
/
allocations
cURL
curl --request PUT \
--url https://app.example.com/v1/admin/finance/supplier-invoices/<id>/allocations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"allocations": [
{}
]
}'const response = await fetch("https://app.example.com/v1/admin/finance/supplier-invoices/<id>/allocations", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
body: JSON.stringify({
"allocations": [
{}
]
}),
});
const data = await response.json();import requests
response = requests.put(
"https://app.example.com/v1/admin/finance/supplier-invoices/<id>/allocations",
headers={
"Authorization": "Bearer <token>"
},
json={
"allocations": [
{}
]
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{operatorDomain}/v1/admin/finance/supplier-invoices/{id}/allocations",
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([
'allocations' => [
[
]
]
]),
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://{operatorDomain}/v1/admin/finance/supplier-invoices/{id}/allocations"
payload := strings.NewReader("{\n \"allocations\": [\n {}\n ]\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://{operatorDomain}/v1/admin/finance/supplier-invoices/{id}/allocations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allocations\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{operatorDomain}/v1/admin/finance/supplier-invoices/{id}/allocations")
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 \"allocations\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "sinv_01HZX...",
"currency": "EUR",
"totalCents": 80000,
"supplierName": "<string>",
"invoiceNumber": "<string>",
"baseCurrency": "<string>",
"status": "approved",
"issueDate": "2023-12-25",
"dueDate": "2023-12-25"
}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}⌘I