Order Recharges
This guide explains how to interact with the Order Recharge API in the Sumaya369 web application. The API provides endpoints for recharging orders using various payment methods.
Recharge Order with Credit Card
Recharge an existing order using credit card payment method.
Endpoint
- Method: POST
- URL:
/v1/mobile/orders/{id}/recharge
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Success Response
{
"success": true,
"message": "Payment URL generated successfully.",
"data": {
"payment_url": "https://payment-gateway.com/checkout/xyz"
},
"status_code": 200
}
Example Implementation Flow
- Recharge Order
- User selects payment method
- Application sends authenticated POST request to appropriate recharge endpoint
- Redirect user to payment gateway checkout URL
- Handle success/failure callback from payment gateway
Key Considerations
- Authentication is required for all recharge endpoints
- Order must exist and belong to the authenticated customer
- Payment method availability may vary by customer's location
- Handle payment gateway callbacks appropriately