openapi: 3.0.0
info:
  title: Stallion Express API
  version: '4'
  contact:
    name: API Support
    email: developersupport@stallionexpress.ca
  description: >-
    Access to the sandbox environment can be provided upon request. (Not all
    rates are available in the Sandbox environment). API token can be found
    under "Account Settings > API Token" in the Stallion Express dashboard. To
    help us assist you more effectively when troubleshooting, please make sure
    to include the Request-ID in your email communication.
servers:
  - url: https://ship.stallionexpress.ca/api/v4
    description: Production server (uses live data)
  - url: https://sandbox.stallionexpress.ca/api/v4
    description: Sandbox server (uses test data)
security:
  - bearerAuth: []
paths:
  /postage-types:
    get:
      tags:
        - Postage Types
      summary: Get Postage Types
      description: Get a list of all available postage types
      operationId: getPostageTypes
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  postage_types:
                    type: array
                    items:
                      $ref: '#/components/schemas/PostageType'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /rates:
    post:
      tags:
        - Shipments
      summary: Get Rates
      description: Validates shipment details and returns all available rates.
      operationId: getRates
      requestBody:
        description: Shipment details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RatesRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  rates:
                    type: array
                    description: Array of rates
                    items:
                      $ref: '#/components/schemas/Rate'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '422':
          description: Validation Error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /orders:
    get:
      tags:
        - Orders
      summary: Get Orders
      description: Get a paginated list of orders based on certain criteria.
      operationId: getOrders
      parameters:
        - in: query
          name: limit
          description: The maximum number of orders to retrieve per page.
          schema:
            type: integer
            minimum: 10
            maximum: 500
        - in: query
          name: page
          description: The page number of results to retrieve.
          schema:
            type: integer
            minimum: 1
        - in: query
          name: order_id
          description: Filter orders by a specific order ID.
          schema:
            type: string
        - in: query
          name: from_date
          description: The start date for filtering orders (optional).
          schema:
            type: string
            format: date
        - in: query
          name: to_date
          description: >-
            The end date for filtering orders (optional). Must be after or equal
            to from_date.
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  path:
                    type: string
                    description: The path to the orders.
                    example: http://admin.stallionexpress.test/api/v4/orders
                  per_page:
                    type: integer
                    description: The number of orders displayed per page.
                    example: 100
                  to:
                    type: integer
                    description: The page number of the current result set.
                    example: 2
                  total:
                    type: integer
                    description: The total number of orders.
                    example: 2
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                  data:
                    type: array
                    description: Array of orders.
                    items:
                      $ref: '#/components/schemas/Order'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
    post:
      tags:
        - Orders
      summary: Create Order
      description: Create an order.
      operationId: createOrder
      requestBody:
        description: The order object that needs to be created.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequest'
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                  order:
                    $ref: '#/components/schemas/Order'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '409':
          description: Conflict
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                    example: false
                  errors:
                    type: array
                    description: An array of error messages.
                    items:
                      type: string
                      example: Order already exists
        '422':
          description: Validation Error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /orders/{id}:
    get:
      tags:
        - Orders
      summary: Get Order
      description: Retrieve a specific order by its auto generated unique ID.
      operationId: getOrder
      parameters:
        - in: path
          name: id
          description: The unique ID of the order to retrieve.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                  order:
                    $ref: '#/components/schemas/Order'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '404':
          description: Order not found
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                    example: false
                  errors:
                    type: array
                    description: An array of error messages.
                    items:
                      type: string
                      example: Order not found
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
    put:
      tags:
        - Orders
      summary: Update Order
      description: Update an order.
      operationId: updateOrder
      parameters:
        - in: path
          name: id
          description: The unique ID of the order to update.
          required: true
          schema:
            type: string
      requestBody:
        description: The order object that needs to be updated.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequest'
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                  order:
                    $ref: '#/components/schemas/Order'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '409':
          description: Conflict
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                    example: false
                  errors:
                    type: array
                    description: An array of error messages.
                    items:
                      type: string
                      example: Order already exists
        '422':
          description: Validation Error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /stores:
    get:
      tags:
        - Stores
      summary: Get Stores
      description: >-
        Get a list of all stores associated with the authenticated user. (This
        only shows store create via the API.)
      operationId: getStores
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                  stores:
                    type: array
                    description: Array of stores
                    items:
                      $ref: '#/components/schemas/Store'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
    post:
      tags:
        - Stores
      summary: Create Store
      description: Create a new store for the authenticated user.
      operationId: createStore
      requestBody:
        description: The store data that needs to be created.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateStoreRequest'
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                  store:
                    $ref: '#/components/schemas/Store'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '422':
          description: Validation Error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /stores/{id}:
    delete:
      tags:
        - Stores
      summary: Delete Store by ID
      description: Delete a store by its unique ID.
      operationId: deleteStore
      parameters:
        - in: path
          name: id
          description: The unique ID of the store to delete.
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '404':
          description: Store not found
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                    example: false
                  errors:
                    type: array
                    description: An array of error messages.
                    items:
                      type: string
                      example: Store not found
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /{store_id}/orders/{order_id}:
    get:
      tags:
        - Orders
      summary: Get Store Order
      description: Retrieve a specific order by its unique ID.
      operationId: getStoreOrder
      parameters:
        - in: path
          name: store_id
          description: The unique ID of the store to retrieve.
          required: true
          schema:
            type: string
        - in: path
          name: order_id
          description: The user provided order ID of the order to retrieve.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                  order:
                    $ref: '#/components/schemas/Order'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '404':
          description: Order not found
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the request was successful.
                    example: false
                  errors:
                    type: array
                    description: An array of error messages.
                    items:
                      type: string
                      example: Order not found
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /shipments:
    get:
      tags:
        - Shipments
      summary: Get Shipments
      description: Get the list of paginated shipments by different search parameters.
      operationId: getShipments
      parameters:
        - name: from_date
          in: query
          description: return shipments with a created_at on or after the given date
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: to_date
          in: query
          description: >-
            return shipments with a created_at greater than or equal to the
            given date.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: ship_code
          in: query
          description: search by ship code
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: to_name
          in: query
          description: search by recipient
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: tracking_code
          in: query
          description: search by tracking code
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: order_id
          in: query
          description: search by order id
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: batch_id
          in: query
          description: search by batch id
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: closeout_id
          in: query
          description: search by closeout id
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: status
          in: query
          description: search by shipment statuses
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - unpaid
                - postage-expired
                - pending
                - incomplete
                - ready
                - received
                - processing
                - in-transit
                - delivered
                - exception
                - void-requested
                - voided
                - complete
        - name: limit
          in: query
          description: number of records to return per page
          required: false
          style: form
          explode: true
          schema:
            type: integer
        - name: page
          in: query
          description: the current page number of the response
          required: false
          style: form
          explode: true
          schema:
            type: integer
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipmentsResponse'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '422':
          description: Validation Error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
    post:
      tags:
        - Shipments
      summary: Create Shipment
      parameters:
        - in: header
          name: Idempotency-Key
          schema:
            type: string
            maxLength: 255
          description: >-
            A unique key to ensure idempotent behavior of the request. If
            provided and a matching key was used in the last 24 hours, the
            previous shipment will be returned.
          required: false
      description: Create a shipment and return the postage label.
      operationId: createShipment
      requestBody:
        description: >-
          The shipment object that needs to be created. Note that size fields
          are required for any shipments with the package type of Parcel.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShipmentRequest'
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipmentResponse'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '422':
          description: Validation Error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /track:
    get:
      tags:
        - Shipments
      summary: Track Shipment
      description: Fetch a shipment tracking details by different search parameters
      operationId: track
      parameters:
        - name: ship_code
          in: query
          description: The ship_code or identifier of a shipment.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: tracking_code
          in: query
          description: The tracking number of a shipment.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: order_id
          in: query
          description: The order id of a shipment.
          required: false
          style: form
          explode: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackResponse'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '422':
          description: Validation Error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /shipments/{ship_code}:
    get:
      tags:
        - Shipments
      summary: Get Shipment
      description: Get a shipment
      operationId: getTracking
      parameters:
        - name: ship_code
          in: path
          description: The ship_code of a shipment.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipmentResponse'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '404':
          description: Not Found
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /shipments/{ship_code}/void:
    get:
      tags:
        - Shipments
      summary: Void Shipment
      description: Requests a void for a shipment with the provided id.
      operationId: voidShipment
      parameters:
        - name: ship_code
          in: path
          description: The ship_code of a shipment.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoidResponse'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '404':
          description: Not Found
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Validation Error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /batches:
    post:
      tags:
        - Batches
      summary: Create a batch
      description: Creates a new batch to be used when creating shipments.
      operationId: createBatch
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /locations:
    get:
      tags:
        - Locations
      summary: Get Locations
      description: Gets a list of all current Stallion Express locations.
      operationId: getLocations
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationsResponse'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
  /credits:
    get:
      tags:
        - Credits
      summary: Get Credits
      description: Return the current account balance
      operationId: getCredits
      responses:
        '200':
          description: successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsResponse'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
      security:
        - bearerAuth: []
    post:
      tags:
        - Credits
      summary: Add Credits
      description: Add credits using hte account's default credit card
      operationId: addCredits
      requestBody:
        description: Amount of credits to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditsRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsResponse'
        '401':
          description: Unauthenticated
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
        '422':
          description: Validation Error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal error
          headers:
            Request-Id:
              schema:
                type: string
              description: UUID for the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
components:
  schemas:
    ShipmentStatus:
      type: string
      enum:
        - Postage Expired
        - Pending
        - Incomplete
        - Ready
        - Received
        - Processing
        - In Transit
        - Delivered
        - Exception
        - Void Requested
        - Voided
        - Complete
    PackageCode:
      type: string
      enum:
        - parcel
        - legal_flat_rate_envelope
        - flat_rate_padded_envelope
        - small_flat_rate_box
        - medium_flat_rate_box_1
        - medium_flat_rate_box_2
        - large_flat_rate_box
        - regional_rate_box_a1
        - regional_rate_box_a2
        - regional_rate_box_b1
        - regional_rate_box_b2
        - letter
        - large_envelope_or_flat
        - thick_envelope
    PackageType:
      type: string
      enum:
        - Parcel
        - Legal Flat Rate Envelope
        - Flat Rate PAdded Envelope
        - Small Flat Rate Box
        - Medium Flat Rate Box 1
        - Medium Flat Rate Box 2
        - Large Flat Rate Box
        - Regional Rate Box A1
        - Regional Rate Box A2
        - Regional Rate Box B1
        - Regional Rate Box B2
        - Letter
        - Large Envelope Or Flat
        - Thick Envelope
    PostageCode:
      type: string
      enum:
        - usps_first_class_mail
        - usps_priority_mail
        - usps_priority_mail_express
        - usps_parcel_select_ground
        - usps_media_mail
        - usps_library_mail
        - usps_express_mail_international
        - usps_priority_mail_international
        - usps_first_class_mail_international
        - fedex_ground
        - ups_standard
        - postnl_international_packet
        - postnl_international_packet_tracked
        - apc_priority_worldwide
        - apc_priority_worldwide_tracked
        - apc_priority_worldwide_expedited
        - apc_priority_worldwide_expedited_ddp_
        - stallion_economy_usa
        - stallion_economy_ca
        - us_economy
    PostageType:
      type: string
      enum:
        - USPS First Class Mail
        - USPS Priority Mail
        - USPS Priority Mail Express
        - USPS Parcel Select Ground
        - USPS Media Mail
        - USPS Library Mail
        - USPS Express Mail International
        - USPS Priority Mail International
        - USPS First Class Mail International
        - FedEx Ground
        - UPS Standard
        - PostNL International Packet
        - PostNL International Packet Tracked
        - APC Priority Worldwide
        - APC Priority Worldwide Tracked
        - APC Priority Worldwide Expedited
        - APC Priority Worldwide Expedited(DDP)
        - Stallion Economy USA
        - Stallion Economy CA
        - US Economy
    WeightUnit:
      type: string
      enum:
        - lbs
        - kg
        - g
        - oz
    SizeUnit:
      type: string
      enum:
        - cm
        - in
    Currency:
      type: string
      enum:
        - CAD
        - USD
        - EUR
        - AUD
        - GBP
    Item:
      type: object
      properties:
        description:
          type: string
          example: Two pair of socks
        sku:
          type: string
          nullable: true
          example: SKU123
          description: The SKU/ASIN of the item. Required for FBA shipments.
        quantity:
          type: integer
          example: 2
        value:
          type: number
          example: 10
        currency:
          $ref: '#/components/schemas/Currency'
        country_of_origin:
          type: string
          example: CN
          description: Required if the shipment is being sent to US
        hs_code:
          type: string
          example: '123456'
          description: Required if the shipment country_of_origin is CN/HK.
    RegionCode:
      description: >-
        Default account region. The region where the shipment will be delivered
        to Stallion. Ability to change this is needs to be enabled by Stallion.
      type: string
      nullable: true
      enum:
        - 'ON'
        - BC
        - QC
      example: null
    RegionName:
      type: string
      enum:
        - Ontario
        - British Columbia
        - Quebec
    Address:
      type: object
      properties:
        name:
          type: string
          example: Pramod Thomson
          maxLength: 40
          description: The full name associated with the address.
        company:
          type: string
          nullable: true
          maxLength: 40
          description: The company name associated with the address, if applicable.
        address1:
          type: string
          example: 30 Clearview Dr
          maxLength: 50
          description: The primary street address or post office box number.
        address2:
          type: string
          nullable: true
          maxLength: 50
          description: >-
            Additional address information, such as suite or apartment number,
            if needed.
        city:
          type: string
          example: Rock Springs
          maxLength: 35
          description: The city or locality of the address.
        province_code:
          type: string
          example: WY
          minLength: 2
          maxLength: 2
          description: >-
            The code for the state, province, or territory where the address is
            located.
        postal_code:
          type: string
          example: '82901'
          maxLength: 10
          description: The postal or ZIP code for the address.
        country_code:
          type: string
          example: US
          minLength: 2
          maxLength: 2
          description: The two-letter ISO code representing the country of the address.
        phone:
          type: string
          nullable: true
          maxLength: 20
          description: The contact phone number for the address, if provided.
        email:
          type: string
          nullable: true
          maxLength: 50
          description: The email address associated with the address, if available.
        is_residential:
          type: boolean
          example: true
          default: true
          description: >-
            Specifies whether the address is residential. Assumed to be true
            unless indicated otherwise.
    TaxType:
      type: string
      example: IOSS
      enum:
        - IOSS
        - EORI
        - VAT
    RatesRequest:
      required:
        - to_address
        - package_type
        - size_unit
        - weight
        - weight_unit
      type: object
      properties:
        to_address:
          type: object
          description: Recipient address for the shipment.
          allOf:
            - $ref: '#/components/schemas/Address'
        return_address:
          type: object
          description: >-
            The return address is required exclusively for generating a return
            label and should only be provided if is_return is set to true. This
            field is not applicable to regular shipments.
          allOf:
            - $ref: '#/components/schemas/Address'
        is_return:
          type: boolean
          description: Indicates if the shipment will be a return.
          example: false
          nullable: true
        weight_unit:
          $ref: '#/components/schemas/WeightUnit'
        weight:
          type: number
          example: 0.6
          description: >-
            Represents the total weight of the shipment in the specified weight
            unit (e.g., kg, g, oz, or lbs).
        length:
          type: number
          example: 9
          description: >-
            Specifies the length of the shipment package, measured in the
            designated size unit (e.g., in or cm). This measurement should
            correspond to the longest side of the package.
        width:
          type: number
          example: 12
          description: >-
            Indicates the width of the shipment package, measured in the
            designated size unit (e.g., in or sm). Width is typically the second
            longest side of the package, perpendicular to the length.
        height:
          type: number
          example: 1
          description: >-
            Defines the height of the shipment package, measured in the
            designated size unit (e.g., in or cm). Height is the dimension from
            the base to the top of the package, perpendicular to the length and
            width.
        size_unit:
          $ref: '#/components/schemas/SizeUnit'
        items:
          type: array
          items:
            $ref: '#/components/schemas/Item'
          description: An array of items in the shipment.
        package_type:
          oneOf:
            - $ref: '#/components/schemas/PackageType'
            - $ref: '#/components/schemas/PackageCode'
        postage_types:
          type: array
          nullable: true
          description: Limit the results to specific postage types
          example: []
          items:
            oneOf:
              - $ref: '#/components/schemas/PostageType'
              - $ref: '#/components/schemas/PostageCode'
        signature_confirmation:
          type: boolean
          example: true
          nullable: true
          description: Indicates if the shipment should require a signature upon delivery.
        insured:
          type: boolean
          example: true
          nullable: true
          description: Indicates if the shipment should have Stallion Protection.
        region:
          $ref: '#/components/schemas/RegionCode'
        tax_identifier:
          type: object
          description: Information about tax identification for the shipment.
          properties:
            tax_type:
              description: Type of tax identification (e.g., IOSS, EORI, VAT).
              $ref: '#/components/schemas/TaxType'
              example: IOSS
              nullable: false
            number:
              description: Tax identification number.
              type: string
              example: IM1234567890
              nullable: false
            issuing_authority:
              description: >-
                Country code for the authority responsible for issuing the tax
                identification number.
              type: string
              example: GB
              nullable: false
    BatchResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        batch_id:
          type: string
          example: '18179823'
    Rate:
      type: object
      properties:
        postage_type:
          $ref: '#/components/schemas/PostageType'
        package_type:
          $ref: '#/components/schemas/PackageType'
        trackable:
          type: boolean
          example: true
        base_rate:
          type: integer
          example: 10
        add_ons:
          type: array
          items:
            $ref: '#/components/schemas/Rate_add_ons'
        rate:
          type: integer
          example: 10
        tax:
          type: integer
        total:
          type: integer
        currency:
          $ref: '#/components/schemas/Currency'
        delivery_days:
          type: string
          example: '2'
    LocationsResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        locations:
          type: array
          items:
            $ref: '#/components/schemas/LocationsResponse_locations'
    OrderRequest:
      required:
        - store_id
        - name
        - address1
        - city
        - country_code
        - weight_unit
        - weight
        - items
        - order_id
        - order_at
        - value
        - currency
      type: object
      properties:
        store_id:
          type: string
          example: '1234'
          description: The unique identifier for the store.
        name:
          type: string
          example: Pramod Thomson
          maxLength: 40
          description: The name of the recipient.
        company:
          type: string
          nullable: true
          maxLength: 40
          description: The company name of the recipient (optional).
        address1:
          type: string
          example: 30 Clearview Dr
          maxLength: 50
          description: The first line of the delivery address.
        address2:
          type: string
          nullable: true
          maxLength: 50
          description: The second line of the delivery address (optional).
        city:
          type: string
          example: Rock Springs
          maxLength: 35
          description: The city where the recipient is located.
        province_code:
          type: string
          example: WY
          minLength: 2
          maxLength: 2
          description: >-
            The two-letter province or state code where the recipient is
            located.
        postal_code:
          type: string
          example: '82901'
          maxLength: 10
          description: The postal code or ZIP code of the recipient's location.
        country_code:
          type: string
          example: US
          minLength: 2
          maxLength: 2
          description: The two-letter country code of the recipient's country.
        phone:
          type: string
          nullable: true
          maxLength: 20
          description: The recipient's phone number (optional).
        email:
          type: string
          nullable: true
          maxLength: 50
          description: The recipient's email address (optional).
        customer_id:
          type: string
          nullable: true
          maxLength: 50
          description: The customer ID associated with the order (optional).
        carrier_code:
          type: string
          nullable: true
          maxLength: 50
          description: The carrier code for shipping (optional).
        postage_code:
          type: string
          nullable: true
          maxLength: 50
          description: The postage code for shipping (optional).
        package_code:
          type: string
          nullable: true
          maxLength: 50
          description: The package code for shipping (optional).
        note:
          type: string
          nullable: true
          maxLength: 255
          description: Additional notes or comments for the order (optional).
        weight_unit:
          $ref: '#/components/schemas/WeightUnit'
        weight:
          type: number
          example: 0.6
          minimum: 0.01
          description: The weight of the order in the specified weight unit.
        value:
          type: number
          example: 10.5
          minimum: 0.01
          description: The total value of the order.
        currency:
          $ref: '#/components/schemas/Currency'
        order_id:
          type: string
          example: 1234-1233
          description: The unique identifier for the order.
        order_at:
          type: string
          format: date-time
          example: '2023-09-26 14:30:00'
          description: The date and time when the order was placed.
        store:
          type: string
          example: My Shopify Store
          description: Store Nickname or Identifier.
        items:
          description: Order Line Items.
          type: array
          items:
            $ref: '#/components/schemas/OrderRequestItem'
        tags:
          type: array
          example: '[''this is a tag'', ''this is another tag'']'
          description: The tags for the order.
    OrderRequestItem:
      required:
        - title
        - quantity
        - value
        - currency
      type: object
      properties:
        item_id:
          type: string
          example: 1234
          description: The unique identifier for the item.
        title:
          type: string
          example: Cool T-Shirt
          description: The title or name of the item.
        sku:
          type: string
          nullable: true
          example: SKU123
          description: The SKU (Stock Keeping Unit) of the item (optional).
        hs_code:
          type: string
          nullable: true
          example: '620800'
          description: >-
            The HS (Harmonized System) code for customs (optional). Required if
            the shipment country_of_origin is CN/HK
        quantity:
          type: number
          example: 1
          minimum: 1
          description: The quantity of the item in the order.
        value:
          type: number
          example: 10
          minimum: 0.01
          description: The value of the item.
        currency:
          $ref: '#/components/schemas/Currency'
        country_of_origin:
          type: string
          nullable: true
          maxLength: 2
          minLength: 2
          example: CN
          description: >-
            The two-letter country code indicating the country of origin for the
            item (optional). Required if the shipment is being sent to US
        warehouse_location:
          type: string
          nullable: true
          maxLength: 50
          example: Warehouse A
          description: The location of the item in the warehouse (optional).
    OrderResponse_data:
      type: object
      properties:
        name:
          type: string
          example: Pramod Thomson
        address1:
          type: string
          example: 30 Clearview Dr
        address2:
          type: string
          example: Lot 2
        city:
          type: string
          example: Rock Springs
        postal_code:
          type: string
          example: '82901'
        province_code:
          type: string
          example: WY
        country_code:
          type: string
          example: US
        phone:
          type: string
          example: 888-992
        value:
          type: number
          example: 10
        currency:
          $ref: '#/components/schemas/Currency'
        length:
          type: number
          example: 9
        width:
          type: number
          example: 12
        height:
          type: number
          example: 1
        size_unit:
          $ref: '#/components/schemas/SizeUnit'
        weight:
          type: number
          example: 0.6
        weight_unit:
          $ref: '#/components/schemas/WeightUnit'
        store:
          type: string
          example: My Shopify Store
        order_id:
          type: string
          example: '82901'
        display_order_id:
          type: string
          example: '82901'
        tags:
          type: array
          example: '[''this is a tag'', ''this is another tag'']'
        items:
          type: object
          properties:
            item_id:
              type: string
              example: 1234
            description:
              type: string
              example: Cool T-Shirt
            quantity:
              type: number
              example: 1
            hs_code:
              type: string
              example: '620800'
            value:
              type: number
              example: 10
            currency:
              $ref: '#/components/schemas/Currency'
            country_of_origin:
              type: string
              example: CN
      example: null
    ShipmentRequest:
      required:
        - to_address
        - size_unit
        - weight
        - weight_unit
      type: object
      properties:
        to_address:
          type: object
          description: Recipient address for the shipment.
          allOf:
            - $ref: '#/components/schemas/Address'
        return_address:
          type: object
          description: >-
            The return address is required exclusively for generating a return
            label and should only be provided if is_return is set to true. This
            field is not applicable to regular shipments.
          allOf:
            - $ref: '#/components/schemas/Address'
        is_return:
          type: boolean
          description: Indicates if the shipment will be a return.
          example: false
          nullable: true
        weight_unit:
          $ref: '#/components/schemas/WeightUnit'
        weight:
          type: number
          example: 0.6
        length:
          type: number
          example: 9
        width:
          type: number
          example: 12
        height:
          type: number
          example: 1
        size_unit:
          $ref: '#/components/schemas/SizeUnit'
        items:
          type: array
          items:
            $ref: '#/components/schemas/Item'
        package_type:
          oneOf:
            - $ref: '#/components/schemas/PackageType'
            - $ref: '#/components/schemas/PackageCode'
        signature_confirmation:
          description: Default false.
          type: boolean
          example: false
          nullable: true
        postage_type:
          description: >-
            Set the postage type for the shipment. ("Cheapest Tracked" or
            "Cheapest Express Tracked" will return the cheapest tracked or
            express tracked postage type available.)
          oneOf:
            - $ref: '#/components/schemas/PostageType'
            - $ref: '#/components/schemas/PostageCode'
        label_format:
          description: Default pdf. Set the format of the returned label.
          type: string
          enum:
            - pdf
            - zpl
            - png
          default: pdf
        is_fba:
          description: Default false. Set to true to create a Stallion FBA label.
          type: boolean
          example: false
          nullable: true
          default: false
        is_draft:
          description: >-
            Default false. Set to true to save the shipment without purchasing
            the label.
          type: boolean
          example: false
          nullable: true
          default: false
        insured:
          description: Set to true to apply Stallion Protection for tracked shipments only.
          type: boolean
          example: true
          nullable: true
        region:
          $ref: '#/components/schemas/RegionCode'
        tax_identifier:
          type: object
          description: Information about tax identification for the shipment.
          properties:
            tax_type:
              description: Type of tax identification (e.g., IOSS, EORI, VAT).
              $ref: '#/components/schemas/TaxType'
              example: IOSS
              nullable: false
            number:
              description: Tax identification number.
              type: string
              example: IM1234567890
              nullable: false
            issuing_authority:
              description: >-
                Country code for the authority responsible for issuing the tax
                identification number.
              type: string
              example: GB
              nullable: false
    ShipmentCreateReturnLabelRequest:
      required:
        - order_id
        - ship_code
        - tracking_code
      type: object
      properties:
        ship_code:
          type: string
          example: 210907WY78
        tracking_code:
          type: string
          example: '940002312332'
        order_id:
          type: string
          example: '40011'
    ShipmentResponse:
      type: object
      properties:
        success:
          type: boolean
        label:
          description: Base 64 encoded label.
          type: string
          example: base64_label
        tracking_code:
          type: string
          example: '9400111969000940000011'
        message:
          type: string
          example: Shipment successfully completed
        shipment:
          $ref: '#/components/schemas/Shipment'
        rate:
          $ref: '#/components/schemas/Rate'
    ShipmentsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ShipmentsResponse_data'
        links:
          $ref: '#/components/schemas/ShipmentsResponse_links'
        meta:
          $ref: '#/components/schemas/ShipmentsResponse_meta'
    ValidationError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        errors:
          type: array
          items:
            type: string
            example: The data you entered is invalid
    TrackResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        status:
          $ref: '#/components/schemas/ShipmentStatus'
        events:
          type: array
          items:
            $ref: '#/components/schemas/TrackResponse_events'
        details:
          type: object
          properties:
            ship_code:
              type: string
              example: 2012121234
            destination:
              type: string
              example: Toronto ON, CA
            tracking:
              type: string
              example: '123123123123123123'
            url:
              type: string
              example: https://carrier.com/track/9400111969000940000011
            carrier_phone:
              type: string
              example: '12312341234'
    VoidResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: boolean
          example: false
    CreditsResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        amount:
          type: string
          example: '0.00'
    CreditsRequest:
      type: object
      properties:
        amount:
          type: integer
          format: int64
          example: 100
    UnauthenticatedError:
      type: object
      properties:
        message:
          type: string
          example: Unauthenticated.
    InternalError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        errors:
          type: array
          items:
            type: string
            example: An unknown error occured
    NotFoundResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        errors:
          type: array
          items:
            type: string
            example: No shipment found
    Rate_return_address:
      type: object
      properties:
        address1:
          type: string
          example: Unit 5 - 2045 Niagara Falls Blvd
        address2:
          type: string
          example: SE
        city:
          type: string
          example: Niagara Falls
        postal_code:
          type: string
          example: '14304'
        province_code:
          type: string
          example: NY
        country_code:
          type: string
          example: US
        phone:
          type: string
          example: '8778637447'
        name:
          type: string
          example: Jane Doe
      example: null
    Rate_add_ons:
      type: object
      properties:
        name:
          type: string
          example: USPS Signature Confirmation
        type:
          type: string
          example: signature_confirmation
        cost:
          type: number
          example: 2.65
        currency:
          $ref: '#/components/schemas/Currency'
        return_address:
          $ref: '#/components/schemas/Rate_return_address'
      example: null
    LocationsResponse_locations:
      type: object
      properties:
        name:
          type: string
          example: Mississauga HQ
        type:
          type: string
          example: Branch
        address1:
          type: string
          example: 6691 Edwards Blvd
        city:
          type: string
          example: Mississauga
        province_code:
          type: string
          example: 'ON'
        postal_code:
          type: string
          example: L5T 2H8
        country_code:
          type: string
          example: CA
      example: null
    Shipment:
      type: object
      properties:
        ship_code:
          type: string
          example: 2019JHSJDHSJ
        name:
          type: string
          example: Pramod Thomson
        address1:
          type: string
          example: 30 Clearview Dr
        address2:
          type: string
          example: Lot 2
        city:
          type: string
          example: Rock Springs
        province_code:
          type: string
          example: WY
        postal_code:
          type: string
          example: '82901'
        country_code:
          type: string
          example: US
        weight_unit:
          $ref: '#/components/schemas/WeightUnit'
        weight:
          type: number
          example: 0.6
        length:
          type: number
          example: 9
        width:
          type: number
          example: 12
        height:
          type: number
          example: 1
        size_unit:
          $ref: '#/components/schemas/SizeUnit'
        items:
          type: array
          items:
            $ref: '#/components/schemas/Item'
        package_type:
          $ref: '#/components/schemas/PackageType'
        postage_type:
          $ref: '#/components/schemas/PostageType'
        region:
          $ref: '#/components/schemas/RegionName'
        tracking_code:
          type: string
          example: '9400111969000940000011'
        rate:
          type: integer
          example: 9
        tax:
          type: integer
        total_paid:
          type: integer
        insured:
          type: boolean
          example: true
      example: null
    ShipmentsResponse_data:
      type: object
      properties:
        ship_code:
          type: string
          example: 2019JHSJDHSJ
        name:
          type: string
          example: Pramod Thomson
        address1:
          type: string
          example: 30 Clearview Dr
        address2:
          type: string
          example: Lot 2
        city:
          type: string
          example: Rock Springs
        province_code:
          type: string
          example: WY
        postal_code:
          type: string
          example: '82901'
        country_code:
          type: string
          example: US
        weight_unit:
          $ref: '#/components/schemas/WeightUnit'
        weight:
          type: number
          example: 0.6
        length:
          type: number
          example: 9
        width:
          type: number
          example: 12
        height:
          type: number
          example: 1
        size_unit:
          $ref: '#/components/schemas/SizeUnit'
        items:
          type: array
          items:
            $ref: '#/components/schemas/Item'
        package_type:
          $ref: '#/components/schemas/PackageType'
        postage_type:
          $ref: '#/components/schemas/PostageType'
        tracking_code:
          type: string
          example: '9400111969000940000011'
        rate:
          type: integer
          example: 9
        tax:
          type: integer
        total_paid:
          type: integer
        insured:
          type: boolean
          example: true
      example: null
    ShipmentsResponse_links:
      type: object
      properties:
        first:
          type: string
          example: https://sandbox.stallionexpress.ca/api/v4/shipments?page=1
        last:
          type: string
          example: https://sandbox.stallionexpress.ca/api/v4/shipments?page=16
        prev:
          type: string
          example: https://sandbox.stallionexpress.ca/api/v4/shipments?page=1
        next:
          type: string
          example: https://sandbox.stallionexpress.ca/api/v4/shipments?page=3
      example: null
    ShipmentsResponse_meta:
      type: object
      properties:
        current_page:
          type: integer
          example: 2
        from:
          type: integer
          example: 11
        last_page:
          type: integer
          example: 16
        path:
          type: string
          example: https://sandbox.stallionexpress.ca/api/v4/shipments
        per_page:
          type: integer
          example: 10
      example: null
    TrackResponse_events:
      type: object
      properties:
        carrier:
          type: string
          example: USPS
        location:
          type: string
          example: Mississauga ON, CA
        status:
          type: string
          example: In-transit from Mississauga ON, CA
        datetime:
          type: string
          example: '2020-06-24 11:40:15'
        tracking:
          type: string
          example: '9400111969000940000011'
      example: null
    CreateStoreRequest:
      type: object
      properties:
        identifier:
          type: string
          description: Unique identifier for the store
    Store:
      type: object
      properties:
        id:
          type: integer
          description: The unique identifier for the store.
        identifier:
          type: string
          description: The identifier associated with the store.
        created_at:
          type: string
          format: date-time
          description: The date and time when the store was created.
        store_type:
          type: string
          description: The description of the store type.
    Order:
      type: object
      properties:
        id:
          type: integer
          description: The unique identifier for the store.
        name:
          type: string
          description: The name of the store.
        company:
          type: string
          description: The company associated with the store.
        address1:
          type: string
          description: The first address line of the store.
        address2:
          type: string
          description: The second address line of the store.
        city:
          type: string
          description: The city where the store is located.
        province_code:
          type: string
          description: The province code of the store's location.
        postal_code:
          type: string
          description: The postal code of the store's location.
        country_code:
          type: string
          description: The country code of the store's location.
        phone:
          type: string
          description: The phone number of the store.
        email:
          type: string
          format: email
          description: The email address associated with the store.
        customer_id:
          type: string
          description: The customer ID related to the store.
        carrier_code:
          type: string
          description: The carrier code associated with the store.
        postage_code:
          type: string
          description: The postage code used by the store.
        package_code:
          type: string
          description: The package code used by the store.
        note:
          type: string
          description: Additional notes related to the store.
        weight_unit:
          type: string
          description: The unit of weight used by the store.
        weight:
          type: number
          format: double
          description: The weight associated with the store.
        value:
          type: number
          format: double
          description: The value associated with the store.
        currency:
          type: string
          description: The currency code used by the store.
        order_id:
          type: string
          description: The order ID associated with the store.
        order_at:
          type: string
          format: date-time
          description: The date and time of the order associated with the store.
        store:
          type: string
          description: The store name or identifier.
        tags:
          type: array
          description: An array of tags associated with the store.
        items:
          type: array
          description: An array of items associated with the store.
          items:
            type: object
            properties:
              item_id:
                type: string
                description: The unique identifier for the item.
              title:
                type: string
                description: The title or name of the item.
              sku:
                type: string
                description: The SKU (Stock Keeping Unit) of the item.
              hs_code:
                type: string
                description: The HS (Harmonized System) code of the item.
              quantity:
                type: integer
                description: The quantity of the item.
              value:
                type: number
                format: double
                description: The value associated with the item.
              currency:
                type: string
                description: The currency code used for the item.
              country_of_origin:
                type: string
                description: The country of origin for the item.
              warehouse_location:
                type: string
                description: The warehouse location of the item.
        shipment:
          $ref: '#/components/schemas/Shipment'
        created_at:
          type: string
          format: date-time
          description: The date and time when the store was created.
        updated_at:
          type: string
          format: date-time
          description: The date and time when the store was last updated.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
