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

Create Shipment

POST
https://app.gotreek.com/api/shipments
Shipments
Last modified:2025-12-26 21:00:46
Creates a shipment for an existing order using the specified courier service ,debit the appropriate wallet if needed, and generate a printable shipping label.
📌
Authentication
Requires Bearer token.
Only orders belonging to the authenticated merchant can be used to create a shipment.
📌
Behavior
The phone number must be valid and correctly formatted for the shipment to be created successfully.
Creates a shipment for the specified order using the selected courier and either global or order‑level configuration.
Calculates shipment cost, optionally debits the merchant or warehouse user wallet, and records a wallet transaction.
Generates a shipping label PDF and updates the order’s latest shipment fields (tracking link, label URL, costs, external id, status)

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

🟢200
application/json
Shipment created successfully
Body

🟠401
🟠404
🟠422
🔴500
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://app.gotreek.com/api/shipments' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "order_id": 123,
    "courier": "aramex"
}'
Response Response Example
200 - Success
{
    "success": true,
    "message": "Shipment created successfully",
    "data": {
        "shipment_id": 23153,
        "tracking_link": "http://localhost/shipment_tracking?trackingNumber=100387034046",
        "shipment_label_url": "https://elasticbeanstalk-eu-central-1-640066223797.s3-accelerate.amazonaws.com/360/Deliverist_1766159050543_report.pdf",
        "shipment_cost": 2595,
        "shipment_cost_without_cod": 1795,
        "order_status": "awaiting_pickup",
        "courier": "deliverist",
        "external_id": "38703404"
    }
}
Modified at 2025-12-26 21:00:46
Previous
Order Price
Next
Return Shipment
Built with