API Documentation
Complete guide to integrating DGS-Pay payment infrastructure
API Authentication
All DGS API endpoints require Bearer Token authentication.
Include your token in the Authorization header for every request.
Authentication Header
Authorization: Bearer YOUR_DGS_API_TOKEN
Content-Type: application/json
Base URL
https://pay.digitalservicescenter.rw/api-v2
Requesting a Token
Use the following endpoint to request a token for sandbox or live environments:
/api/auth/token
| Parameter | Type | Description |
|---|---|---|
account_number |
string | Your DGS-assigned client account number |
client_secret |
string | The secret key for the requested environment.
Sandbox keys start with sk_sandbox_, Live keys start with sk_live_.
|
Notes & Best Practices
- Use the correct environment key:
sk_sandbox_*for testing,sk_live_*for production. - Do not request a new token for every API call. Tokens expire in 10 minutes (600 seconds). Implement token refresh logic.
- Only request a new token when the previous one has expired or been revoked.
- Never expose your secret keys publicly or in client-side code.
Example Request (PHP)
<?php
$data = [
'account_number' => 'ACC-2322-0001',
'client_secret' => 'sk_sandbox_abc123yoursandboxkey'
];
$ch = curl_init('https://pay.digitalservicescenter.rw/api-v2/api/auth/token');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
$tokenData = json_decode($response, true);
if (isset($tokenData['access_token'])) {
$accessToken = $tokenData['access_token'];
echo "Token: " . $accessToken;
} else {
echo "Error: " . ($tokenData['error'] ?? 'Unknown error');
}
?>
Example Request (Node.js)
const fetch = require('node-fetch');
async function getToken() {
const response = await fetch(
'https://pay.digitalservicescenter.rw/api-v2/api/auth/token',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
account_number: 'ACC-2322-0001',
client_secret: 'sk_sandbox_abc123yoursandboxkey'
})
}
);
const data = await response.json();
if (data.access_token) {
console.log('Token:', data.access_token);
} else {
console.log('Error:', data.error || 'Unknown error');
}
}
getToken();
Token Refresh (PHP)
<?php
// Check if token exists and is still valid
$tokenFile = '/path/to/token.json';
$refreshToken = true;
if (file_exists($tokenFile)) {
$saved = json_decode(file_get_contents($tokenFile), true);
if (isset($saved['expires_at']) && time() < $saved['expires_at']) {
$accessToken = $saved['access_token'];
$refreshToken = false;
}
}
if ($refreshToken) {
// Request new token as before
$data = [
'account_number' => 'ACC-2322-0001',
'client_secret' => 'sk_sandbox_abc123yoursandboxkey'
];
$ch = curl_init('https://pay.digitalservicescenter.rw/api-v2/api/auth/token');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
$tokenData = json_decode($response, true);
if (isset($tokenData['access_token'])) {
$accessToken = $tokenData['access_token'];
$tokenData['expires_at'] = time() + 600;
file_put_contents($tokenFile, json_encode($tokenData));
} else {
echo "Error refreshing token: " . ($tokenData['error'] ?? 'Unknown error');
}
}
echo "Current token: $accessToken";
?>
Token Refresh (Node.js)
// Token refresh example
const fs = require('fs');
const fetch = require('node-fetch');
const tokenFile = './token.json';
async function getToken() {
let accessToken;
let refresh = true;
if (fs.existsSync(tokenFile)) {
const saved = JSON.parse(fs.readFileSync(tokenFile));
if (saved.expires_at && Date.now() / 1000 < saved.expires_at) {
accessToken = saved.access_token;
refresh = false;
}
}
if (refresh) {
const response = await fetch(
'https://pay.digitalservicescenter.rw/api-v2/api/auth/token',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
account_number: 'ACC-2322-0001',
client_secret: 'sk_sandbox_abc123yoursandboxkey'
})
}
);
const data = await response.json();
if (data.access_token) {
accessToken = data.access_token;
data.expires_at = Math.floor(Date.now() / 1000) + 600;
fs.writeFileSync(tokenFile, JSON.stringify(data));
} else {
console.log('Error refreshing token:', data.error || 'Unknown error');
}
}
console.log('Current token:', accessToken);
}
getToken();
Available API Codes
PAYIN_MOBILE
Mobile Money Collection
PAYIN_CARD_LOCAL
Local Card Collection
PAYIN_CARD_INTL
International Card Collection
PAYOUT_BANK
Bank Payouts
PAYOUT_MOBILE
Mobile Money Payouts
Create Payment Link
/api-v2/api/create-link
Use this endpoint to generate a unique payment link (and optional QR code) for your customers. The link can handle multiple payment methods such as CARD, MOMO, LOCALCARD, and Airtel Money.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount |
numeric | required | Payment amount |
currency |
string | required | ISO 4217 currency code (e.g., RWF, USD) |
payment_methods |
array[string] | required | Array of allowed payment methods: CARD, MOMO |
description |
string | optional | Payment description |
metadata |
object | optional | Additional info like order_id or custom notes |
Complete Request Example
{
"amount": 150000,
"currency": "RWF",
"payment_methods": ["CARD", "MOMO"],
"description": "Purchase of widgets",
"metadata": {
"order_id": "12345",
"custom_info": "VIP Customer"
}
}
Response Format
Success Response
{
"status": "success",
"message": "Payment link created",
"token": "kjaiudiudhuwiyheniiuweniofebuihfwiuewuwuebfiweuwewe",
"payment_link": "https://pay.digitalservicescenter/pay/kj89j87iukjf874ui87hde87uu87eiu",
"qr_code_url": "https://pay.digitalservicescenter/pay/qr/kj89j87iukjf874ui87hde87uu87eiu.png",
"expires_at": "2026-02-20T12:00:00Z"
}
Error Response
{
"status": "error",
"message": "Invalid payment method or missing parameter",
"errors": {
"payment_methods": "Must include at least one valid payment method: CARD, MOMO"
}
}
Mobile Money API
The Mobile Money API allows you to collect payments from customers across supported African countries using local mobile money providers. Each country supports specific providers and a fixed currency. Using an unsupported provider, country code, or currency will result in a failed transaction.
Supported Countries & Providers
| Country | ISO Code | Country Code | Currency | Supported Providers |
|---|---|---|---|---|
| Rwanda | RW | 250 | RWF | MTN, Airtel |
| Kenya | KE | 254 | KES | Mpesa |
| Uganda | UG | 256 | UGX | MTN, Airtel |
| Tanzania | TZ | 255 | TZS | Airtel, Tigo, Halopesa |
| Ghana | GH | 233 | GHS | MTN, Vodafone, Airtel |
| Nigeria | NG | 234 | NGN | MTN, Airtel, Glo |
| South Africa | ZA | 27 | ZAR | Vodacom, MTN |
Mobile Money is country-specific.
- The
currencymust match the selected country (see table above). - The
providermust be supported in that country. - The
country_codemust be the international dialing code (e.g., 250 for Rwanda). - Using an unsupported provider or currency will result in a failed or refused transaction.
MTN Mobile Money
Leading mobile money provider
Airtel Money
Reliable mobile payments
Other Countries
Refer to the Supported Countries table
Initiate Mobile Money Payment
/api/init_payment
Use this endpoint to collect funds via mobile money. Always provide the correct currency, country code, and provider for successful processing.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| pay_info Object | |||
amount |
numeric | required | Payment amount |
currency |
string | required | ISO 4217 currency code. Must match selected country (e.g., RWF for RW, KES for KE) |
api_code |
string | required | Must be PAYIN_MOBILE |
reference |
string | required | Unique alphanumeric transaction reference |
callback_url |
string | required | HTTPS URL for status updates |
description |
string | optional | Payment description |
| from Object | |||
payment_type |
string | required | Must be mobile_money |
provider |
string | required | Mobile money provider supported in the selected country (see Supported Countries table) |
name |
string | required | Customer full name (2–50 characters, letters, spaces, hyphens, apostrophes allowed) |
email |
string | required | Customer email address |
phone |
string | required | Customer phone number (without country code, use country_code) |
country_code |
string | required | International country code (e.g., 250 for RW) |
Complete Request Example
{
"pay_info": {
"amount": 100,
"currency": "RWF",
"api_code": "PAYIN_MOBILE",
"reference": "MMTEST001",
"callback_url": "https://your-callback.url",
"description": "Test Mobile Money Payment"
},
"from": {
"payment_type": "mobile_money",
"provider": "MTN",
"name": "John Doe",
"email": "john@example.com",
"phone": "782589800",
"country_code": "250"
},
"metadata": {
"order_id": "12345",
"custom_info": "DGS Mobile Money Test"
},
"simulation": {
"context": "auth_pin",
"response": "approved"
}
}
Response Format
Pending/Success Response
{
"status": "pending",
"message": "Charge created",
"code": "02",
"transaction_id": 100,
"tx_ref": "MM1764319676",
"payment_type": "mobile_money",
"amount": 550,
"currency": "RWF",
"customer_id": "cus_haqG7fRTfv",
"reference": "MM1764319676",
"network": "MTN",
"phone_number": "0782589800",
"fee": 39,
"next_action": {
"type": "payment_instruction",
"note": "Please authorise this payment on your mobile device..."
}
}
Error Response
{
"status": "failed",
"message": "Request is not valid",
"code": "10400",
"transaction_id": 95,
"tx_ref": "MM_1764318847",
"payment_type": "mobile_money",
"errors": {
"reference": "must be an alphanumeric string"
}
}
Status Indicators
pending- Awaiting customer authorizationsuccessful- Payment completed successfullyfailed- Validation or API-level failure OR Charge created but refused by the mobile money provider<
Webhook Handling
DGS sends final payment status updates to your configured callback_url. All webhook requests include a HTTP_DGS_WEBHOOK_SECRET header for verification.
Webhook Security
// Example webhook verification
$webhookSecret = $_SERVER['HTTP_DGS_WEBHOOK_SECRET'];
if ($webhookSecret !== 'YOUR_WEBHOOK_SECRET') {
http_response_code(401);
exit('Unauthorized');
}
Always provide at least two characters for any customer name field. Must be between 2 and 50 characters. Allowed characters: letters, spaces, commas (,), periods (.), apostrophes ('), hyphens (-).
Ensure your reference contains only letters and numbers. Must be between 6 and 50 characters. Allowed characters: letters (A-Z, a-z) and numbers (0-9) only.
Card Payments API
Secure card processing with AES-256-CBC encryption, supporting VISA, Mastercard, and local card networks with comprehensive fraud protection.
VISA & Mastercard
Global card networks
AES-256-CBC
Military-grade encryption
3D Secure
Fraud protection
Card Data Encryption & PCI Compliance
DGS-Pay uses a secure, PCI-aligned encryption model similar to Flutterwave and Stripe. Raw card details must never reach the merchant server. All sensitive card data must be encrypted on the client side using the DGS-Pay public key before being sent to any API.
• Never send raw card data to your server
• Never log, store, or inspect card numbers (PAN), CVV, or PIN
• Encrypt card data in the browser or mobile app only
• Use HTTPS endpoints exclusively
• Use DGS-Pay public key for encryption
Any server that receives unencrypted card data is NOT PCI compliant.
Encryption Model
DGS-Pay uses an asymmetric encryption model:
- Public Key: Used on frontend (safe to expose)
- Private Key: Stored securely by DGS-Pay only
- Merchant Server: Never decrypts card data
- DGS-Pay: Decrypts and processes payments
Recommended Data Flow
Customer Browser / App
↓
Encrypt card data using DGS-Pay Public Key
↓
Send encrypted payload to Merchant Server (or directly to DGS-Pay)
↓
Merchant Server forwards encrypted data unchanged
↓
DGS-Pay decrypts using Private Key
↓
Payment Processing
Fields That Must Be Encrypted
- Card Number (PAN)
- Expiry Month
- Expiry Year
- CVV
- PIN (when required)
• All card fields must be encrypted together as a single payload
• Do not send encrypted fields separately
• Do not send IVs, keys, or secrets as separate parameters
Plaintext Payload (Before Encryption)
{
"card_number": "4532123456789010",
"expiry_month": "01",
"expiry_year": "2028",
"cvv": "123",
"pin": "0000"
}
Encrypted Payload Sent to API
{
"encrypted_card_data": "ENCRYPTED_STRING"
}
JavaScript Encryption Example
const encryptor = new JSEncrypt();
encryptor.setPublicKey(DGS_PUBLIC_KEY);
const cardPayload = JSON.stringify({
card_number: "4532123456789010",
expiry_month: "01",
expiry_year: "2028",
cvv: "123",
pin: "0000"
});
const encryptedCardData = encryptor.encrypt(cardPayload);
• Do NOT decrypt card data on your server
• Do NOT store encrypted card blobs permanently
• Do NOT return card data in API responses
• Do NOT attempt to build your own key management
Initialize Card Payment
/api/init_payment
Start a card payment transaction with encrypted card details. This endpoint handles the initial payment request and returns the payment status.
Request Example
{
"pay_info": {
"amount": 100,
"currency": "USD",
"api_code": "PAYIN_CARD_LOCAL",
"callback_url": "https://my-callback.test",
"description": "Test Card Payment"
},
"from": {
"payment_type": "card",
"provider": "VISA",
"name": "John Doe",
"email": "john@example.com",
"phone": "782589800",
"country_code": "1",
"encrypted_card_data": "COMBINATION OF ENCRYPTED DATA. FROM CARD NUMBER, CVV, EXPIRY MONTH AND YEAR"
},
"metadata": {
"order_id": "12345",
"custom_info": "DGS test"
}
}
Response - Requires PIN
{
"status": "pending",
"charge_id": "chg_ABC123XYZ",
"transaction_id": "chg_ABC123XYZ",
"amount": 150,
"currency": "USD",
"customer_id": "cus_ABC123XYZ",
"reference": "DGS-1764359999-8888",
"processor_code": "02",
"next_action": {
"type": "requires_pin",
"requires_pin": true
}
}
Payment Authorization
/api/authorize_payment
Complete additional verification steps required by the card issuer, such as PIN, OTP, or address verification.
PIN Authorization
{
"charge_id": "chg_xxxx",
"method": "pin",
"fields": {
"encrypted_pin": ""
}
}
OTP Authorization
{
"charge_id": "chg_xxxx",
"method": "otp",
"fields": {
"code": "123456"
}
}
AVS Verification
{
"charge_id": "chg_xxxx",
"method": "avs",
"fields": {
"city": "Gotham",
"state": "Colorado",
"line1": "221B Baker Street",
"country": "US",
"postal_code": "94105"
}
}
Multi-Step Authentication
Some card issuers require multiple verification steps. Your integration must handle next_action responses and continue authorization until completion.
Initialize Payment
Handle Next Action
Complete Authorization
Repeat if Necessary
Card payments may require multiple authorization steps depending on the issuing bank. Do NOT assume that a single step (PIN, OTP, or redirect) completes the payment.
A card payment is complete ONLY when:
• status = "success"
• AND no next_action is returned
Next Action Types
requires_pin- Card PIN requiredrequires_otp- OTP sent by issuerrequires_avs- Address verification requiredredirect_url- 3D Secure authentication
Payout & Disbursement API
Send money securely to bank accounts and mobile wallets across Rwanda. For international payouts, our team is ready to assist with tailored cross-border transfer solutions.
Rwanda Bank Transfers
Fast and reliable processing
Mobile Money Payouts
MTN, Airtel
International
Contact for cross-border
Payout / Disbursement Flow
Payouts on DGS Pay follow a clear two-step process: an immediate acknowledgement followed by a final webhook notification once the transfer is completed or fails.
Step 1 – Send Payout Request
POST request to /api/init_payout
Bank Payout Example
{
"pay_info": {
"api_code": "PAYOUT_BANK",
"amount": 1000,
"source_currency": "RWF",
"destination_currency": "RWF",
"callback_url": "https://your-domain.com/webhook",
"description": "Vendor payout",
"reference": "REF87287328787"
},
"to": {
"bank": {
"account_number": "18287377638728",
"bank_code_name": "access_rwanda",
"first_name": "Client first name",
"last_name": "Client last name",
"email": "Client Email"
}
},
"type": "bank",
"action": "instant",
"simulation": {
"context": "successful"
}
}
Mobile Money Payout Example
{
"pay_info": {
"api_code": "PAYOUT_MOBILE_MONEY",
"amount": 1000,
"source_currency": "RWF",
"destination_currency": "RWF",
"callback_url": "https://your-domain.com/webhook",
"description": "Vendor mobile money payout",
"reference": "REF87287328787"
},
"to": {
"mobile_money": {
"phone_number": "250788123456",
"provider": "MTN",
"country": "RW",
"first_name": "Client first name",
"last_name": "Client last name",
"email": "Client Email"
}
},
"type": "mobile_money",
"action": "instant",
"simulation": {
"context": "successful"
}
}
Immediate Response (Acknowledgement)
{
"status": "NEW",
"message": "Transfer created",
"code": null,
"transfer_id": "trf_7nyftY7EzWWgv7",
"transaction_id": 97,
"tx_ref": "DGSPAYOUT176588029657501",
"payout_type": "bank",
"amount": 1000,
"currency": "RWF",
"fee": 500,
"created_at": "2025-12-16T10:18:16.788Z",
"bank": {
"account_number": "2323389387",
"bank_code": "30",
"branch": " ",
"account_name": "Customer Payout"
}
}
Bank Payout Success Webhook
{
"event": "transaction.completed",
"status": "success",
"direction": "disbursement",
"reference": "5748745ug8ufdgjhveyebjhcdbchb",
"transaction_id": "trf_yMZATJ11yVPNkZ",
"amount": 50000,
"currency": "RWF",
"fee": 500,
"net_amount": 49500,
"payout_type": "bank",
"beneficiary": {
"type": "bank",
"account_number": "0122333334",
"bank_code": "044",
"branch": " ",
"name": null
},
"actual_debit_amount": 50000,
"vat": 3750,
"rate_used": 0.00123,
"metadata": {},
"proof": "504828363550713897092362940989"
}
Supported Banks (bank_code_name)
Wallet & Transactions API
Retrieve your wallet balances across multiple currencies, including withdrawable and pending funds, list all transactions, and check individual transaction status. This API is settlement-aware and designed for delayed provider payouts.
Multi-Currency Wallet
Balance, withdrawable & pending funds
Transaction History
Paginated transaction listing
Transaction Status
Real-time transaction tracking
/api-v2/wallet
Request Parameters
| Parameter | Type | Description |
|---|---|---|
action |
string |
Operation type:
balance,
balance_single,
transaction_list,
transaction_status
|
currency |
string | Wallet currency (required for balance_single) |
reference |
string | Transaction reference (required for transaction_status) |
limit |
integer | Number of transactions to return (optional, default 50) |
offset |
integer | Starting index for pagination (optional, default 0) |
Get All Wallet Balances
curl -X POST "https://pay.digitalservicescenter.rw/api-v2/api/wallet" \
-H "Authorization: Bearer YOUR_DGS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"balance"}'
Response
{
"status": "success",
"environment": "live",
"wallets": [
{
"currency": "RWF",
"balance": 150000.00,
"withdrawable_balance": 120000.00,
"pending_balance": 30000.00,
"total_incoming": 200000.00,
"total_outgoing": 50000.00,
"net_incoming": 200000.00,
"net_outgoing": 50000.00
}
]
}
Get Single Currency Wallet
curl -X POST "https://pay.digitalservicescenter.rw/api-v2/api/wallet" \
-H "Authorization: Bearer YOUR_DGS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"balance_single","currency":"RWF"}'
{
"status": "success",
"wallet": {
"currency": "RWF",
"balance": 150000.00,
"withdrawable_balance": 120000.00,
"pending_balance": 30000.00,
"total_incoming": 200000.00,
"total_outgoing": 50000.00,
"net_incoming": 200000.00,
"net_outgoing": 50000.00
}
}
List Transactions
curl -X POST "https://pay.digitalservicescenter.rw/api-v2/api/wallet" \
-H "Authorization: Bearer YOUR_DGS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"transaction_list","limit":20,"offset":0}'
{
"status": "success",
"limit": 20,
"offset": 0,
"count": 1,
"transactions": [
{
"id": 102,
"direction": "collection",
"reference": "TXN-2025-0002",
"currency": "USD",
"base_amount": 100.00,
"charged_amount": 102.00,
"total_fee": 2.00,
"client_net_amount": 100.00,
"status": "successful",
"created_at": "2025-01-10 14:21:10",
"updated_at": "2025-01-10 14:22:02"
}
]
}
Get Transaction Status
curl -X POST "https://pay.digitalservicescenter.rw/api-v2/api/wallet" \
-H "Authorization: Bearer YOUR_DGS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"transaction_status","reference":"TXN-2025-0002"}'
{
"status": "success",
"transaction": {
"id": 102,
"direction": "collection",
"reference": "TXN-2025-0002",
"currency": "RWF",
"base_amount": 100.00,
"charged_amount": 102.00,
"total_fee": 2.00,
"client_net_amount": 100.00,
"status": "successful",
"created_at": "2025-01-10 14:21:10",
"updated_at": "2025-01-10 14:22:02"
}
}
- Only
withdrawable_balancecan be withdrawn. pending_balancerepresents unsettled provider funds.- Settlement may take between 1 and 5 business days.
- Always include your API token in the Authorization header.
FX Rate & Currency Conversion API
Retrieve real-time foreign exchange rates between supported currencies. Easily calculate the destination amount for any transfer or payout. This API also supports sandbox simulation for testing without real transfers.
Real-Time Rates
Fetch current FX rates instantly
Sandbox Simulation
Test your flows without hitting live APIs
Normalized Responses
Easy-to-read amounts for users
/api/fx-rate
Request Parameters
| Parameter | Type | Description |
|---|---|---|
source_currency |
string | Currency you are converting from (e.g., USD) |
destination_currency |
string | Currency you are converting to (e.g., NGN) |
amount |
number | Amount in source_currency to convert |
Sandbox FX Rate Example
curl -X POST "https://pay.digitalservicescenter.rw/api-v2/api/fx-rate" \
-H "Authorization: Bearer YOUR_DGS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"source_currency": "USD",
"destination_currency": "NGN",
"amount": 300
}'
Sandbox Response
{
"status": "success",
"message": "Sandbox FX rate retrieved successfully",
"rate_id": "sim_USD_NGN",
"rate": 725,
"source": {
"currency": "USD",
"amount": 300
},
"destination": {
"currency": "NGN",
"amount": 217500
},
"created_at": "2026-01-07T12:45:00+00:00",
"sandbox": true
}
Live FX Rate Example
curl -X POST "https://pay.digitalservicescenter.rw/api-v2/api/fx-rate" \
-H "Authorization: Bearer YOUR_DGS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"source_currency": "USD",
"destination_currency": "NGN",
"amount": 300
}'
Live Response
{
"status": "success",
"message": "FX rate retrieved successfully",
"rate_id": "rex_JtA0MDnO0ITr",
"rate": 728.55,
"source": {
"currency": "USD",
"amount": 300
},
"destination": {
"currency": "NGN",
"amount": 218565
},
"created_at": "2026-01-07T12:48:00+00:00",
"sandbox": false
}
- Always include your API token in the Authorization header.
- In sandbox mode, FX rates are simulated and may not reflect real market rates.
- When running multi-currency payouts, its good practice to use it and show a client - build trust
- The
destination.amountis calculated using the returnedrate. - Ensure the
source_currencyanddestination_currencyare supported.
Testing & Simulation
DGS Pay provides comprehensive simulation capabilities to test payment flows without real transactions.
Simulation Context Values
| Context | Meaning |
|---|---|
auth_pin |
Mock PIN authentication (customer enters PIN/OTP) |
auth_pin_3ds |
Mock failover from PIN to 3DS authentication |
auth_3ds |
Mock 3DS authentication and return a redirect URL |
auth_avs |
Mock AVS flow (billing address verification) |
Simulation Response Options
approved
insufficient_funds
incorrect_pin
expired_card
blocked_first_use
exceeds_withdrawal_limit
Payout Simulation Context
successful
insufficient_balance
blocked_bank
amount_below_limit_error
amount_exceed_limit_error
duplicate_reference
Simulation Example
{
"simulation": {
"context": "auth_pin",
"response": "approved"
}
}
Error Codes
| Code | Status | Description |
|---|---|---|
10400 |
Bad Request | Invalid request parameters |
401 |
Unauthorized | Invalid or missing API token |
403 |
Forbidden | API code not enabled in dashboard |
02 |
Pending | Awaiting customer authorization |
Status vs Error
- Status "error" - Request failed DGS validation
- Status "failed" - Passed DGS validation but failed at provider level
- Status "pending" - Awaiting customer authorization
- Status "success" - Payment completed successfully
Need Help?
Our technical team is ready to assist you with integration
Contact Support