1. Boxes
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. Boxes

Create Box

POST
https://app.gotreek.com/api/boxes
Boxes
Last modified:2025-12-25 15:05:04
💡
Authentification
Bearer token authentication is required.
The box is always created for the currently authenticated user (user_id is taken from the token).
📌
Automatic fields
user_id: Automatically filled from the authenticated user and cannot be overridden.
weight: Defaults to 0 if not provided in the request.
💡
Behavior
Validates required fields (type, length, width, height, weight) before creation.
Persists the box with its full dimensions so it can be selected later in shipment flows.

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
Box created successfully
Body

🟠422
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://app.gotreek.com/api/boxes' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "primary",
    "length": 22,
    "width": 15,
    "height": 36,
    "weight": 3
}'
Response Response Example
201 - Example 1
{
    "success": true,
    "message": "Box created successfully",
    "data": {
        "id": 1,
        "type": "Small Box",
        "length": 33,
        "width": 14,
        "height": 8,
        "weight": 31,
        "user_id": 94,
        "created_at": "2025-07-21T13:05:41Z",
        "updated_at": "2025-07-21T13:05:41Z"
    }
}
Modified at 2025-12-25 15:05:04
Previous
Print Invoice
Next
Get Boxes
Built with