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

# Retrieve an order

> Fetch a single order by its UUID for the authenticated merchant.



## OpenAPI

````yaml /openapi/points-api-v1.yaml get /v1/orders/{orderUuid}
openapi: 3.0.3
info:
  title: Points API
  version: 1.0.0
  description: >
    OpenAPI definition for the `/api/v1` endpoints defined in
    `routes/api_v1.php`. This spec reflects the behaviour of the Laravel backend
    and is the source of truth for integrators.
  contact:
    name: Points API Support
    email: support@papp.sa
    url: https://docs.papp.sa
servers:
  - url: https://business.papp.sa/api
    description: Production server
  - url: https://sandbox.papp.sa/api
    description: Sandbox server
security:
  - ApiKeyAuth: []
tags:
  - name: Orders
    description: Operations for creating and managing orders
  - name: Webhooks
    description: CRUD operations for merchant webhooks
  - name: Integration
    description: External-platform toggle state (e.g. Matajer's "ربط بوينتس" switch)
paths:
  /v1/orders/{orderUuid}:
    get:
      tags:
        - Orders
      summary: Retrieve an order
      description: Fetch a single order by its UUID for the authenticated merchant.
      operationId: getOrder
      parameters:
        - $ref: '#/components/parameters/orderUuid'
      responses:
        '200':
          description: Order retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResponse'
        '400':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    orderUuid:
      name: orderUuid
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Order UUID.
  schemas:
    OrderResponse:
      allOf:
        - $ref: '#/components/schemas/ApiMetadata'
        - type: object
          required:
            - data
          properties:
            data:
              $ref: '#/components/schemas/OrderResource'
    ApiMetadata:
      type: object
      required:
        - status
        - message
        - appended_data
      properties:
        status:
          type: boolean
          example: true
        message:
          type: string
          nullable: true
          example: ''
        appended_data:
          type: object
          additionalProperties: true
          example: {}
    OrderResource:
      type: object
      properties:
        id:
          type: integer
          example: 42
        uuid:
          type: string
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        reference_number:
          type: string
          nullable: true
          example: REF-2024-001234
        order_status:
          type: string
          enum:
            - new
            - approved
            - authorized
            - captured
            - cancelled
            - fully_refunded
            - partially_refunded
          description: Financial state of the order.
          example: approved
        status_label:
          type: string
          description: >
            Resolved display label for the shipping status. Prefers the
            merchant's `custom_status` value in the request's locale when set,
            otherwise falls back to the canonical enum label ("New",
            "Delivered", …). **Render this directly** — locale switching +
            custom-label fallback are already applied server-side.
          example: خرج للتوصيل
        custom_status:
          type: object
          nullable: true
          description: >
            Merchant-defined free-form shipping label, populated by sending
            `name_ar` / `name_en` to `POST /v1/orders/{uuid}/status`. `null`
            when the merchant hasn't set a custom label — `status_label` falls
            back to the canonical enum text. Useful for multi-locale clients
            that switch language without refetching.
          properties:
            ar:
              type: string
              example: خرج للتوصيل
            en:
              type: string
              example: Out for delivery
        order_number:
          type: string
          example: ORD-2024-001234
        type:
          type: integer
          enum:
            - 1
            - 2
          description: |
            Order type: `1` = earning, `2` = replacing.
          example: 1
        total_price:
          type: number
          format: float
          example: 150.5
        total_points:
          type: number
          format: float
          example: 1505
        metadata:
          type: object
          nullable: true
          additionalProperties: true
          example:
            source: mobile_app
        date:
          type: string
          format: date
          nullable: true
          example: '2024-12-23T00:00:00.000Z'
        time:
          type: string
          nullable: true
          example: '10:00:00'
        since:
          type: string
          nullable: true
          description: Human-readable relative time (e.g. "2 hours ago").
          example: 2 hours ago
        settlement_status:
          type: string
          nullable: true
          description: >-
            Settlement state of the order (backed enum value of
            OrderSettlementStatus).
          example: settled
        status:
          type: integer
          nullable: true
          description: >-
            Shipping status as a backed integer enum value of
            OrderShippingStatus.
          example: 1
        created_at:
          type: string
          format: date-time
          example: '2024-12-23T10:00:00.000Z'
        updated_at:
          type: string
          format: date-time
          example: '2024-12-23T15:30:00.000Z'
        items:
          type: array
          nullable: true
          description: Present only when products were attached to the order.
          items:
            $ref: '#/components/schemas/ProductLine'
    ErrorResponse:
      type: object
      required:
        - status
        - message
        - appended_data
      properties:
        status:
          type: boolean
          example: false
        message:
          type: string
          example: Invalid or inactive API key
        appended_data:
          type: object
          additionalProperties: true
          example: {}
    ProductLine:
      type: object
      required:
        - product_name
        - product_price
        - quantity
      properties:
        product_name:
          type: string
          example: Cappuccino
        product_price:
          type: number
          format: float
          minimum: 0
          example: 18.5
        quantity:
          type: integer
          minimum: 1
          example: 2
  responses:
    Unauthorized:
      description: >
        The `x-api-key` header is missing, invalid, or belongs to an inactive
        merchant. The Points API returns `400` (not `401`) for auth failures.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found for the authenticated merchant.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````