Skip to main content
POST
/
api
/
payments
/
short-links
Create payment links
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": "<string>",
  "paymentDescription": "<string>",
  "amount": 123,
  "paymentId": "<string>",
  "currency": "<string>",
  "webhookUrl": "<string>",
  "returnUrl": "<string>",
  "expiryDate": "2023-11-07T05:31:56Z"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "paymentDescription": "<string>",
  "amount": 123,
  "currency": "<string>",
  "isActive": true,
  "createdDate": "2023-11-07T05:31:56Z",
  "shortLinkUrls": {
    "shortLink": "<string>",
    "qrCodeLink": "<string>"
  },
  "expiryDate": "2023-11-07T05:31:56Z"
}

Authorizations

x-api-key
string
header
required

To get your own API keys, go to the Integration tab in your Rocka Hub. Use your test (not live) credentials to make API requests from this form.

Body

application/json
name
string
required

Link name. Your link will appear under this name in the Payment Links section in your Rocka Hub. Up to 100 symbols.

paymentDescription
string
required

Payment description that your customer will see in the checkout form. Up to 255 symbols.

amount
number<decimal>
required

Payment amount.

paymentId
string
required

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.

currency
string
required

Payment currency. For example, EUR.

webhookUrl
string

Rocka sends a webhook to this URL whenever the payment's status changes.

returnUrl
string

The URL the customer is redirected to once the payment is completed.

expiryDate
string<date-time>

This link's expiry date. By default, it'll expire in 30 days.

Response

id
string

This link's unique identifier.

name
string

Link name.

paymentDescription
string

Payment description.

amount
number<decimal>

Payment amount.

currency
string

Payment currency.

isActive
boolean

Link status, either active or not.

createdDate
string<date-time>

Link creation timestamp.

expiryDate
string<date-time>

Link expiration date. By default, links expire in 30 days.