curl --request POST \
--url https://api.example.com/v1/payment-links \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": "12.34",
"currency": "EUR",
"description": "Order payment",
"expiresAt": "2023-11-07T05:31:56Z",
"failureUrl": "https://shop.example.com/failure",
"maxUses": 500000.5,
"metadata": {},
"reusable": false,
"successUrl": "https://shop.example.com/success"
}
'import requests
url = "https://api.example.com/v1/payment-links"
payload = {
"amount": "12.34",
"currency": "EUR",
"description": "Order payment",
"expiresAt": "2023-11-07T05:31:56Z",
"failureUrl": "https://shop.example.com/failure",
"maxUses": 500000.5,
"metadata": {},
"reusable": False,
"successUrl": "https://shop.example.com/success"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '12.34',
currency: 'EUR',
description: 'Order payment',
expiresAt: '2023-11-07T05:31:56Z',
failureUrl: 'https://shop.example.com/failure',
maxUses: 500000.5,
metadata: {},
reusable: false,
successUrl: 'https://shop.example.com/success'
})
};
fetch('https://api.example.com/v1/payment-links', 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://api.example.com/v1/payment-links",
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' => '12.34',
'currency' => 'EUR',
'description' => 'Order payment',
'expiresAt' => '2023-11-07T05:31:56Z',
'failureUrl' => 'https://shop.example.com/failure',
'maxUses' => 500000.5,
'metadata' => [
],
'reusable' => false,
'successUrl' => 'https://shop.example.com/success'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payment-links"
payload := strings.NewReader("{\n \"amount\": \"12.34\",\n \"currency\": \"EUR\",\n \"description\": \"Order payment\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"failureUrl\": \"https://shop.example.com/failure\",\n \"maxUses\": 500000.5,\n \"metadata\": {},\n \"reusable\": false,\n \"successUrl\": \"https://shop.example.com/success\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/payment-links")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"12.34\",\n \"currency\": \"EUR\",\n \"description\": \"Order payment\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"failureUrl\": \"https://shop.example.com/failure\",\n \"maxUses\": 500000.5,\n \"metadata\": {},\n \"reusable\": false,\n \"successUrl\": \"https://shop.example.com/success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payment-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"12.34\",\n \"currency\": \"EUR\",\n \"description\": \"Order payment\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"failureUrl\": \"https://shop.example.com/failure\",\n \"maxUses\": 500000.5,\n \"metadata\": {},\n \"reusable\": false,\n \"successUrl\": \"https://shop.example.com/success\"\n}"
response = http.request(request)
puts response.read_body{
"amount": "12.34",
"createdAt": "2026-10-11T10:00:00.000Z",
"currency": "EUR",
"description": "Order payment",
"expired": false,
"expiresAt": "2026-10-18T10:00:00.000Z",
"failureUrl": "https://shop.example.com/failure",
"id": "pl_01j9a6d6dqevssvyw7s97pkrga",
"isActive": true,
"livemode": true,
"maxUses": 1,
"merchantId": "mer_example",
"metadata": {
"cartId": "cart_example"
},
"reusable": false,
"slug": "aBcDeFgHiJkLmNoPqRsTuVwX",
"status": "ACTIVE",
"successUrl": "https://shop.example.com/success",
"url": "https://pay.example.com/l/aBcDeFgHiJkLmNoPqRsTuVwX",
"usesCount": 0
}Create a merchant-scoped payment link
Creates a link in the authenticated API key’s live/test mode that the merchant can share with a buyer. Money is a decimal string in major units within the currency exponent. Idempotency-Key is required: a retry with the same key and body returns the stored answer with Idempotency-Replayed: true.
curl --request POST \
--url https://api.example.com/v1/payment-links \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": "12.34",
"currency": "EUR",
"description": "Order payment",
"expiresAt": "2023-11-07T05:31:56Z",
"failureUrl": "https://shop.example.com/failure",
"maxUses": 500000.5,
"metadata": {},
"reusable": false,
"successUrl": "https://shop.example.com/success"
}
'import requests
url = "https://api.example.com/v1/payment-links"
payload = {
"amount": "12.34",
"currency": "EUR",
"description": "Order payment",
"expiresAt": "2023-11-07T05:31:56Z",
"failureUrl": "https://shop.example.com/failure",
"maxUses": 500000.5,
"metadata": {},
"reusable": False,
"successUrl": "https://shop.example.com/success"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '12.34',
currency: 'EUR',
description: 'Order payment',
expiresAt: '2023-11-07T05:31:56Z',
failureUrl: 'https://shop.example.com/failure',
maxUses: 500000.5,
metadata: {},
reusable: false,
successUrl: 'https://shop.example.com/success'
})
};
fetch('https://api.example.com/v1/payment-links', 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://api.example.com/v1/payment-links",
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' => '12.34',
'currency' => 'EUR',
'description' => 'Order payment',
'expiresAt' => '2023-11-07T05:31:56Z',
'failureUrl' => 'https://shop.example.com/failure',
'maxUses' => 500000.5,
'metadata' => [
],
'reusable' => false,
'successUrl' => 'https://shop.example.com/success'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payment-links"
payload := strings.NewReader("{\n \"amount\": \"12.34\",\n \"currency\": \"EUR\",\n \"description\": \"Order payment\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"failureUrl\": \"https://shop.example.com/failure\",\n \"maxUses\": 500000.5,\n \"metadata\": {},\n \"reusable\": false,\n \"successUrl\": \"https://shop.example.com/success\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/payment-links")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"12.34\",\n \"currency\": \"EUR\",\n \"description\": \"Order payment\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"failureUrl\": \"https://shop.example.com/failure\",\n \"maxUses\": 500000.5,\n \"metadata\": {},\n \"reusable\": false,\n \"successUrl\": \"https://shop.example.com/success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payment-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"12.34\",\n \"currency\": \"EUR\",\n \"description\": \"Order payment\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"failureUrl\": \"https://shop.example.com/failure\",\n \"maxUses\": 500000.5,\n \"metadata\": {},\n \"reusable\": false,\n \"successUrl\": \"https://shop.example.com/success\"\n}"
response = http.request(request)
puts response.read_body{
"amount": "12.34",
"createdAt": "2026-10-11T10:00:00.000Z",
"currency": "EUR",
"description": "Order payment",
"expired": false,
"expiresAt": "2026-10-18T10:00:00.000Z",
"failureUrl": "https://shop.example.com/failure",
"id": "pl_01j9a6d6dqevssvyw7s97pkrga",
"isActive": true,
"livemode": true,
"maxUses": 1,
"merchantId": "mer_example",
"metadata": {
"cartId": "cart_example"
},
"reusable": false,
"slug": "aBcDeFgHiJkLmNoPqRsTuVwX",
"status": "ACTIVE",
"successUrl": "https://shop.example.com/success",
"url": "https://pay.example.com/l/aBcDeFgHiJkLmNoPqRsTuVwX",
"usesCount": 0
}Authorizations
Headers
1–255 printable ASCII characters without spaces. Reuse for retries; replay responses carry Idempotency-Replayed: true.
"0b6f2c1e-4c7a-4a43-9a51-6a4b1d7e9f10"
Body
Positive decimal string in major units, within the currency exponent.
^(0|[1-9]\d{0,19})(\.\d{1,18})?$"12.34"
"EUR"
500"Order payment"
ISO-8601 timestamp with explicit Z or ±hh:mm offset.
2048"https://shop.example.com/failure"
Defaults to 1 for a single-use link; unlimited when reusable and omitted.
1 <= x <= 1000000JSON object, at most 16 KiB.
2048"https://shop.example.com/success"
Response
Link created, or the stored answer for a replayed Idempotency-Key
^(0|[1-9]\d{0,19})(\.\d{1,18})?$"12.34"
"EUR"
"pl_01j9a6d6dqevssvyw7s97pkrga"
The live/test mode inherited from the authenticated API key.
true
^[A-Za-z0-9]{24}$ACTIVE, INACTIVE, EXPIRED, EXHAUSTED Null when hosted checkout is disabled.
"https://pay.example.com/l/aBcDeFgHiJkLmNoPqRsTuVwX"