API Integration Для бизнеса

Интегрируйте Romb в вашу платформу, используя наш гибкий и безопасный API. Автоматизируйте платежи, управляйте счетами и масштабируйтесь глобально — всё из вашего бэкенда.

Будь вы маркетплейс, финтех-приложение, SaaS или платформа электронной коммерции — API Romb даёт вам полный контроль: создавать, выставлять, выплачивать и отслеживать транзакции в реальном времени.

Getting Started

1
Register an account

Create your account at https://romb.mx

2
Login to your account

Access your dashboard using your credentials

3
Go to "My Merchants"

Navigate to https://romb.mx/shops/index

4
Create a new merchant

Click "New shop" to create a merchant account

5
Fill in the details

Complete all required fields for your merchant account

6
Get your API credentials

Copy your API token from the shop settings section

API VERIFICATION

All API requests must include authentication headers:

Header Описание Required
X-Uid Your merchant unique identifier Да
X-Public-Key Your public API key Да
X-Private-Key Your private API key Да
Content-Type Must be application/json Да
Accept Must be application/json Да
Headers Example:
X-Uid: ***************************
X-Public-Key: ************************************
X-Private-Key: ************************************
Content-Type: application/json
Accept: application/json

CREATE PAYMENT

POST
https://romb.mx/api/pay/order/create
Parameter Описание Тип
orderNumber Unique payment ID in your system (Required) String
amount Payment amount (Required) Number
description Описание платежа String
currency Currency code (643 for RUB) Number
email Customer email String
phone Customer phone String
cURL Example:
curl --location 'https://romb.mx/api/pay/order/create' \
--header 'X-Uid: ***************************' \
--header 'X-Public-Key: ************************************' \
--header 'X-Private-Key: ************************************' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
    "orderNumber": "E-0061",
    "amount": 289.68,
    "description": "Test Pay",
    "currency": 643,
    "email": "test@example.com",
    "phone": "+71111111111"
}'

Success Response:

{
    "status": "success",
    "data": {
        "orderId": "123456789",
        "formUrl": "https://romb.mx/pay/order/0198212c4-140423-72bf-97da-8b73a3e8401b"
    }
}

Error Response:

{
    "status": "error",
    "error": {
        "code": "validation_error",
        "message": "Invalid email format"
    }
}

CANCEL PAYMENT

POST
https://romb.mx/pay/order/cancel/{orderNumber}

Use this endpoint to cancel a pending payment. The system will send a webhook notification about the cancellation.

Parameter Описание Тип
orderNumber Unique payment ID in your system (URL parameter) String
Webhook Notification:

After successful cancellation, a webhook will be sent with event type: payment_canceled

cURL Example:
curl --location 'https://romb.mx/pay/order/cancel/E-0061' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'

Success Response:

{
    "status": "success",
    "message": "Payment cancelled successfully"
}

Error Response:

{
    "status": "error",
    "message": "Order not found or already processed"
}

PAYMENT FEEDBACK

After successful payment, we will send a POST request to your callback URL with the following JSON data:

Parameter Описание
id Transaction ID in our system
order_id Your order number
amount Payment amount
data Additional payment data
createdDateTime Payment creation time in ISO 8601 format
status Payment status (PAID, WAIT, PENDING, CANCELED)
sign HMAC-SHA256 signature for data verification
Request Example:
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"order_id": "ORDER-12345",
"amount": 100.50,
"data": {
    "customer_email": "customer@example.com",
    "product_id": "PROD-001"
},
"createdDateTime": "2024-01-15T10:30:45+00:00",
"status": "PAID",
"sign": "a7d8f9g0h1i2j3k4l5m6n7o8p9q0r1s2t3u4v5w6x7y8z9"
}
Signature Verification:

To verify the signature, follow these steps:

  1. Remove the sign parameter from received data
  2. Sort all parameters alphabetically by key
  3. Create a string in format: key1=value1&key2=value2
  4. Calculate HMAC-SHA256 using your secret token
  5. Compare with received signature
PHP Verification Example:
function verifySignature($receivedData, $secretToken) {
    $receivedSignature = $receivedData['sign'];
    unset($receivedData['sign']);
    
    ksort($receivedData);
    
    $signatureString = '';
    foreach ($receivedData as $key => $value) {
        if (is_array($value)) {
            $value = json_encode($value, JSON_UNESCAPED_UNICODE);
        }
        $signatureString .= $key . '=' . $value . '&';
    }
    $signatureString = rtrim($signatureString, '&');
    
    $calculatedSignature = hash_hmac('sha256', $signatureString, $secretToken);
    
    return hash_equals($calculatedSignature, $receivedSignature);
}

// Usage
$isValid = verifySignature($_POST, 'your_secret_token');

Ready-to-Use Solutions

Check out our open-source integrations and code samples to get started quickly with Romb API.

Need Custom Integration?

Our technical team is ready to help you implement Romb API into your business workflow.

Email us at api@romb.mx for personalized assistance.