1. Price Calculator
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
    • Cities List
    • Couriers List
  • Warehouses
    • Warehouses List
    • Create warehouse
    • warehouse Details
  • Price Calculator
    • Price Calculator
      POST
  • 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. Price Calculator

Price Calculator

Developing
POST
https://app.gotreek.com/api/calculate
Last modified:2026-02-18 11:47:05
Calculate shipping rates between two cities for one or more boxes. This endpoint is a public price calculator that does not require an order or authentication and can be used to estimate shipping costs.
💡
Authentication
No authentication is required for this endpoint.
Any client can call this API to estimate shipping prices based on city names and box dimensions.
💡
Behavior
Accepts origin and destination city names (from_city, to_city) and an array of boxes (length, width, height, weight).
Calculates shipping rates using the configured pricing rules.
Returns the calculated rates along with a summary of the input parameters (from_city, to_city, boxes) and the currency (SAR).
If one of the cities cannot be resolved, returns a 400 error with error = city_not_found and a descriptive message.

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
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://app.gotreek.com/api/calculate' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "from_city": "string",
    "to_city": "string",
    "boxes": [
        {
            "length": 0,
            "width": 0,
            "height": 0,
            "weight": 0,
            "box_id": 0
        }
    ]
}'
Response Response Example
{
    "data": [
        {
            "service_id": 0,
            "courier_name": "string",
            "service_name": "string",
            "identifier": "string",
            "price_cents": 0,
            "price_sar": 0,
            "delivery_time": "string",
            "logo": "string",
            "logo_big": "string"
        }
    ],
    "request_params": {
        "from_city": "string",
        "to_city": "string",
        "boxes_count": 0,
        "is_cod": true
    },
    "currency": "string"
}
Modified at 2026-02-18 11:47:05
Previous
warehouse Details
Next
Packaging Types List
Built with