API Documentation
Complete guide to integrate ORYNX Payment Gateway into your applications
🔧 Configuration
Base URL & Authentication
API Base URL: https://casher-payment-worker.speedofmastry.workers.dev
Authorization: Bearer Ob7EmFhfCoAcMSiI8LDruZBd23vN46Uy
Content-Type: application/json
💳 Create Payment Request
POST /api/payment/request
Request Body:
{
"amount": 5000,
"reference_no": "ORDER-2025-001",
"callback_url": "https://yourapp.com/webhook",
"success_url": "https://yourapp.com/success",
"back_url": "https://yourapp.com/cancel",
"description": "Product purchase",
"currency": "SAR"
}
JavaScript Example:
const response = await fetch('https://casher-payment-worker.speedofmastry.workers.dev/api/payment/request', {
method: 'POST',
headers: {
'Authorization': 'Bearer Ob7EmFhfCoAcMSiI8LDruZBd23vN46Uy',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 5000,
reference_no: 'ORDER-2025-001',
callback_url: 'https://yourapp.com/webhook',
success_url: 'https://yourapp.com/success',
back_url: 'https://yourapp.com/cancel',
description: 'Product purchase'
})
});
const result = await response.json();
console.log('Payment URL:', result.data.payment_url);
console.log('Invoice ID:', result.data.invoice_id);
📝 Generate Payment Form
POST /api/payment/form
JavaScript Example:
const response = await fetch('https://casher-payment-worker.speedofmastry.workers.dev/api/payment/form', {
method: 'POST',
headers: {
'Authorization': 'Bearer Ob7EmFhfCoAcMSiI8LDruZBd23vN46Uy',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 7500,
reference_no: 'FORM-ORDER-001',
callback_url: 'https://yourapp.com/webhook',
success_url: 'https://yourapp.com/success',
back_url: 'https://yourapp.com/cancel',
description: 'Embedded payment form'
})
});
const result = await response.json();
// Inject the form into your page
document.getElementById('payment-container').innerHTML = result.data.payment_form_html;
🔍 Check Payment Status
GET /api/payment/status/{invoice_id}
JavaScript Example:
const checkStatus = async (invoiceId) => {
const response = await fetch(`https://casher-payment-worker.speedofmastry.workers.dev/api/payment/status/${invoiceId}`, {
headers: {
'Authorization': 'Bearer Ob7EmFhfCoAcMSiI8LDruZBd23vN46Uy'
}
});
const result = await response.json();
console.log('Payment Status:', result.data.status);
return result.data;
};
🚀 Integration Examples
E-commerce Integration
Perfect for online stores and marketplaces
Test E-commerce
Service Booking
Ideal for appointments and reservations
Test Service
📋 Response Examples
Success Response:
{
"success": true,
"message": "Payment request created successfully",
"data": {
"invoice_id": "INV_20251118_ABC123",
"payment_url": "https://pay.casher.sa/invoice/INV_20251118_ABC123",
"reference_no": "ORDER-2025-001",
"amount": 5000,
"currency": "SAR",
"status": "pending"
}
}
Error Response:
{
"success": false,
"message": "Invalid amount specified",
"error": "INVALID_AMOUNT"
}