> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eximpe.com/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 updating order details after creation or if additional buyer information is requested from the bank.

You can update the following fields:

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

## Request Parameters

### Path

| Name      | In   | Type   | Required | Description                    |
| --------- | ---- | ------ | -------- | ------------------------------ |
| order\_id | path | string | Yes      | Unique identifier of the order |

### Body (JSON)

Only include the fields you want to update.

### Parameter Definitions

#### Top-level

| Name    | Type   | Required | Description                   | Constraints        |
| ------- | ------ | -------- | ----------------------------- | ------------------ |
| buyer   | object | No       | Buyer information to update   | See Buyer object   |
| invoice | object | No       | Invoice information to update | See Invoice object |

#### Buyer

| Name        | Type          | Required | Description           | Constraints                             |
| ----------- | ------------- | -------- | --------------------- | --------------------------------------- |
| pan\_number | string        | No       | Buyer's PAN number    | Format: Indian PAN (e.g., `ABCDE1234F`) |
| dob         | string (date) | No       | Buyer's date of birth | Format: `YYYY-MM-DD`                    |

#### Invoice

| Name   | Type          | Required | Description    | Constraints          |
| ------ | ------------- | -------- | -------------- | -------------------- |
| number | string        | No       | Invoice number | Max 255 chars        |
| date   | string (date) | No       | Invoice date   | Format: `YYYY-MM-DD` |


## OpenAPI

````yaml 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. This specification includes v1, v2, and v3 API versions.
  license:
    name: Proprietary
  version: 2.0.0
servers:
  - url: https://api-pacb-uat.eximpe.com
    description: Payment Gateway Sandbox URL
security:
  - clientAuth: []
    clientSecretAuth: []
    apiVersionHeader: []
tags:
  - name: Card Tokens
  - name: Merchants
  - name: Orders
  - name: Payment Links
  - name: Payments
  - name: Refunds
  - name: Settlements
  - name: Subscriptions
paths:
  /pg/orders/{order_id}/:
    patch:
      tags:
        - Orders
      summary: Update Order
      description: Update specific fields of an existing order.
      operationId: v1_patch_pg_orders_order_id_
      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/v1_UpdateOrderRequest'
            example:
              buyer:
                pan_number: CDEFG1234H
                dob: '1992-08-14'
              invoice:
                number: INV_UPDATED_2024_1205
                date: '2024-12-05'
        required: true
      responses:
        '200':
          description: Order updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_UpdateOrderResponse'
              example:
                success: true
                message: Order updated successfully
                data:
                  success: true
                  message: Order updated successfully
                  data:
                    order_id: '{Order_ID}'
                    buyer:
                      pan_number: CDEFG1234H
                      dob: '1992-08-14'
                    invoice:
                      number: INV_UPDATED_2024_1205
                      date: '2024-12-05'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_ORDER_002
                  message: Validation error
                  details:
                    buyer:
                      pan_number: >-
                        PAN number must be in format: AAAAA1111A (5 letters, 4
                        digits, 1 letter)
        '401':
          description: Unauthorized - Invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_AUTH_000
                  message: Missing credentials
                  details:
                    authentication: Missing credentials.
        '404':
          description: Order not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_ORDER_001
                  message: Order not found
                  details:
                    order_id: Order not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_SERVICE_ERROR_000
                  message: Payment gateway error
                  details:
                    error: An unexpected error occurred. Please try again later
      security:
        - clientAuth: []
          clientSecretAuth: []
          apiVersionHeader: []
components:
  schemas:
    v1_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)
    v1_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
    v1_ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
          description: >-
            Indicates if the request was successful. Always false for error
            responses.
        error:
          $ref: '#/components/schemas/v1_ErrorDetails'
    v1_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 Application ID** - Your unique application identifier used to
        authenticate API requests. You can find your Client ID in the Developer
        Settings section of the merchant dashboard.
      x-displayName: Client ID
      x-example: your-client-id
    clientSecretAuth:
      type: apiKey
      name: X-Client-Secret
      in: header
      description: >-
        **Client Secret Key** - Your secret key used alongside the Client ID for
        secure authentication. Keep this confidential and never expose it in
        client-side code. Available in the Developer Settings section of the
        merchant dashboard.
      x-displayName: Client Secret
      x-example: your-client-secret
    apiVersionHeader:
      type: apiKey
      name: X-API-Version
      in: header
      description: >-
        **API Version** - Specifies which version of the API to use (e.g.,
        '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which
        API version your integration uses. Default version information is
        available in the Developer Settings.
      x-displayName: API Version
      x-example: 3.0.0

````