curl --request POST \
--url https://api.stage.rocka.live/api/payments/short-links \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Order #123",
"paymentDescription": "Payment for order #123",
"amount": 174,
"paymentId": "order123-customer11",
"currency": "EUR",
"webhookUrl": "https://example.com/webhookUrl",
"returnUrl": "https://example.com/returnUrl",
"expiryDate": "2026-08-11T05:31:56.000Z"
}
'import requests
url = "https://api.stage.rocka.live/api/payments/short-links"
payload = {
"name": "Order #123",
"paymentDescription": "Payment for order #123",
"amount": 174,
"paymentId": "order123-customer11",
"currency": "EUR",
"webhookUrl": "https://example.com/webhookUrl",
"returnUrl": "https://example.com/returnUrl",
"expiryDate": "2026-08-11T05:31:56.000Z"
}
headers = {
"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: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Order #123',
paymentDescription: 'Payment for order #123',
amount: 174,
paymentId: 'order123-customer11',
currency: 'EUR',
webhookUrl: 'https://example.com/webhookUrl',
returnUrl: 'https://example.com/returnUrl',
expiryDate: '2026-08-11T05:31:56.000Z'
})
};
fetch('https://api.stage.rocka.live/api/payments/short-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.stage.rocka.live/api/payments/short-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([
'name' => 'Order #123',
'paymentDescription' => 'Payment for order #123',
'amount' => 174,
'paymentId' => 'order123-customer11',
'currency' => 'EUR',
'webhookUrl' => 'https://example.com/webhookUrl',
'returnUrl' => 'https://example.com/returnUrl',
'expiryDate' => '2026-08-11T05:31:56.000Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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.stage.rocka.live/api/payments/short-links"
payload := strings.NewReader("{\n \"name\": \"Order #123\",\n \"paymentDescription\": \"Payment for order #123\",\n \"amount\": 174,\n \"paymentId\": \"order123-customer11\",\n \"currency\": \"EUR\",\n \"webhookUrl\": \"https://example.com/webhookUrl\",\n \"returnUrl\": \"https://example.com/returnUrl\",\n \"expiryDate\": \"2026-08-11T05:31:56.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.stage.rocka.live/api/payments/short-links")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Order #123\",\n \"paymentDescription\": \"Payment for order #123\",\n \"amount\": 174,\n \"paymentId\": \"order123-customer11\",\n \"currency\": \"EUR\",\n \"webhookUrl\": \"https://example.com/webhookUrl\",\n \"returnUrl\": \"https://example.com/returnUrl\",\n \"expiryDate\": \"2026-08-11T05:31:56.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stage.rocka.live/api/payments/short-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Order #123\",\n \"paymentDescription\": \"Payment for order #123\",\n \"amount\": 174,\n \"paymentId\": \"order123-customer11\",\n \"currency\": \"EUR\",\n \"webhookUrl\": \"https://example.com/webhookUrl\",\n \"returnUrl\": \"https://example.com/returnUrl\",\n \"expiryDate\": \"2026-08-11T05:31:56.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "IrXEFonH1a",
"name": "Order #123",
"paymentDescription": "Payment for order #123",
"amount": 174,
"currency": "EUR",
"isActive": true,
"createdDate": "2026-05-08T11:34:34.1096921Z",
"shortLinkUrls": {
"shortLink": "https://stage.nd.link/IrXEFonH1a",
"qrCodeLink": "https://stage.nd.link/IrXEFonH1a?qr"
},
"expiryDate": "2026-06-07T11:34:28.0289266Z"
}Create a payment link
curl --request POST \
--url https://api.stage.rocka.live/api/payments/short-links \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Order #123",
"paymentDescription": "Payment for order #123",
"amount": 174,
"paymentId": "order123-customer11",
"currency": "EUR",
"webhookUrl": "https://example.com/webhookUrl",
"returnUrl": "https://example.com/returnUrl",
"expiryDate": "2026-08-11T05:31:56.000Z"
}
'import requests
url = "https://api.stage.rocka.live/api/payments/short-links"
payload = {
"name": "Order #123",
"paymentDescription": "Payment for order #123",
"amount": 174,
"paymentId": "order123-customer11",
"currency": "EUR",
"webhookUrl": "https://example.com/webhookUrl",
"returnUrl": "https://example.com/returnUrl",
"expiryDate": "2026-08-11T05:31:56.000Z"
}
headers = {
"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: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Order #123',
paymentDescription: 'Payment for order #123',
amount: 174,
paymentId: 'order123-customer11',
currency: 'EUR',
webhookUrl: 'https://example.com/webhookUrl',
returnUrl: 'https://example.com/returnUrl',
expiryDate: '2026-08-11T05:31:56.000Z'
})
};
fetch('https://api.stage.rocka.live/api/payments/short-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.stage.rocka.live/api/payments/short-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([
'name' => 'Order #123',
'paymentDescription' => 'Payment for order #123',
'amount' => 174,
'paymentId' => 'order123-customer11',
'currency' => 'EUR',
'webhookUrl' => 'https://example.com/webhookUrl',
'returnUrl' => 'https://example.com/returnUrl',
'expiryDate' => '2026-08-11T05:31:56.000Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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.stage.rocka.live/api/payments/short-links"
payload := strings.NewReader("{\n \"name\": \"Order #123\",\n \"paymentDescription\": \"Payment for order #123\",\n \"amount\": 174,\n \"paymentId\": \"order123-customer11\",\n \"currency\": \"EUR\",\n \"webhookUrl\": \"https://example.com/webhookUrl\",\n \"returnUrl\": \"https://example.com/returnUrl\",\n \"expiryDate\": \"2026-08-11T05:31:56.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.stage.rocka.live/api/payments/short-links")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Order #123\",\n \"paymentDescription\": \"Payment for order #123\",\n \"amount\": 174,\n \"paymentId\": \"order123-customer11\",\n \"currency\": \"EUR\",\n \"webhookUrl\": \"https://example.com/webhookUrl\",\n \"returnUrl\": \"https://example.com/returnUrl\",\n \"expiryDate\": \"2026-08-11T05:31:56.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stage.rocka.live/api/payments/short-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Order #123\",\n \"paymentDescription\": \"Payment for order #123\",\n \"amount\": 174,\n \"paymentId\": \"order123-customer11\",\n \"currency\": \"EUR\",\n \"webhookUrl\": \"https://example.com/webhookUrl\",\n \"returnUrl\": \"https://example.com/returnUrl\",\n \"expiryDate\": \"2026-08-11T05:31:56.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "IrXEFonH1a",
"name": "Order #123",
"paymentDescription": "Payment for order #123",
"amount": 174,
"currency": "EUR",
"isActive": true,
"createdDate": "2026-05-08T11:34:34.1096921Z",
"shortLinkUrls": {
"shortLink": "https://stage.nd.link/IrXEFonH1a",
"qrCodeLink": "https://stage.nd.link/IrXEFonH1a?qr"
},
"expiryDate": "2026-06-07T11:34:28.0289266Z"
}Authorizations
Body
Link name. Your link will appear under this name in the Payment Links section in your Rocka Hub. Up to 100 symbols.
Payment description that your customer will see in the checkout form. Up to 255 symbols.
Payment amount.
This payment's identifier in your system. If you provide it, it'll be included in the webhook Rocka sends once the payment is completed.
Payment currency. For example, EUR.
Rocka sends a webhook to this URL whenever the payment's status changes.
The URL the customer is redirected to once the payment is completed.
This link's expiry date. By default, it'll expire in 30 days.
Response
This link's unique identifier.
Link name.
Payment description.
Payment amount.
Payment currency.
Link status, either active or not.
Link creation timestamp.
Show child attributes
Show child attributes
Link expiration date. By default, links expire in 30 days.
Was this page helpful?