1. Orders
Treek-Public
  • Authentication
    • User login with email and password
      POST
  • Orders
    • Create Order
      POST
    • List Orders
      GET
    • Order Details
      GET
    • Update Order
      PUT
    • Cancel Order
      POST
    • Reset Order
      POST
    • Get Statuses
      GET
    • Verify Item
      POST
    • Verify Order
      POST
    • Order Price
      GET
  • Shipments
    • Create Shipment
      POST
    • Return Shipment
      POST
    • Print Invoice
      GET
  • Boxes
    • Create Box
      POST
    • Get Boxes
      GET
    • Box Details
      GET
    • Update Box
      PUT
  • Merchants
    • Merchants Details
      GET
  • Profile
    • User Details
      GET
    • Update User
      PUT
    • Change Password
      PUT
  • Utilities
    • Countries List
      GET
    • Cities List
      GET
    • Couriers List
      GET
  • Warehouses
    • Warehouses List
    • Create warehouse
    • warehouse Details
  • Price Calculator
    • Price Calculator
  • Packaging Type
    • Packaging Types List
    • Packaging Type Details
  • statistics
    • Statistics
  • Schemas
    • LoginRequest
    • CreateOrderRequest
    • UpdateOrderRequest
    • Price Calculator
    • VerifyItem
    • CreateWarehouseRequest
    • Shipment Package
    • Create Reverse Shipment
    • OrderPackages
    • OrderItem
    • Order
    • City
    • Country
    • User
    • OrderItem
    • CreateOrderItemRequest
    • CalculateRatesRequest
    • BoxDimensions
    • OrderShippingRate
    • RateCalculationParams
    • Warehouse
    • Box
    • CreateBoxRequest
    • UpdateBoxRequest
    • ValidationError
    • NotFoundError
    • UnauthorizedError
    • ForbiddenError
    • PaginationMeta
    • PaginationLinks
  1. Orders

Create Order

POST
https://app.gotreek.com/api/orders
Orders
Last modified:2026-02-25 22:06:08
Create a new shipping order for the authenticated user. The order is automatically linked either to the current merchant or, for manually created orders, to the warehouse owner, and initialized with a default status of pending.
💡
Authentification
Bearer token authentication is required.
📌
Automatic fields
order_number: Auto-generated when not provided (based on timestamp and a random 4‑digit suffix).
status: Always initialized as pending for newly created orders.
merchant_id: Always null for this endpoint, and is only used for orders imported automatically from external shops, not for orders created manually via Treek’s API
💡
Association behavior
Every order created through this API is considered a manual order and is not associated with any merchant/shop via merchant_id.
Manual orders are associated to the warehouse (through warehouse_id) and thus to the warehouse owner (warehouse.user_id).
In orderboxes, the weight field is always expressed in grams.
📌
Phone number format
The phone number must be provided in international format.
It must start with + followed by the country code and the mobile number.
Local phone formats are not accepted.
Example (Saudi Arabia 🇸🇦):
✅ +966501234567
❌ 0501234567
❌ 966501234567
❌ +966 50 123 4567

Request

Authorization
OAuth 2.0
Client Credentials
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Token URL: https://app.gotreek.com/api/auth/login
or
Header Params

Body Params application/jsonRequired

Examples

Responses

🟢201
application/json
Order created successfully
Body

🟠404
🟠401
🟠422
🟠409
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://app.gotreek.com/api/orders' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "receiver_first_name": "testorderbox",
  "receiver_last_name": "testorderbox",
  "receiver_phone": "+966501234567",
  "receiver_address_line": "testapidogprod",
  "receiver_short_address": "RRRR2929",
  "receiver_city_id": 62,
  "receiver_country_id": 1,
  "warehouse_id": 207,
  "order_grand_total": 1601,
  "payment_method": "paid",
  "items": [
    {
      "name": "غطاء أيفون 15",
      "quantity": 2,
      "price": 100,
      "weight": 1
    },
    {
      "name": "غطاء أيفون ",
      "quantity": 2,
      "price": 100,
      "weight": 0.2
    }
  ],
  "boxes": [
    {
      "length": 123,
      "width": 123,
      "height": 123,
      "weight": 12300,
      "packaging_type_id": 1
    }
  ]
}'
Response Response Example
201 - Success
{
    "message": "Order created successfully.",
    "data": {
        "order_number": "17676030724246",
        "status": "pending",
        "date": "2026-01-05T08:51:12.188097Z",
        "order_grand_total": 1601,
        "currency": "SAR",
        "description": null,
        "payment_method": "paid",
        "receiver_first_name": "testorderbox",
        "receiver_last_name": "testorderbox",
        "receiver_phone": "+966501234567",
        "receiver_email": null,
        "receiver_country_id": 1,
        "receiver_address_line": "testapidogprod",
        "receiver_street_name": null,
        "receiver_postal_code": null,
        "receiver_block": null,
        "receiver_latitude": null,
        "receiver_longitude": null,
        "receiver_short_address": "RRRD2929",
        "shipper_name": "تست",
        "shipper_email": null,
        "shipper_phone": "+966533112592",
        "shipper_address_line": "الهنداوية شارع زهرة اللوتس مقابل تموينات التوفير ",
        "shipper_city": "جدة",
        "shipper_short_address": null,
        "warehouse_id": 207,
        "receiver_city_id": 62,
        "updated_at": "2026-01-05T08:51:12.000000Z",
        "created_at": "2026-01-05T08:51:12.000000Z",
        "id": 43978,
        "receiver_city": {
            "id": 62,
            "country_id": 1,
            "name": "Riyadh",
            "name_ar": "الرياض",
            "created_at": null,
            "updated_at": "2025-04-16T09:15:16.000000Z"
        },
        "receiver_country": {
            "id": 1,
            "name": "Saudi Arabia",
            "name_zid": "السعودية",
            "name_ar": "السعودية",
            "code_country": "SA",
            "phone_code": "+966",
            "phone_number_length": 9,
            "created_at": "2024-12-22T18:23:12.000000Z",
            "updated_at": "2025-04-16T08:52:36.000000Z"
        },
        "merchant": null,
        "items": [
            {
                "id": 62504,
                "order_id": 43978,
                "name": "غطاء أيفون 15",
                "sku": null,
                "quantity": 2,
                "weight": 1,
                "weight_unit": null,
                "price": 100,
                "total_price": null,
                "tax": null,
                "currency": "SAR",
                "created_at": "2026-01-05T08:51:12.000000Z",
                "updated_at": "2026-01-05T08:51:12.000000Z",
                "verification_status": "pending",
                "verified_at": null,
                "verified_by": null,
                "wrong_attempts": 0,
                "verification_note": null
            },
            {
                "id": 62505,
                "order_id": 43978,
                "name": "غطاء أيفون",
                "sku": null,
                "quantity": 2,
                "weight": 0,
                "weight_unit": null,
                "price": 100,
                "total_price": null,
                "tax": null,
                "currency": "SAR",
                "created_at": "2026-01-05T08:51:12.000000Z",
                "updated_at": "2026-01-05T08:51:12.000000Z",
                "verification_status": "pending",
                "verified_at": null,
                "verified_by": null,
                "wrong_attempts": 0,
                "verification_note": null
            }
        ],
        "boxes": [
            {
                "id": 33041,
                "order_id": 43978,
                "box_id": null,
                "length": 123,
                "width": 123,
                "height": 123,
                "weight": 12300,
                "packaging_type_id": 1,
                "created_at": "2026-01-05T08:51:12.000000Z",
                "updated_at": "2026-01-05T08:51:12.000000Z"
            }
        ]
    }
}
Modified at 2026-02-25 22:06:08
Previous
User login with email and password
Next
List Orders
Built with