curl -X PUT \
/dunning/overdue-rules/{id} \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"daysOverdue": "1",
"dueInDays": "7",
"emailTemplate": {
"subject": "Order confirmation #{{ order.number }}",
"contentHtml": "<h1>Order confirmation<\/h1><p>Thank you for your order.<\/p>"
},
"documentTemplate": {
"title": "Your invoice $invoice.documentId",
"introduction": "Thank you for your order.",
"closing": "Pay this invoice in the next 7 days.",
"information": [
{
"key": "Invoice number",
"value": "$invoice.documentId"
}
]
},
"amountInCents": "100",
"attachOriginalInvoice": "1",
"sendLetter": "",
"isEnabled": "1"
}'import requests
url = "https://coreapi.io/dunning/overdue-rules/{id}"
payload = {
"daysOverdue": 1,
"dueInDays": 7,
"type": "reminder",
"emailTemplate": {
"subject": "Order confirmation #{{ order.number }}",
"contentHtml": "<h1>Order confirmation</h1><p>Thank you for your order.</p>"
},
"documentTemplate": {
"title": "Your invoice $invoice.documentId",
"introduction": "Thank you for your order.",
"closing": "Pay this invoice in the next 7 days.",
"information": [
{
"key": "Invoice number",
"value": "$invoice.documentId"
}
]
},
"amountInCents": 100,
"attachOriginalInvoice": True,
"sendLetter": True,
"isEnabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
daysOverdue: 1,
dueInDays: 7,
type: 'reminder',
emailTemplate: {
subject: 'Order confirmation #{{ order.number }}',
contentHtml: '<h1>Order confirmation</h1><p>Thank you for your order.</p>'
},
documentTemplate: {
title: 'Your invoice $invoice.documentId',
introduction: 'Thank you for your order.',
closing: 'Pay this invoice in the next 7 days.',
information: [{key: 'Invoice number', value: '$invoice.documentId'}]
},
amountInCents: 100,
attachOriginalInvoice: true,
sendLetter: true,
isEnabled: true
})
};
fetch('https://coreapi.io/dunning/overdue-rules/{id}', 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://coreapi.io/dunning/overdue-rules/{id}",
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([
'daysOverdue' => 1,
'dueInDays' => 7,
'type' => 'reminder',
'emailTemplate' => [
'subject' => 'Order confirmation #{{ order.number }}',
'contentHtml' => '<h1>Order confirmation</h1><p>Thank you for your order.</p>'
],
'documentTemplate' => [
'title' => 'Your invoice $invoice.documentId',
'introduction' => 'Thank you for your order.',
'closing' => 'Pay this invoice in the next 7 days.',
'information' => [
[
'key' => 'Invoice number',
'value' => '$invoice.documentId'
]
]
],
'amountInCents' => 100,
'attachOriginalInvoice' => true,
'sendLetter' => true,
'isEnabled' => true
]),
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;
}{
"level": 1,
"daysOverdue": 1,
"dueInDays": 7,
"type": "reminder",
"emailTemplate": {
"name": "Order confirmation",
"description": "Order confirmation for a new order",
"subject": "Order confirmation #{{ order.number }}",
"contentHtml": "<h1>Order confirmation</h1><p>Thank you for your order.</p>",
"contentPlain": "Order confirmation\\n\\nThank you for your order.",
"id": "8d6b0c3e-0b7a-4b0a-8b1a-3b0b8b2d0b0b",
"senderName": "Acme Inc.",
"senderAddress": "noreply@acme.com",
"isSystem": true,
"isEnabled": "true",
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00",
"preHeader": "Your order confirmation",
"versions": [
{
"id": "mltplv_1b2nE1a2b3nF4c5d6e7f8g9h0j",
"version": 1,
"subject": "Hello {{ name }}",
"contentHtml": "<h1>Hello {{ name }}</h1>",
"contentPlain": "Hello {{ name }}",
"preHeader": "Hello {{ name }}",
"createdAt": "2021-01-01T00:00:00+00:00",
"createdBy": "system"
}
],
"currentVersion": {
"id": "mltplv_1b2nE1a2b3nF4c5d6e7f8g9h0j",
"version": 1,
"subject": "Hello {{ name }}",
"contentHtml": "<h1>Hello {{ name }}</h1>",
"contentPlain": "Hello {{ name }}",
"preHeader": "Hello {{ name }}",
"createdAt": "2021-01-01T00:00:00+00:00",
"createdBy": "system"
}
},
"documentTemplate": {
"type": "invoice",
"name": "invoice",
"language": "de",
"title": "Your invoice $invoice.documentId",
"introduction": "Thank you for your order.",
"closing": "Pay this invoice in the next 7 days.",
"id": "00000000-0000-0000-0000-000000000000",
"brandColor": "#000000",
"headerBackgroundColor": "#ffffff",
"logoPosition": "right",
"logoUrl": "base64",
"information": [
{
"key": "Invoice number",
"value": "$invoice.documentId"
}
],
"footer": [
{
"line1": "Company name",
"line2": "Street",
"line3": "City",
"line4": "Country",
"line5": "VAT number"
}
]
},
"id": "ad8f3b1c-4f0e-4b9e-8b0a-0e0e0e0e0e0e",
"amountInCents": 100,
"attachOriginalInvoice": true,
"sendLetter": true,
"isEnabled": true,
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00"
}Update overdue rule
Update overdue rule.
Required permissions:dunning-rule:writecurl -X PUT \
/dunning/overdue-rules/{id} \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"daysOverdue": "1",
"dueInDays": "7",
"emailTemplate": {
"subject": "Order confirmation #{{ order.number }}",
"contentHtml": "<h1>Order confirmation<\/h1><p>Thank you for your order.<\/p>"
},
"documentTemplate": {
"title": "Your invoice $invoice.documentId",
"introduction": "Thank you for your order.",
"closing": "Pay this invoice in the next 7 days.",
"information": [
{
"key": "Invoice number",
"value": "$invoice.documentId"
}
]
},
"amountInCents": "100",
"attachOriginalInvoice": "1",
"sendLetter": "",
"isEnabled": "1"
}'import requests
url = "https://coreapi.io/dunning/overdue-rules/{id}"
payload = {
"daysOverdue": 1,
"dueInDays": 7,
"type": "reminder",
"emailTemplate": {
"subject": "Order confirmation #{{ order.number }}",
"contentHtml": "<h1>Order confirmation</h1><p>Thank you for your order.</p>"
},
"documentTemplate": {
"title": "Your invoice $invoice.documentId",
"introduction": "Thank you for your order.",
"closing": "Pay this invoice in the next 7 days.",
"information": [
{
"key": "Invoice number",
"value": "$invoice.documentId"
}
]
},
"amountInCents": 100,
"attachOriginalInvoice": True,
"sendLetter": True,
"isEnabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
daysOverdue: 1,
dueInDays: 7,
type: 'reminder',
emailTemplate: {
subject: 'Order confirmation #{{ order.number }}',
contentHtml: '<h1>Order confirmation</h1><p>Thank you for your order.</p>'
},
documentTemplate: {
title: 'Your invoice $invoice.documentId',
introduction: 'Thank you for your order.',
closing: 'Pay this invoice in the next 7 days.',
information: [{key: 'Invoice number', value: '$invoice.documentId'}]
},
amountInCents: 100,
attachOriginalInvoice: true,
sendLetter: true,
isEnabled: true
})
};
fetch('https://coreapi.io/dunning/overdue-rules/{id}', 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://coreapi.io/dunning/overdue-rules/{id}",
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([
'daysOverdue' => 1,
'dueInDays' => 7,
'type' => 'reminder',
'emailTemplate' => [
'subject' => 'Order confirmation #{{ order.number }}',
'contentHtml' => '<h1>Order confirmation</h1><p>Thank you for your order.</p>'
],
'documentTemplate' => [
'title' => 'Your invoice $invoice.documentId',
'introduction' => 'Thank you for your order.',
'closing' => 'Pay this invoice in the next 7 days.',
'information' => [
[
'key' => 'Invoice number',
'value' => '$invoice.documentId'
]
]
],
'amountInCents' => 100,
'attachOriginalInvoice' => true,
'sendLetter' => true,
'isEnabled' => true
]),
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;
}{
"level": 1,
"daysOverdue": 1,
"dueInDays": 7,
"type": "reminder",
"emailTemplate": {
"name": "Order confirmation",
"description": "Order confirmation for a new order",
"subject": "Order confirmation #{{ order.number }}",
"contentHtml": "<h1>Order confirmation</h1><p>Thank you for your order.</p>",
"contentPlain": "Order confirmation\\n\\nThank you for your order.",
"id": "8d6b0c3e-0b7a-4b0a-8b1a-3b0b8b2d0b0b",
"senderName": "Acme Inc.",
"senderAddress": "noreply@acme.com",
"isSystem": true,
"isEnabled": "true",
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00",
"preHeader": "Your order confirmation",
"versions": [
{
"id": "mltplv_1b2nE1a2b3nF4c5d6e7f8g9h0j",
"version": 1,
"subject": "Hello {{ name }}",
"contentHtml": "<h1>Hello {{ name }}</h1>",
"contentPlain": "Hello {{ name }}",
"preHeader": "Hello {{ name }}",
"createdAt": "2021-01-01T00:00:00+00:00",
"createdBy": "system"
}
],
"currentVersion": {
"id": "mltplv_1b2nE1a2b3nF4c5d6e7f8g9h0j",
"version": 1,
"subject": "Hello {{ name }}",
"contentHtml": "<h1>Hello {{ name }}</h1>",
"contentPlain": "Hello {{ name }}",
"preHeader": "Hello {{ name }}",
"createdAt": "2021-01-01T00:00:00+00:00",
"createdBy": "system"
}
},
"documentTemplate": {
"type": "invoice",
"name": "invoice",
"language": "de",
"title": "Your invoice $invoice.documentId",
"introduction": "Thank you for your order.",
"closing": "Pay this invoice in the next 7 days.",
"id": "00000000-0000-0000-0000-000000000000",
"brandColor": "#000000",
"headerBackgroundColor": "#ffffff",
"logoPosition": "right",
"logoUrl": "base64",
"information": [
{
"key": "Invoice number",
"value": "$invoice.documentId"
}
],
"footer": [
{
"line1": "Company name",
"line2": "Street",
"line3": "City",
"line4": "Country",
"line5": "VAT number"
}
]
},
"id": "ad8f3b1c-4f0e-4b9e-8b0a-0e0e0e0e0e0e",
"amountInCents": 100,
"attachOriginalInvoice": true,
"sendLetter": true,
"isEnabled": true,
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00"
}Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Pfadparameter
OverdueRule identifier
Body
The updated OverdueRule resource
Days after the invoice or last reminder / dunning is overdue.
1
Number of days until this reminder / dunning should be paid.
7
Type of the overdue rule.
Possible values:
reminder: Send a reminder to the customer.dunning: Send a dunning to the customer.
"reminder"
The email template that is used to send the reminder / dunning.
Show child attributes
Show child attributes
The document template that is used to generate the reminder / dunning. This is required for a dunning and optional for a reminder.
Show child attributes
Show child attributes
Amount in cents that is charged in the currency of the base invoice, for the dunning. This is required for type "dunning".
x >= 0100
Attach the original invoice additionally to the reminder / dunning.
true
Send a letter by mail to the customer.
Enable or disable the overdue rule.
true
Antwort
OverdueRule resource updated
Level of the overdue rule. The level is used to sort the overdue rules. The overdue rule with the lowest level is used first.
x <= 61
Days after the invoice or last reminder / dunning is overdue.
1
Number of days until this reminder / dunning should be paid.
7
Type of the overdue rule.
Possible values:
reminder: Send a reminder to the customer.dunning: Send a dunning to the customer.
"reminder"
The email template that is used to send the reminder / dunning.
Show child attributes
Show child attributes
The document template that is used to generate the reminder / dunning. This is required for a dunning and optional for a reminder.
Show child attributes
Show child attributes
"ad8f3b1c-4f0e-4b9e-8b0a-0e0e0e0e0e0e"
Amount in cents that is charged in the currency of the base invoice, for the dunning. This is required for type "dunning".
x >= 0100
Attach the original invoice additionally to the reminder / dunning.
true
Send a letter by mail to the customer.
Enable or disable the overdue rule.
true
Date and time when the overdue rule was created.
"2021-01-01T00:00:00+00:00"
Date and time when the overdue rule was last updated.
"2021-01-01T00:00:00+00:00"
War diese Seite hilfreich?