> ## Documentation Index
> Fetch the complete documentation index at: https://help.hoopai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Order by ID

> The "Get Order by ID" API allows to retrieve information for a specific order using its unique identifier. Use this endpoint to fetch details for a single order based on the provided order ID.



## OpenAPI

````yaml /api-reference/payments/openapi.json get /payments/orders/{orderId}
openapi: 3.0.0
info:
  title: Payments API
  description: Documentation for payments API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Payments
    description: Documentation for payments API
  - name: Integrations
    description: Documentation for payments API
  - name: Orders
    description: Documentation for payments API
  - name: Order fulfillments
    description: Documentation for payments API
  - name: Order Notes
    description: Documentation for payments API
  - name: Transactions
    description: Documentation for payments API
  - name: Subscriptions
    description: Documentation for payments API
  - name: Coupons
    description: Documentation for payments API
  - name: Custom Provider
    description: Documentation for payments API
paths:
  /payments/orders/{orderId}:
    get:
      tags:
        - Orders
      summary: Get Order by ID
      description: >-
        The "Get Order by ID" API allows to retrieve information for a specific
        order using its unique identifier. Use this endpoint to fetch details
        for a single order based on the provided order ID.
      operationId: get-order-by-id
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
        - name: orderId
          required: true
          in: path
          description: ID of the order that needs to be returned
          schema:
            example: 653f5e0cde5a1314e62a837c
            type: string
        - name: locationId
          required: false
          in: query
          description: LocationId is the id of the sub-account.
          schema:
            example: 3SwdhCu3svxI8AKsPJt6
            type: string
        - name: altId
          required: true
          in: query
          description: 'AltId is the unique identifier e.g: location id.'
          schema:
            example: 3SwdhCu3svxI8AKsPJt6
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderResponseSchema'
        '400':
          description: Order not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
      security:
        - Location-Access:
            - payments/orders.readonly
components:
  schemas:
    GetOrderResponseSchema:
      type: object
      properties:
        _id:
          type: string
          description: The unique identifier for the order.
          example: 653f5e0cde5a1314e62a837c
        altId:
          type: string
          description: 'AltId is the unique identifier eg: location id.'
          example: 3SwdhCu3svxI8AKsPJt6
        altType:
          type: string
          example: location
          description: AltType is the type of identifier.
        contactId:
          type: string
          example: XPLSw2SVagl12LMDeTmQ
          description: Contact id corresponding to the order.
        currency:
          type: string
          example: USD
          description: Currency in which order was created.
        amount:
          type: number
          example: '100'
          description: Order value.
        status:
          type: string
          description: The status of the order (e.g., completed).
          example: completed
        liveMode:
          type: boolean
          example: 'false'
          description: Order is in live / test mode.
        createdAt:
          format: date-time
          type: string
          description: The creation timestamp of the order.
          example: '2023-11-20T10:23:36.515Z'
        updatedAt:
          format: date-time
          type: string
          description: The last update timestamp of the order.
          example: '2024-01-23T09:57:04.846Z'
        fulfillmentStatus:
          type: string
          description: Fulfillment status of the order.
          example: unfulfilled
        contactSnapshot:
          type: object
          description: Contact details of the order.
          example: >-
            { last_name: "Mcclain", type: "lead", first_name_lower_case:
            "rogan", email: "anish+11@hoopai.com", last_name_lower_case:
            "mcclain", location_id: "o6241QsiRwUIJHyjuhos", company_name:
            "Jordan and Cox Trading"}
        amountSummary:
          $ref: '#/components/schemas/AmountSummary'
          example: '{ subtotal: 100, discount: 5 }'
        source:
          $ref: '#/components/schemas/OrderSource'
          example: '{ type: "invoice", id: "61dd48ff65b013bc39bb09c6" }'
        items:
          description: Item details of the order.
          example: >-
            { _id: 61dd33e88058b9f967ca79dc, authorizeAmount: 0, locationId:
            "SBAWb4yu7A4LSc0skQ6g", name: "Sample Product": price: {}, product:
            { name: "Testing product", productType: "SERVICE" }}
          type: array
          items:
            type: string
        coupon:
          type: object
          description: Coupon details of the order.
          example: '{ code: "FEST10", _id: "63455e48901b43d4ef364a20" }'
        trackingId:
          type: string
          description: Tracking id of the order.
          example: 63319ef9-de0a-4c84-aebd-3585fb4a0cdf
        fingerprint:
          type: string
          description: Fingerprint id of the order.
          example: 5d51db5a-42b0-4b04-ba88-2c046c982a3a
        meta:
          type: object
          description: Meta details of the order.
          example: '{ couponSessionExpired: true }'
        markAsTest:
          type: boolean
          description: Is test order.
          example: 'false'
        traceId:
          type: string
          description: Trace id of the order.
          example: d3b16a92-a8ed-4e6b-8467-844750f78ed5
        automaticTaxesCalculated:
          type: boolean
          description: Automatic taxes applied for the Order
          example: true
        taxCalculationProvider:
          type: object
          description: Provider name for automatic tax calculation
          example: taxjar
        createdBy:
          type: string
          example: user123
          description: User ID who created the order.
      required:
        - _id
        - altId
        - altType
        - status
        - createdAt
        - updatedAt
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
        - error
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
      required:
        - statusCode
        - message
        - error
    AmountSummary:
      type: object
      properties:
        subtotal:
          type: number
          example: '100'
          description: Order sub-total value.
        discount:
          type: number
          example: '10'
          description: Discount value on order.
      required:
        - subtotal
    OrderSource:
      type: object
      properties:
        type:
          type: string
          enum:
            - funnel
            - website
            - invoice
            - calendar
            - text2Pay
            - document_contracts
            - membership
            - mobile_app
            - communities
            - point_of_sale
            - manual
            - form
            - survey
            - payment_link
            - external
        subType:
          type: string
          enum:
            - one_step_order_form
            - two_step_order_form
            - upsell
            - tap_to_pay
            - card_payment
            - store
            - contact_view
            - email_campaign
            - payments_dashboard
            - shopify
            - subscription_view
            - store_upsell
            - woocommerce
            - service
            - meeting
            - imported_csv
            - qr_code
            - saas_one_time
            - saas_subscription
        id:
          type: string
        name:
          type: string
        meta:
          type: object
      required:
        - type
        - id

````