Secure payment integration for your applications
This payment gateway allows your application to process payments through Fiuu (formerly MOLPay/RazerPay). Authentication is handled via JWT tokens.
Generate a JWT access token using your API credentials.
{
"client_id": "your_client_id",
"client_secret": "your_client_secret"
}
{
"success": true,
"data": {
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"token_type": "bearer",
"expires_in": 3600,
"client_name": "Your App Name"
}
}
Include the token in the Authorization header for all protected endpoints:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
Create a new payment transaction and get the payment URL.
Authorization: Bearer {your_token}
Content-Type: application/json
| Parameter | Type | Description |
|---|---|---|
| order_id | string required | Your unique order identifier |
| amount | number required | Payment amount (min: 0.01) |
| currency | string optional | Currency code (default: MYR) |
| customer_name | string optional | Customer's name |
| customer_email | string optional | Customer's email |
| customer_phone | string optional | Customer's phone number |
| description | string optional | Payment description |
| metadata | object optional | Additional custom data |
{
"order_id": "ORD-12345",
"amount": 100.00,
"currency": "MYR",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"customer_phone": "0123456789",
"description": "Payment for Order #12345",
"metadata": {
"product_id": "PROD-001",
"notes": "Express delivery"
}
}
{
"success": true,
"transaction_id": "TXN1234567890ABCDEFGH",
"payment_url": "https://sandbox.merchant.razer.com/RMS/pay/...",
"expires_at": "2024-01-15T12:30:00+08:00"
}
Important: Redirect the customer to the payment_url to complete the payment.
Get the current status of a payment transaction.
{
"success": true,
"data": {
"transaction_id": "TXN1234567890ABCDEFGH",
"order_id": "ORD-12345",
"amount": "100.00",
"currency": "MYR",
"status": "completed",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"payment_channel": "fpx",
"payment_method": "Maybank2U",
"description": "Payment for Order #12345",
"created_at": "2024-01-15T12:00:00+08:00",
"completed_at": "2024-01-15T12:05:00+08:00"
}
}
| Status | Description |
|---|---|
| pending | Payment created, awaiting customer action |
| completed | Payment successful |
| failed | Payment failed or rejected |
| cancelled | Payment cancelled by customer |
| expired | Payment session expired |
Get a paginated list of your transactions.
| Parameter | Type | Description |
|---|---|---|
| status | string | Filter by status (pending, completed, failed) |
| order_id | string | Filter by order ID |
| from_date | date | Filter from date (YYYY-MM-DD) |
| to_date | date | Filter to date (YYYY-MM-DD) |
| per_page | integer | Results per page (default: 15) |
Configure your webhook URL in your API client settings to receive real-time payment notifications.
{
"event": "payment.completed",
"transaction_id": "TXN1234567890ABCDEFGH",
"order_id": "ORD-12345",
"amount": "100.00",
"currency": "MYR",
"status": "completed",
"payment_channel": "fpx",
"completed_at": "2024-01-15T12:05:00+08:00",
"metadata": {
"product_id": "PROD-001"
}
}
Note: Your webhook endpoint should return HTTP 200 to acknowledge receipt. Failed webhooks will be retried up to 5 times.
{
"success": false,
"message": "Error description",
"errors": {
"field_name": ["Validation error message"]
}
}
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 401 | Unauthorized - Invalid or expired token |
| 403 | Forbidden - Client inactive or IP not allowed |
| 404 | Not Found |
| 409 | Conflict - Duplicate order ID |
| 422 | Validation Error |
| 500 | Server Error |