> ## 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.

# Place Order API

> Place an airmiles order. A unique `poNumber` must be sent per order. `userMeta.loyaltyMemberId` is required for miles transfer to the correct loyalty program account.

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


> A unique reference ID needs to be sent for every unique order in the "poNumber" parameter
>
> We strongly recommend storing the request and response of every "PlaceOrderAPI" call

## Implementation Notes

1. To avoid facing an error while placing an order, please pass the valid productID and denomination
2. The maximum order quantity allowed for the products is 1 as mentioned in the **"orderQuantityLimit"** parameter in the GetVouchersAPI
3. Should you wish to notify the recipient via email, please pass "1" in the **"notifyReceiverEmail"** parameter
4. We recommend you store the "poNumber" that you pass in the request and the\*\*"orderID"\*\* you receive in the response
5. Should you get a 5xx error from the PlaceOrderAPI, please call [GetOrderDetails](https://developers.xoxoday.com/v1.2/reference/get-order-details-api-1) and confirm if an order exists using the poNumber. If there's no order against the poNumber, you can go ahead and place another order

> Learn how to manage [webhooks](https://developers.xoxoday.com/v1.2/docs/webhooks-1) to receive order status updates for delayed product types.


## OpenAPI

````yaml specs/rewards-airmiles.yaml POST /placeOrder
openapi: 3.0.3
info:
  title: Xoxoday Rewards API – Airmiles
  version: '1.2'
  description: >
    Airmiles API endpoints for browsing the miles 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`

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


    **Get Balance** sends parameters as URL query string (not request body).
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:
  /placeOrder:
    post:
      tags:
        - Orders
      summary: Place Order API
      description: >
        Place an airmiles order. A unique `poNumber` must be sent per order.
        `userMeta.loyaltyMemberId` is required for miles transfer to the correct
        loyalty program account.


        **Real URL:** `POST https://accounts.xoxoday.com/chef/v1/oauth/api`
      operationId: airmilesPlaceOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
                - tag
                - variables
              properties:
                query:
                  type: string
                  enum:
                    - plumProAPI.mutation.placeOrder
                  default: plumProAPI.mutation.placeOrder
                tag:
                  type: string
                  enum:
                    - plumProAPI
                  default: plumProAPI
                variables:
                  type: object
                  required:
                    - data
                  properties:
                    data:
                      type: object
                      required:
                        - productId
                        - quantity
                        - denomination
                        - poNumber
                        - userMeta
                      properties:
                        productId:
                          type: integer
                          description: Airmiles product ID to order.
                          example: 15365
                        quantity:
                          type: integer
                          description: Number of units to order.
                          example: 1
                        denomination:
                          type: number
                          description: Value/amount of the airmiles product.
                          example: 50
                        email:
                          type: string
                          format: email
                          description: Customer email for order confirmation.
                          example: your.email@example.com
                        contact:
                          type: string
                          description: Customer contact number.
                          example: +1-4705000000
                        tag:
                          type: string
                          description: Optional tag for internal tracking.
                          example: Rewarding
                        poNumber:
                          type: string
                          description: >-
                            Client-generated PO number — must be unique per
                            order.
                          example: PO12662
                        notifyReceiverEmail:
                          type: integer
                          enum:
                            - 0
                            - 1
                          description: '`1` = notify recipient via email.'
                          example: 1
                        notifyAdminEmail:
                          type: integer
                          enum:
                            - 0
                            - 1
                          description: '`1` = notify admin via email.'
                          example: 0
                        userMeta:
                          type: object
                          required:
                            - loyaltyMemberId
                          description: >-
                            Loyalty program metadata required for miles
                            transfer.
                          properties:
                            loyaltyMemberId:
                              type: string
                              description: Recipient's loyalty program member ID.
                              example: '324523423'
            example:
              query: plumProAPI.mutation.placeOrder
              tag: plumProAPI
              variables:
                data:
                  productId: 15365
                  quantity: 1
                  denomination: 50
                  email: your.email@example.com
                  contact: +1-4705000000
                  tag: Rewarding
                  poNumber: PO12662
                  notifyReceiverEmail: 1
                  notifyAdminEmail: 0
                  userMeta:
                    loyaltyMemberId: '324523423'
      responses:
        '200':
          description: Airmiles order placed successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      placeOrder:
                        type: object
                        properties:
                          status:
                            type: number
                          data:
                            type: object
                            properties:
                              orderId:
                                type: number
                              orderTotal:
                                type: number
                              orderDiscount:
                                type: string
                              discountPercent:
                                type: string
                              currencyCode:
                                type: string
                              currencyValue:
                                type: number
                              amountCharged:
                                type: number
                              orderStatus:
                                type: string
                              deliveryStatus:
                                type: string
                              tag:
                                type: string
                              quantity:
                                type: number
                              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
              example:
                data:
                  placeOrder:
                    status: 1
                    data:
                      orderId: 98765432
                      orderTotal: 50
                      currencyCode: USD
                      amountCharged: 50
                      orderStatus: complete
                      deliveryStatus: delivered
                      quantity: 1
                      voucherDetails:
                        - orderId: 98765432
                          productId: 15365
                          productName: Emirates Skywards Miles
                          currencyCode: USD
                          productStatus: delivered
                          denomination: 50
        '400':
          $ref: '#/components/responses/BadRequest'
        '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:
  responses:
    BadRequest:
      description: Invalid request body or parameters.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
              message:
                type: string
    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>`'

````