openapi: "3.1.0"
info:
  title: "Logistics API"
  version: "1.0.0"
  description: "Shipments, tracking, carrier rates, and delivery flows Exported as an OpenAPI 3.1 document from Fake API for Devs."
servers:
  - url: "https://fakeapifordevs.vercel.app"
        description: "Fake API for Devs production endpoint"
tags:
  - name: "Logistics"
        description: "Shipments, tracking, carrier rates, and delivery flows"
paths:
  /api/logistics/shipments:
    get:
      tags:
        - "Logistics"
      summary: "GET /api/logistics/shipments?page=2"
      operationId: "logistics_get_logistics_shipments"
      parameters:
        - name: "page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      default: 1
                    description: "1-indexed page number for collection endpoints."
        - name: "per_page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      maximum: 50
                      default: 10
                    description: "Page size for collection endpoints."
        - name: "q"
                    in: "query"
                    schema:
                      type: "string"
                    description: "Optional text search filter where supported."
        - name: "delay"
                    in: "query"
                    schema:
                      type: "number"
                      minimum: 0
                      maximum: 10
                    description: "Optional artificial delay in seconds."
        - name: "simulate_error"
                    in: "query"
                    schema:
                      type: "string"
                      enum:
                        - "rate_limit"
                        - "server_error"
                        - "not_found"
                        - "unauthorized"
                        - "forbidden"
                        - "bad_request"
                        - "service_unavailable"
                        - "timeout"
                        - "malformed"
                    description: "Force a mock failure scenario for resilience testing."
      responses:
        200:
          description: "Successful response"
          content:
            application/json:
              schema:
                type: "object"
        400:
          description: "Bad request"
        401:
          description: "Unauthorized"
        404:
          description: "Not found"
        429:
          description: "Rate limited"
        500:
          description: "Internal server error"
    post:
      tags:
        - "Logistics"
      summary: "POST /api/logistics/shipments"
      operationId: "logistics_post_logistics_shipments"
      parameters:
        []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: "object"
            example:
              origin: "New York, NY"
              destination: "San Francisco, CA"
              weight: "2.5 kg"
      responses:
        200:
          description: "Successful response"
          content:
            application/json:
              schema:
                type: "object"
        400:
          description: "Bad request"
        401:
          description: "Unauthorized"
        404:
          description: "Not found"
        429:
          description: "Rate limited"
        500:
          description: "Internal server error"
  /api/logistics/shipments/TRK-2025-001000/tracking:
    get:
      tags:
        - "Logistics"
      summary: "GET /api/logistics/shipments/TRK-2025-001000/tracking"
      operationId: "logistics_get_logistics_shipments_TRK_2025_001000_tracking"
      parameters:
        - name: "page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      default: 1
                    description: "1-indexed page number for collection endpoints."
        - name: "per_page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      maximum: 50
                      default: 10
                    description: "Page size for collection endpoints."
        - name: "q"
                    in: "query"
                    schema:
                      type: "string"
                    description: "Optional text search filter where supported."
        - name: "delay"
                    in: "query"
                    schema:
                      type: "number"
                      minimum: 0
                      maximum: 10
                    description: "Optional artificial delay in seconds."
        - name: "simulate_error"
                    in: "query"
                    schema:
                      type: "string"
                      enum:
                        - "rate_limit"
                        - "server_error"
                        - "not_found"
                        - "unauthorized"
                        - "forbidden"
                        - "bad_request"
                        - "service_unavailable"
                        - "timeout"
                        - "malformed"
                    description: "Force a mock failure scenario for resilience testing."
      responses:
        200:
          description: "Successful response"
          content:
            application/json:
              schema:
                type: "object"
        400:
          description: "Bad request"
        401:
          description: "Unauthorized"
        404:
          description: "Not found"
        429:
          description: "Rate limited"
        500:
          description: "Internal server error"
  /api/logistics/carriers:
    get:
      tags:
        - "Logistics"
      summary: "GET /api/logistics/carriers?service_level=express"
      operationId: "logistics_get_logistics_carriers"
      parameters:
        - name: "page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      default: 1
                    description: "1-indexed page number for collection endpoints."
        - name: "per_page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      maximum: 50
                      default: 10
                    description: "Page size for collection endpoints."
        - name: "q"
                    in: "query"
                    schema:
                      type: "string"
                    description: "Optional text search filter where supported."
        - name: "delay"
                    in: "query"
                    schema:
                      type: "number"
                      minimum: 0
                      maximum: 10
                    description: "Optional artificial delay in seconds."
        - name: "simulate_error"
                    in: "query"
                    schema:
                      type: "string"
                      enum:
                        - "rate_limit"
                        - "server_error"
                        - "not_found"
                        - "unauthorized"
                        - "forbidden"
                        - "bad_request"
                        - "service_unavailable"
                        - "timeout"
                        - "malformed"
                    description: "Force a mock failure scenario for resilience testing."
      responses:
        200:
          description: "Successful response"
          content:
            application/json:
              schema:
                type: "object"
        400:
          description: "Bad request"
        401:
          description: "Unauthorized"
        404:
          description: "Not found"
        429:
          description: "Rate limited"
        500:
          description: "Internal server error"
  /api/logistics/carriers/rates:
    post:
      tags:
        - "Logistics"
      summary: "POST /api/logistics/carriers/rates"
      operationId: "logistics_post_logistics_carriers_rates"
      parameters:
        []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: "object"
            example:
              origin:
                postal_code: "94107"
                country: "US"
              destination:
                postal_code: "10001"
                country: "US"
              weight: 5.4
              dimensions:
                length_cm: 40
                width_cm: 30
                height_cm: 25
      responses:
        200:
          description: "Successful response"
          content:
            application/json:
              schema:
                type: "object"
        400:
          description: "Bad request"
        401:
          description: "Unauthorized"
        404:
          description: "Not found"
        429:
          description: "Rate limited"
        500:
          description: "Internal server error"