> ## 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 by Date

This API allows you to fetch settlement details by date.

### Request Body

```json theme={null}
{
  "key": "string", // Merchant key, available in dashboard profile section
  "date": "string", // The date you want to fetch settlements for (format: YYYY-MM-DD)
  "pg": "string", // Payment gateway code (optional)
  "offset": "string", // Starting point for results (optional)
  "limit": "string" // Maximum number of records to return (optional)
}
```

### Responses

#### 200 OK

```json theme={null}
{
  "status": true,
  "data": [
    {
      "order_id": null,
      "pg_transaction_id": "string",
      "order_date": "string",
      "utr": "string",
      "settlement_date": "string",
      "order_status": "string",
      "pg_status": "string",
      "payment_mode": "string",
      "amount": 0,
      "settled_amount": 0
    }
  ],
  "is_last_page": false,
  "request_id": "string"
}
```

#### 400 Bad Request

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


## OpenAPI

````yaml POST /api/v2/settlement/fetch
openapi: 3.1.0
info:
  title: Orchestration
  version: '1'
servers:
  - url: https://api.paytring.com
security:
  - sec0: []
paths:
  /api/v2/settlement/fetch:
    post:
      summary: Fetch by Date
      operationId: fetch-settlement-by-date
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - key
                - date
                - pg
              properties:
                key:
                  type: string
                  description: Merchant key, available in dashboard profile section
                date:
                  type: string
                  description: the date you want to fetch settlements for
                  format: date
                pg:
                  type: string
                  description: >-
                    if you want to fetch details of a particular pg. only,
                    please pass it's pg code
                offset:
                  type: string
                  description: It specifies the starting point from which to return results
                limit:
                  type: string
                  description: >-
                    It specifies the maximum number of records to return in a
                    response
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "status": true,
                        "data": [
                        {
                                "order_id": null,
                                "pg_transaction_id": "xxxx83793xxxxxxxxx",
                                "order_date": "2xxx-0x-xx 2x:0x:xx",
                                "utr": "xxxx4791xxxxxx",
                                "settlement_date": "2xxx-0x-xx 00:xx:00",
                                "order_status": "success",
                                "pg_status": "Shipped",
                                "payment_mode": "UPI",
                                "amount": 1xxxxxx,
                                "mer_service_fee": 0,
                                "mer_service_tax": 0,
                                "merchant_subvention_amount": "0.00",
                                "cgst": "0.00",
                                "igst": "0.00",
                                "sgst": "0.00",
                                "settled_amount": 1xxxxx,
                                "dispute_id": null,
                                "description": null
                            },
                        ],
                         "is_last_page": false, // If it is the last page, it will return true.
                        "request_id": "67bf1xxxxxxx4"
                    }
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: '{}'
              schema:
                type: object
                properties: {}
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````