Create Payment Order¶
Endpoint¶
POST /api/v1/subscriber/CreatePaymentOrder
This endpoint is used to create a new payment order for the authenticated subscriber.
Authorization¶
- Type: Bearer Token
- Header:
Authorization: Bearer <your_token_here>
Request Body¶
- Content-Type:
application/json
JSON Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
plan_id | integer | Yes | ID of the plan to purchase. |
gateway | string | Yes | Payment gateway to use (e.g., razorpay). |
invoice_id | integer | No | Associated invoice ID (optional). |
Example Request¶
curl -X POST "https://yourispcrmdomain/api/v1/subscriber/CreatePaymentOrder" \
-H "Authorization: Bearer YOURAPITOKENHERE" \
-H "Content-Type: application/json" \
-d '{
"plan_id": 1,
"gateway": "razorpay",
"invoice_id": 123
}'
Response¶
Success Response (200 OK)¶
{
"success": true,
"data": {
"order_id": "1234567890",
"key": "rzp_test_ABC123XYZ",
"url": "https://paymentgateway.com/payment/1234567890"
}
}
Explanation: - success - Indicates if the request was successful. - data - Contains the payment order details: - order_id - Unique ID of the payment order. - key - API key for the payment gateway. - url - URL for completing the payment.
Error Responses¶
404 Not Found¶
{
"success": false,
"message": "Subscriber not found"
}
Explanation: - This error occurs if the subscriber cannot be found.
500 Internal Server Error¶
{
"success": false,
"message": "Internal Server Error"
}
Explanation: - This error occurs if there is an issue with the server while processing the payment order.
Example Response¶
{
"success": true,
"data": {
"order_id": "1234567890",
"key": "rzp_test_ABC123XYZ",
"url": "https://paymentgateway.com/payment/1234567890"
}
}
For further assistance, contact our support team at support@netgroot.com.