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

# Get Order History API

> Fetch historical merchandise orders within a date range.

**Real URL:** `POST https://accounts.xoxoday.com/chef/v1/oauth/api`


| Parameter | Type   | Description                                                                 |
| :-------- | :----- | :-------------------------------------------------------------------------- |
| startDate | String | Start date for filtering records.                                           |
| endDate   | String | End date for filtering records.                                             |
| limit     | Int    | Number of records to return per page (pagination).                          |
| page      | Int    | Page number to fetch when paginating results.                               |
| tag       | String | Custom tag to filter or group records by campaign, user, or other metadata. |

## Response Schema

| \*\*Path \*\*                                                 | \*\* Type \*\* | \*\* Description\*\*                                                 |
| ------------------------------------------------------------- | -------------- | -------------------------------------------------------------------- |
| data                                                          | object         | Root response object.                                                |
| data.getOrderHistory                                          | object         | Container for order history.                                         |
| data.getOrderHistory.status                                   | number         | API execution status (`1` = success).                                |
| data.getOrderHistory.data                                     | array          | List of historical orders (generic across all categories).           |
| data.getOrderHistory.data\[].orderId                          | number         | Unique order ID.                                                     |
| data.getOrderHistory.data\[].orderDate                        | string         | Order creation timestamp.                                            |
| data.getOrderHistory.data\[].email                            | string         | Email used for the order.                                            |
| data.getOrderHistory.data\[].deliveryStatus                   | string         | Delivery status (`pending`, `delivered`).                            |
| data.getOrderHistory.data\[].poNumber                         | string         | PO number passed during checkout.                                    |
| data.getOrderHistory.data\[].tag                              | string/null    | Custom tag (generic).                                                |
| data.getOrderHistory.data\[].orderTotal                       | number         | Rounded order amount.                                                |
| data.getOrderHistory.data\[].rawOrderTotal                    | number/null    | Unrounded order amount (may be NULL for older orders).               |
| data.getOrderHistory.data\[].orderDiscount                    | number         | Discount applied.                                                    |
| data.getOrderHistory.data\[].rawOrderDiscount                 | number/null    | Exact unrounded discount (may be NULL).                              |
| data.getOrderHistory.data\[].discountPercent                  | number         | Discount percentage.                                                 |
| data.getOrderHistory.data\[].amountCharged                    | number         | Final charged amount.                                                |
| data.getOrderHistory.data\[].currencyValue                    | number         | FX conversion multiplier.                                            |
| data.getOrderHistory.data\[].currencyCode                     | string         | Currency code of the order.                                          |
| data.getOrderHistory.data\[].products                         | array          | List of ordered products (generic across all categories).            |
| data.getOrderHistory.data\[].products\[].productId            | number         | Product ID (generic across voucher/lounge/merchandise/top-up/perks). |
| data.getOrderHistory.data\[].products\[].productName          | string         | Product name.                                                        |
| data.getOrderHistory.data\[].products\[].receiverMobileNumber | string         | Receiver mobile number                                               |
| data.getOrderHistory.data\[].products\[].receiverEmail        | string         | Receiver email (generic).                                            |
| data.getOrderHistory.data\[].products\[].price                | number         | Price/denomination/value.                                            |
| data.getOrderHistory.data\[].products\[].quantity             | number         | Ordered quantity.                                                    |
| data.getOrderHistory.data\[].products\[].orderProductStatus   | string         | Status of the individual product item (generic).                     |
| data.getOrderHistory.data\[].products\[].currency             | string         | Currency code for the product.                                       |
| data.getOrderHistory.data\[].products\[].trackingId           | string/null    | Shipment tracking ID **(merchandise only)**.                         |
| data.getOrderHistory.data\[].products\[].trackingLink         | string/null    | Shipment tracking URL **(merchandise only)**.                        |
| data.getOrderHistory.data\[].voucherDetails                   | array          | Summary of voucher/lounge/product info (all categories).             |
| data.getOrderHistory.data\[].voucherDetails\[].orderId        | number         | Order ID.                                                            |
| data.getOrderHistory.data\[].voucherDetails\[].productId      | number         | Product ID.                                                          |
| data.getOrderHistory.data\[].voucherDetails\[].productName    | string         | Product name.                                                        |
| data.getOrderHistory.data\[].voucherDetails\[].currencyCode   | string         | Currency code.                                                       |
| data.getOrderHistory.data\[].voucherDetails\[].productStatus  | string         | Cancelled Or Delivered                                               |
| data.getOrderHistory.data\[].voucherDetails\[].denomination   | number         | Product denomination/value.                                          |

## Implementation Notes

1. To fetch all the orders within a specified timeframe, pass a higher value in the "limit" parameter and pass the value as "1" in the\*\* "page"\*\* parameter

> **How Customers use this getOrderHistory API ?**
>
> Customer who have their own internal reporting systems or those personas who want to know the historic data of the transactions for internal auditing purpose, use this endpoint to fetch the order history for a specified time.


## OpenAPI

````yaml specs/rewards-merchandise.yaml POST /getOrderHistory
openapi: 3.0.3
info:
  title: Xoxoday Rewards API – Merchandise
  version: '1.2'
  description: >
    Merchandise API endpoints for browsing the catalog, placing orders, and
    reporting.


    All operations dispatch to `POST /v1/oauth/api`. Virtual path suffixes are
    used

    for playground differentiation since OpenAPI does not allow multiple POST
    operations

    on the same path.


    **Host split:**

    - `getFilters`, `getBalance`, `paymentHistory` → `stagingstores.xoxoday.com`

    - `getMerchandise`, `placeOrder`, `getOrderDetails`, `getOrderHistory` →
    `accounts.xoxoday.com`


    **Notable differences from other categories:**

    - Place Order: `productId` is a string, shipping fields are flat inside
    `data`

    - Get Order Details: `variables` fields are flat (no `data` wrapper)
servers:
  - url: https://stagingstores.xoxoday.com/chef/v1/oauth/api
    description: Sandbox
  - url: https://accounts.xoxoday.com/chef/v1/oauth/api
    description: Production
  - url: https://canvas.xoxoday.com/chef/v1/oauth/api
    description: Testing
security:
  - BearerAuth: []
tags:
  - name: Catalog
  - name: Orders
  - name: Reporting
paths:
  /getOrderHistory:
    post:
      tags:
        - Orders
      summary: Get Order History API
      description: |
        Fetch historical merchandise orders within a date range.

        **Real URL:** `POST https://accounts.xoxoday.com/chef/v1/oauth/api`
      operationId: merchandiseGetOrderHistory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
                - tag
                - variables
              properties:
                query:
                  type: string
                  enum:
                    - plumProAPI.mutation.getOrderHistory
                  default: plumProAPI.mutation.getOrderHistory
                tag:
                  type: string
                  enum:
                    - plumProAPI
                  default: plumProAPI
                variables:
                  type: object
                  required:
                    - data
                  properties:
                    data:
                      type: object
                      properties:
                        startDate:
                          type: string
                          description: 'Start date. Format: `YYYY-MM-DD`.'
                          example: '2012-07-25'
                        endDate:
                          type: string
                          description: 'End date. Format: `YYYY-MM-DD`.'
                          example: '2012-07-28'
                        limit:
                          type: integer
                          example: 10
                        page:
                          type: integer
                          example: 1
            example:
              query: plumProAPI.mutation.getOrderHistory
              tag: plumProAPI
              variables:
                data:
                  startDate: '2012-07-25'
                  endDate: '2012-07-28'
                  limit: 10
                  page: 1
      responses:
        '200':
          description: Order history returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      getOrderHistory:
                        type: object
                        properties:
                          status:
                            type: number
                          data:
                            type: array
                            items:
                              $ref: '#/components/schemas/OrderHistoryItem'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '502':
          $ref: '#/components/responses/BadGateway'
      servers:
        - url: https://stagingstores.xoxoday.com/chef/v1/oauth/api
          description: Sandbox
        - url: https://accounts.xoxoday.com/chef/v1/oauth/api
          description: Production
        - url: https://canvas.xoxoday.com/chef/v1/oauth/api
          description: Testing
components:
  schemas:
    OrderHistoryItem:
      type: object
      properties:
        orderId:
          type: number
        orderDate:
          type: string
        email:
          type: string
        deliveryStatus:
          type: string
        poNumber:
          type: string
        tag:
          type: string
          nullable: true
        orderTotal:
          type: number
        rawOrderTotal:
          type: number
          nullable: true
        orderDiscount:
          type: number
        rawOrderDiscount:
          type: number
          nullable: true
        discountPercent:
          type: number
        amountCharged:
          type: number
        currencyValue:
          type: number
        currencyCode:
          type: string
        products:
          type: array
          items:
            type: object
            properties:
              productId:
                type: number
              productName:
                type: string
              receiverEmail:
                type: string
              price:
                type: number
              quantity:
                type: number
              orderProductStatus:
                type: string
              currency:
                type: string
              trackingId:
                type: string
                nullable: true
              trackingLink:
                type: string
                nullable: true
        voucherDetails:
          type: array
          items:
            type: object
            properties:
              orderId:
                type: number
              productId:
                type: number
              productName:
                type: string
              currencyCode:
                type: string
              productStatus:
                type: string
              denomination:
                type: number
  responses:
    Unauthorized:
      description: Missing or invalid access token.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Unauthorized
    BadGateway:
      description: Upstream service error.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: '`Authorization: Bearer <access_token>`'

````