Skip to main content

IDRX API - IDR Onramp/Offramp Integration

The IDRX API provides comprehensive IDR onramp and offramp functionality for Indonesian market, enabling seamless conversion between Indonesian Rupiah (IDR) and digital currencies (IDRX/USDC). Built with BRDZ platform branding for enterprise-grade operations with automated payment processing, bank account management, and real-time transaction tracking.

🎯 What Can You Manage?

Your complete IDR payment gateway ecosystem with these powerful tools:

  • Onramp Operations: Convert IDR → IDRX/USDC via payment gateway (QRIS, Virtual Account, E-Wallet)
  • Offramp Operations: Convert IDRX → IDR to bank account with automated processing
  • Bank Management: Multi-bank account registration and management for withdrawals
  • Transaction Tracking: Real-time mint and redeem transaction history with status monitoring
  • Admin Operations: Refund processing for failed transactions (admin-only)
  • Payment Methods: Live payment method options with dynamic fee structures
  • Fee Information: Transparent fee calculation for all operations (onramp, offramp, refund)

🧩 Your Payment Building Blocks

💰 Onramp Blocks (IDR → Digital Currency)

  • POST /api/idrx/onramp/initiate - Create payment request
  • GET /api/idrx/onramp/status/:reference_id - Track payment status

💸 Offramp Blocks (Digital Currency → IDR)

  • POST /api/idrx/offramp/initiate - Create withdrawal request
  • GET /api/idrx/offramp/status/:reference_id - Track withdrawal status

🏦 Bank Management Blocks

  • POST /api/idrx/banks/add - Register bank account
  • GET /api/idrx/banks/list - Get all bank accounts
  • DELETE /api/idrx/banks/:bank_id - Remove bank account

📊 Transaction History Blocks

  • GET /api/idrx/transactions/mint - Onramp transaction history
  • GET /api/idrx/transactions/redeem - Offramp transaction history

🔧 Admin Operations Blocks

  • POST /api/idrx/admin/refund - Process refund (admin only)

⚙️ Utility Blocks

  • GET /api/idrx/payment-methods - Get available payment methods
  • GET /api/idrx/fees - Get fee information

🔐 Authentication

All IDRX endpoints require authentication with JWT token and API key.

Required Headers

Authorization: Bearer YOUR_JWT_TOKEN
x-api-key: YOUR_API_KEY
Content-Type: application/json

Getting JWT Token

First, login to get JWT token:

curl -X POST https://api.brdz.link/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"usernameoremail": "user@example.com",
"password": "your_password"
}'

Response:

{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user_id": 123,
"role": "user"
}

Auth Levels

  • User/Admin - Most endpoints require authMiddleware(['user', 'admin'])
  • Admin Only - Refund endpoint requires authMiddleware(['admin'])
  • No Auth - Callback endpoints (called by external payment providers)

💰 Onramp Operations (IDR → Digital Currency)

Initiate Onramp

POST/api/idrx/onramp/initiate

Initiate Onramp Request

Create payment request to convert IDR to IDRX/USDC. User pays via payment gateway (QRIS, Virtual Account, or E-Wallet), and receives digital currency in their wallet after payment confirmation. Supports multiple payment methods with different fee structures.

Parameters

amountnumberrequired

Amount in IDR (minimum 20,000, maximum 100,000,000)

paymentMethodstringrequired

Payment method: QRIS, VA (Virtual Account), or EWALLET

walletAddressstringrequired

Destination wallet address (0x... for EVM chains)

Request Body

{
  "amount": 100000,
  "paymentMethod": "VA",
  "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}

Response

200Payment request created successfully
{
  "success": true,
  "data": {
    "referenceId": "MINT-1705308000000-123",
    "amount": 100000,
    "fee": 3000,
    "totalAmount": 103000,
    "paymentMethod": "VA",
    "paymentUrl": "https://payment.provider.com/pay/abc123",
    "status": "PENDING",
    "expiresAt": "2025-01-16T10:00:00Z"
  },
  "message": "Payment request created successfully. Please complete the payment to receive your funds."
}
400Invalid request or amount out of range
{
  "success": false,
  "error": "Amount must be between Rp 20,000 and Rp 100,000,000"
}
401Authentication failed
{
  "success": false,
  "error": "Authentication required"
}
500Failed to process request
{
  "success": false,
  "error": "Failed to process payment request. Please try again."
}
curl -X POST https://api.brdz.link/api/idrx/onramp/initiate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "amount": 100000,
  "paymentMethod": "VA",
  "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}'

Get Onramp Status

GET/api/idrx/onramp/status/:reference_id

Get Onramp Transaction Status

Track onramp transaction status by reference ID. Monitor payment confirmation, minting process, and final completion. Status flows: PENDING → PAID → MINTED → SUCCESS.

Parameters

reference_idstringrequired

Transaction reference ID from initiate response (e.g., MINT-1705308000000-123)

Response

200Transaction status retrieved successfully
{
  "success": true,
  "data": {
    "referenceId": "MINT-1705308000000-123",
    "amount": 100000,
    "fee": 3000,
    "status": "SUCCESS",
    "paymentStatus": "PAID",
    "createdAt": "2025-01-15T10:00:00Z",
    "expiresAt": "2025-01-16T10:00:00Z"
  }
}
404Transaction not found
{
  "success": false,
  "error": "Transaction not found"
}
500Failed to retrieve status
{
  "success": false,
  "error": "Failed to retrieve transaction status"
}
curl -X GET https://api.brdz.link/api/idrx/onramp/status/MINT-1705308000000-123 \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

💸 Offramp Operations (Digital Currency → IDR)

Initiate Offramp

POST/api/idrx/offramp/initiate

Initiate Offramp Request

Create withdrawal request to convert IDRX to IDR and send to bank account. User must first burn IDRX tokens on blockchain, then provide burn transaction hash to initiate offramp. IDR will be transferred to registered bank account within 24 hours.

Parameters

burnTxHashstringrequired

Burn transaction hash from blockchain

amountnumberrequired

Amount in IDRX to redeem (minimum 20,000)

bankIdnumberrequired

Bank account ID from user's registered banks

walletAddressstringrequired

Wallet address that performed the burn

Request Body

{
  "burnTxHash": "0xa38c057222872d8e3d106ab5f9b86b7d1d6ade72d485eb01366650e45c8a65d1",
  "amount": 100000,
  "bankId": 1,
  "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}

Response

200Withdrawal request submitted successfully
{
  "success": true,
  "data": {
    "referenceId": "REDEEM-1705308000000-123",
    "amount": 100000,
    "fee": 5000,
    "netAmount": 95000,
    "bankAccount": {
      "bankName": "BANK CENTRAL ASIA",
      "accountNumber": "1234567890",
      "accountName": "JOHN SMITH"
    },
    "status": "PENDING"
  },
  "message": "Withdrawal request submitted successfully. Funds will be transferred to your bank account within 24 hours."
}
400Invalid request or burn transaction
{
  "success": false,
  "error": "Invalid burn transaction hash or amount mismatch"
}
404Bank account not found
{
  "success": false,
  "error": "Bank account not found or inactive"
}
500Failed to process withdrawal
{
  "success": false,
  "error": "Failed to process withdrawal request. Please try again."
}
curl -X POST https://api.brdz.link/api/idrx/offramp/initiate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "burnTxHash": "0xa38c057222872d8e3d106ab5f9b86b7d1d6ade72d485eb01366650e45c8a65d1",
  "amount": 100000,
  "bankId": 1,
  "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}'

Get Offramp Status

GET/api/idrx/offramp/status/:reference_id

Get Offramp Transaction Status

Track offramp transaction status by reference ID. Monitor withdrawal processing and bank transfer confirmation. Status flows: PENDING → PROCESSING → COMPLETED.

Parameters

reference_idstringrequired

Transaction reference ID (e.g., REDEEM-1705308000000-123)

Response

200Transaction status retrieved successfully
{
  "success": true,
  "data": {
    "referenceId": "REDEEM-1705308000000-123",
    "amount": 100000,
    "fee": 5000,
    "netAmount": 95000,
    "status": "COMPLETED",
    "bankTransferStatus": "SUCCESS",
    "createdAt": "2025-01-15T10:00:00Z"
  }
}
404Transaction not found
{
  "success": false,
  "error": "Transaction not found"
}
500Failed to retrieve status
{
  "success": false,
  "error": "Failed to retrieve transaction status"
}
curl -X GET https://api.brdz.link/api/idrx/offramp/status/REDEEM-1705308000000-123 \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

🏦 Bank Account Management

Add Bank Account

POST/api/idrx/banks/add

Add Bank Account

Register bank account for offramp withdrawals. Users can add multiple bank accounts and set one as primary. Bank account name must match user's registered name for security compliance.

Parameters

bankNamestringrequired

Bank name (e.g., 'BANK CENTRAL ASIA')

bankCodestringrequired

Bank code (e.g., '014' for BCA)

accountNumberstringrequired

Bank account number

accountNamestringrequired

Account holder name (must match user's name)

isPrimaryboolean

Set as primary account (default: false)

Request Body

{
  "bankName": "BANK CENTRAL ASIA",
  "bankCode": "014",
  "accountNumber": "1234567890",
  "accountName": "JOHN SMITH",
  "isPrimary": true
}

Response

200Bank account added successfully
{
  "success": true,
  "data": {
    "idrx_bank_id": 1,
    "bank_name": "BANK CENTRAL ASIA",
    "bank_code": "014",
    "bank_account_number": "1234567890",
    "bank_account_name": "JOHN SMITH",
    "is_primary": true,
    "status": "ACTIVE"
  },
  "message": "Bank account added successfully"
}
400Invalid bank information
{
  "success": false,
  "error": "Missing required fields: bankName, bankCode, accountNumber, accountName"
}
500Failed to add bank account
{
  "success": false,
  "error": "Failed to add bank account"
}
curl -X POST https://api.brdz.link/api/idrx/banks/add \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "bankName": "BANK CENTRAL ASIA",
  "bankCode": "014",
  "accountNumber": "1234567890",
  "accountName": "JOHN SMITH",
  "isPrimary": true
}'

List Bank Accounts

GET/api/idrx/banks/list

Get User's Bank Accounts

Retrieve all active bank accounts for the authenticated user. Returns list of registered banks with primary account indicator.

Response

200Bank accounts retrieved successfully
{
  "success": true,
  "data": [
    {
      "idrx_bank_id": 1,
      "bank_name": "BANK CENTRAL ASIA",
      "bank_code": "014",
      "bank_account_number": "1234567890",
      "bank_account_name": "JOHN SMITH",
      "is_primary": true,
      "status": "ACTIVE",
      "created_at": "2025-01-15T10:00:00Z"
    },
    {
      "idrx_bank_id": 2,
      "bank_name": "BANK MANDIRI",
      "bank_code": "008",
      "bank_account_number": "9876543210",
      "bank_account_name": "JOHN SMITH",
      "is_primary": false,
      "status": "ACTIVE",
      "created_at": "2025-01-14T09:00:00Z"
    }
  ]
}
500Failed to retrieve bank accounts
{
  "success": false,
  "error": "Failed to retrieve bank accounts"
}
curl -X GET https://api.brdz.link/api/idrx/banks/list \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

Delete Bank Account

DELETE/api/idrx/banks/:bank_id

Delete Bank Account

Soft delete (deactivate) a bank account. Account is marked as inactive but not permanently removed. Cannot delete if it's the only bank account or if there are pending transactions.

Parameters

bank_idnumberrequired

Bank account ID to delete

Response

200Bank account deleted successfully
{
  "success": true,
  "message": "Bank account deleted successfully"
}
400Cannot delete bank account
{
  "success": false,
  "error": "Cannot delete primary bank or last remaining bank"
}
500Failed to delete bank account
{
  "success": false,
  "error": "Failed to delete bank account"
}
curl -X DELETE https://api.brdz.link/api/idrx/banks/2 \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

📊 Transaction History

Get Mint Transactions

GET/api/idrx/transactions/mint

Get Mint (Onramp) Transaction History

Retrieve user's mint transaction history with pagination and status filtering. Returns list of all onramp transactions with amounts, fees, payment methods, and current status.

Parameters

statusstring

Filter by status: PENDING, PAID, MINTED, SUCCESS, FAILED

pagenumber

Page number (default: 1)

limitnumber

Items per page (default: 10)

Response

200Mint transactions retrieved successfully
{
  "success": true,
  "data": [
    {
      "reference_id": "MINT-1705308000000-123",
      "amount_idr": 100000,
      "amount_idrx": 100000,
      "fee_amount": 3000,
      "total_amount_idr": 103000,
      "payment_method": "VA",
      "status": "SUCCESS",
      "payment_status": "PAID",
      "created_at": "2025-01-15T10:00:00Z",
      "expired_at": "2025-01-16T10:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 1
  }
}
500Failed to retrieve transaction history
{
  "success": false,
  "error": "Failed to retrieve transaction history"
}
curl -X GET "https://api.brdz.link/api/idrx/transactions/mint?status=SUCCESS&page=1&limit=10" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

Get Redeem Transactions

GET/api/idrx/transactions/redeem

Get Redeem (Offramp) Transaction History

Retrieve user's redeem transaction history with pagination and status filtering. Returns list of all offramp transactions with amounts, fees, bank details, and current status.

Parameters

statusstring

Filter by status: PENDING, PROCESSING, COMPLETED, FAILED

pagenumber

Page number (default: 1)

limitnumber

Items per page (default: 10)

Response

200Redeem transactions retrieved successfully
{
  "success": true,
  "data": [
    {
      "reference_id": "REDEEM-1705308000000-123",
      "amount_idrx": 100000,
      "amount_idr": 100000,
      "fee_amount": 5000,
      "net_amount_idr": 95000,
      "bank_name": "BANK CENTRAL ASIA",
      "bank_account_number": "1234567890",
      "status": "COMPLETED",
      "bank_transfer_status": "SUCCESS",
      "created_at": "2025-01-15T10:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 1
  }
}
500Failed to retrieve transaction history
{
  "success": false,
  "error": "Failed to retrieve transaction history"
}
curl -X GET "https://api.brdz.link/api/idrx/transactions/redeem?status=COMPLETED&page=1&limit=10" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

🔧 Admin Operations

Process Admin Refund

POST/api/idrx/admin/refund

Process Refund (Admin Only)

Process refund for failed mint or redeem transaction. Refunds user's funds minus refund fee. Admin-only operation for handling transaction failures or disputes. Refund fee structure: Rp 5,000 (base) + applicable redeem fee.

Parameters

transactionTypestringrequired

Transaction type: MINT or REDEEM

transactionIdnumberrequired

Original transaction ID (mint_id or redeem_id)

reasonstringrequired

Refund reason for audit trail

Request Body

{
  "transactionType": "MINT",
  "transactionId": 123,
  "reason": "Payment received but minting failed due to technical error"
}

Response

200Refund processed successfully
{
  "success": true,
  "data": {
    "refundTransactionId": "REFUND-1705308000000-123",
    "netRefund": 90000,
    "refundFee": 10000,
    "message": "Refund processed successfully"
  },
  "message": "Refund processed successfully"
}
400Invalid request or transaction not eligible
{
  "success": false,
  "error": "Missing required fields: transactionType, transactionId, reason"
}
401Unauthorized - Admin only
{
  "success": false,
  "error": "Admin access required"
}
500Failed to process refund
{
  "success": false,
  "error": "Failed to process refund"
}
curl -X POST https://api.brdz.link/api/idrx/admin/refund \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ADMIN_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "transactionType": "MINT",
  "transactionId": 123,
  "reason": "Payment received but minting failed due to technical error"
}'

⚙️ Utility Operations

Get Payment Methods

GET/api/idrx/payment-methods

Get Available Payment Methods

Fetch live payment methods with current fee structures. Returns list of supported payment methods (QRIS, Virtual Account, E-Wallet) with fees and descriptions. Useful for displaying payment options to users.

Response

200Payment methods retrieved successfully
{
  "success": true,
  "data": [
    {
      "method": "QRIS",
      "name": "QRIS",
      "fee": 0,
      "fee_type": "FIXED",
      "description": "Pay with any QRIS-enabled app"
    },
    {
      "method": "VA",
      "name": "Virtual Account",
      "fee": 3000,
      "fee_type": "FIXED",
      "description": "Bank transfer via Virtual Account"
    },
    {
      "method": "EWALLET",
      "name": "E-Wallet",
      "fee": 1.67,
      "fee_type": "PERCENTAGE",
      "description": "GoPay, OVO, DANA, ShopeePay"
    }
  ],
  "source": "LIVE"
}
500Failed to retrieve payment methods
{
  "success": false,
  "error": "Failed to retrieve payment methods"
}
curl -X GET https://api.brdz.link/api/idrx/payment-methods \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

Get Fee Information

GET/api/idrx/fees

Get Fee Information

Fetch comprehensive fee information for all operations (mint, redeem, refund, bridge). Returns detailed fee structures, thresholds, and processing times. Query specific fee type or get all fees.

Parameters

typestring

Fee type: MINT, REDEEM, REFUND, or BRIDGE (optional, query parameter)

Response

200Fee information retrieved successfully
{
  "success": true,
  "data": {
    "mint": {
      "operation": "Mint (Onramp)",
      "methods": [
        {
          "method": "QRIS",
          "fee": "Rp 0 (FREE)",
          "description": "All QRIS payments"
        },
        {
          "method": "Virtual Account",
          "fee": "Rp 3,000",
          "description": "Flat fee for all banks"
        },
        {
          "method": "E-Wallet",
          "fee": "1.67%",
          "description": "GoPay, OVO, DANA, ShopeePay"
        }
      ],
      "processingTime": "Max 24 hours",
      "autoCancel": "After 24 hours if not paid"
    },
    "redeem": {
      "operation": "Redeem (Offramp)",
      "fees": [
        {
          "range": "≤ Rp 250,000,000",
          "fee": "Rp 5,000",
          "processingTime": "Real-time"
        },
        {
          "range": "> Rp 250,000,000 - Rp 1,000,000,000",
          "fee": "Rp 35,000",
          "processingTime": "Office hours only"
        }
      ],
      "maxProcessingTime": "Max 24 hours to bank account"
    },
    "refund": {
      "operation": "Refund (Admin only)",
      "formula": "Rp 5,000 (base) + Redeem Fee",
      "examples": [
        {
          "amount": "Rp 100,000",
          "calculation": "Rp 5,000 + Rp 5,000 = Rp 10,000",
          "netRefund": "Rp 90,000"
        }
      ],
      "note": "Refund must be requested through admin"
    },
    "bridge": {
      "operation": "Bridge (Cross-chain)",
      "fee": "10,000 IDRX",
      "description": "Fixed fee for cross-chain bridge operations"
    }
  }
}
500Failed to retrieve fee information
{
  "success": false,
  "error": "Failed to retrieve fee information"
}
# Get all fees
curl -X GET https://api.brdz.link/api/idrx/fees \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

# Get specific fee type
curl -X GET "https://api.brdz.link/api/idrx/fees?type=MINT" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

🔄 Complete Flow Examples

Example 1: Complete Onramp Flow

// Step 1: Get available payment methods
const methodsResponse = await fetch('https://api.brdz.link/api/idrx/payment-methods', {
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'x-api-key': 'YOUR_API_KEY'
}
});
const methods = await methodsResponse.json();
console.log('Available methods:', methods.data);

// Step 2: Initiate onramp
const onrampResponse = await fetch('https://api.brdz.link/api/idrx/onramp/initiate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
amount: 100000,
paymentMethod: 'VA',
walletAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
})
});
const onramp = await onrampResponse.json();

console.log('Reference ID:', onramp.data.referenceId);
console.log('Payment URL:', onramp.data.paymentUrl);

// Step 3: User pays via payment URL
window.open(onramp.data.paymentUrl, '_blank');

// Step 4: Monitor status
const referenceId = onramp.data.referenceId;

const checkStatus = setInterval(async () => {
const statusResponse = await fetch(
`https://api.brdz.link/api/idrx/onramp/status/${referenceId}`,
{
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'x-api-key': 'YOUR_API_KEY'
}
}
);

const status = await statusResponse.json();
console.log('Status:', status.data.status);

if (status.data.status === 'SUCCESS') {
console.log('✅ Payment completed!');
clearInterval(checkStatus);
} else if (status.data.status === 'FAILED') {
console.log('❌ Payment failed');
clearInterval(checkStatus);
}
}, 5000);

Example 2: Complete Offramp Flow

// Step 1: Get user's banks
const banksResponse = await fetch('https://api.brdz.link/api/idrx/banks/list', {
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'x-api-key': 'YOUR_API_KEY'
}
});
const banks = await banksResponse.json();

// If no banks, add one first
if (banks.data.length === 0) {
const addBankResponse = await fetch('https://api.brdz.link/api/idrx/banks/add', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
bankName: 'BANK CENTRAL ASIA',
bankCode: '014',
accountNumber: '1234567890',
accountName: 'JOHN SMITH',
isPrimary: true
})
});
const newBank = await addBankResponse.json();
console.log('Bank added:', newBank.data);
}

// Step 2: Burn IDRX on blockchain (using Web3/ethers)
// ... perform burn transaction on blockchain ...
const burnTxHash = '0xa38c057222872d8e3d106ab5f9b86b7d1d6ade72d485eb01366650e45c8a65d1';

// Step 3: Initiate offramp
const primaryBank = banks.data.find(b => b.is_primary);

const offrampResponse = await fetch('https://api.brdz.link/api/idrx/offramp/initiate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
burnTxHash: burnTxHash,
amount: 100000,
bankId: primaryBank.idrx_bank_id,
walletAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
})
});
const offramp = await offrampResponse.json();

console.log('Reference ID:', offramp.data.referenceId);
console.log('Net to Bank:', offramp.data.netAmount);

// Step 4: Monitor status
const checkOfframpStatus = setInterval(async () => {
const statusResponse = await fetch(
`https://api.brdz.link/api/idrx/offramp/status/${offramp.data.referenceId}`,
{
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'x-api-key': 'YOUR_API_KEY'
}
}
);

const status = await statusResponse.json();
console.log('Status:', status.data.status);

if (status.data.status === 'COMPLETED') {
console.log('✅ IDR transferred to bank!');
clearInterval(checkOfframpStatus);
}
}, 10000);

📊 Database Schema Reference

idrx_mint_transactions Table

- mint_id (serial primary key)
- user_id (integer)
- wallet_id (integer)
- reference_id (varchar) - MINT-{timestamp}-{user_id}
- amount_idr (decimal)
- amount_idrx (decimal)
- fee_amount (decimal)
- total_amount_idr (decimal)
- payment_method (varchar) - QRIS, VA, EWALLET
- status (varchar) - PENDING, PAID, MINTED, SUCCESS, FAILED
- payment_status (varchar)
- wallet_address (varchar)
- network_chain_id (varchar)
- external_payment_id (varchar)
- payment_url (text)
- expired_at (timestamp)
- created_at (timestamp)
- updated_at (timestamp)

idrx_redeem_transactions Table

- redeem_id (serial primary key)
- user_id (integer)
- wallet_id (integer)
- idrx_bank_id (integer)
- reference_id (varchar) - REDEEM-{timestamp}-{user_id}
- burn_tx_hash (varchar)
- wallet_address (varchar)
- network_chain_id (varchar)
- amount_idrx (decimal)
- amount_idr (decimal)
- fee_amount (decimal)
- net_amount_idr (decimal)
- bank_account_hash (varchar)
- status (varchar) - PENDING, PROCESSING, COMPLETED, FAILED
- bank_transfer_status (varchar)
- created_at (timestamp)
- updated_at (timestamp)

idrx_user_banks Table

- idrx_bank_id (serial primary key)
- user_id (integer)
- bank_name (varchar)
- bank_code (varchar)
- bank_account_number (varchar)
- bank_account_name (varchar)
- is_primary (boolean)
- status (varchar) - ACTIVE, INACTIVE
- created_at (timestamp)
- updated_at (timestamp)

🌍 Supported Features

Payment Methods

  • QRIS - Free, instant QR code payment
  • Virtual Account - Rp 3,000 flat fee, all major banks
  • E-Wallet - 1.67% fee, GoPay/OVO/DANA/ShopeePay

Transaction Limits

  • Minimum: Rp 20,000
  • Maximum: Rp 100,000,000 (auto-processed)
  • Above Maximum: Requires manual approval

Processing Times

  • Onramp: Up to 24 hours (typically 1-6 hours)
  • Offramp: Up to 24 hours for bank transfer
  • Payment Expiry: 24 hours from creation

Fee Structure

  • Onramp Fees: Varies by payment method (0% - 1.67%)
  • Offramp Fees: Rp 5,000 - Rp 35,000 based on amount
  • Refund Fees: Rp 5,000 + applicable redeem fee

⚠️ Important Notes

Payment Expiry

Payment requests expire after 24 hours. If payment is not completed within this time, users must create a new onramp request.

Bank Account Name

For security and compliance, bank account holder name must match the user's registered name in the system.

Processing Time

Both onramp and offramp operations are processed asynchronously. Use status endpoints to track progress. Bank transfers may take up to 24 hours.

Burn Transaction

For offramp, users must first burn IDRX on blockchain and wait for transaction confirmation before initiating offramp request. Unconfirmed burns will be rejected.

Refunds

Refunds are admin-only operations and include a refund fee. Users should contact support for refund requests.


🚨 Troubleshooting

Common Errors

ErrorCauseSolution
Amount must be between Rp 20,000 and Rp 100,000,000Amount outside valid rangeCheck amount is within limits
Bank account not foundUser hasn't registered bankAdd bank account first via /banks/add
Invalid burn transaction hashBurn transaction not confirmedWait for blockchain confirmation
Transaction expiredPayment not completed in 24 hoursCreate new onramp request
Authentication requiredMissing or invalid JWT tokenLogin and provide valid token
API key is missingMissing x-api-key headerAdd API key to headers

💬 Support

For technical support or issues: