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

# Fetch Order by ID

> This API allows you to retrieve details of a previously created order.

This API allows you to retrieve details of a previously created order.

### Request Body

```json theme={null}
{
  "key": "test_123", // Merchant API key
  "id": "string", // Order ID
  "hash": "string" // Calculated hash for request validation
}
```

### Responses

#### 200 OK

```json theme={null}
{
  "status": true,
  "order": {
    "order_id": "string",
    "amount": 100,
    "currency": "INR",
    "status": "success",
    "card_last_4": "6005",
    "card_issuer": "amex"
  }
}
```

#### 400 Bad Request

```json theme={null}
{
  "status": false,
  "error": {
    "message": "Invalid request",
    "code": 400
  }
}
```


## OpenAPI

````yaml POST /api/v2/order/fetch
openapi: 3.1.0
info:
  title: Orchestration
  version: '1'
servers:
  - url: https://api.paytring.com
security:
  - sec0: []
paths:
  /api/v2/order/fetch:
    post:
      summary: Fetch by Order ID
      description: This API allows you to retrieve details of a previously created order.
      operationId: fetch-order
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - key
                - id
                - hash
              properties:
                key:
                  type: string
                  description: Merchant Key
                  default: test_123
                id:
                  type: string
                  description: pass order id of partying in this param.
                hash:
                  type: string
                  description: hash is calculated as provided in doc.
      responses:
        '200':
          description: '200'
          content:
            text/plain:
              examples:
                Result:
                  value: >-
                    {"status":true,"order":{"order_id":"1111111111111111","receipt_id":"MGI2222222222222333","pg_transaction_id":"222222222222","amount":118,"currency":"INR","pg":"Paytm","method":"UPI","order_status":"success","unmapped_status":"TXN_SUCCESS","card_last_4":"6005","card_issuer":"amex","customer":{"name":"Jhon
                    Doe","email":"Jhon@doe.com","phone":"917732887777"},"notes":{"udf1":"Sync
                    with
                    #122","udf2":"","udf3":"","udf4":"","udf5":"","udf6":"","udf8":"","udf9":"","udf10":""},"billing_address":{"firstname":"Jhon","lastname":"LastName","phone":"917732887777","line1":"Gurugram","line2":"Gurugram","city":"Gurgaon","state":"Haryana","country":"IN","zipcode":"122005"},"shipping_address":{"firstname":"Jhon","lastname":"LastName","phone":"917732887777","line1":"Gurugram","line2":"Gurugram","city":"Gurgaon","state":"Haryana","country":"IN","zipcode":"122005"},"additional_charges":0,"mdr":"","tpv":[],"created_at":"2024-04-05
                    12:19:24","updated_at":"2024-04-05 12:23:24"}}
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                    default: true
                  order:
                    type: object
                    properties:
                      order_id:
                        type: string
                        example: '1111111111111111'
                      receipt_id:
                        type: string
                        example: MGI2222222222222333
                      pg_transaction_id:
                        type: string
                        example: '222222222222'
                      amount:
                        type: integer
                        example: 118
                        default: 0
                      currency:
                        type: string
                        example: INR
                      pg:
                        type: string
                        example: Paytm
                      method:
                        type: string
                        example: UPI
                      order_status:
                        type: string
                        example: success
                      unmapped_status:
                        type: string
                        example: TXN_SUCCESS
                      customer:
                        type: object
                        properties:
                          name:
                            type: string
                            example: Jhon Doe
                          email:
                            type: string
                            example: Jhon@doe.com
                          phone:
                            type: string
                            example: '917732887777'
                      notes:
                        type: object
                        properties:
                          udf1:
                            type: string
                            example: 'Sync with #122'
                          udf2:
                            type: string
                            example: ''
                          udf3:
                            type: string
                            example: ''
                          udf4:
                            type: string
                            example: ''
                          udf5:
                            type: string
                            example: ''
                          udf6:
                            type: string
                            example: ''
                          udf8:
                            type: string
                            example: ''
                          udf9:
                            type: string
                            example: ''
                          udf10:
                            type: string
                            example: ''
                      billing_address:
                        type: object
                        properties:
                          firstname:
                            type: string
                            example: Jhon
                          lastname:
                            type: string
                            example: LastName
                          phone:
                            type: string
                            example: '917732887777'
                          line1:
                            type: string
                            example: Gurugram
                          line2:
                            type: string
                            example: Gurugram
                          city:
                            type: string
                            example: Gurgaon
                          state:
                            type: string
                            example: Haryana
                          country:
                            type: string
                            example: IN
                          zipcode:
                            type: string
                            example: '122005'
                      shipping_address:
                        type: object
                        properties:
                          firstname:
                            type: string
                            example: Jhon
                          lastname:
                            type: string
                            example: LastName
                          phone:
                            type: string
                            example: '917732887777'
                          line1:
                            type: string
                            example: Gurugram
                          line2:
                            type: string
                            example: Gurugram
                          city:
                            type: string
                            example: Gurgaon
                          state:
                            type: string
                            example: Haryana
                          country:
                            type: string
                            example: IN
                          zipcode:
                            type: string
                            example: '122005'
                      additional_charges:
                        type: integer
                        example: 0
                        default: 0
                      mdr:
                        type: string
                        example: ''
                      tpv:
                        type: array
                      created_at:
                        type: string
                        example: '2024-04-05 12:19:24'
                      updated_at:
                        type: string
                        example: '2024-04-05 12:23:24'
                      card_last_4:
                        type: string
                        example: '6005'
                      card_issuer:
                        type: string
                        example: amex
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"status\": false,\n    \"error\": {\n    \t\"code\": 202,\n      \"message\":\"error message\"\n    }\n}\n\n\n\n\n\n\n\n\n\n"
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                    default: true
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 202
                        default: 0
                      message:
                        type: string
                        example: error message
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````