--- url: https://docs.youcan.shop/youcan-pay/transactions/list.md --- # List All Transactions Returns a paginated list of transaction objects related to the current authenticated account. The list is sorted, with the most recent transactions appearing first by default. **Required scope (OAuth only):** `view-transactions` ## Parameters ### Filter and Sort Transactions | Parameter | Type | Description | | --- | --- | --- | | `sort_field` | string optional | Field you want to sort by. Defaults to `created_at`. | | `sort_order` | string optional | Sorting order, `asc` or `desc`. Defaults to `desc`; any other value falls back to `desc`. | | `page` | integer optional | Page number. Defaults to `1`. | | `limit` | integer optional | Page size. Defaults to `10`, capped at `50`. | | `q` | string optional | Free-text search term. | | `filters` | array optional | An array of filter criteria where each entry has the following keys: | | `filters[].field` | string | Field you want to filter by. | | `filters[].value` | string | The value to compare by. | | `filters[].operator` | string | Comparison operator. Accepted values: `=` (default), `is`, `is_not`, `!=`, `<`, `<=`, `>`, `>=`, `in`, `like`, `not like`. | ## Returns Returns a paginated collection of transaction objects. If no transactions are found, returns an empty collection. ## Request **Endpoint:** `https://youcanpay.com/api/v2/transactions` **Method:** `GET` ```bash $ curl --location -g --request GET 'https://youcanpay.com/api/v2/transactions' \ --header 'Accept: application/json' \ -u 'YOUR_PRIVATE_KEY:' ``` ### Request with Filters ```bash $ curl --location -g --request GET 'https://youcanpay.com/api/v2/transactions?sort_field=amount&sort_order=asc&filters[0][field]=amount&filters[0][value]=10000' \ --header 'Accept: application/json' \ -u 'YOUR_PRIVATE_KEY:' ``` ## Response ```json { "object": "v2.transaction", "data": [ { "object": "v2.transaction", "id": "10e7691c-14a2-4936-833b-ec154c817ce9", "status": "paid", "is_live_mode": false, "paid_at": "2024-01-29 10:31:39", "amount": { "amount": "100.00", "currency": "MAD", "localized": "MAD 100.00" }, "fees": { "amount": "6.90", "currency": "MAD", "localized": "MAD 6.90" }, "order_id": "inv_028ef20c-5065-4515-a0d6-a1c17ff0d53e", "customer_id": "38678dea-d23a-4388-bb78-648892bce85b", "customer_ip": "192.168.65.1", "payment_method": { "type": "credit_card", "id": "0fd9bb2c-f14b-411c-bc90-deb73ddaf9ff" }, "is_fully_refunded": false, "amount_refunded": { "amount": "0.00", "currency": "MAD", "localized": "MAD 0.00" }, "hold_released_at": null, "success_url": null, "error_url": null, "metadata": { "type": "youcan_pay.invoice" }, "created_at": "2024-01-29 10:31:30" } ], "pagination": { "current_page": 1, "per_page": 10, "total": 6, "last_page": 1 } } ``` See the [Transaction object](/youcan-pay/transactions/object) for a description of each field.