Update dunning settings
Replaces the dunning settings of the tenant: the reply-to address, the default dunning schedule, the logo and the primary color of the dunning e-mails, and when they go out. Returns the dunning settings as the fetch of the dunning settings does, with the files that the e-mail of a dunning step can attach.
Requires the role dunning:write.
curl --request PUT \
--url https://api.useaira.com/v1/dunning-schedules/settings \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"replyTo": "financeiro@acme.com",
"defaultDunningScheduleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"logoUrl": "https://acme.com/logo.png",
"primaryColor": "#123ABC"
}
'import requests
url = "https://api.useaira.com/v1/dunning-schedules/settings"
payload = {
"replyTo": "financeiro@acme.com",
"defaultDunningScheduleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"logoUrl": "https://acme.com/logo.png",
"primaryColor": "#123ABC"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
replyTo: 'financeiro@acme.com',
defaultDunningScheduleId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
logoUrl: 'https://acme.com/logo.png',
primaryColor: '#123ABC'
})
};
fetch('https://api.useaira.com/v1/dunning-schedules/settings', 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.useaira.com/v1/dunning-schedules/settings",
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([
'replyTo' => 'financeiro@acme.com',
'defaultDunningScheduleId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'logoUrl' => 'https://acme.com/logo.png',
'primaryColor' => '#123ABC'
]),
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.useaira.com/v1/dunning-schedules/settings"
payload := strings.NewReader("{\n \"replyTo\": \"financeiro@acme.com\",\n \"defaultDunningScheduleId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"logoUrl\": \"https://acme.com/logo.png\",\n \"primaryColor\": \"#123ABC\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.useaira.com/v1/dunning-schedules/settings")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"replyTo\": \"financeiro@acme.com\",\n \"defaultDunningScheduleId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"logoUrl\": \"https://acme.com/logo.png\",\n \"primaryColor\": \"#123ABC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useaira.com/v1/dunning-schedules/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"replyTo\": \"financeiro@acme.com\",\n \"defaultDunningScheduleId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"logoUrl\": \"https://acme.com/logo.png\",\n \"primaryColor\": \"#123ABC\"\n}"
response = http.request(request)
puts response.read_body{
"replyTo": "financeiro@acme.com",
"defaultDunningScheduleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"logoUrl": "https://acme.com/logo.png",
"primaryColor": "#123ABC",
"dispatchWindow": "business_hours",
"attachmentOptions": {
"artifacts": [
{
"type": "default:invoice_pdf",
"label": "Demonstrativo de uso"
}
],
"paymentFiles": true,
"fiscalDocumentFiles": true,
"invoiceAttachmentFiles": true
}
}Body
The dunning settings of the tenant: the reply-to address, the default dunning schedule, the logo and the primary color of the dunning e-mails, and when they go out.
The id of the default dunning schedule, which a customer follows when its creation leaves out the dunning schedule, or null for none. PUT /v1/dunning-schedules/settings refuses an archived dunning schedule, and while the default dunning schedule is archived, a customer whose creation leaves out the dunning schedule follows none.
Response
The dunning settings of the tenant: the reply-to address, the default dunning schedule, the logo and the primary color of the dunning e-mails, and when they go out.
The id of the default dunning schedule, which a customer follows when its creation leaves out the dunning schedule, or null for none. PUT /v1/dunning-schedules/settings refuses an archived dunning schedule, and while the default dunning schedule is archived, a customer whose creation leaves out the dunning schedule follows none.
curl --request PUT \
--url https://api.useaira.com/v1/dunning-schedules/settings \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"replyTo": "financeiro@acme.com",
"defaultDunningScheduleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"logoUrl": "https://acme.com/logo.png",
"primaryColor": "#123ABC"
}
'import requests
url = "https://api.useaira.com/v1/dunning-schedules/settings"
payload = {
"replyTo": "financeiro@acme.com",
"defaultDunningScheduleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"logoUrl": "https://acme.com/logo.png",
"primaryColor": "#123ABC"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
replyTo: 'financeiro@acme.com',
defaultDunningScheduleId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
logoUrl: 'https://acme.com/logo.png',
primaryColor: '#123ABC'
})
};
fetch('https://api.useaira.com/v1/dunning-schedules/settings', 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.useaira.com/v1/dunning-schedules/settings",
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([
'replyTo' => 'financeiro@acme.com',
'defaultDunningScheduleId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'logoUrl' => 'https://acme.com/logo.png',
'primaryColor' => '#123ABC'
]),
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.useaira.com/v1/dunning-schedules/settings"
payload := strings.NewReader("{\n \"replyTo\": \"financeiro@acme.com\",\n \"defaultDunningScheduleId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"logoUrl\": \"https://acme.com/logo.png\",\n \"primaryColor\": \"#123ABC\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.useaira.com/v1/dunning-schedules/settings")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"replyTo\": \"financeiro@acme.com\",\n \"defaultDunningScheduleId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"logoUrl\": \"https://acme.com/logo.png\",\n \"primaryColor\": \"#123ABC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useaira.com/v1/dunning-schedules/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"replyTo\": \"financeiro@acme.com\",\n \"defaultDunningScheduleId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"logoUrl\": \"https://acme.com/logo.png\",\n \"primaryColor\": \"#123ABC\"\n}"
response = http.request(request)
puts response.read_body{
"replyTo": "financeiro@acme.com",
"defaultDunningScheduleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"logoUrl": "https://acme.com/logo.png",
"primaryColor": "#123ABC",
"dispatchWindow": "business_hours",
"attachmentOptions": {
"artifacts": [
{
"type": "default:invoice_pdf",
"label": "Demonstrativo de uso"
}
],
"paymentFiles": true,
"fiscalDocumentFiles": true,
"invoiceAttachmentFiles": true
}
}