Skip to main content
POST
/
api
/
payments
Create a payment
curl --request POST \
  --url https://api.stage.rocka.live/api/payments \
  --header 'Content-Type: application/*+json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "amount": 1.24,
  "currency": "EUR",
  "customerId": "CID-012456789-1",
  "description": "Order 1234-DS-1234",
  "shopId": "d0c3ccd9-162c-497e-808b-e769aea89c58",
  "paymentId": "119318-123-test-1423",
  "returnUrl": "https://example.com/returnUrl"
}
'
{
  "id": "31739456-be7a-4ed5-bb47-1076247235c7",
  "url": "https://checkout.rocka.live/?id=31739456-be7a-4ed5-bb47-1076247235c7&token=v4.local.8f-oWexxulzmRG4lriUJ1IZuKJsV_kBd9WDufvxBlYMiJZ1-losr11ZY0mDsO_sUFOfY8KLTsFd4Xig9vSxGXfU-Su0o05pcJTJs3f0V4sWjB8nCST3VrBnLUcoIxh8v9XuZnF6tylaK7qJCEr6f2dqMzphJxPaUBNEu1EcxgyEexbU3foC3j6IfJs4vZEvTgaCeqxOu1NYKjptr1ACDQB_fBymZyINyNKfWdEDMUdT-3YJpAkuiDW7y0eeaD-bH6_Q7VHw7KyiTIET3JBUf94uZSNXqcpOkuHJ_dkZGFnExF8FzWoHNev8GHVPXMeygyANlfbrBfcQG8iF3nolXSp_VaFkhmeStRS0kQ05XSofVS6OOO6WGvpdGELXF9FVgMka_m3S4TyQVMYpJK42U4tzsXpMwOjg70eW_TQ&country=EU&info_isNew=true",
  "qrCode": null,
  "token": "v4.local.8f-oWexxulzmRG4lriUJ1IZuKJsV_kBd9WDufvxBlYMiJZ1-losr11ZY0mDsO_sUFOfY8KLTsFd4Xig9vSxGXfU-Su0o05pcJTJs3f0V4sWjB8nCST3VrBnLUcoIxh8v9XuZnF6tylaK7qJCEr6f2dqMzphJxPaUBNEu1EcxgyEexbU3foC3j6IfJs4vZEvTgaCeqxOu1NYKjptr1ACDQB_fBymZyINyNKfWdEDMUdT-3YJpAkuiDW7y0eeaD-bH6_Q7VHw7KyiTIET3JBUf94uZSNXqcpOkuHJ_dkZGFnExF8FzWoHNev8GHVPXMeygyANlfbrBfcQG8iF3nolXSp_VaFkhmeStRS0kQ05XSofVS6OOO6WGvpdGELXF9FVgMka_m3S4TyQVMYpJK42U4tzsXpMwOjg70eW_TQ",
  "threeDsData": null,
  "status": "New"
}

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

Information for the new payment creation.

amount
number<decimal>
required

Payment amount in decimal format (e.g. 999.99).

currency
enum<string>
required

Payment currency. Currently accepted: {EUR, BGN, BRL, CAD, DKK, HUF, NOK, RON, SEK}.

Available options:
EUR,
BGN,
BRL,
CAD,
DKK,
HUF,
NOK,
RON,
SEK
returnUrl
string
required

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

paymentId
string
required

Order identifier in your records.

description
string
required

Short payment description for the customer.

customerId
string
required

Customer's unique identifier in your records.

webhookUrl
string

Rocka will send payment status updates to this URL.

shopId
string

Your website's identifier in Rocka's records. This parameter is useful if you have more than one website.

email
string

Customer's email address.

providerId
string

If you include this parameter, the payment will be initiated directly through this provider, skipping Rocka's payment form.

ipAddress
string

Customer's IP Address.

iban
string

Customer's IBAN.

merchantBankReference
string

Bank reference for this payment, with a space.

Example:

"864abc4d12648 IN"

Response

id
string

The payment's ID.

url
string

The link to the payment.