> ## 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 Receipt ID

> Fetch a collection order by the merchant receipt_id supplied at creation. Send that value as id, not receipt_id. Use HTTP Basic Auth and omit key and hash from the body. V1 orders remain accessible for the same business account and test or live environment.

Retrieve a collection order using the `receipt_id` you supplied when creating it. Send that receipt ID in the request field `id`, not `receipt_id`. This differs from [Fetch Order by ID](https://docs.paytring.com/api-reference/endpoint/fetch.md), which expects Paytring's `order_id`.

Authenticate with [HTTP Basic Auth](https://docs.paytring.com/api-reference/introduction.md) using your API key and secret. Do not include `key` or `hash` in the request body.

## Request example

The receipt ID must be a string between 5 and 75 characters.

```bash theme={null}
curl --request POST 'https://api.paytring.com/api/v2/order/fetch/receipt' \
  --user "${PAYTRING_API_KEY}:${PAYTRING_API_SECRET}" \
  --header 'Content-Type: application/json' \
  --data '{"id":"DEMO202611030001"}'
```

## Success response excerpt

```json theme={null}
{
  "status": true,
  "order": {
    "order_id": "1111111111111111",
    "receipt_id": "DEMO202611030001",
    "amount": 10000,
    "currency": "INR",
    "order_status": "success"
  }
}
```

The full response also includes customer, gateway, address, note, and timestamp fields. The top-level `status` describes whether the fetch succeeded. `order.order_status` describes the payment state.

V1 orders can be fetched through this endpoint for the same business account and environment. Use the matching test or live credentials. You do not need to recreate existing orders or regenerate credentials for V2.

## Errors and payment confirmation

Known authentication, validation, and lookup errors can return HTTP 200 with `status: false` and an `error` object. Always inspect the response body.

Before updating your payment records, confirm `order.order_status` is `success` and match the receipt ID, amount, and currency against your expected order. A successful fetch or receipt of a webhook alone does not mean the payment succeeded.

See [Migrating collection requests from V1](https://docs.paytring.com/api-reference/introduction.md#migrating-collection-requests-from-v1) for the endpoint changes and collection webhook considerations.


## OpenAPI

````yaml POST /api/v2/order/fetch/receipt
openapi: 3.1.0
info:
  title: Orchestration
  version: '1'
servers:
  - url: https://api.paytring.com
security:
  - sec0: []
paths:
  /api/v2/order/fetch/receipt:
    post:
      summary: Fetch by Receipt ID
      description: >-
        Fetch a collection order by the merchant receipt_id supplied at
        creation. Send that value as id, not receipt_id. Use HTTP Basic Auth and
        omit key and hash from the body. V1 orders remain accessible for the
        same business account and test or live environment.
      operationId: fetch-order-by-receipt-id
      requestBody:
        required: true
        content:
          application/json:
            example:
              id: DEMO202611030001
            schema:
              type: object
              required:
                - id
              properties:
                id:
                  type: string
                  description: >-
                    The receipt_id you supplied when creating the order. This is
                    not Paytring's order_id.
                  minLength: 5
                  maxLength: 75
                  example: DEMO202611030001
      responses:
        '200':
          description: >-
            Inspect status. A successful fetch returns order; order.order_status
            is the payment state. Handled API errors can also return HTTP 200
            with status false and error.
          content:
            application/json:
              examples:
                Result:
                  summary: Successful fetch, response excerpt
                  value:
                    status: true
                    order:
                      order_id: '1111111111111111'
                      receipt_id: DEMO202611030001
                      amount: 10000
                      currency: INR
                      order_status: success
                InvalidInput:
                  value:
                    status: false
                    error:
                      message: Invalid Input Parameters Provided
                      code: 1001
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                    default: true
                  error:
                    type: object
                    description: Present for a handled API error when status is false.
                    properties:
                      message:
                        type: string
                      code:
                        type: integer
                  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'
        default:
          description: >-
            API error. Do not rely on the HTTP status alone; handled errors may
            also use HTTP 200.
          content:
            application/json:
              examples:
                Result:
                  value:
                    status: false
                    error:
                      message: Invalid Input Parameters Provided
                      code: 1001
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                    default: true
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Invalid Input Parameters Provided
                      code:
                        type: integer
                        example: 1001
                        default: 0
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.