Accept payments programmatically with our RESTful API
Create an account at OrionPay and wait for admin approval.
Go to Dashboard → API Keys → Generate New Key. Admin will approve it.
Use your API key to create invoices and accept payments.
X-API-Key: oes_your_api_key_here
⚠️ Keep your API key secret. Never share it publicly or expose it in client-side code.
https://yourdomain.com/api/create-invoice
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | numeric | ✅ Yes | Amount to charge (min 1, max 10000) |
| pay_way | string | ✅ Yes | cashapp, ecashapp, applepay, googlepay, chime, btcpay, paypal, venmo |
| customer_email | string | ❌ No | Customer email address (optional) |
{
"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": 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"
}
https://yourdomain.com/api/check-status/{order_id}
{
"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"
}
OrionPay sends POST requests to your webhook URL when payment status changes.
{
"mchOrderNo": "MCH_123456_abc",
"state": 2,
"amount": 10000,
"realAmount": 10000
}
state: 1=Pending, 2=Success, 3=Failed, 6=Closed
| Code | Message | Solution |
|---|---|---|
| 401 | API key required / Invalid API key | Generate a new API key from dashboard |
| 400 | Payment method not available | Check if gateway is active |
| 404 | Order not found | Verify order ID |
| 500 | Failed to create invoice | Contact support |