Payment Links
Payment links provide a flexible and convenient way to collect payments from customers. Create a shareable link that customers can use to complete payments at their convenience, making it ideal for various use cases such as invoice payments, donations, subscriptions, or one-time transactions. Under the hood Payment Link is just a link which initiates creation of Payment Orders.
Create Payment Link
To create a payment link, send a POST request to the payment links endpoint: POST /payment-links. Upon successful creation, the API will return a payment link URL that can be shared with customers to complete their payment.
Required Parameters
You should include these parameters in the JWT payload alongside other parameters required for authentication.
- Name
amount- Type
- numeric
- Description
Transaction amount. Must be a positive number. Note: Amount may be optional but requires additional approval.
- Name
currency- Type
- string
- Description
Transaction currency code. Currently supported: EUR.
- Name
country- Type
- string
- Description
Two-letter ISO country code. Currently supported: LT.
- Name
locale- Type
- string
- Description
Language/locale code for payment interface. Currently supported: lt, en.
- Name
purpose- Type
- string
- Description
Payment purpose description. Maximum 120 characters.
- Name
isReusable- Type
- boolean
- Description
Whether the payment link can be reused multiple times. Must be a boolean value.
- Name
expiresAt- Type
- string
- Description
Payment link expiration date and time in ISO8601 format.
Optional Parameters
- Name
clientRedirectUrl- Type
- string
- Description
Callback URL for post-payment customer redirection. Must be a valid URL if provided.
- Name
webhookUrl- Type
- string
- Description
Endpoint URL for receiving payment status notifications. Must be a valid URL if provided. If not provided, webhook notifications will not be sent.
Payload example in JSON
{
"jti": "e.g. 9f3c2a1b7d9e4c51",
"exp": 1718112345,
"accessKey": "your-access-key",
"amount": 100.00,
"currency": "EUR",
"country": "LT",
"locale": "en",
"isReusable": true,
"expiresAt": "2025-02-26T12:00:00Z",
"purpose": "Payment for order #12345",
"clientRedirectUrl": "https://{merchant_domain}/payment/return",
"webhookUrl": "https://{merchant_domain}/api/payment/webhook"
}
Token generation examples
// Generate JWT token for authentication
const jwt = require('jsonwebtoken');
const crypto = require('crypto');
const createPaymentLink = async () => {
const payload = {
jti: crypto.randomBytes(8).toString('hex'),
exp: Math.floor(Date.now() / 1000) + (5 * 60),
accessKey: 'your-access-key',
amount: 100.00,
currency: 'EUR',
country: 'LT',
locale: 'en',
isReusable: true,
expiresAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(), // 30 days from now
purpose: 'Payment for order #12345',
clientRedirectUrl: 'https://{merchant_domain}/payment/return',
webhookUrl: 'https://{merchant_domain}/api/payment/webhook'
};
const token = jwt.sign(payload, secret, { algorithm: 'HS256' });
};
Refer this guide on how to include token to request.
Response Format
The API returns a JSON response containing the payment link details:
{
"uuid": "019744b8-33e1-7350-bef1-1be8b7bda7aa",
"url": "https://mip.urbo.lt/payment-link/019744b8-33e1-7350-bef1-1be8b7bda7aa",
"expiresAt": "2027-01-27T09:50:32.000000Z",
"isReusable": true
}
Payment Link Flow
Link Sharing
Upon receiving the paymentUrl, you can share this link with your customers. They can use this link to complete their payment at any time before the expiresAt date.
Reusable Links
If isReusable is set to true, the same payment link can be used multiple times by different customers or for multiple payments. Perfect for donation collection or payment collection from a group of people.
If set to false, the link can only paid once. Ideal for invoice payments or one time purchases.