> ## Documentation Index
> Fetch the complete documentation index at: https://www.commercengine.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve order invoice

> Retrieves an order's invoice. Staff can retrieve orders across all store locations.



## OpenAPI

````yaml https://openapi.commercengine.io/ce-pos.json get /pos/orders/{order_number}/invoice
openapi: 3.2.0
info:
  title: CE POS APIs
  description: >-
    The consolidated Point of Sale surface. Every operation is served under the
    storefront base URL; the POS backend proxies some of them to the admin
    service.
  version: '1.0'
servers:
  - url: https://staging.api.commercengine.io/api/v1/{store_id}/storefront
    description: Staging Server
    variables:
      store_id:
        description: Store ID
        default: store_id
    x-speakeasy-server-id: staging
  - url: https://prod.api.commercengine.io/api/v1/{store_id}/storefront
    description: Prod Server
    variables:
      store_id:
        description: Store ID
        default: store_id
    x-speakeasy-server-id: prod
security:
  - Authorization: []
tags:
  - name: section-identity
    summary: Identity
    kind: nav
  - name: Devices
    description: >-
      Set up the till: pair a device with the store using its pairing code, list
      the store's `PosLocation`s and `PosDevice`s, and claim a device for the
      signed-in user or release it.
    summary: Devices
    kind: nav
    parent: section-identity
  - name: Authentication
    description: >-
      Sign a staff member in on a paired device with a one-time password over
      SMS, WhatsApp or email, then refresh the access token or log out.
    summary: Authentication
    kind: nav
    parent: section-identity
  - name: Users
    description: >-
      The staff member signed in on the till, as a `PosUser` with their
      location, device and roles.
    summary: Users
    kind: nav
    parent: section-identity
  - name: section-customers
    summary: Customers
    kind: nav
  - name: Customers
    description: >-
      Look up the shopper at the till: list customers (`CustomerListItem`) and
      read one's full `CustomerDetail`.
    summary: Customers
    kind: nav
    parent: section-customers
  - name: Addresses
    description: >-
      A customer's saved addresses, as `Address` objects: list, add, update and
      remove them.
    summary: Addresses
    kind: nav
    parent: section-customers
  - name: section-catalog
    summary: Catalog
    kind: nav
  - name: Products
    description: >-
      Browse and search the catalog at the till: list `Product`s and SKUs, read
      a product and its variants, and show similar, up-sell and cross-sell
      items.
    summary: Products
    kind: nav
    parent: section-catalog
  - name: Reviews
    description: Read product reviews at the till.
    summary: Reviews
    kind: nav
    parent: section-catalog
  - name: Categories
    description: >-
      The store's categories, as `ProductCategory` objects with their child
      categories.
    summary: Categories
    kind: nav
    parent: section-catalog
  - name: Inventory
    description: >-
      Stock at the store's locations: list it by item, read an item's
      `InventoryDetail`, and follow the `InventoryActivity` that moved it.
    summary: Inventory
    kind: nav
    parent: section-catalog
  - name: section-shopping
    summary: Shopping
    kind: nav
  - name: Carts
    description: >-
      The till's `Cart`: create it, add, update or remove items, link the
      customer, set the address, and apply loyalty points or credit balance.
      Each update returns the full, updated `Cart`.
    summary: Carts
    kind: nav
    parent: section-shopping
  - name: Coupons & promotions
    description: >-
      The coupons and promotions a cart can use: list what the store offers, see
      which apply to a cart and why the rest don't, and apply or remove a
      coupon.
    summary: Coupons & promotions
    kind: nav
    parent: section-shopping
  - name: Fulfillment
    description: >-
      List the delivery and collect-in-store options for a cart, and save the
      cart's choice.
    summary: Fulfillment
    kind: nav
    parent: section-shopping
  - name: section-orders
    summary: Orders
    kind: nav
  - name: Orders
    description: >-
      Place an order from the till's cart and follow it: list orders, read an
      `OrderDetail` and its activity, check stock before it ships, and get its
      invoice, receipt and shipments.
    summary: Orders
    kind: nav
    parent: section-orders
  - name: Order payments
    description: >-
      Collect payment for an order: add payments toward what is left to pay,
      across one or more methods, poll the payment status, and retry a failed or
      expired payment.
    summary: Order payments
    kind: nav
    parent: section-orders
  - name: Shipments
    description: >-
      The shipments that fulfill orders: list them, read a `ShipmentDetail` with
      its activity and invoice, approve, reject or update one, send a
      replacement, and refund a shortfall.
    summary: Shipments
    kind: nav
    parent: section-orders
  - name: section-payments
    summary: Payments
    kind: nav
  - name: Payments
    description: >-
      The payment methods the till accepts and the checks around paying with
      them: card BIN details, VPA verification, and authenticating a payment
      with a direct OTP.
    summary: Payments
    kind: nav
    parent: section-payments
  - name: section-store
    summary: Store
    kind: nav
  - name: Locations
    description: States and pincodes for address forms.
    summary: Locations
    kind: nav
    parent: section-store
paths:
  /pos/orders/{order_number}/invoice:
    get:
      tags:
        - Orders
      summary: Retrieve order invoice
      description: >-
        Retrieves an order's invoice. Staff can retrieve orders across all store
        locations.
      operationId: pos-get-order-invoice
      parameters:
        - name: invoice_source
          in: query
          description: >-
            Omit to use the seller invoice when one exists, otherwise the store
            invoice. Specify seller or default to choose explicitly.
          schema:
            type: string
            enum:
              - default
              - seller
        - name: order_number
          in: path
          description: order number
          required: true
          schema:
            type: string
            maxLength: 128
            minLength: 1
            pattern: ^[A-Za-z0-9_-]{1,128}$
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - success
                  - content
                properties:
                  message:
                    type: string
                  success:
                    type: boolean
                  content:
                    properties:
                      invoices:
                        type: array
                        items:
                          $ref: '#/components/schemas/OrderInvoiceDetail'
                    required:
                      - invoices
                    type: object
        '400':
          $ref: '#/components/responses/AdminBadRequest'
        '401':
          $ref: '#/components/responses/AdminUnauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/AdminNotFound'
          description: >-
            The order was not found, or it is unpaid or cancelled and has no
            invoice.
        '500':
          $ref: '#/components/responses/AdminInternalServerError'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
      security:
        - Authorization: []
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/admin-pos/operations/pos-get-order-invoice
components:
  schemas:
    OrderInvoiceDetail:
      title: OrderInvoiceDetail
      description: An order invoice.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/OrderInvoiceDetail
      required:
        - invoice_number
        - invoice_date
        - seller_details
        - irn_number
        - ack_number
        - ack_date
        - signed_qr_code
        - gatepass_barcode
        - status
        - created_at
        - modified_at
        - items
        - sub_total
        - sub_total_including_tax
        - promotion_discount_amount
        - coupon_discount_amount
        - grand_total
        - loyalty_point_redeemed
        - shipping_amount
        - shipping_amount_including_tax
        - billing_business_name
      properties:
        invoice_number:
          type: string
        status:
          description: Current state of the invoice, e.g. `"printed"`.
          type: string
        invoice_date:
          type:
            - string
            - 'null'
          format: date
        irn_number:
          description: Invoice Reference Number
          type:
            - string
            - 'null'
        ack_number:
          description: Acknowledgement Number
          type:
            - string
            - 'null'
        ack_date:
          description: Acknowledgement Date
          type:
            - string
            - 'null'
          format: date-time
        signed_qr_code:
          type:
            - string
            - 'null'
        gatepass_barcode:
          type:
            - string
            - 'null'
        seller_details:
          description: >-
            Party the invoice is raised by: the seller record for marketplace
            seller invoices, the warehouse for single-seller stores, or `null`.
          anyOf:
            - $ref: '#/components/schemas/AdminSellerInfo'
            - $ref: '#/components/schemas/Warehouse'
            - type: 'null'
        billing_address:
          $ref: '#/components/schemas/AdminOrderAddress'
        shipping_address:
          $ref: '#/components/schemas/AdminOrderAddress'
        subtotal:
          type: number
        sub_total:
          type: number
        sub_total_including_tax:
          type: number
        shipping_amount:
          type: number
        shipping_amount_including_tax:
          type: number
        coupon_code:
          type:
            - string
            - 'null'
        coupon_discount_percent:
          type:
            - number
            - 'null'
        coupon_discount_amount:
          type:
            - number
            - 'null'
        promotion_discount_amount:
          type: number
        loyalty_point_redeemed:
          type: number
        total_tax:
          type: number
        grand_total:
          type: number
        tax_summary:
          type: array
          items:
            type: object
            properties:
              tax_rate:
                type: number
              taxable_value:
                type: number
              igst:
                type: number
              cgst:
                type: number
              sgst:
                type: number
        created_at:
          type: string
          format: date-time
        modified_at:
          type: string
          format: date-time
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrderInvoiceItem'
        billing_business_name:
          type:
            - string
            - 'null'
      x-tags:
        - Shipping
    AdminSellerInfo:
      title: SellerInfo
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/AdminSellerInfo
      properties:
        id:
          type: string
        name:
          description: >-
            Display name of the seller. Sent in place of `trade_name` and
            `legal_name` on the abbreviated form of this object.
          type: string
        trade_name:
          type: string
        legal_name:
          type: string
        business_type:
          $ref: '#/components/schemas/SellerBusinessType'
        tax_identification_number:
          type: string
        status:
          $ref: '#/components/schemas/SellerAccountStatus'
        kyc_status:
          $ref: '#/components/schemas/SellerKycStatus'
        visibility:
          description: >-
            Visibility of the products of the seller. public: products are
            visible to all users, private: products are visible to only
            authenticated users.
          type: string
          enum:
            - public
            - private
        logo:
          type:
            - string
            - 'null'
    Warehouse:
      title: Warehouse
      description: >-
        Validations:


        1) Either 'can_receive_stock' or 'accepts_returns' must be set to true.

        2) 'can_receive_stock' cannot be set to false while the warehouse has
        existing inventory.

        3) 'is_checkout_point' must be true when the warehouse type is
        'retail-store'.

        4) If 'can_receive_stock' is false then 'can_ship_parcel' and
        'can_collect' fields should be false.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/Warehouse
      required:
        - name
        - warehouse_type
        - city
        - address_line1
        - pincode
        - state
        - country
        - contact_phone
        - contact_email
        - can_receive_stock
        - can_ship_parcel
        - can_collect
        - is_checkout_point
        - accepts_returns
      properties:
        id:
          description: warehouse id
          type: string
          readOnly: true
        name:
          description: legal name
          type: string
        warehouse_type:
          enum:
            - retail-store
            - distribution-center
        active:
          type: boolean
          default: true
        gstin:
          type:
            - string
            - 'null'
        city:
          type:
            - string
            - 'null'
        address_line1:
          type: string
        address_line2:
          type:
            - string
            - 'null'
        landmark:
          type:
            - string
            - 'null'
        pincode:
          type:
            - string
            - 'null'
        state:
          type:
            - string
            - 'null'
        country:
          type: string
        country_code:
          type:
            - string
            - 'null'
        contact_phone:
          description: 10 digit number without country code.
          type:
            - string
            - 'null'
        contact_email:
          type:
            - string
            - 'null'
        is_default:
          type: boolean
        image_url:
          type:
            - string
            - 'null'
        seller_warehouse_id:
          type:
            - string
            - 'null'
        can_receive_stock:
          type: boolean
        can_ship_parcel:
          type: boolean
        can_collect:
          type: boolean
        is_checkout_point:
          description: this field will be always true for warehouse_type = retail-store.
          type: boolean
        accepts_returns:
          type: boolean
        opening_hours:
          anyOf:
            - $ref: '#/components/schemas/OpeningHours'
            - type: 'null'
        channels:
          description: channels associated with the warehouse
          type: array
          items:
            $ref: '#/components/schemas/WarehouseSalesChannel'
          readOnly: true
        marketplace_listing:
          type: array
          items:
            type: object
            properties:
              marketplace_id:
                type: string
    AdminOrderAddress:
      title: OrderAddress
      description: Address snapshot captured at checkout for an order or invoice.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/AdminOrderAddress
      required:
        - first_name
        - phone
        - email
        - address_line1
        - pincode
        - city
        - state
        - country
      properties:
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        country_code:
          description: Phone country calling code, e.g. +91.
          type:
            - string
            - 'null'
        phone:
          description: 10 digit phone number without country code.
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        address_line1:
          type:
            - string
            - 'null'
        address_line2:
          type:
            - string
            - 'null'
        landmark:
          type:
            - string
            - 'null'
        pincode:
          type:
            - string
            - 'null'
        city:
          type:
            - string
            - 'null'
        state:
          type:
            - string
            - 'null'
        country:
          type:
            - string
            - 'null'
        gstin:
          description: Use in shipping details only for third party.
          type:
            - string
            - 'null'
        business_name:
          description: Use in shipping details only for third party.
          type:
            - string
            - 'null'
        is_phone_verified:
          type: boolean
          readOnly: true
        is_email_verified:
          type: boolean
          readOnly: true
      x-tags:
        - Orders
    OrderInvoiceItem:
      title: OrderInvoiceItem
      description: A line on an order invoice.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/OrderInvoiceItem
      required:
        - sku
        - qty
        - batch_number
        - expiry
        - free_qty
      properties:
        sku:
          type:
            - string
            - 'null'
        product_name:
          type: string
        product_image_url:
          type:
            - string
            - 'null'
        listing_price:
          type: number
        selling_price:
          type: number
        qty:
          description: Quantity invoiced. Sent as a numeric string, not a number.
          type: string
        free_qty:
          description: >-
            Quantity supplied free of charge. Sent as a numeric string, not a
            number.
          type:
            - string
            - 'null'
        tax_type:
          type: string
        tax_rate:
          type: number
        hsncode:
          type:
            - string
            - 'null'
        expiry:
          type:
            - string
            - 'null'
        amount:
          type: number
        coupon_discount_amount:
          type: number
        promotion_discount_amount:
          type: number
        selling_price_excluding_tax:
          type: number
        batch_number:
          type:
            - string
            - 'null'
      x-tags:
        - Shipping
    SellerBusinessType:
      title: SellerBusinessType
      type: string
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/SellerBusinessType
      enum:
        - sole_proprietorship
        - private_limited
        - public_listed
        - public_limited
        - state_owned
        - charity
        - individual
    SellerAccountStatus:
      title: SellerAccountStatus
      type: string
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/admin-pos/schemas/SellerAccountStatus
      enum:
        - pending_approval
        - approved
        - rejected
    SellerKycStatus:
      title: SellerKycStatus
      type: string
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/SellerKycStatus
      enum:
        - document_pending
        - document_submitted
        - approved
        - rejected
    OpeningHours:
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/OpeningHours
      required:
        - monday
        - tuesday
        - wednesday
        - thursday
        - friday
        - saturday
        - sunday
      properties:
        monday:
          type:
            - object
            - 'null'
          properties:
            opening_time:
              type: string
              format: time
            closing_time:
              type: string
              format: time
          required:
            - opening_time
            - closing_time
        tuesday:
          type:
            - object
            - 'null'
          properties:
            opening_time:
              type: string
              format: time
            closing_time:
              type: string
              format: time
          required:
            - opening_time
            - closing_time
        wednesday:
          type:
            - object
            - 'null'
          properties:
            opening_time:
              type: string
              format: time
            closing_time:
              type: string
              format: time
          required:
            - opening_time
            - closing_time
        thursday:
          type:
            - object
            - 'null'
          properties:
            opening_time:
              type: string
              format: time
            closing_time:
              type: string
              format: time
          required:
            - opening_time
            - closing_time
        friday:
          type:
            - object
            - 'null'
          properties:
            opening_time:
              type: string
              format: time
            closing_time:
              type: string
              format: time
          required:
            - opening_time
            - closing_time
        saturday:
          type:
            - object
            - 'null'
          properties:
            opening_time:
              type: string
              format: time
            closing_time:
              type: string
              format: time
          required:
            - opening_time
            - closing_time
        sunday:
          type:
            - object
            - 'null'
          properties:
            opening_time:
              type: string
              format: time
            closing_time:
              type: string
              format: time
          required:
            - opening_time
            - closing_time
    WarehouseSalesChannel:
      title: WarehouseSalesChannel
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/admin-pos/schemas/WarehouseSalesChannel
      allOf:
        - $ref: '#/components/schemas/SalesChannel'
        - type: object
          properties:
            channel_type:
              description: 'Observed values: `web`, `pos`, `internal`.'
              type: string
            is_default:
              type: boolean
            domain:
              type:
                - string
                - 'null'
            app_platform:
              type:
                - string
                - 'null'
            external_id:
              type:
                - string
                - 'null'
            pos_vendor:
              type:
                - string
                - 'null'
            store_id:
              type: string
            store_name:
              type: string
            marketplace_id:
              description: Set only when `kind` is `marketplace`.
              type:
                - string
                - 'null'
            marketplace:
              description: '`null` unless `kind` is `marketplace`.'
              oneOf:
                - type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                    slug:
                      type: string
                    marketplace_type:
                      type: string
                    store_id:
                      description: The marketplace operator's store.
                      type: string
                    sync_products:
                      type: boolean
                    sync_inventory:
                      type: boolean
                    sync_orders:
                      type: boolean
                    required_credentials_params:
                      type:
                        - object
                        - 'null'
                    created_at:
                      type: string
                      format: date-time
                    modified_at:
                      type: string
                      format: date-time
                - type: 'null'
            seller_account:
              description: >-
                This store's seller account on the marketplace. `null` unless
                `kind` is `marketplace`.
              oneOf:
                - allOf:
                    - $ref: '#/components/schemas/AdminSellerInfo'
                    - type: object
                      properties:
                        marketplace_id:
                          type: string
                        marketplace_name:
                          type: string
                - type: 'null'
      x-tags:
        - Store
    SalesChannel:
      title: SalesChannel
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/SalesChannel
      required:
        - id
        - name
        - active
      properties:
        id:
          type: string
        name:
          type: string
          readOnly: true
        kind:
          type: string
          enum:
            - storefront
            - marketplace
        active:
          type: boolean
          readOnly: true
        sales_channel_type:
          description: 'Observed values: `commercengine`, `web`, `pos`.'
          type:
            - string
            - 'null'
          readOnly: true
        sales_channel_slug:
          type:
            - string
            - 'null'
          readOnly: true
  responses:
    AdminBadRequest:
      description: The request is invalid or cannot be completed in the current state.
      content:
        application/json:
          schema:
            type: object
            required:
              - message
              - success
            properties:
              message:
                type: string
              success:
                type: boolean
              code:
                type: string
              errors:
                description: Validation details as a field map, a bulk list or a string.
                anyOf:
                  - type: object
                    additionalProperties: true
                  - type: array
                  - type: string
              content:
                type: object
                additionalProperties: true
              details:
                type: string
    AdminUnauthorized:
      description: >-
        The token is missing, invalid or expired, or does not grant access to
        this store and operation.
      content:
        application/json:
          schema:
            type: object
            required:
              - message
              - success
            properties:
              message:
                type: string
              success:
                type: boolean
              code:
                type: string
              details:
                type: string
    Forbidden:
      description: >-
        Access denied. `token-required` requires an authenticated session;
        `permission-denied` means the caller cannot access this resource. On
        POS, `session-expired` requires signing in again.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - message
              - success
            properties:
              code:
                type: string
              message:
                type: string
                x-speakeasy-error-message: true
              success:
                type: boolean
              details:
                type: string
    AdminNotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            type: object
            required:
              - message
              - success
            properties:
              message:
                type: string
              success:
                type: boolean
              code:
                type: string
              details:
                type: string
    AdminInternalServerError:
      description: >-
        The request could not be completed. Quote error_id, when present, when
        contacting support.
      content:
        application/json:
          schema:
            type: object
            required:
              - message
              - success
            properties:
              message:
                type: string
              success:
                type: boolean
              code:
                type: string
              details:
                type: string
              error_id:
                type: string
    GatewayTimeout:
      description: The request timed out.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - message
              - success
            properties:
              code:
                type: string
              message:
                type: string
                x-speakeasy-error-message: true
              success:
                type: boolean
              details:
                type: string
  securitySchemes:
    Authorization:
      type: http
      description: Access token
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.