Payment Docs
Basics

Create payment

Create an order and redirect the payer to the hosted payment page

A payment starts with an order. You create it with one request, receive a paymentLink, and redirect the payer to it. The payment page handles the rest.

Requests are signed with the X-Api-Token header, see Authorization.

Endpoint

POST /v1/orders

Request parameters

FieldTypeRequiredDescription
amountstring (decimal)✅ YesOrder amount
currencystringDepends on the terminalOrder currency (ISO 4217). Required for multi-currency terminals
serviceIdinteger✅ Yes, for new accountsService to process the payment through
externalIdstring / null❌ NoOrder ID in your system. Returned in webhooks; use it to match records
externalUserIdstring / null❌ No (required by some methods)User ID in your system
isFeeOnUserboolean❌ NoPass the fee on to the payer
purposestring / null❌ NoPayment purpose shown to the payer
successUrlstring / null❌ No (if set in settings)Redirect URL after a successful payment
failUrlstring / null❌ NoRedirect URL after a failed payment
callbackUrlstring / null❌ NoWebhook URL for this order. When omitted, the address from merchant settings is used

Method-specific objects

Some countries and payment methods require additional data about the payer or the payment method. These are passed in the same request as extra fields:

FieldTypeUsed for
customerobjectPayer details: name, email, phone, country, document. Required by most local methods
extraParamsstringSelects a specific payment method on the terminal, for example Apple Pay or Trustly
cardobjectCard details for direct card payments

The exact set of required fields depends on the country and the method. Find your case in Payments by country or Payment methods.

Request example

curl -X POST "https://api.riopay.online/v1/orders" \
  -H "Content-Type: application/json" \
  -H "X-Api-Token: YOUR_API_TOKEN" \
  -d '{
    "amount": "1000.50",
    "serviceId": 3,
    "externalId": "order_1234",
    "externalUserId": "user_987",
    "isFeeOnUser": true,
    "purpose": "Payment for order #1234",
    "successUrl": "https://example.com/success",
    "failUrl": "https://example.com/fail",
    "callbackUrl": "https://example.com/webhooks/payments"
  }'

Response

A successful request returns the order object. The same object is returned by the status endpoint and sent in webhooks.

{
  "id": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
  "status": "CREATED",
  "statusMessage": "Ok",
  "purpose": "Payment for order #1234",
  "amount": "1000.5",
  "commission": "1.5",
  "received": "999.0",
  "currency": "EUR",
  "paymentType": null,
  "shopId": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
  "terminalId": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
  "merchantId": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
  "externalId": "order_1234",
  "externalUserId": "user_987",
  "paymentLink": "https://example.com/payment?id=a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
  "successUrl": "https://example.com/success",
  "failUrl": "https://example.com/fail",
  "callbackUrl": "https://example.com/webhook",
  "metadata": null,
  "fingerprint": null,
  "ipAddress": null,
  "gatewayTransactionId": null,
  "payedAt": null,
  "updatedAt": "2023-03-21T12:34:56Z",
  "createdAt": "2023-03-21T12:34:56Z"
}

Order object fields

FieldTypeDescription
idstring (UUID)Order ID in our system. Use it to check the status
statusstringCurrent order status, see Order statuses
statusMessagestring / nullHuman-readable status details
purposestring / nullPayment purpose
amountstringOrder amount
commissionstring / nullFee charged for the order
receivedstring / nullAmount credited to your balance
currencystringOrder currency (ISO 4217)
paymentTypestring / nullPayment method used by the payer
shopIdstring (UUID)Shop ID
terminalIdstring (UUID)Terminal the order is processed through
merchantIdstring (UUID)Your merchant ID
externalIdstring / nullOrder ID in your system (the value you passed)
externalUserIdstring / nullUser ID in your system (the value you passed)
paymentLinkstringLink to the payment page. Redirect the payer to it
successUrlstring / nullRedirect URL after a successful payment
failUrlstring / nullRedirect URL after a failed payment
callbackUrlstring / nullWebhook URL for this order (null — merchant settings are used)
metadataobject / nullAdditional data
fingerprintstring / nullPayer device fingerprint
ipAddressstring / nullPayer IP address
gatewayTransactionIdstring / nullTransaction ID on the provider side
payedAtstring / nullPayment time (ISO 8601)
createdAtstringCreation time (ISO 8601)
updatedAtstringLast update time (ISO 8601)

Order statuses

StatusFinalDescription
CREATEDNoOrder created, payment link not yet opened
PENDINGNoAwaiting payment
COMPLETEDYesPayment successful, funds received
FAILEDConditionallyPayment error
CANCELEDConditionallyOrder canceled by the system
EXPIREDConditionallyOrder expired before it was paid
BLOCKEDConditionallyTransaction blocked by the bank
REFUNDYesPayment refunded to the payer. Set after COMPLETED
CHARGEBACKYesPayment disputed by the payer and reversed by the bank. Set after COMPLETED

FAILED, CANCELED, EXPIRED and BLOCKED are not strictly final. If the bank confirms the payment later because of an error on its side, the order moves to COMPLETED and the webhook for this change is sent automatically. Be ready to receive COMPLETED for an order you have already marked as unsuccessful.

Some fields may be null depending on the processing stage. Up-to-date request and response schemas are always available in the Swagger documentation (link in the top navigation).

Redirect the payer

Redirect the payer to the paymentLink from the response. After the payment, the payer is sent to successUrl or failUrl.

Do not treat the redirect to successUrl as a payment confirmation. Only the COMPLETED status, received via webhook or the status endpoint, confirms that the funds arrived.

Next steps

On this page