POST https://3ati2ak.com/api/orders

Create a new order. It will be created with Pending status.

Requires authentication. Your account must have the resource (seller) role.

Headers

Accept application/json
Authorization Bearer {your_token}
Content-Type application/json

Request Body

Field Type Required Notes
trackingNumber string required Must be unique across all orders
priceLbp number required Price in Lebanese Pounds. Min: 0
priceUsd number required Price in USD. Min: 0
clientPhone string required Alphanumeric and underscores only (no spaces or special chars)
location string required Additional address / delivery notes
clientName string optional Client's full name
note string optional Any extra notes for this order
{
    "trackingNumber": "ORDER123",
    "priceLbp": 50000,
    "priceUsd": 5.00,
    "clientPhone": "0123456789",
    "location": "Hamra, near the pharmacy",
    "clientName": "John Doe",
    "note": "Handle with care"
}

Response 200 OK

{
    "success": true,
    "message": "Order created successfully",
    "data": {
        "id": 42,
        "trackingNumber": "ORDER123",
        "clientName": "John Doe",
        "clientPhone": "0123456789",
        "createdAt": "2026-04-01 10:00",
        "location": "Hamra, near the pharmacy",
        "priceLbp": 50000,
        "priceUsd": 5.00,
        "feeLbp": 0,
        "feeUsd": 0,
        "status": "Pending",
        "note": "Handle with care"
    }
}

Error Responses

422 Unprocessable Validation failed — message describes the specific issue
{"success": false, "message": "The tracking number has already been taken."}
403 Forbidden Account does not have the seller (resource) role
{"success": false, "message": "This action is unauthorized."}
401 Unauthorized Token is missing or invalid
{"success": false, "message": "Unauthenticated."}