{
  "openapi": "3.0.0",
  "info": {
    "title": "Carrier Search API v2",
    "description": "Loadlink Carrier Search API — v2\n\nSearch active carrier postings on Loadlink and/or DAT by lane and equipment type.\n\n**New here?** [Check your access →](/access)\n\nAll endpoints require a bearer token — call `POST /v2/authorize` with your\norganization's integration email and org token to get one. Your Salesforce account\nadmin provisions the org token; it is shared across every sub-account in your\norganization.\n\n**Errors**: 400 responses follow RFC 9457 (`ProblemDetails`) with a structured\n`errors[]` array of `{name, reason}` pairs. 401 responses have no body.\n429 (rate limit exceeded) includes `X-RateLimit-*` headers and `Retry-After`.\n\n**Example payloads**: every operation below has a sample request/response for\nillustration only — cities, tokens, rates, etc. are made up. Substitute your own\nvalid values both in \"Try it\" and in real integration code; nothing about the\nexample values themselves is required or enforced.",
    "version": "v2"
  },
  "servers": [
    {
      "url": "https://azdevgateway.loadlink.ca/carrier-search",
      "description": "Dev"
    }
  ],
  "paths": {
    "/v2/reference/vehicle-types": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "Get all vehicle types",
        "operationId": "GetVehicleTypes",
        "responses": {
          "200": {
            "description": "Vehicle types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VehicleTypeResponse"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "vehicleTypeId": 1,
                    "detail": "Van",
                    "value": 1,
                    "code": "V"
                  },
                  {
                    "id": 2,
                    "vehicleTypeId": 2,
                    "detail": "Reefer",
                    "value": 2,
                    "code": "R"
                  }
                ]
              }
            }
          },
          "204": {
            "description": "No types found"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "OrgTokenBearer": []
          }
        ]
      }
    },
    "/v2/carrier-search": {
      "post": {
        "tags": [
          "carrier-search"
        ],
        "summary": "Search active carrier postings on Loadlink and/or DAT",
        "description": "Returns active lane postings matching the given criteria. At least one of OriginCity, OriginProvince, DestinationCity, or DestinationProvince is required.",
        "operationId": "FreightMatchingApiEndpointsCarrierSearchPostCarrierSearchEndpoint",
        "requestBody": {
          "x-name": "CarrierSearchRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CarrierSearchRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Matching postings (empty result set if none match)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing origin/destination or invalid input"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "OrgTokenBearer": []
          }
        ]
      }
    },
    "/v2/authorize": {
      "post": {
        "tags": [
          "Authorize"
        ],
        "summary": "Exchange an org token for a bearer",
        "description": "Resolves the given email against your organization, validates the org-level integration token, and — if your organization has the Integration API feature provisioned — returns a bearer token to use as `Authorization: Bearer <token>` on every other endpoint. Tokens expire after 5 minutes; call this endpoint again to get a new one.",
        "operationId": "Authorize",
        "requestBody": {
          "x-name": "AuthorizeRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizeRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Bearer issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeResponse"
                },
                "example": {
                  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
                  "tokenType": "Bearer",
                  "expiresIn": 300
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Org token does not match"
          },
          "403": {
            "description": "Account does not have the Integration API feature provisioned"
          },
          "404": {
            "description": "No user for that email, no account, or no org token provisioned yet"
          },
          "503": {
            "description": "Identity is temporarily unreachable — retry shortly"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "VehicleTypeResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique row identifier for this vehicle type.",
            "format": "int32"
          },
          "vehicleTypeId": {
            "type": "integer",
            "description": "Broader category grouping several vehicle types together (e.g. Van, Straight Truck, and Container all share the same category).",
            "format": "int32"
          },
          "detail": {
            "type": "string",
            "description": "Human-readable name (e.g. \"Van\", \"Reefer\", \"Flatbed\")."
          },
          "value": {
            "type": "integer",
            "description": "Bit-flag value for this vehicle type (a power of two). Postings encode their accepted vehicle types as a bitwise combination of these values.",
            "format": "int64"
          },
          "code": {
            "type": "string",
            "description": "Single-letter code for this vehicle type (e.g. \"V\" for Van, \"R\" for Reefer). This is the character used in a posting's VehicleType string."
          }
        }
      },
      "CarrierSearchResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "loadlinkResults": {
            "$ref": "#/components/schemas/CarrierSearchBucketResponse"
          },
          "datResults": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/CarrierSearchBucketResponse"
              }
            ]
          }
        }
      },
      "CarrierSearchBucketResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CarrierSearchResultResponse"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true
          },
          "hasMore": {
            "type": "boolean"
          }
        }
      },
      "CarrierSearchResultResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "dateAvail": {
            "type": "string",
            "format": "date-time"
          },
          "srceStateCity": {
            "type": "string",
            "nullable": true
          },
          "destStateCity": {
            "type": "string",
            "nullable": true
          },
          "companyName": {
            "type": "string",
            "nullable": true
          },
          "postDate": {
            "type": "string",
            "format": "date-time"
          },
          "vehicleSize": {
            "type": "string",
            "nullable": true
          },
          "vehicleType": {
            "type": "string",
            "nullable": true
          },
          "postingAttrib": {
            "type": "string",
            "nullable": true
          },
          "comment": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "hasCrossBorderAuthority": {
            "type": "boolean"
          },
          "registeredName": {
            "type": "string",
            "nullable": true
          },
          "phoneNumber": {
            "type": "string",
            "nullable": true
          },
          "street": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "province": {
            "type": "string",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "hoursOfOperation": {
            "type": "string",
            "nullable": true
          },
          "carrierType": {
            "type": "string",
            "nullable": true
          },
          "mcIccNumber": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "usdotNumber": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "ontarioCvor": {
            "type": "string",
            "nullable": true
          },
          "nscNumber": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "insuranceLiabilityCoverage": {
            "type": "number",
            "nullable": true
          },
          "insuranceCargoCoverage": {
            "type": "number",
            "nullable": true
          },
          "insuranceExpiryDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "creditScoreBand": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "CarrierSearchRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourcePostingCompany": {
            "type": "string"
          },
          "carrierCompanyName": {
            "type": "string",
            "maxLength": 50,
            "minLength": 0,
            "nullable": true
          },
          "originCity": {
            "type": "string",
            "maxLength": 50,
            "minLength": 0,
            "nullable": true
          },
          "originProvince": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "nullable": true
          },
          "originRadius": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "destinationCity": {
            "type": "string",
            "maxLength": 50,
            "minLength": 0,
            "nullable": true
          },
          "destinationProvince": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "nullable": true
          },
          "destinationRadius": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "vehicleSize": {
            "type": "string",
            "nullable": true
          },
          "vehicleType": {
            "type": "string",
            "nullable": true
          },
          "vehicleAttributes": {
            "type": "string",
            "nullable": true
          },
          "getMexicanData": {
            "type": "boolean"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "exclusiveMinimum": true
          },
          "loadlinkCursor": {
            "type": "string",
            "nullable": true
          },
          "datCursor": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "AuthorizeResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "tokenType": {
            "type": "string"
          },
          "expiresIn": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "AuthorizeRequest": {
        "type": "object",
        "example": {
          "email": "dispatch@example.com",
          "orgToken": "ll_example-org-token"
        },
        "additionalProperties": false,
        "required": [
          "email",
          "orgToken"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 1,
            "pattern": "^[^@]+@[^@]+$",
            "nullable": false,
            "example": "dispatch@example.com"
          },
          "orgToken": {
            "type": "string",
            "maxLength": 100,
            "minLength": 0,
            "nullable": false,
            "example": "ll_example-org-token"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "description": "RFC9457 compatible problem details/ error response class. this can be used by configuring startup like so:\napp.UseFastEndpoints(c => c.Errors.UseProblemDetails())",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "default": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1"
          },
          "title": {
            "type": "string",
            "default": "One or more validation errors occurred."
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "default": 400
          },
          "instance": {
            "type": "string",
            "default": "/api/route"
          },
          "traceId": {
            "type": "string",
            "default": "0HMPNHL0JHL76:00000001"
          },
          "detail": {
            "type": "string",
            "description": "the details of the error",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProblemDetails_Error"
            }
          }
        }
      },
      "ProblemDetails_Error": {
        "type": "object",
        "description": "the error details object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "the name of the error or property of the dto that caused the error",
            "default": "Error or field name"
          },
          "reason": {
            "type": "string",
            "description": "the reason for the error",
            "default": "Error reason"
          },
          "code": {
            "type": "string",
            "description": "the code of the error",
            "nullable": true
          },
          "severity": {
            "type": "string",
            "description": "the severity of the error",
            "nullable": true
          }
        }
      }
    },
    "securitySchemes": {
      "OrgTokenBearer": {
        "type": "http",
        "description": "Bearer token from POST /v2/authorize — exchange your org token for one, then use it here.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "tags": [
    {
      "name": "Authorize"
    },
    {
      "name": "Reference"
    },
    {
      "name": "carrier-search"
    }
  ]
}