API Documentation - Place Order & Check Order Status

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"
}