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

Update Box

PUT
https://app.gotreek.com/api/boxes/{id}
Boxes
Last modified:2025-12-25 15:05:20
Update an existing box by its ID, applying validated changes to its attributes (type, dimensions, weight..) and returning the updated resource.
💡
Authentication
Bearer token authentication is required.
Only boxes owned or accessible by the authenticated user should be updated according to your access rules.
📌
Behavior
If the box exists, the API updates only the allowed fields (type, length, width, height, weight) from the validated request and returns the updated box in the response body.

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
Path Params

Header Params

Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Box updated successfully
Body

🟠404
🟠422
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT '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
200 - Example 1
{
    "success": true,
    "message": "Box updated 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:20
Previous
Box Details
Next
Merchants Details
Built with