cURL
curl --request POST \
--url https://{tenant}.stamp.eu/rest/surcharge_rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"compensation_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"time_from": "<string>",
"time_to": "<string>",
"rate_value": 1,
"applies_on_holidays": true,
"is_active": true,
"tax_free": true,
"tax_free_max_percent": 499.995,
"only_beyond_planned": true,
"non_cumulative": true,
"priority": 0,
"weekdays": [
4
]
}
'import requests
url = "https://{tenant}.stamp.eu/rest/surcharge_rules"
payload = {
"name": "<string>",
"compensation_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"time_from": "<string>",
"time_to": "<string>",
"rate_value": 1,
"applies_on_holidays": True,
"is_active": True,
"tax_free": True,
"tax_free_max_percent": 499.995,
"only_beyond_planned": True,
"non_cumulative": True,
"priority": 0,
"weekdays": [4]
}
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: '<string>',
compensation_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
time_from: '<string>',
time_to: '<string>',
rate_value: 1,
applies_on_holidays: true,
is_active: true,
tax_free: true,
tax_free_max_percent: 499.995,
only_beyond_planned: true,
non_cumulative: true,
priority: 0,
weekdays: [4]
})
};
fetch('https://{tenant}.stamp.eu/rest/surcharge_rules', 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://{tenant}.stamp.eu/rest/surcharge_rules",
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' => '<string>',
'compensation_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'time_from' => '<string>',
'time_to' => '<string>',
'rate_value' => 1,
'applies_on_holidays' => true,
'is_active' => true,
'tax_free' => true,
'tax_free_max_percent' => 499.995,
'only_beyond_planned' => true,
'non_cumulative' => true,
'priority' => 0,
'weekdays' => [
4
]
]),
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://{tenant}.stamp.eu/rest/surcharge_rules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"compensation_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"time_from\": \"<string>\",\n \"time_to\": \"<string>\",\n \"rate_value\": 1,\n \"applies_on_holidays\": true,\n \"is_active\": true,\n \"tax_free\": true,\n \"tax_free_max_percent\": 499.995,\n \"only_beyond_planned\": true,\n \"non_cumulative\": true,\n \"priority\": 0,\n \"weekdays\": [\n 4\n ]\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://{tenant}.stamp.eu/rest/surcharge_rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"compensation_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"time_from\": \"<string>\",\n \"time_to\": \"<string>\",\n \"rate_value\": 1,\n \"applies_on_holidays\": true,\n \"is_active\": true,\n \"tax_free\": true,\n \"tax_free_max_percent\": 499.995,\n \"only_beyond_planned\": true,\n \"non_cumulative\": true,\n \"priority\": 0,\n \"weekdays\": [\n 4\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.stamp.eu/rest/surcharge_rules")
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\": \"<string>\",\n \"compensation_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"time_from\": \"<string>\",\n \"time_to\": \"<string>\",\n \"rate_value\": 1,\n \"applies_on_holidays\": true,\n \"is_active\": true,\n \"tax_free\": true,\n \"tax_free_max_percent\": 499.995,\n \"only_beyond_planned\": true,\n \"non_cumulative\": true,\n \"priority\": 0,\n \"weekdays\": [\n 4\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"compensation_type_id": "<string>",
"time_from": "<string>",
"time_to": "<string>",
"weekdays": "<string>",
"applies_on_holidays": "<string>",
"rate_type": "<string>",
"rate_value": 123,
"is_active": "<string>",
"tax_free": "<string>",
"tax_free_max_percent": 123,
"only_beyond_planned": "<string>",
"non_cumulative": "<string>",
"priority": "<string>",
"compensation_type": {
"id": "<string>",
"name": "<string>"
}
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Zuschläge
Zuschlagsregel erstellen
POST
/
surcharge_rules
cURL
curl --request POST \
--url https://{tenant}.stamp.eu/rest/surcharge_rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"compensation_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"time_from": "<string>",
"time_to": "<string>",
"rate_value": 1,
"applies_on_holidays": true,
"is_active": true,
"tax_free": true,
"tax_free_max_percent": 499.995,
"only_beyond_planned": true,
"non_cumulative": true,
"priority": 0,
"weekdays": [
4
]
}
'import requests
url = "https://{tenant}.stamp.eu/rest/surcharge_rules"
payload = {
"name": "<string>",
"compensation_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"time_from": "<string>",
"time_to": "<string>",
"rate_value": 1,
"applies_on_holidays": True,
"is_active": True,
"tax_free": True,
"tax_free_max_percent": 499.995,
"only_beyond_planned": True,
"non_cumulative": True,
"priority": 0,
"weekdays": [4]
}
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: '<string>',
compensation_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
time_from: '<string>',
time_to: '<string>',
rate_value: 1,
applies_on_holidays: true,
is_active: true,
tax_free: true,
tax_free_max_percent: 499.995,
only_beyond_planned: true,
non_cumulative: true,
priority: 0,
weekdays: [4]
})
};
fetch('https://{tenant}.stamp.eu/rest/surcharge_rules', 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://{tenant}.stamp.eu/rest/surcharge_rules",
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' => '<string>',
'compensation_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'time_from' => '<string>',
'time_to' => '<string>',
'rate_value' => 1,
'applies_on_holidays' => true,
'is_active' => true,
'tax_free' => true,
'tax_free_max_percent' => 499.995,
'only_beyond_planned' => true,
'non_cumulative' => true,
'priority' => 0,
'weekdays' => [
4
]
]),
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://{tenant}.stamp.eu/rest/surcharge_rules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"compensation_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"time_from\": \"<string>\",\n \"time_to\": \"<string>\",\n \"rate_value\": 1,\n \"applies_on_holidays\": true,\n \"is_active\": true,\n \"tax_free\": true,\n \"tax_free_max_percent\": 499.995,\n \"only_beyond_planned\": true,\n \"non_cumulative\": true,\n \"priority\": 0,\n \"weekdays\": [\n 4\n ]\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://{tenant}.stamp.eu/rest/surcharge_rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"compensation_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"time_from\": \"<string>\",\n \"time_to\": \"<string>\",\n \"rate_value\": 1,\n \"applies_on_holidays\": true,\n \"is_active\": true,\n \"tax_free\": true,\n \"tax_free_max_percent\": 499.995,\n \"only_beyond_planned\": true,\n \"non_cumulative\": true,\n \"priority\": 0,\n \"weekdays\": [\n 4\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.stamp.eu/rest/surcharge_rules")
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\": \"<string>\",\n \"compensation_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"time_from\": \"<string>\",\n \"time_to\": \"<string>\",\n \"rate_value\": 1,\n \"applies_on_holidays\": true,\n \"is_active\": true,\n \"tax_free\": true,\n \"tax_free_max_percent\": 499.995,\n \"only_beyond_planned\": true,\n \"non_cumulative\": true,\n \"priority\": 0,\n \"weekdays\": [\n 4\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"compensation_type_id": "<string>",
"time_from": "<string>",
"time_to": "<string>",
"weekdays": "<string>",
"applies_on_holidays": "<string>",
"rate_type": "<string>",
"rate_value": 123,
"is_active": "<string>",
"tax_free": "<string>",
"tax_free_max_percent": 123,
"only_beyond_planned": "<string>",
"non_cumulative": "<string>",
"priority": "<string>",
"compensation_type": {
"id": "<string>",
"name": "<string>"
}
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
Bearer-Token, erhalten über den Login-Endpunkt (POST /rest/login).
Body
application/json
Maximum string length:
255Available options:
0, 1 Required range:
x >= 0Required range:
0 <= x <= 999.99Required range:
-1000 <= x <= 1000Required range:
1 <= x <= 7Response
SurchargeRuleResource
Show child attributes
Show child attributes
⌘I