Calculate fees for an invoice
curl --request POST \
--url https://api.tilta.io/v1/invoices/calculate_fees \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"due_at": 1582896122,
"buyer_external_id": "<string>",
"paid_out_at": 1582896122,
"merchant_external_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
due_at: 1582896122,
buyer_external_id: '<string>',
paid_out_at: 1582896122,
merchant_external_id: '<string>'
})
};
fetch('https://api.tilta.io/v1/invoices/calculate_fees', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tilta.io/v1/invoices/calculate_fees"
payload = {
"amount": 123,
"due_at": 1582896122,
"buyer_external_id": "<string>",
"paid_out_at": 1582896122,
"merchant_external_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tilta.io/v1/invoices/calculate_fees",
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([
'amount' => 123,
'due_at' => 1582896122,
'buyer_external_id' => '<string>',
'paid_out_at' => 1582896122,
'merchant_external_id' => '<string>'
]),
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;
}{
"fees": {
"financing": {
"merchant_fee": {
"base_rate": {
"value": 123,
"min": 123,
"max": 123
},
"daily_rate": {
"value": 123,
"min": 123,
"max": 123
},
"total_rate": {
"value": 123,
"min": 123,
"max": 123
},
"tax_rate": {
"value": 123,
"min": 123,
"max": 123
},
"amount": {
"net": {
"value": 123,
"min": 123,
"max": 123
},
"tax": {
"value": 123,
"min": 123,
"max": 123
},
"gross": {
"value": 123,
"min": 123,
"max": 123
}
}
}
},
"insurance": {
"merchant_fee": {
"base_rate": {
"value": 123,
"min": 123,
"max": 123
},
"daily_rate": {
"value": 123,
"min": 123,
"max": 123
},
"total_rate": {
"value": 123,
"min": 123,
"max": 123
},
"tax_rate": {
"value": 123,
"min": 123,
"max": 123
},
"amount": {
"net": {
"value": 123,
"min": 123,
"max": 123
},
"tax": {
"value": 123,
"min": 123,
"max": 123
},
"gross": {
"value": 123,
"min": 123,
"max": 123
}
}
}
},
"collection": {
"merchant_fee": {
"base_rate": {
"value": 123,
"min": 123,
"max": 123
},
"daily_rate": {
"value": 123,
"min": 123,
"max": 123
},
"total_rate": {
"value": 123,
"min": 123,
"max": 123
},
"tax_rate": {
"value": 123,
"min": 123,
"max": 123
},
"amount": {
"net": {
"value": 123,
"min": 123,
"max": 123
},
"tax": {
"value": 123,
"min": 123,
"max": 123
},
"gross": {
"value": 123,
"min": 123,
"max": 123
}
}
}
}
},
"amount": 123,
"due_at": 1582896122,
"buyer_external_id": "<string>",
"merchant_external_id": "<string>",
"paid_out_at": 1582896122
}{
"code": "BAD_REQUEST",
"error": "Request validation failed. 1 issue found.",
"issues": [
{
"code": "INVALID_TYPE",
"path": "body.registered_at",
"message": "Invalid type"
}
]
}{
"error": "Unauthorized",
"code": "UNAUTHORIZED"
}Invoices
Calculate fees
Calculate the exact buyer and merchant fees for a proposed invoice. Use this before capturing financing to show transparent fee amounts at checkout.
POST
/
v1
/
invoices
/
calculate_fees
Calculate fees for an invoice
curl --request POST \
--url https://api.tilta.io/v1/invoices/calculate_fees \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"due_at": 1582896122,
"buyer_external_id": "<string>",
"paid_out_at": 1582896122,
"merchant_external_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
due_at: 1582896122,
buyer_external_id: '<string>',
paid_out_at: 1582896122,
merchant_external_id: '<string>'
})
};
fetch('https://api.tilta.io/v1/invoices/calculate_fees', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tilta.io/v1/invoices/calculate_fees"
payload = {
"amount": 123,
"due_at": 1582896122,
"buyer_external_id": "<string>",
"paid_out_at": 1582896122,
"merchant_external_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tilta.io/v1/invoices/calculate_fees",
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([
'amount' => 123,
'due_at' => 1582896122,
'buyer_external_id' => '<string>',
'paid_out_at' => 1582896122,
'merchant_external_id' => '<string>'
]),
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;
}{
"fees": {
"financing": {
"merchant_fee": {
"base_rate": {
"value": 123,
"min": 123,
"max": 123
},
"daily_rate": {
"value": 123,
"min": 123,
"max": 123
},
"total_rate": {
"value": 123,
"min": 123,
"max": 123
},
"tax_rate": {
"value": 123,
"min": 123,
"max": 123
},
"amount": {
"net": {
"value": 123,
"min": 123,
"max": 123
},
"tax": {
"value": 123,
"min": 123,
"max": 123
},
"gross": {
"value": 123,
"min": 123,
"max": 123
}
}
}
},
"insurance": {
"merchant_fee": {
"base_rate": {
"value": 123,
"min": 123,
"max": 123
},
"daily_rate": {
"value": 123,
"min": 123,
"max": 123
},
"total_rate": {
"value": 123,
"min": 123,
"max": 123
},
"tax_rate": {
"value": 123,
"min": 123,
"max": 123
},
"amount": {
"net": {
"value": 123,
"min": 123,
"max": 123
},
"tax": {
"value": 123,
"min": 123,
"max": 123
},
"gross": {
"value": 123,
"min": 123,
"max": 123
}
}
}
},
"collection": {
"merchant_fee": {
"base_rate": {
"value": 123,
"min": 123,
"max": 123
},
"daily_rate": {
"value": 123,
"min": 123,
"max": 123
},
"total_rate": {
"value": 123,
"min": 123,
"max": 123
},
"tax_rate": {
"value": 123,
"min": 123,
"max": 123
},
"amount": {
"net": {
"value": 123,
"min": 123,
"max": 123
},
"tax": {
"value": 123,
"min": 123,
"max": 123
},
"gross": {
"value": 123,
"min": 123,
"max": 123
}
}
}
}
},
"amount": 123,
"due_at": 1582896122,
"buyer_external_id": "<string>",
"merchant_external_id": "<string>",
"paid_out_at": 1582896122
}{
"code": "BAD_REQUEST",
"error": "Request validation failed. 1 issue found.",
"issues": [
{
"code": "INVALID_TYPE",
"path": "body.registered_at",
"message": "Invalid type"
}
]
}{
"error": "Unauthorized",
"code": "UNAUTHORIZED"
}Before creating an invoice, you can use this endpoint to calculate the precise service fees that would apply to a proposed financing transaction. The fee calculation takes into account the buyer’s credit facility terms, the requested payment term, the invoice amount, and your platform’s configured fee structure. Calling this endpoint at checkout lets you display exact fee amounts to the buyer before they confirm their payment term selection – improving transparency and reducing disputes.
Call this endpoint for each payment term option you display to the buyer at checkout. Showing a breakdown of fees per term
(e.g., “30 days – €5.95 fee / 60 days – €9.50 fee”) helps buyers make informed decisions and reduces post-purchase confusion.
Fee calculations are non-binding estimates based on current configuration. The actual fees applied when you create the invoice
may differ if the buyer’s credit facility terms or your platform’s fee configuration changes between the calculate-fees call
and invoice creation.
Authorizations
Your Tilta API key, sent as Bearer <key>.
Body
application/json
Total amount of the invoice in cents.
Timestamp indicating when the invoice should be paid.
Example:
1582896122
Unique identifier of a related buyer.
Maximum string length:
100Pattern:
^[a-zA-Z0-9-_]+$Timestamp indicating when the invoice is actually paid.
Example:
1582896122
Unique identifier of a merchant. Optional only for Single-merchant platforms.
Maximum string length:
100Pattern:
^[a-zA-Z0-9-_]+$Response
Show child attributes
Show child attributes
Total amount of the invoice in cents.
Timestamp indicating when the invoice should be paid.
Example:
1582896122
Unique identifier of a related buyer.
Maximum string length:
100Pattern:
^[a-zA-Z0-9-_]+$Unique identifier of a related merchant.
Maximum string length:
100Pattern:
^[a-zA-Z0-9-_]+$Timestamp indicating when the invoice is actually paid.
Example:
1582896122