Trustly
How to integrate Trustly payments
Accepting payments via Trustly follows the same principle as regular payment through the Web form, but with a few important differences.
Quick Start
For Trustly, you need to specify additional parameters when creating an order — the payment method and customer data.
Creating an Order
The order is created through the standard endpoint, but with additional parameters:
| Parameter | Type | Description |
|---|---|---|
| extraParams | string | Payment method: trustly |
| customer | object | Customer information (required) |
The rest of the request fields are identical to creating a regular order.
How to create orders
extraParams Parameter
Specify the payment method:
| Value | Description |
|---|---|
| trustly | Payment via Trustly |
customer Object
Required fields for customer data:
| Field | Type | Required | Description |
|---|---|---|---|
| firstName | string | ✅ Yes | Customer first name |
| lastName | string | ✅ Yes | Customer last name |
| string | ✅ Yes | Customer email |
The list of required fields may vary depending on your merchant settings. Check the exact requirements with your manager.
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": "1500.00",
"externalId": "order_12345",
"purpose": "Payment for order №12345",
"extraParams": "trustly",
"customer": {
"firstName": "Ivan",
"lastName": "Ivanov",
"email": "customer@example.com"
}
}'Successful Response Example
{
"id": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
"status": "PENDING",
"purpose": "Payment for order №12345",
"amount": "1500.0",
"commission": "1.5",
"received": "1498.5",
"currency": "RUB",
"shopId": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
"terminalId": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
"merchantId": "a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
"externalId": "order_12345",
"paymentLink": "https://example.com/payment?id=a1b2c3d4-e5f6-7g8h-i9j0-k1l2m3n4o5p6",
"successUrl": null,
"payedAt": null,
"updatedAt": "2023-03-21T12:34:56Z",
"createdAt": "2023-03-21T12:34:56Z"
}Redirecting the User
After creating an order, you will receive a paymentLink — a link for payment.
Redirect the user to this link to complete the payment via Trustly.
Recommendations
- Ensure all required
customerfields are filled in correctly - Trustly supports bank transfers from European banks
- Test the integration before launch