Fares

Fares are a set of metrics to determine the price of a task. The shipping fares calculation takes into account the distance, the number of products, and the package size or capacity of vehicle requested.

Fares also depend on the city, even in the same country cities can differ their fares.

Fare Fetching

Endpoint GET /task/fare

  • Fetches the shipping price based on the company and city fares. Takes into account a list of fares and items.

Schema

Request (query)

{
  "data" [ // Shipment list. (object)
    "pickup_location" { // Pickup location object. (object)
      "lat" // Location latitude. (double)
      "lng" // Location longitude. (double)
    }
    "delivery_location" { // Delivery location object. (object)
      "lat" // Location latitude. (double)
      "lng" // Location longitude. (double)
    }
    "items" [ // Product list. (array)
      "qty" // Total amount of product-type. (int)
      "size" // Product size based on vehicle size chart: 1 - Bicycle, 2 - Motorcycle, 3 - Car, 4 - SUV, 5 - Truck.. (int) (shippify-package-size)
    ]
  ]
}

Response

{
  "errFlag" // Error code. (int)
  "errMsg" // Error message. (string)
  "price" // Total shipping price. (double)
  "distance" // Total shipping route distance. (double)
  "currency" // Task currency sign. (string)
  "city" { // City object envelope. (object)
    "id" // City id. (string)
    "name" // City name. (string)
    "country" // City's country's name. (string)
    "lat" // City center location latitude. (double)
    "lng" // City center location longitude. (double)
    "short" // City short name. (string)
    "lang" // City language abbreviature. (string)
  }
}

Example

curl
-X GET
-u '**APIKeyId**:**APISecretId*'
'https://api.shippify.co/task/fare?data=[{"pickup_location":{"lat":-2.19761,"lng":-79.8917601},"delivery_location":{"lat":-2.141976,"lng":-79.86730899999998},"items":[{"id":"10234","name":"TV","qty":"2","size":"3","price":"0"}]}]'

Payload

{
  "errFlag": 0,
  "price": "18.55",
  "distance": 2.9655261209905985,
  "currency": "BRL",
  "city": {
    "id": 1,
    "name": "Belo Horizonte",
    "country": "BRASIL",
    "lat": -19.9245,
    "lng": -43.9353,
    "short": "BH",
    "lang": "pr"
  }
}

results matching ""

    No results matching ""