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

# Get Transactions

> Using this endpoint you'll have the ability to get a list of transactions with some filtering & sorting capabilities.

### Query Parameters

<ParamField query="apiKey" type="string" placeholder="API Key" required>
  The API Key of your account.
</ParamField>

<ParamField query="startDate" type="string" placeholder="Start-date" required>
  The starting date of the result.

  Sample: `2021-05-27 15:31:39`
</ParamField>

<ParamField query="endDate" type="string" placeholder="End-date" required>
  The ending date of the result.

  Sample: `2021-06-28 23:59:59`
</ParamField>

<ParamField query="pageNum" type="integer" placeholder="Page number" required>
  The current page number (used for pagination in your system)
</ParamField>

<ParamField query="itemsPerPage" type="integer" placeholder="Total items per page" required>
  Specifies the total items that should be return for each request (each page).
  It should be a number between 1 and 50.
</ParamField>

<ResponseExample>
  ```json Success theme={null}
  {
    "success": true,
    "result": {
      "items": [
        {
          "id": 1,
          "payment_method": "ap-mada",
          "amount": "313.00",
          "service_charge": "1.00",
          "time": "2021-01-21 13:12:59"
        }
      ],
      "page_num": 1,
      "total_pages": 1,
      "total_rows": 1
    }
  }
  ```

  ```json Error theme={null}
  {
    "success": false,
    "code": "1",
    "message": "Missing or invalid api key"
  }
  ```
</ResponseExample>

### Response properties

<ResponseField name="success" type="boolean" required>
  A boolean value indicates the response status.
</ResponseField>

<ResponseField name="result" type="object" required>
  <Expandable title="properties" defaultOpen={true}>
    <ResponseField name="items" type="object" required>
      <Expandable title="properties" defaultOpen={true}>
        <ResponseField name="id" type="integer" required>
          A unique integer value indicating the deposit request in DashPay system.
        </ResponseField>

        <ResponseField name="payment_method" type="string" required>
          The payment method used by the customer to complete the payment process.

          This can be one of the following values:

          1. `mada`
          2. `visa`
          3. `master`
          4. `amex`
          5. `ap-mada` (ApplePay Mada)
          6. `ap-visa` (ApplePay Visa)
          7. `ap-master` (ApplePay Mastercard)
          8. `ap-amex` (ApplePay AmericanExpress)
        </ResponseField>

        <ResponseField name="amount" type="string" required>
          The total amount of the transaction.
        </ResponseField>

        <ResponseField name="service_charge" type="string" required>
          The fee amount of the transaction (DashPay fees).
        </ResponseField>

        <ResponseField name="time" type="string" required>
          Date of creating the transaction.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="page_num" type="integer" required>
      The current page number.
    </ResponseField>

    <ResponseField name="total_pages" type="integer" required>
      Total pages available (according to the date range specified and the total items per page).
    </ResponseField>

    <ResponseField name="total_rows" type="integer" required>
      Total rows of the current page (total transactions returned in this request).
    </ResponseField>
  </Expandable>
</ResponseField>

## Error Codes

Here's a list of possible error codes of this endpoint.

| **Code** | **Description**                                                           |
| -------- | ------------------------------------------------------------------------- |
| 1        | Missing or invalid api key                                                |
| 3        | You cannot pass a number greater than 50 for the parameter `itemsPerPage` |
| 4        | Invalid \`startDate\`\`.                                                  |
| 5        | invalid \`endDate\`\`.                                                    |
