Download OpenAPI specification:Download
This OpenAPI Specification describes v1_0 of the Trexity API.
Before getting started, please make sure you've acquired Trexity Merchant API Key.
Each endpoint requires an Authorization header with "Bearer <Trexity API Key>" in order to be used.
Below, we describe the available API endpoints in details and provide examples (request/response and curl ones).
All endpoints will return an object and if there is actual data to be returned, it is going to be named data
.
data
may be an array or an object.
If there is error
field present on the root JSON object, that means something went wrong and that error message is
all we know about it. Additionally, in some cases, you may inspect the HTTP status codes to gather more information.
Please check our payload/response examples in details as well as the curl examples that are a part of each section that documents
an operation.
Example of a successful response:
{ data: ... }
Example of a response with an error:
{ error: 'Some error message', data: null }
In order for Trexity to start the process of matching drivers for your shipment, your shipment must be posted.
The most common way of doing this is via our (post shipment)[/#operation/postShipment] endpoint.
In order to schedule posting a shipment in the future, please use 'scheduledPostAt' in our (create shipment)[/#operation/createShipment] endpoint.
The bearer token which is your Trexity API KEY.
Every request against a Trexity API endpoint must be accompanied with an Authorization header.
For instance:
curl -X POST https://trexity.app/api/v1_0/shipment-rates\
-H 'Content-Type: application/json'\
-H 'Authorization: Bearer <Trexity API Key>'\
-d '{
"pickupAddress": "9 Slack Road, Ottawa, Canada",
"deliveryAddresses": ["123 Slater Street, Ottawa, Canada"],
"requirements": {},
"orderValue": 2500
}'
Please check our curl examples for more examples.
Security Scheme Type | HTTP |
---|---|
HTTP Authorization Scheme | bearer |
In order to obtain a Trexity Merchant API key, you need to sign-up as Merchant at https://trexity.com
The API key is a string of 128 characters that you can create after you've logged in as Merchant in Trexity's Merchant Portal (https://merchant.trexity.com/)
Feel free to contact support@trexity.com for any questions you may have.
Prior to creating a Shipment, you can calculate the rates based on the pickup address and the number of stops the driver has to do. See our shipment-rates endpoint for more information.
Returns the distance (in meters), travel duration (in seconds), and fee from a pickup address to the completion of the shipment (takes into account multiple parcel dropoffs, if any). Supports specifying an order value parameter, which will check against API Preferences configured in the merchant portal.
Payload that minimally describes a shipment.
pickupAddress required | string (AddressOrLatLng) <= 512 characters Latitutde and longitude values separated by comma or an address to be geocoded into latitude and longitude values. Examples:
|
deliveryAddresses required | Array of strings (AddressOrLatLng) [ 1 .. 19 ] items One or more latitude and longitude values separated by comma or an address to be geocoded into latitude and longitude values. Examples:
|
required | object (ShipmentRequirements) Object representing the requirements that to be met by a driver in order for them to be considered for delivery. |
orderValue | number >= 0 The order value, if any. Specified in cents. |
{- "pickupAddress": "456 Elgin Street, Ottawa, ON",
- "deliveryAddresses": [
- "45.4132789,-75.6885815",
- "225 Preston St, Ottawa, ON K1R 7R1"
], - "requirements": {
- "vehicleType": "small"
}, - "orderValue": 2500
}
{- "data": [
- {
- "totalWithoutTaxes": 1688,
- "name": "Trexity Local Delivery",
- "pickupDeliveryDuration": 2121,
- "pickupDeliveryDistance": 17172,
- "directionsResult": {
- "features": [
- {
- "geometry": {
- "type": "LineString",
- "coordinates": [
- [
- -75.72048,
- 45.32606
], - [
- -75.72022,
- 45.32575
], - [
- -75.72007,
- 45.32555
], - [
- -75.72038,
- 45.32544
], - [
- -75.72209,
- 45.32479
], - [
- -75.72319,
- 45.32436
], - [
- -75.72502,
- 45.32366
], - [
- -75.72764,
- 45.32266
], - [
- -75.7343,
- 45.32012
], - [
- -75.73699,
- 45.31907
], - [
- -75.73815,
- 45.31863
], - [
- -75.73974,
- 45.31802
], - [
- -75.73994,
- 45.31801
], - [
- -75.74025,
- 45.31792
], - [
- -75.7417,
- 45.31735
], - [
- -75.74183,
- 45.3173
], - [
- -75.7422,
- 45.31788
], - [
- -75.74249,
- 45.31834
], - [
- -75.74303,
- 45.31918
], - [
- -75.74357,
- 45.32011
], - [
- -75.74428,
- 45.32132
], - [
- -75.7446,
- 45.32186
], - [
- -75.74507,
- 45.32262
], - [
- -75.74675,
- 45.32537
], - [
- -75.7486,
- 45.32835
], - [
- -75.74912,
- 45.32923
], - [
- -75.74962,
- 45.33001
], - [
- -75.75044,
- 45.33134
], - [
- -75.75067,
- 45.33167
], - [
- -75.7511,
- 45.33242
], - [
- -75.75171,
- 45.33339
], - [
- -75.75201,
- 45.33394
], - [
- -75.75287,
- 45.3355
], - [
- -75.75375,
- 45.33713
], - [
- -75.75483,
- 45.33911
], - [
- -75.75518,
- 45.33977
], - [
- -75.75584,
- 45.34089
], - [
- -75.75655,
- 45.34206
], - [
- -75.7569,
- 45.34268
], - [
- -75.75786,
- 45.34434
], - [
- -75.75866,
- 45.34572
], - [
- -75.75942,
- 45.34698
], - [
- -75.76006,
- 45.34809
], - [
- -75.76026,
- 45.34836
], - [
- -75.76049,
- 45.34861
], - [
- -75.76117,
- 45.34926
], - [
- -75.76187,
- 45.34995
], - [
- -75.7621,
- 45.35022
], - [
- -75.76231,
- 45.3505
], - [
- -75.76283,
- 45.35145
], - [
- -75.76295,
- 45.35166
], - [
- -75.76363,
- 45.35288
], - [
- -75.76475,
- 45.35486
], - [
- -75.76566,
- 45.3565
], - [
- -75.76625,
- 45.35759
], - [
- -75.76727,
- 45.35935
], - [
- -75.76763,
- 45.36002
], - [
- -75.76761,
- 45.36012
], - [
- -75.76766,
- 45.36027
], - [
- -75.76769,
- 45.36053
], - [
- -75.76768,
- 45.36066
], - [
- -75.76764,
- 45.3608
], - [
- -75.76757,
- 45.36094
], - [
- -75.76747,
- 45.36107
], - [