How to integrate

Sample code for the different integrations are provided below:

You must have the prerequisites in order to use this API.
See prerequisites
💰 Integration Fee
To access and use the API, a one-time integration fee of $16,000 USD is required. This fee covers onboarding, access credentials, and technical support.

Payment Method: Crypto Only

Accepted Coins: USDT, BTC, ETH, USDC
Wallet details provided after request.
Capture
Step 1: API request
PHP
Go
Python
Javascript

How to integrate

Sample code for the different integrations are provided below:

You must have the prerequisites in order to use this API.
See prerequisites
💰 Integration Fee
To access and use the API, a one-time integration fee of $16,000 USD is required.

Payment Method: Crypto Only

Accepted Coins: USDT, BTC, ETH, USDC
Wallet details provided after request.
Capture

Capture completes a previously authorized transaction.

PHP
Python
JavaScript
POST /v1/capture { "transaction_id": "123456", "amount": "100.00", "currency": "USD" }
Refund

Refund returns funds to the customer after a completed transaction.

POST /v1/refund { "transaction_id": "123456", "amount": "50.00" }
Void

Void cancels a transaction before settlement (same-day).

POST /v1/void { "transaction_id": "123456" }
Reversal

Reversal is used to undo a processed transaction.

POST /v1/reversal { "transaction_id": "123456" }
Authorization

Authorization reserves funds without capturing them.

POST /v1/authorize { "amount": "100.00", "card_number": "4111111111111111" }
Webhooks

Receive real-time transaction updates.

{ "event": "payment.success", "amount": "100.00" }

🔗 Direct API Integration

Complete payments within your app context using tokenization and direct API calls. No redirects required.

📖 Overview

RedotPay Connect Direct API enables merchants to process payments directly within their application context. This integration retrieves payment information (URL/QR Code) directly via API calls without redirecting users away from your platform.

Primary Use Cases: H5/Web/App embedded payments, DApp wallet integrations, QR code payments

đŸŽ¯ Key Features

  • Tokenized payment processing
  • QR Code / Deep Link payments
  • Real-time status updates
  • Server-to-server callbacks
  • Multiple currency support

🔄 Integration Flows

Two primary flows: H5/Web/App Flow (redirect to payment page) and DApp Flow (embedded QR/DeepLink).

🌐 H5/Web/App Flow

```mermaid sequenceDiagram autonumber actor User as User box Merchant Side #f9f9f9 participant App as Merchant Web participant Backend as Merchant Server end box RedotPay Connect #e1f5fe participant API as Open-API participant SDK as Payment Page end rect rgb(245, 255, 250) note over User, Backend: Phase 1: User Places Order User->>App: 1. User Place an Order App->>Backend: 2. Submit Order Information Backend->>Backend: 3. Create Merchant Order end rect rgb(240, 248, 255) note over Backend, API: Phase 2: Payment Order Creation Backend->>API: 4. Create Payment Order (/openapi/v2/order/create) API->>Backend: 5. Return Payment Order SN & Payment link end rect rgb(255, 250, 240) note over App, User: Phase 3: Payment Execution Backend->>App: 6. Return Payment Order SN & Payment link App->>SDK: 7. Redirecting To Payment Page SDK->>User: 8. Display Payment Interface User->>SDK: 9. Complete Payment SDK-->>App: 10. Return To Merchant end rect rgb(255, 245, 238) note over API, Backend: Phase 4: Payment Result API-->>Backend: 11. Payment Result Callback end text

📱 DApp Flow

text sequenceDiagram autonumber actor User as User box Merchant Side #f9f9f9 participant App as Merchant Web participant Backend as Merchant Server end box RedotPay Connect #e1f5fe participant API as Open-API participant DApp as RedotPay App end rect rgb(245, 255, 250) note over User, Backend: Phase 1: User Places Order User->>App: 1. User Places an Order App->>Backend: 2. Submit Order Information Backend->>Backend: 3. Create Merchant Order end rect rgb(240, 248, 255) note over Backend, API: Phase 2: Payment Order Creation Backend->>API: 4. Create Payment Order (/openapi/v2/order/create) API-->>Backend: 5. Return Payment SN + Payment Methods end alt manual = true Backend->>API: 6. Get Payment Methods (/openapi/v2/order/payment-method) API-->>Backend: 7. Return Payment Info (Url/QRCode) else manual = false Backend->>App: 6. Return Payment Info (From Create Order) end rect rgb(255, 250, 240) note over App, User: Phase 4: Payment Execution App->>User: 9. Display QR Code OR Deeplink Button User->>DApp: 10. Open DApp (Scan QR or Deeplink) User->>DApp: 11. Complete Payment end rect rgb(255, 245, 238) note over API, Backend: Phase 5: Payment Result API-->>Backend: 12. Payment Result Callback end text

🔌 API Endpoints

Method Endpoint Description Parameters
POST /openapi/v2/order/create Create Payment Order merchant_code, amount, currency, ref_no
GET /openapi/v2/order/payment-method Get Payment Methods order_sn
GET /openapi/v2/order/{sn} Query Order Status order_sn

đŸ’ģ Code Examples

Create Payment Order

curl -X POST https://api.redotpay.com/openapi/v2/order/create \
-H "Content-Type: application/json"
-H "Authorization: Bearer YOUR_MERCHANT_KEY"
-d '{
"merchant_code": "ID00001",
"amount": 300000,
"currency": "USD",
"ref_no": "ORD123456",
"callback_url": "https://yourapp.com/callback",
"manual": false
}'

Response:

{
"code": 0,
"data": {
"order_sn": "SN20260318123456789",
"payment_url": "https://pay.redotpay.com/...",
"manual": false,
"expire_time": 3600
}
}
text

Get Payment Methods (Manual Flow)

curl -X GET "https://api.redotpay.com/openapi/v2/order/payment-method?order_sn=SN20260318123456789" \
-H "Authorization: Bearer YOUR_MERCHANT_KEY"
text

🔔 Server Callbacks

RedotPay will POST payment results to your callback URL:

{
"order_sn": "SN20260318123456789",
"merchant_order_sn": "ORD123456",
"status": "paid",
"amount": 300000,
"currency": "USD",
"signature": "hmachmac_signature_here"
}

Required Response: HTTP 200 with "SUCCESS"

text

🔐 Signature Verification

Verify callback signatures using HMAC-SHA256 with your secret key:

concat = secret_key + merchant_code + order_sn + ref_no + amount + currency + status
signature = HMAC_SHA256(concat, secret_key)
if received_signature == signature: ✅ Valid

Example: secretID00001SN123ORD456300000USDpaid

text