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

# Update Order

> Update specific fields of an existing order.

## Overview

The Update Order endpoint enables you to modify specific information of an existing order, such as buyer details (PAN number, date of birth) and invoice information. This is useful for correcting or updating order details after creation.

You can update the following fields:

* **Buyer Information**: PAN number, date of birth
* **Invoice Information**: Invoice number, invoice date


## OpenAPI

````yaml openapi.json patch /pg/orders/{order_id}
openapi: 3.0.0
info:
  title: Eximpe Payment Gateway API
  description: >-
    API for payment processing and order management through Eximpe payment
    gateway
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://api-staging.eximpe.com
    description: Staging server
  - url: https://api.eximpe.com
    description: Production server
security:
  - clientAuth: []
    clientSecretAuth: []
paths:
  /pg/orders/{order_id}:
    patch:
      tags:
        - Orders
      summary: Update Order
      description: Update specific fields of an existing order.
      parameters:
        - name: order_id
          in: path
          description: Unique identifier of the order
          required: true
          schema:
            type: string
          example: OD3451762252
      requestBody:
        description: Order update request - only include fields to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrderRequest'
            example:
              buyer:
                pan_number: BNYPG9212K
                dob: '2010-01-23'
              invoice:
                number: INV_2TIO9F
                date: '2025-06-22'
        required: true
      responses:
        '200':
          description: Order updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateOrderResponse'
              example:
                success: true
                message: Order updated successfully
                data:
                  success: true
                  message: Order updated successfully
                  data:
                    order_id: '{Order_ID}'
                    buyer:
                      pan_number: BNYPG9212K
                      dob: '2010-01-23'
                    invoice:
                      number: INV_2TIO9F
                      date: '2025-06-22'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Order not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                message: Order not found
                error:
                  code: ERR_ORDER_404
                  message: Order with ID 'OD3451762252' not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - clientAuth: []
          clientSecretAuth: []
components:
  schemas:
    UpdateOrderRequest:
      type: object
      description: Request body for updating order - only include fields to update
      properties:
        buyer:
          type: object
          description: Buyer information to update
          properties:
            pan_number:
              type: string
              description: Buyer's PAN number
            dob:
              type: string
              format: date
              description: Buyer's date of birth (YYYY-MM-DD)
        invoice:
          type: object
          description: Invoice information to update
          properties:
            number:
              type: string
              description: Invoice number
            date:
              type: string
              format: date
              description: Invoice date (YYYY-MM-DD)
    UpdateOrderResponse:
      type: object
      required:
        - success
        - message
        - data
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful
        message:
          type: string
          description: Response message
        data:
          type: object
          description: Nested response data
          properties:
            success:
              type: boolean
              description: Indicates if the order update was successful
            message:
              type: string
              description: Success message for the order update
            data:
              type: object
              description: Contains the updated order fields
              properties:
                order_id:
                  type: string
                  description: The ID of the updated order
                buyer:
                  type: object
                  description: Updated buyer information
                  properties:
                    pan_number:
                      type: string
                      description: Updated PAN number
                    dob:
                      type: string
                      format: date
                      description: Updated date of birth
                invoice:
                  type: object
                  description: Updated invoice information
                  properties:
                    number:
                      type: string
                      description: Updated invoice number
                    date:
                      type: string
                      format: date
                      description: Updated invoice date
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful
        error:
          $ref: '#/components/schemas/ErrorDetails'
    ErrorDetails:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code (e.g., ERR_ORDER_002)
        message:
          type: string
          description: Error message
        details:
          type: object
          description: Detailed validation error information with field-specific errors
          additionalProperties:
            type: string
            description: Error message for the specific field
  securitySchemes:
    clientAuth:
      type: apiKey
      name: X-Client-ID
      in: header
      description: Client app ID. You can find your app id in the merchant dashboard.
    clientSecretAuth:
      type: apiKey
      name: X-Client-Secret
      in: header
      description: Client secret key. You can find your secret in the merchant dashboard.

````