curl --request POST \
--url https://api.quidkey.com/v1/merchants/{id}/payment-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amount": {
"value": 5000000,
"currency": "<string>"
},
"statement_descriptor": "<string>",
"type": "single_use",
"is_test": false,
"locale": "en",
"success_url": "<string>",
"failure_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.quidkey.com/v1/merchants/{id}/payment-links"
payload = {
"amount": {
"value": 5000000,
"currency": "<string>"
},
"statement_descriptor": "<string>",
"type": "single_use",
"is_test": False,
"locale": "en",
"success_url": "<string>",
"failure_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: {value: 5000000, currency: '<string>'},
statement_descriptor: '<string>',
type: 'single_use',
is_test: false,
locale: 'en',
success_url: '<string>',
failure_url: '<string>',
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.quidkey.com/v1/merchants/{id}/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.quidkey.com/v1/merchants/{id}/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' => [
'value' => 5000000,
'currency' => '<string>'
],
'statement_descriptor' => '<string>',
'type' => 'single_use',
'is_test' => false,
'locale' => 'en',
'success_url' => '<string>',
'failure_url' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.quidkey.com/v1/merchants/{id}/payment-links"
payload := strings.NewReader("{\n \"amount\": {\n \"value\": 5000000,\n \"currency\": \"<string>\"\n },\n \"statement_descriptor\": \"<string>\",\n \"type\": \"single_use\",\n \"is_test\": false,\n \"locale\": \"en\",\n \"success_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.quidkey.com/v1/merchants/{id}/payment-links")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": {\n \"value\": 5000000,\n \"currency\": \"<string>\"\n },\n \"statement_descriptor\": \"<string>\",\n \"type\": \"single_use\",\n \"is_test\": false,\n \"locale\": \"en\",\n \"success_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quidkey.com/v1/merchants/{id}/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["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": {\n \"value\": 5000000,\n \"currency\": \"<string>\"\n },\n \"statement_descriptor\": \"<string>\",\n \"type\": \"single_use\",\n \"is_test\": false,\n \"locale\": \"en\",\n \"success_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"result": {
"_type": "payment_link",
"_uri": "<string>",
"_view": "full",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"merchant": {
"_link": "<string>",
"_type": "merchant",
"id": "<string>"
},
"type": "single_use",
"is_test": true,
"status": "active",
"amount": {
"value": 4503599627370495,
"currency": "<string>"
},
"order": {
"order_id": "<string>"
},
"statement_descriptor": "<string>",
"locale": "<string>",
"success_url": "<string>",
"failure_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"checkout": {
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"qr_code": {
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"view_count": 1,
"first_viewed_at": "2023-11-07T05:31:56Z",
"transactions": {
"_link": "<string>",
"_type": "collection"
}
},
"entities": {},
"not_included": [
{
"link": {
"_link": "<string>",
"_type": "<string>",
"id": "<string>"
},
"reason": "no_permission"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}Create a payment link
Creates a page that takes payment without an integration, by URL or QR code. A retry with the same key answers the link the first one created, checkout and qr_code included. Treat checkout and qr_code as secrets. The page shows the merchant’s name and branding, the amount and the statement descriptor, and it can tell whether an email belongs to a returning customer. Anyone holding the URL can pay, and on a single-use link can start or take over the checkout. No merchant webhook covers a link’s payment transactions, so poll its transactions link for them: GET /merchants/{merchant_id}/transactions?payment_link_id={id}, with is_test=true for a test link.
Credentials: partner, merchant
Permission: payment-links:create
curl --request POST \
--url https://api.quidkey.com/v1/merchants/{id}/payment-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amount": {
"value": 5000000,
"currency": "<string>"
},
"statement_descriptor": "<string>",
"type": "single_use",
"is_test": false,
"locale": "en",
"success_url": "<string>",
"failure_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.quidkey.com/v1/merchants/{id}/payment-links"
payload = {
"amount": {
"value": 5000000,
"currency": "<string>"
},
"statement_descriptor": "<string>",
"type": "single_use",
"is_test": False,
"locale": "en",
"success_url": "<string>",
"failure_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: {value: 5000000, currency: '<string>'},
statement_descriptor: '<string>',
type: 'single_use',
is_test: false,
locale: 'en',
success_url: '<string>',
failure_url: '<string>',
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.quidkey.com/v1/merchants/{id}/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.quidkey.com/v1/merchants/{id}/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' => [
'value' => 5000000,
'currency' => '<string>'
],
'statement_descriptor' => '<string>',
'type' => 'single_use',
'is_test' => false,
'locale' => 'en',
'success_url' => '<string>',
'failure_url' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.quidkey.com/v1/merchants/{id}/payment-links"
payload := strings.NewReader("{\n \"amount\": {\n \"value\": 5000000,\n \"currency\": \"<string>\"\n },\n \"statement_descriptor\": \"<string>\",\n \"type\": \"single_use\",\n \"is_test\": false,\n \"locale\": \"en\",\n \"success_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.quidkey.com/v1/merchants/{id}/payment-links")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": {\n \"value\": 5000000,\n \"currency\": \"<string>\"\n },\n \"statement_descriptor\": \"<string>\",\n \"type\": \"single_use\",\n \"is_test\": false,\n \"locale\": \"en\",\n \"success_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quidkey.com/v1/merchants/{id}/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["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": {\n \"value\": 5000000,\n \"currency\": \"<string>\"\n },\n \"statement_descriptor\": \"<string>\",\n \"type\": \"single_use\",\n \"is_test\": false,\n \"locale\": \"en\",\n \"success_url\": \"<string>\",\n \"failure_url\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"result": {
"_type": "payment_link",
"_uri": "<string>",
"_view": "full",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"merchant": {
"_link": "<string>",
"_type": "merchant",
"id": "<string>"
},
"type": "single_use",
"is_test": true,
"status": "active",
"amount": {
"value": 4503599627370495,
"currency": "<string>"
},
"order": {
"order_id": "<string>"
},
"statement_descriptor": "<string>",
"locale": "<string>",
"success_url": "<string>",
"failure_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"checkout": {
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"qr_code": {
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"view_count": 1,
"first_viewed_at": "2023-11-07T05:31:56Z",
"transactions": {
"_link": "<string>",
"_type": "collection"
}
},
"entities": {},
"not_included": [
{
"link": {
"_link": "<string>",
"_type": "<string>",
"id": "<string>"
},
"reason": "no_permission"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"retryable": true,
"request_id": "<string>"
}
}Authorizations
Headers
1 to 255 printable ASCII characters with no spaces, quotes or backslashes, in double quotes as the IETF draft defines, or without them. We recommend a UUID. Make one for each thing you mean to happen once and store it before you send the request, so a retry after a crash sends the same key. Keys are scoped to your account and the endpoint, not to a token, so a new token or a rotated secret doesn't affect a retry. A partner and its merchant are separate accounts, so the same key sent with each credential starts two requests. Keys are kept for at least 7 days. After that, the same key starts a new request.
1 - 257^(?:([\x21\x23-\x5B\x5D-\x7E]{1,255})|"([\x21\x23-\x5B\x5D-\x7E]{1,255})")$Body
Makes the link's payment transactions test ones. Without it the link is live, which answers LIVE_PAYMENTS_NOT_ALLOWED for a merchant not yet activated. A suspended merchant still gets its live link, whose payment transactions are refused until it can take live payment transactions again.