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

# Retrieve order

> Returns the current state of an order, including `payment_status` and
`fulfilment_status`. Poll this after the customer returns from Paystack
to confirm payment.

Only orders belonging to the API key's store are retrievable.




## OpenAPI

````yaml /openapi.yaml get /api/public/v1/orders/{order_number}
openapi: 3.1.0
info:
  title: Leyyow Public Commerce API
  version: 1.0.0
  summary: Build a custom storefront on top of a Leyyow store.
  description: >
    The Public Commerce API lets a merchant's own website or application read
    their

    Leyyow catalog, calculate delivery, create an order, and receive a Paystack

    payment link.


    ## Authentication


    Every request requires an API key created in the Leyyow suite under

    **Settings → Public API**, sent as a bearer token:


    ```

    Authorization: Bearer lyw_live_xxxxxxxxxxxxxxxx

    ```


    The key identifies exactly one store. Any product, variant, delivery option,

    shipping quote, or order that does not belong to that store returns `404`,

    regardless of whether the identifier exists elsewhere in Leyyow.


    Keys used in browser code are visible to anyone who opens the network

    inspector. Keep the key server-side where possible, and rotate it from the

    suite if it is abused.


    ## Response envelope


    Every response — success or failure — uses the same envelope:


    ```json

    { "error": null, "message": "Products retrieved.", "data": {} }

    ```


    On success `error` is `null` and `data` carries the payload. On failure

    `error` holds a human-readable reason, `data` is `null`, and the HTTP status

    carries the machine-readable meaning.


    ## Server-calculated amounts


    Prices, taxes, delivery fees, and totals are calculated by Leyyow. Order

    requests carry the customer's *choices* — variants, quantities, fulfilment

    method — never amounts. Any amount submitted in a request body is ignored.


    ## Rate limits


    Order creation and shipping quotes are rate limited more strictly than

    catalog reads. Exceeding a limit returns `429`.
  contact:
    name: Leyyow API support
    email: support@leyyow.com
servers:
  - url: https://sandbox.api.leyyow.com
    description: Sandbox — test keys, seeded data, no real orders
  - url: https://api.leyyow.com
    description: Production — live merchant data
security:
  - bearerAuth: []
tags:
  - name: Store
    description: Store profile, theme, categories, and fulfilment configuration.
  - name: Products
    description: Customer-facing catalog.
  - name: Delivery
    description: Fulfilment options and managed-delivery quotes.
  - name: Orders
    description: Order creation and status.
paths:
  /api/public/v1/orders/{order_number}:
    get:
      tags:
        - Orders
      summary: Retrieve order
      description: |
        Returns the current state of an order, including `payment_status` and
        `fulfilment_status`. Poll this after the customer returns from Paystack
        to confirm payment.

        Only orders belonging to the API key's store are retrievable.
      operationId: getOrder
      parameters:
        - name: order_number
          in: path
          required: true
          description: Human-readable order number.
          schema:
            type: string
          example: LYW-10482
      responses:
        '200':
          description: Order retrieved.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Order'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Envelope:
      type: object
      required:
        - error
        - message
        - data
      properties:
        error:
          type:
            - string
            - 'null'
          description: Human-readable failure reason, or `null` on success.
          examples:
            - null
        message:
          type: string
          description: Short status message.
          examples:
            - Request successful.
        data:
          description: Response payload. `null` on failure.
    Order:
      type: object
      properties:
        uid:
          type: string
          format: uuid
        order_number:
          type: string
          examples:
            - LYW-10482
        source:
          type: string
          const: storefront
          description: Always `storefront` for API-created orders.
        store:
          type: string
          format: uuid
        store_name:
          type: string
        store_email:
          type: string
          format: email
        store_phone:
          type: string
        logo:
          type: string
          format: uri
        location:
          type: string
          format: uuid
        location_name:
          type: string
        customer:
          type: string
          format: uuid
        customer_name:
          type: string
        customer_phone:
          type: string
        customer_email:
          type: string
          format: email
        customer_address:
          type: string
        user:
          type:
            - string
            - 'null'
        total_amount:
          $ref: '#/components/schemas/Money'
        subtotal:
          $ref: '#/components/schemas/Money'
        discount_amount:
          $ref: '#/components/schemas/Money'
        tax_amount:
          $ref: '#/components/schemas/Money'
        tax_rate_used:
          type: string
          examples:
            - '7.50'
        total_paid:
          type: number
        outstanding_balance:
          type: number
        payment_status:
          type: string
          examples:
            - pending
        payment_status_display:
          type: string
          examples:
            - Pending
        fulfilment_status:
          type: string
        fulfilment_status_display:
          type: string
        fulfilment_method:
          type: string
          enum:
            - pickup
            - delivery
        delivery_fee:
          $ref: '#/components/schemas/Money'
        manual_delivery_type:
          type:
            - string
            - 'null'
        delivery_address:
          type:
            - string
            - 'null'
        delivery_method:
          type:
            - string
            - 'null'
        courier:
          type: object
          additionalProperties: true
        rate:
          type: string
        tracking_number:
          type: string
        has_shipping:
          type: boolean
        order_date:
          type:
            - string
            - 'null'
          format: date-time
        shipping_details:
          type:
            - object
            - 'null'
          additionalProperties: true
        coupon:
          type:
            - string
            - 'null'
          description: Always `null` in v1 — coupons are out of scope.
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrderItem'
        created_at:
          type: string
          format: date-time
    Money:
      type: string
      description: |
        Decimal amount as a string, in the store's currency (NGN). Kept as a
        string to avoid floating-point rounding. Example — `"45000.00"`.
      examples:
        - '45000.00'
    OrderItem:
      type: object
      properties:
        uid:
          type: string
          format: uuid
        variant:
          type: string
          format: uuid
        variant_name:
          type: string
        variant_sku:
          type: string
        product_name:
          type: string
        image:
          type: string
          format: uri
        popup_inventory:
          type:
            - string
            - 'null'
        quantity:
          type: integer
        unit_price:
          $ref: '#/components/schemas/Money'
        total_price:
          $ref: '#/components/schemas/Money'
        fulfilment_status:
          type: string
        qty_fulfilled:
          type: integer
        notes:
          type: string
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/Attribute'
        product_images:
          type: array
          items:
            $ref: '#/components/schemas/ProductImage'
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - data
      properties:
        error:
          type: string
          description: Human-readable failure reason.
        message:
          type: string
        data:
          type: 'null'
    Attribute:
      type: object
      properties:
        uid:
          type: string
          format: uuid
        attribute:
          type: string
          format: uuid
        value:
          type: string
          format: uuid
        attribute_name:
          type: string
          examples:
            - Size
        attribute_value:
          type: string
          examples:
            - Medium
    ProductImage:
      type: object
      properties:
        uid:
          type: string
          format: uuid
        image:
          type: string
          format: uri
        alt_text:
          type: string
        is_primary:
          type: boolean
        order:
          type: integer
        sort_order:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: API key missing, malformed, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Invalid or revoked API key.
            message: Authentication failed.
            data: null
    NotFound:
      description: |
        Record not found, or not owned by the store linked to this API key.
        Identifiers from another store return `404` rather than `403`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Product not found.
            message: The requested resource does not exist.
            data: null
    RateLimited:
      description: Too many requests. Retry after the window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Rate limit exceeded.
            message: Too many requests.
            data: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        Store API key created in the Leyyow suite under Settings → Public API.
        Sent as `Authorization: Bearer <key>`.

````