API Documentation

Accept payments programmatically with our RESTful API

PCI Compliant Lightning Fast 99.9% Uptime

🚀 Getting Started

1
Register as Merchant

Create an account at OrionPay and wait for admin approval.

2
Generate API Key

Go to Dashboard → API Keys → Generate New Key. Admin will approve it.

3
Start Integrating

Use your API key to create invoices and accept payments.

🔐 Authentication

All API requests require a valid API key. Include it in the request header.
X-API-Key: oes_your_api_key_here

⚠️ Keep your API key secret. Never share it publicly or expose it in client-side code.

📝 Create Invoice

POST https://yourdomain.com/api/create-invoice

📤 Request Parameters

ParameterTypeRequiredDescription
amountnumeric✅ YesAmount to charge (min 1, max 10000)
pay_waystring✅ Yescashapp, ecashapp, applepay, googlepay, chime, btcpay, paypal, venmo
customer_emailstring❌ NoCustomer email address (optional)

✅ Success Response (Auto Wallet)

{
    "success": true,
    "order_id": 123,
    "order_no": "API_1706000000_abc123",
    "amount": 100.00,
    "pay_way": "cashapp",
    "payment_url": "https://pay.orionpay.com/xxx",
    "expires_at": "2026-01-15 12:00:00",
    "status": "processing"
}

✅ Success Response (Manual Wallet - PayPal/Venmo/Chime)

{
    "success": true,
    "order_id": 123,
    "order_no": "API_1706000000_abc123",
    "amount": 100.00,
    "pay_way": "paypal",
    "manual_code": "W6X-F1",
    "checkout_url": "https://orionpay.com/checkout/123",
    "status": "pending_manual"
}

🔍 Check Order Status

GET https://yourdomain.com/api/check-status/{order_id}

✅ Response

{
    "order_id": 123,
    "order_no": "API_1706000000_abc123",
    "amount": 100.00,
    "real_amount": 100.00,
    "fee": 11.00,
    "net": 89.00,
    "pay_way": "cashapp",
    "status": "success",
    "created_at": "2026-01-15T10:00:00Z",
    "success_time": "2026-01-15T10:05:00Z"
}

📊 Status Values

pending processing success failed pending_manual

Webhooks

OrionPay sends POST requests to your webhook URL when payment status changes.

Make sure your webhook endpoint returns HTTP 200 with "success".

📦 Webhook Payload (Third-party)

{
    "mchOrderNo": "MCH_123456_abc",
    "state": 2,
    "amount": 10000,
    "realAmount": 10000
}

state: 1=Pending, 2=Success, 3=Failed, 6=Closed

⚠️ Error Codes

CodeMessageSolution
401API key required / Invalid API keyGenerate a new API key from dashboard
400Payment method not availableCheck if gateway is active
404Order not foundVerify order ID
500Failed to create invoiceContact support

🔒 Security Best Practices

✅ Never expose your API key in client-side code (JavaScript, mobile apps)
✅ Use HTTPS for all API requests
✅ Rotate your API keys periodically
✅ Verify webhook signatures to ensure authenticity

Need Help?

Contact our support team for integration assistance.

Get API Keys →