openapi: 3.0.0 info: title: FRAYT API — Oauth version: '2.2' description: "
Welcome to the FRAYT's REST API. Each endpoint is documented individually, and\ \ the endpoints are categorized by the resource that they primarily affect (Matches, and OAuth). By following the outlined\ \ schema of each endpoint, our API allows you to integrate FRAYT's logistics services seamlessly into your application.
\n\ \nThe logistics industry tends to have a wide variety of terms for a single item. So\ \ let's make sure we define our terms before getting into the API:
\nNow that we have our terms defined, let's\ \ paint a bigger picture of what the life of a match looks like. These examples are the most common but are by no means\ \ exhaustive.
\n*Once a match is picked up, the match.stop state changes from Pending–>En Route–>Arrived–>Signed–>Delivered\ \ or Returned
\nThe FRAYT API endpoints are organized as matches,\ \ match estimates, and oauth. Once authentication has been made, the primary endpoint used will be the Matches endpoint\ \ for all estimates and matches.\n\nOur endpoints have a base url of https://api.frayt.com/api/v2.2/\n\nThe schema\ \ for each endpoint lists the properties and provides a brief description to provide context for your mapping needs.\ \ Additionally, all required properties are listed with a red asterisk (*).
\n\n\nAll FRAYT API requests require a valid bearer token. To\ \ generate your bearer token, you will need to hit the OAuth endpoint passing your Client ID and Secret in the payload.\n To acquire your Client ID\ \ and Secret, reach out to the FRAYT team at dev@frayt.com.
\n\nThe match estimates endpoint provides the ability to get a rate estimate, create a match,\ \ update an estimate, or turn an estimate into a match.
\nTo receive an estimated rate for a delivery without\ \ creating the match itself, hit the POST match estimates endpoint.
\nTo turn the estimate into a delivery (what\ \ we call a match at FRAYT), make a call to ouar PATCH match estimates endpoint.
\n\nThe\ \ matches endpoint\ \ provides the ability to create a match, update a match, add a tip, or cancel a match.
\nTo tender a delivery\ \ (what we call a match at FRAYT), pass the required payload to our POST matches endpoint.
\nTo fetch data on\ \ a match at any point, hit the GET /matches/{id} endpoint.
\n\n\nWebhook payloads are defined\ \ in the callbacks of each method below. You can find detailed state information under the response Schema of each callback.
\n\ \To receive webhook updates from FRAYT, contact the FRAYT team for setup and configuration at dev@frayt.com
\n" servers: - url: https://api.frayt.com variables: {} tags: - name: oauth paths: /api/v2.2/oauth/token: post: callbacks: {} operationId: FraytElixirWeb.API.OauthController.authenticate parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/Oauth Request' description: Credentials required: false responses: '200': content: application/json: schema: $ref: '#/components/schemas/Oauth Response' description: Success '403': content: application/json: schema: $ref: '#/components/schemas/Forbidden' description: Invalid Credentials '422': content: application/json: schema: $ref: '#/components/schemas/Invalid Parameters' description: Invalid Parameters summary: Get bearer token for use in protected API calls` tags: - oauth components: securitySchemes: authorization: scheme: bearer type: http schemas: Forbidden: description: Invalid/expired credentials were provided or permissions are insufficient example: code: forbidden message: string properties: code: description: Error code type: string message: description: Human readable message explaining the error type: string title: Forbidden type: object Invalid Parameters: description: Error response when invalid paramaters are passed properties: errors: items: properties: detail: type: string source: properties: pointer: type: string type: object title: type: string type: object type: array title: Invalid Parameters type: object Oauth Request: description: Company Oauth credentials example: client_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx secret: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx properties: client_id: description: Required client ID type: string client_secret: description: Client secret key (optional if secret is present) type: string secret: description: Secret key (optional if client_secret is present) type: string required: - client_id title: Oauth Request type: object Oauth Response: description: Issued access (bearer) token example: response: token: xxxxxx... properties: response: properties: token: description: Bearer access token type: string required: - token type: object required: - response title: Oauth Response type: object