Working with payments
Create payment
How to create a payment
Before you start
How to authorize your requests
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| amount | string (decimal) | ✅ Yes | Order amount |
| externalId | string / null | ❌ No | External order ID from merchant (your value) |
| externalUserId | string / null | ❌ No | External user ID from merchant (your value) |
| isFeeOnUser | boolean | ❌ No | Whether to pass the fee to the user |
| purpose | string / null | ❌ No | Payment purpose |
| successUrl | string / null | ❌ No (if set in settings) | URL to redirect user after successful payment |
| failUrl | string / null | ❌ No | URL to redirect user after failed payment |
| callbackUrl | string / null | ❌ No | URL for webhook notifications |
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",
"externalId": "order_1234",
"externalUserId": "user_987",
"isFeeOnUser": true,
"purpose": "Payment for №1234",
"successUrl": "https://example.com/success"
}'Successful Response Example
{
"id": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
"status": "PENDING",
"purpose": "Payment for order #1234",
"amount": "1000.5",
"commission": "1.5",
"received": "999.0",
"currency": "RUB",
"paymentType": "SBP",
"shopId": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
"terminalId": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
"merchantId": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
"externalId": "sesemasese3252362632",
"externalUserId": "user15236236",
"paymentLink": "https://example.com/index.php?route=extension/trip/payments/create?id=a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6&amount=1000&hash=2792ob1jhvyif81bhcvfy8iwbhck",
"successUrl": "https://example.com",
"payedAt": null,
"updatedAt": "2023-03-21T12:34:56Z",
"createdAt": "2023-03-21T12:34:56Z"
}Redirecting the User
After successfully creating an order, you will receive a field:
"paymentLink": "https://example.com/..."You need to redirect the user to this link so they can complete the payment.
Checking Order Status
After payment, you can check the order status in the section:
Check Order Status
Details and up-to-date request/response schemas are available in the RioPay Swagger documentation.