Payment links
Create a secure, branded Cardencer payment page with one API call and share the link by email, SMS or chat.
A payment link is a Cardencer-hosted payment page for one payment. Create it with the API, send the URL to your customer, and they pay by card, Apple Pay or Google Pay. No frontend code needed.
Typical uses:
- invoices and quotes sent by email,
- orders taken by phone or chat,
- social commerce and marketing campaigns,
- reminders for unpaid orders, or an alternative to cash on delivery.
Create a payment link#
Create a payment with "payment_link": true. A payment link cannot be confirmed at creation, so do not send "confirm": true.
curl https://sandbox.cardencer.com/payments \
-H "api-key: $CARDENCER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 12000,
"currency": "EUR",
"payment_link": true,
"profile_id": "pro_REPLACE_WITH_YOUR_PROFILE_ID",
"description": "Invoice 2026-118",
"return_url": "https://example.com/thanks",
"session_expiry": 86400
}'const payment = await fetch("https://sandbox.cardencer.com/payments", {
method: "POST",
headers: { "api-key": process.env.CARDENCER_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
amount: 12000,
currency: "EUR",
payment_link: true,
profile_id: process.env.CARDENCER_PROFILE_ID,
description: "Invoice 2026-118",
return_url: "https://example.com/thanks",
session_expiry: 86400,
}),
}).then((r) => r.json());
console.log(payment.payment_link.link);payment = requests.post(
"https://sandbox.cardencer.com/payments",
headers={"api-key": os.environ["CARDENCER_API_KEY"]},
json={
"amount": 12000,
"currency": "EUR",
"payment_link": True,
"profile_id": os.environ["CARDENCER_PROFILE_ID"],
"description": "Invoice 2026-118",
"return_url": "https://example.com/thanks",
"session_expiry": 86400,
},
).json()
print(payment["payment_link"]["link"])The response contains a payment_link object. Send payment_link.link to your customer. Cardencer does not send emails or SMS for you; use your own mail or messaging provider.
Expiry#
A link is valid for 15 minutes by default. Set session_expiry in seconds to extend it, up to 7,890,000 seconds (about 3 months). Once the link expires, create a new payment.
Customise the page#
Pass payment_link_config when you create the link:
{
"amount": 12000,
"currency": "EUR",
"payment_link": true,
"profile_id": "pro_REPLACE_WITH_YOUR_PROFILE_ID",
"payment_link_config": {
"theme": "#4E6ADD",
"logo": "https://example.com/logo.png",
"seller_name": "Atelier Martin",
"sdk_layout": "accordion",
"display_sdk_only": false,
"show_card_form_by_default": true,
"payment_button_text": "Pay invoice",
"transaction_details": [
{ "key": "Invoice", "value": "2026-118", "ui_configuration": { "position": 1, "is_key_bold": true } },
{ "key": "Due date", "value": "30 Nov 2026" }
]
}
}| Field | Effect |
|---|---|
theme |
Primary colour, as a hex value. |
logo |
URL of the logo shown in the details section. |
seller_name |
Your business name in the details section. |
transaction_details |
Key/value rows in the details section, ordered by ui_configuration.position. |
sdk_layout |
Payment form layout: accordion or tabs. |
display_sdk_only |
Show only the payment form, without the details section. |
show_card_form_by_default |
Open the card form directly. |
hide_card_nickname_field |
Hide the card nickname input. |
payment_button_text |
Text of the pay button. |
Track the payment#
A payment link is a normal payment. Follow it with webhooks (payment_succeeded, payment_failed) or retrieve it with GET /payments/{payment_id}. Refunds work the same as for any other payment.