curl --request POST \
--url https://api.comstruct.com/v1/payment-terms \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
[
{
"title": "Net 30",
"number": "30T",
"net_days": 30,
"discount_days1": 10,
"discount_rate1": 2,
"discount_days2": 20,
"discount_rate2": 1
}
]
'import requests
url = "https://api.comstruct.com/v1/payment-terms"
payload = [
{
"title": "Net 30",
"number": "30T",
"net_days": 30,
"discount_days1": 10,
"discount_rate1": 2,
"discount_days2": 20,
"discount_rate2": 1
}
]
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
title: 'Net 30',
number: '30T',
net_days: 30,
discount_days1: 10,
discount_rate1: 2,
discount_days2: 20,
discount_rate2: 1
}
])
};
fetch('https://api.comstruct.com/v1/payment-terms', 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.comstruct.com/v1/payment-terms",
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([
[
'title' => 'Net 30',
'number' => '30T',
'net_days' => 30,
'discount_days1' => 10,
'discount_rate1' => 2,
'discount_days2' => 20,
'discount_rate2' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.comstruct.com/v1/payment-terms"
payload := strings.NewReader("[\n {\n \"title\": \"Net 30\",\n \"number\": \"30T\",\n \"net_days\": 30,\n \"discount_days1\": 10,\n \"discount_rate1\": 2,\n \"discount_days2\": 20,\n \"discount_rate2\": 1\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.post("https://api.comstruct.com/v1/payment-terms")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"title\": \"Net 30\",\n \"number\": \"30T\",\n \"net_days\": 30,\n \"discount_days1\": 10,\n \"discount_rate1\": 2,\n \"discount_days2\": 20,\n \"discount_rate2\": 1\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.comstruct.com/v1/payment-terms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"title\": \"Net 30\",\n \"number\": \"30T\",\n \"net_days\": 30,\n \"discount_days1\": 10,\n \"discount_rate1\": 2,\n \"discount_days2\": 20,\n \"discount_rate2\": 1\n }\n]"
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "Net 30",
"number": "30T",
"net_days": 30,
"discount_days1": 10,
"discount_rate1": 2,
"discount_days2": 20,
"discount_rate2": 1,
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_favorite": true,
"active": true,
"is_default_for_credit_notes": true
}
]Zahlungsbedingungen erstellen/aktualisieren
Erforderliche Berechtigungen: payment_terms:write
Erstellt oder aktualisiert eine oder mehrere Zahlungsbedingungen für den aktuellen Mandanten.
Verwendet das number-Feld zum Abgleich bestehender Zahlungsbedingungen für Aktualisierungen.
curl --request POST \
--url https://api.comstruct.com/v1/payment-terms \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
[
{
"title": "Net 30",
"number": "30T",
"net_days": 30,
"discount_days1": 10,
"discount_rate1": 2,
"discount_days2": 20,
"discount_rate2": 1
}
]
'import requests
url = "https://api.comstruct.com/v1/payment-terms"
payload = [
{
"title": "Net 30",
"number": "30T",
"net_days": 30,
"discount_days1": 10,
"discount_rate1": 2,
"discount_days2": 20,
"discount_rate2": 1
}
]
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
title: 'Net 30',
number: '30T',
net_days: 30,
discount_days1: 10,
discount_rate1: 2,
discount_days2: 20,
discount_rate2: 1
}
])
};
fetch('https://api.comstruct.com/v1/payment-terms', 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.comstruct.com/v1/payment-terms",
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([
[
'title' => 'Net 30',
'number' => '30T',
'net_days' => 30,
'discount_days1' => 10,
'discount_rate1' => 2,
'discount_days2' => 20,
'discount_rate2' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.comstruct.com/v1/payment-terms"
payload := strings.NewReader("[\n {\n \"title\": \"Net 30\",\n \"number\": \"30T\",\n \"net_days\": 30,\n \"discount_days1\": 10,\n \"discount_rate1\": 2,\n \"discount_days2\": 20,\n \"discount_rate2\": 1\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.post("https://api.comstruct.com/v1/payment-terms")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"title\": \"Net 30\",\n \"number\": \"30T\",\n \"net_days\": 30,\n \"discount_days1\": 10,\n \"discount_rate1\": 2,\n \"discount_days2\": 20,\n \"discount_rate2\": 1\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.comstruct.com/v1/payment-terms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"title\": \"Net 30\",\n \"number\": \"30T\",\n \"net_days\": 30,\n \"discount_days1\": 10,\n \"discount_rate1\": 2,\n \"discount_days2\": 20,\n \"discount_rate2\": 1\n }\n]"
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "Net 30",
"number": "30T",
"net_days": 30,
"discount_days1": 10,
"discount_rate1": 2,
"discount_days2": 20,
"discount_rate2": 1,
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_favorite": true,
"active": true,
"is_default_for_credit_notes": true
}
]Autorisierungen
API-Schlüssel zur Authentifizierung. Kontaktieren Sie Ihren Customer Success Manager, um einen API-Schlüssel zu erhalten.
Jeder Endpunkt erfordert spezifische Berechtigungen (Scopes); die erforderlichen Scopes werden pro Endpunkt angezeigt.
Body
Der Titel der Zahlungsbedingung
"Net 30"
Die Nummer/der Code der Zahlungsbedingung
"30T"
Anzahl der Tage bis zur Fälligkeit der Zahlung
30
Anzahl der Tage für den ersten Skontozeitraum
10
Skontosatz für den ersten Zeitraum (Prozent)
2
Anzahl der Tage für den zweiten Skontozeitraum
20
Skontosatz für den zweiten Zeitraum (Prozent)
1
Ob dies die Standard-Zahlungsbedingung für Gutschriften ist. Weglassen, um den bestehenden Wert unverändert zu lassen.
false
Antwort
Zahlungsbedingungen erfolgreich erstellt oder aktualisiert
Die eindeutige Kennung der Zahlungsbedingung
Der Titel der Zahlungsbedingung
"Net 30"
Die Nummer/der Code der Zahlungsbedingung
"30T"
Anzahl der Tage bis zur Fälligkeit der Zahlung
30
Anzahl der Tage für den ersten Skontozeitraum
10
Skontosatz für den ersten Zeitraum (Prozent)
2
Anzahl der Tage für den zweiten Skontozeitraum
20
Skontosatz für den zweiten Zeitraum (Prozent)
1
Die Mandanten-ID
Ob diese Zahlungsbedingung ein Favorit ist
Ob diese Zahlungsbedingung aktiv ist
Ob dies die Standard-Zahlungsbedingung für Gutschriften ist