Calculate delivery price quotes before booking.
flasho.pricing
flasho.pricing
calculate()
Show the fee before the customer confirms.
const { quote } = await flasho.pricing.calculate({
fromLatitude: pickup.latitude,
fromLongitude: pickup.longitude,
toLatitude: dropoff.latitude,
toLongitude: dropoff.longitude,
});
setFee(`${quote.price} ${quote.currency}`); // "1.250 KWD"quote.distance is in kilometres. quote.estimatedDuration is in minutes. quote.tierLabel is the matching price band.
Scheduled quote
const { quote } = await flasho.pricing.calculate({
fromLatitude: 29.3764,
fromLongitude: 47.9785,
toLatitude: 29.3117,
toLongitude: 48.0034,
isScheduled: true,
});
// quote.pricingMode === "scheduled"
// quote.price === "2.000"Area hints
Pass deliveryArea or deliveryPaciArea when the drop-off is near a special zone, for example deliveryArea: 'Salmiya, Block 3'.
| Field | Required | Description |
|---|---|---|
fromLatitude / fromLongitude | Yes | Pickup coordinates |
toLatitude / toLongitude | Yes | Drop-off coordinates |
deliveryArea | No | Area string for zone detection |
deliveryPaciArea | No | PACI area name |
isScheduled | No | true for the scheduled flat rate |