cURL
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"
}Rules
Update overdue rule
Update overdue rule.
Required permissions:dunning-rule:writePUT
/
dunning
/
overdue-rules
/
{id}
cURL
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"
}Autorisierungen
Body
application/jsontext/html
The updated OverdueRule resource
Antwort
OverdueRule resource updated
War diese Seite hilfreich?