Update invoicing preferences
curl --request POST \
--url http://127.0.0.1:8080/v1/c/preferences/invoicing \
--header 'Content-Type: application/json' \
--header 'wb-key: <api-key>' \
--data '
{
"automatic_payment": true,
"invoice_trigger": "immediate"
}
'import requests
url = "http://127.0.0.1:8080/v1/c/preferences/invoicing"
payload = {
"automatic_payment": True,
"invoice_trigger": "immediate"
}
headers = {
"wb-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'wb-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({automatic_payment: true, invoice_trigger: 'immediate'})
};
fetch('http://127.0.0.1:8080/v1/c/preferences/invoicing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://127.0.0.1:8080/v1/c/preferences/invoicing",
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([
'automatic_payment' => true,
'invoice_trigger' => 'immediate'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"wb-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 := "http://127.0.0.1:8080/v1/c/preferences/invoicing"
payload := strings.NewReader("{\n \"automatic_payment\": true,\n \"invoice_trigger\": \"immediate\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("wb-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("http://127.0.0.1:8080/v1/c/preferences/invoicing")
.header("wb-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"automatic_payment\": true,\n \"invoice_trigger\": \"immediate\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8080/v1/c/preferences/invoicing")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["wb-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"automatic_payment\": true,\n \"invoice_trigger\": \"immediate\"\n}"
response = http.request(request)
puts response.read_bodyInvoices
Configure Global Invoicing Preferences
POST
/
v1
/
c
/
preferences
/
invoicing
Update invoicing preferences
curl --request POST \
--url http://127.0.0.1:8080/v1/c/preferences/invoicing \
--header 'Content-Type: application/json' \
--header 'wb-key: <api-key>' \
--data '
{
"automatic_payment": true,
"invoice_trigger": "immediate"
}
'import requests
url = "http://127.0.0.1:8080/v1/c/preferences/invoicing"
payload = {
"automatic_payment": True,
"invoice_trigger": "immediate"
}
headers = {
"wb-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'wb-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({automatic_payment: true, invoice_trigger: 'immediate'})
};
fetch('http://127.0.0.1:8080/v1/c/preferences/invoicing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://127.0.0.1:8080/v1/c/preferences/invoicing",
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([
'automatic_payment' => true,
'invoice_trigger' => 'immediate'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"wb-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 := "http://127.0.0.1:8080/v1/c/preferences/invoicing"
payload := strings.NewReader("{\n \"automatic_payment\": true,\n \"invoice_trigger\": \"immediate\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("wb-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("http://127.0.0.1:8080/v1/c/preferences/invoicing")
.header("wb-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"automatic_payment\": true,\n \"invoice_trigger\": \"immediate\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8080/v1/c/preferences/invoicing")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["wb-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"automatic_payment\": true,\n \"invoice_trigger\": \"immediate\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
api-keywb_user_cookie
Body
application/json
Configuration of invoicing engine
Empty fields (i.e. as None) won't be changed
Should invoice amount be charged automatically or not
Determines when the due_date of the invoices should be set when created:
- StartOfPeriod - invoices are due at the beginning of the billing period
- EndOfPeriod - invoices are due at the end of the billing period
Available options:
start_of_period, end_of_period Determines when the due_date of the invoices should be set when created:
- StartOfPeriod - invoices are due at the beginning of the billing period
- EndOfPeriod - invoices are due at the end of the billing period
Available options:
start_of_period, end_of_period When the invoices should be created
Note: EveryCycle and Periodic aren't yet supported, they will behave as Manual
Available options:
immediate Determines how usage period should be closed:
- Automatic - usage period will be closed as soon as claim period ends
- Manual - usage period will be open until closed manually
- Delayed - automatic with delay after the claim period ends. Valid delays are 15 minutes, 1 hour, 1 day
Available options:
automatic, manual, 15 minutes, 1 hour, 1 day Response
200
Updated