Skip to content

Get Transactions

Get all user transactions.

Endpoint

http
GET /api/v1/user/transactions

Request example

sh
curl --location --request GET 'https://files.ro/api/v1/user/transactions' \
--header 'Authorization: Bearer {token}'

Response

json
{
  "data": [
    {
      "data": {
        "id": "tx_123",
        "type": "transactions",
        "attributes": {
          "type": "charge",
          "status": "completed",
          "note": "Monthly subscription",
          "price": "$10.00",
          "currency": "USD",
          "amount": 10,
          "driver": "stripe",
          "reference": "ch_123",
          "metadata": null,
          "created_at": "01. Jan. 2024",
          "updated_at": "01. Jan. 2024"
        },
        "relationships": {
          "user": {
            "data": {
              "id": "user_123",
              "type": "users",
              "attributes": {
                "avatar": "https://files.ro/storage/avatars/jane.png",
                "first_name": "Jane",
                "last_name": "Doe",
                "name": "Jane Doe",
                "color": "#00BC7E",
                "email": "jane@example.com"
              }
            }
          }
        }
      }
    }
  ],
  "links": {
    "first": "https://files.ro/api/v1/user/transactions?page=1",
    "last": "https://files.ro/api/v1/user/transactions?page=5",
    "prev": null,
    "next": "https://files.ro/api/v1/user/transactions?page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 5,
    "links": [
      {
        "url": "https://files.ro/api/v1/user/transactions?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": "https://files.ro/api/v1/user/transactions?page=2",
        "label": "2",
        "active": false
      }
    ],
    "path": "https://files.ro/api/v1/user/transactions",
    "per_page": 15,
    "to": 15,
    "total": 68
  }
}
json
{
  "type": "error",
  "message": "You are not authorized"
}
json
{
  "message": "The given data was invalid.",
  "errors": {
    "field": [
      "The field is required."
    ]
  }
}