Payment Docs
H2H Integrations

Cards

Host-to-Host card payment integration

H2H (Host-to-Host) integration allows you to accept payments directly through the API, bypassing the payment form. This gives you full control over the payment process.

Before you start

How to authorize your requests

This integration is not available for all merchants. Check availability with your manager.

Creating an Order

Before sending card data, you need to create an order and get its UUID from the id field.

How to create orders

Sending Card Data

Send card data to the following endpoint:

POST /v1/orders/{orderId}/h2h/card

Request Example

curl -X POST "https://api.riopay.online/v1/orders/{orderId}/h2h/card" \
-H "Content-Type: application/json" \
-H "X-Api-Token: YOUR_API_TOKEN" \
-d '{
  "cardNumber": "4111111111111111",
  "expiryDate": "12/25",
  "cardholderName": "John Doe",
  "cvv": "123"
}'

Request Body

FieldTypeRequiredDescription
cardNumberstring✅ YesCard number
expiryDatestring✅ YesExpiry date (MM/YY)
cardholderNamestring✅ YesCardholder name
cvvstring✅ YesCVV/CVC code

If the response returns order information — the card data is valid and accepted. Now you need to check if SMS code verification is required.


Checking SMS Code Requirement

Check the H2H transaction status:

GET /v1/orders/{orderId}/h2h/status

Request Example

curl -X GET "https://api.riopay.online/v1/orders/{orderId}/h2h/status" \
-H "X-Api-Token: YOUR_API_TOKEN"

Response Example

{
  "isSmsRequired": true,
  "status": "PROCESSING"
}

Response Fields

FieldDescription
isSmsRequiredtrue — SMS code verification is required
statusCurrent H2H transaction status

Sending SMS Code

Sending the code means you are passing the code from the payer's bank SMS to the API. This is NOT sending an SMS to the user!

Send the SMS code to the endpoint:

POST /v1/orders/{orderId}/h2h/code

Request Example

curl -X POST "https://api.riopay.online/v1/orders/{orderId}/h2h/code" \
-H "Content-Type: application/json" \
-H "X-Api-Token: YOUR_API_TOKEN" \
-d '{
  "code": "123456"
}'

Verification Algorithm

  1. Successful response — code accepted, continue checking status
  2. Keep checking H2H transaction status while status = "PROCESSING"
  3. If isSmsRequired becomes true again — code was invalid, request it again

H2H Statuses

H2H transaction statuses are NOT the same as main order statuses. They describe the internal Host-to-Host payment process. Always confirm the final result with the order status and webhook messages.

Monitor both status streams:

  • Poll H2H status (/orders/{orderId}/h2h/status) until terminal state
  • Webhook order events (final payment confirmation)

H2H Status List

StatusDescription
INITIALIZINGH2H is initializing
PROCESSINGH2H is processing (validation, 3-D Secure, anti-fraud, etc.)
SUCCESSH2H stage completed successfully (wait for final order status via webhook)
CANCELLEDH2H payment cancelled
FAILEDH2H failed with error
EXPIREDH2H session expired

Processing Recommendations

  • Poll status while it's INITIALIZING or PROCESSING
  • On SUCCESS — proceed to check final order status and wait for webhook event
  • On terminal CANCELLED, FAILED, EXPIRED — stop polling and record unsuccessful result
  • If status is PROCESSING after sending SMS code, continue waiting; if code is required again (isSmsRequired = true), request it again

Only the order status (via webhook / direct request) finally confirms the funds deduction. SUCCESS status at H2H level is an intermediate success.


Overall H2H Integration Process

Checking Order Status

After the H2H process is complete, check the final order status:

Check Order Status

On this page