API Endpoints
API Documentation - Place Order & Check Order Status
This documentation outlines the APIs for placing an order and checking the status of an order.
Place Order
Endpoint
POST https://netpac.pro/wp-json/custom/v1/place-order
Authentication
Basic Auth
This API requires Basic Authentication to access the endpoint.
Headers Required
'Authorization' => 'Basic ' . base64_encode('username:password') // Replace with actual username and password
Response Codes
Code | Meaning |
---|---|
200 | Order placed successfully! |
400 | All fields are required or invalid package size for your user role. |
401 | Authorization header missing or invalid. |
500 | Failed to deduct from wallet. Please try again. |
Sample Request
curl -X POST https://netpac.pro/wp-json/custom/v1/place-order \
-H "Authorization: Basic BASE64_ENCODED_CREDENTIALS" \
-H "Content-Type: application/json" \
-d '{
"recipient": "0539948030",
"package_size": 1,
"order_id": "1355"
}'
Sample Response
{
"status": true,
"code": 200,
"message": "Order placed successfully!",
"order_id": 35749,
"order_reference": "1355"
}
Check Order Status
Endpoint
GET https://netpac.pro/wp-json/custom/v1/check-order-status
Authentication
Basic Auth
This API requires users to be logged in. Use Basic Authentication to access the API.
Headers Required
'Authorization' => 'Basic ' . base64_encode('username:password') // Replace with actual username and password
Request Parameters
Parameter | Type | Description |
---|---|---|
order_reference | string | The unique reference for the order you want to check. |
Sample Request
curl -X GET https://netpac.pro/wp-json/custom/v1/check-order-status?order_reference=ORDER_REFERENCE \
-H "Authorization: Basic BASE64_ENCODED_CREDENTIALS" \
-H "Content-Type: application/json"
Response Format
{
"status": true,
"code": 200,
"message": "Order status retrieved successfully.",
"order_id": 35651,
"order_status": "completed",
"phone": "0534886030",
"reference": "1355"
}
Response Codes
Code | Meaning |
---|---|
200 | Order status retrieved successfully |
400 | Order reference is required |
404 | Order not found |