Skip to main content

Payment Links

Generate shareable payment links for flexible payment collection scenarios.

Payment links provide a URL where customers can complete their payment. This guide covers creating and managing payment links.

Overview​

A payment link:

  • Associates with a payment order
  • Generates a checkout URL for customers
  • Has configurable lifetime (expiration)
  • Supports language and payment method customization
Amount Format

All amounts use minor currency units (e.g., cents for EUR), as integers:

  • Request: integer (e.g., 2500 for €25.00) — note this differs from the orders API, which accepts amount as a string.
  • Response: integer (e.g., 2500 for €25.00)

Endpoints​

MethodEndpointDescription
POST/checkout-payment-link/integration/v1/payment-linksCreate a payment link
GET/checkout-payment-link/integration/v1/payment-links/{id}Get a payment link
GET/checkout-payment-link/integration/v1/payment-linksList payment links
PUT/checkout-payment-link/integration/v1/payment-links/{id}Update a payment link
PUT/checkout-payment-link/integration/v1/payment-links/{id}/cancelCancel a payment link
info

You can read a link with GET /payment-links/{id} and list links with GET /payment-links. Links can also be updated (PUT /payment-links/{id}) and canceled (PUT /payment-links/{id}/cancel). Webhooks remain available for state changes (see Webhooks).

Request​

curl -X POST https://api.paysera.com/checkout-payment-link/integration/v1/payment-links \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"order_id": "a6f2b8e3-5e5f-47d9-b13f-87ed2db2938a",
"name": "Order #12345",
"lifetime": 3600,
"experience": {
"language": "en",
"payment_flow": "paysera_checkout"
},
"purchase": {
"amount": 2500
},
"payment_details": {
"key": "swedbank",
"purpose": "Order #12345 - Leather Wallet",
"country_code": "LT"
},
"payer_information": {
"name": "John Doe",
"email": "john.doe@paysera.net"
},
"metadata": {
"referrer": "https://paysera.net"
}
}'

Request Parameters​

ParameterTypeRequiredDescription
order_idUUIDYesThe payment order ID
namestringYesDisplay name for the payment link (max 255 chars)
lifetimeintegerNoLink validity in seconds (default: 259200 = 3 days, 0 = never expire, max: 86313600)
experienceobjectYesPayment experience configuration
experience.languagestringYesUI language code (ISO 639-1, e.g., "en", "lt")
experience.payment_flowstringNoPayment flow: "paysera_checkout" (default) or "direct_payment"
purchaseobjectYesPurchase information
purchase.amountintegerYesAmount in minor units (e.g., 2500 for €25.00)
payment_detailsobjectNoPre-selected payment method configuration
payment_details.keystringNoPayment method key (e.g., "swedbank")
payment_details.purposestringNoPayment purpose description (max 255 chars)
payment_details.country_codestringNoISO 3166-1 alpha-2 country code
payer_informationobjectNoCustomer information
payer_information.namestringNoCustomer name (max 150 chars)
payer_information.emailstringNoCustomer email
metadataobjectNoAdditional key-value metadata

Response​

{
"link_id": "c8d9e0f1-2a3b-4c5d-6e7f-8a9b0c1d2e3f",
"order_id": "a6f2b8e3-5e5f-47d9-b13f-87ed2db2938a",
"payment_URL": "https://api.paysera.com/checkout-payment-link/payment-collection/v1/payment-links/abc123def456GhiJkl_mNOpQrStUvWxYz0123456",
"experience": {
"language": "en",
"payment_flow": "paysera_checkout"
},
"purchase": {
"amount": 2500
},
"payment_details": {
"key": "swedbank",
"purpose": "Order #12345 - Leather Wallet",
"country_code": "LT"
},
"payer_information": {
"name": "John Doe",
"email": "john.doe@paysera.net"
},
"expired_at": 1736436870,
"created_at": 1736433270
}

Response Fields​

FieldTypeDescription
link_idUUIDUnique payment link identifier
order_idUUIDAssociated order identifier
payment_URLstringPayment URL for customer redirect
experienceobjectPayment experience configuration
experience.languagestringUI language code
experience.payment_flowstringPayment flow type
purchaseobjectPurchase information
purchase.amountLongAmount in minor units
payment_detailsobjectPayment details (if provided)
payment_details.keystringPayment method key
payment_details.purposestringPayment purpose
payment_details.country_codestringCountry code
payer_informationobjectPayer information (if provided)
payer_information.namestringPayer name
payer_information.emailstringPayer email
expired_atLongExpiration Unix timestamp (seconds), null if never expires
created_atLongCreation Unix timestamp (seconds)
StatusCodeDescription
ActiveactiveLink is valid and can be used for payment
CompletedcompletedPayment completed successfully via this link
ExpiredexpiredLink has expired (can still complete if payment in-flight)
CanceledcanceledLink was invalidated
No Failed Status

Payment links do not have a failed status. If a payment attempt fails, the link remains active (unless expired or canceled), allowing the customer to retry.

See Payment Statuses Reference for complete status documentation.

Code Examples​

<?php

function createPaymentLink(string $accessToken, string $orderId, array $linkData): array
{
$ch = curl_init('https://api.paysera.com/checkout-payment-link/integration/v1/payment-links');

$payload = [
'order_id' => $orderId,
'name' => $linkData['name'],
'lifetime' => $linkData['lifetime'] ?? 3600,
'experience' => [
'language' => $linkData['language'] ?? 'en',
'payment_flow' => 'paysera_checkout',
],
'purchase' => [
'amount' => $linkData['amount'], // In minor units (cents)
],
];

// Add optional payer information
if (!empty($linkData['payer_email'])) {
$payload['payer_information'] = [
'name' => $linkData['payer_name'] ?? null,
'email' => $linkData['payer_email'],
];
}

// Add pre-selected payment method
if (!empty($linkData['payment_method'])) {
$payload['payment_details'] = [
'key' => $linkData['payment_method'],
'country_code' => $linkData['country_code'] ?? null,
];
}

curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $accessToken,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode !== 201) {
throw new Exception('Failed to create payment link: ' . $response);
}

return json_decode($response, true);
}

// Usage - amount is in minor units (cents)
$link = createPaymentLink($accessToken, $orderId, [
'name' => 'Order #12345',
'amount' => 2500, // €25.00 in cents
'language' => 'en',
'lifetime' => 3600,
'payer_email' => 'customer@paysera.net',
]);

echo "Payment URL: " . $link['payment_URL'];

Pre-selecting Payment Method​

To skip the payment method selection screen, use direct_payment flow with the preferred payment method:

curl -X POST https://api.paysera.com/checkout-payment-link/integration/v1/payment-links \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"order_id": "order-uuid",
"name": "Direct bank payment",
"lifetime": 3600,
"experience": {
"language": "en",
"payment_flow": "direct_payment"
},
"purchase": {
"amount": 2500
},
"payment_details": {
"key": "swedbank",
"country_code": "LT"
}
}'

Getting Available Payment Methods​

To get available payment methods for pre-selection:

curl -X GET "https://api.paysera.com/checkout-project/integration/v1/methods?amount=2500&currency=EUR" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Filtering by amount and currency is optional and only applied when both are provided. There is no country query parameter — supported countries are returned per method in available_countries.

Response includes available methods with their keys:

{
"items": [
{
"key": "swedbank",
"title": "Swedbank",
"description": "Pay via Swedbank online banking.",
"type": "banklink",
"flow": "redirect",
"available_countries": ["LT", "EE"],
"available_currencies": {
"EUR": { "main": true }
}
},
{
"key": "seb",
"title": "SEB",
"type": "banklink",
"flow": "redirect",
"available_countries": ["LT"],
"available_currencies": {
"EUR": { "main": true }
}
}
]
}

See Payment Methods Reference for the full field list.

Error Responses​

Invalid Order​

{
"error": "not_found",
"error_description": "Order not found"
}

Validation Error​

{
"error": "invalid_request",
"error_description": "Validation failed",
"error_properties": {
"purchase.amount": ["Amount should be greater than 0"],
"experience.language": ["Language is required"]
}
}

Authentication Failure​

{
"error": "unauthorized",
"error_description": "Authentication is required to access this resource"
}
GET /checkout-payment-link/integration/v1/payment-links/{id}

Retrieves a single payment link. Expired links are recognised on read and reflected in status.

curl https://api.paysera.com/checkout-payment-link/integration/v1/payment-links/{id} \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response​

{
"id": "c8d9e0f1-2a3b-4c5d-6e7f-8a9b0c1d2e3f",
"order_id": "a6f2b8e3-5e5f-47d9-b13f-87ed2db2938a",
"project_id": "your-project-id",
"name": "Order #12345",
"amount": 2500,
"currency": "EUR",
"language": "en",
"country_code": "LT",
"link": { "url": "https://api.paysera.com/…/payment-links/abc123", "hash": "abc123" },
"preferred_payment_method_key": "swedbank",
"status": "active",
"is_personalized": true,
"expired_at": 1736436870,
"created_at": 1736433270,
"updated_at": 1736433270
}
GET /checkout-payment-link/integration/v1/payment-links

Returns a cursor-paginated list of payment links for your project.

Query Parameters​

ParameterTypeDescription
order_idUUIDFilter by associated order
statusstringComma-separated statuses, e.g. active,expired
cursorstringPagination cursor
limitintegerPage size
PUT /checkout-payment-link/integration/v1/payment-links/{id}

Updates a payment link. This is a full replacement — send all required fields; changes take effect immediately. The full updated payment-link object is returned.

Request Parameters​

ParameterTypeRequiredDescription
namestringYesDisplay name (max 255 chars)
amountintegerYesAmount in minor units (≥ 1)
currencystringYesISO 4217 currency
languagestringYesUI language (ISO 639-1)
payerobjectYes{ name, email }
receiverobjectNo{ name, email }
link_lifetimeintegerNoSeconds; default 259200 (3 days), 0 = never expires (max 86313600)
preferred_payment_method_keystringNoPre-selected payment method
PUT /checkout-payment-link/integration/v1/payment-links/{id}/cancel

Cancels a payment link. The request body is empty; a 200 OK is returned.

Idempotent

Re-cancelling an already-canceled link succeeds. A 409 is returned only if the link has an active payment session in progress.