FRAYT API

Introduction

This page outlines what will need to be done to successfully integrate with the FRAYT API. If you have any questions throughout the process, you can contact us at api@frayt.com.

The FRAYT API allows you to integrate with our marketplace efficiently. You will be able to receive price estimates, place delivery orders, and receive webhooks that track the order and driver location throughout the delivery process.

API Connection Guide

STEP 1: Setup

You can find the FRAYT API documentation here: https://api.frayt.com/docs/api/v2.2

Initially to get started, you will need to get credentials for the sandbox environment. If you are not already in discussion with us about this, you can contact us at api@frayt.com to request sandbox access.

You will receive a client ID and a secret key. Input these keys into the OAuth endpoint to get a token: /api​/v2.2​/oauth​/token. Once you have a token, you simply need to pass that token into the authorization header of your other requests as a bearer token.

STEP 2: Integrate

There are 4 distinct endpoints you can connect to depending on which features you want to implement. A “Match” in our system is what we call an order/delivery.

Endpoint Feature Description
/api/v2.2/matches/estimate Match Estimate Optional. Allows you to get an accurate price estimate of an order with only an address, service level, vehicle class, and timeframe.
/api/v2.2/matches Match Placement This action will send us a live delivery order. Refer to documentation for what can be sent. lt will be sent in one individual request.
/api/v2.2/matches/{id} (GET, PUT, DELETE) Get Match, Update Match, Delete Match Allows you to manipulate live orders. You can get the current status of an order, make changes to an order, or delete an order.
/api/v2.2/batches Batches Optional. Accepts a list of stops and creates multiple optimized Matches with the most efficient routes possible for our system.


Webhooks

Webhooks can be configured to be sent to a fixed URL of your choosing.  We can include one header in the webhook payload, which is generally used for authorization, but is optional.

Webhook payloads are defined in the callbacks of each method in the documentation. You can find detailed state information under the response Schema of each callback. For example, the shape of the webhook will be identical to the GET request on a Match (endpoint: /api/v2.2/matches/{id}).

STEP 3: Test

Once all desired features have been finished on your side, coordinate with the FRAYT team to live test the integration. This can also be done asynchronously. All endpoints should be prefixed with the sandbox environment.

Sandbox: https://sandbox.api.frayt.com
API Docs:
https://sandbox.api.frayt.com/docs/api/v2.2

Schedule a test request with us by emailing api@frayt.com, or following up in the original integration email. Pending a successful testing session, we are then prepared to turn on the production integration when ready.

STEP 4: Production

Pending financial approval, the integration should be ready to launch at this point. Once any necessary contracts and financials are in order and we have the green light, we will activate your production credentials.

At this stage the integration will be complete from our side and you can begin placing live orders.

Production: https://api.frayt.com
API Docs:
https://api.frayt.com/docs/api/v2.2