# Transaction

## Transaction object

```json
{
  "description": "Recharge bonus balance during tracker registration",
  "type": "bonus_charge",
  "subtype": "register",
  "timestamp": "2021-01-28 08:16:40",
  "user_id": 12203,
  "dealer_id": 5001,
  "tracker_id": 303126,
  "amount": -10.0000,
  "new_balance": 800.0000,
  "old_balance": 810.0000,
  "bonus_amount": 10.0000,
  "new_bonus": 10.0000,
  "old_bonus": 0.0000
}
```

* `description` - string. Transaction description.
* `type` - [enum](https://navixy.com/docs/navixy-api/user-api/backend-api/..#data-types). Type of transaction.
* `subtype` - [enum](https://navixy.com/docs/navixy-api/user-api/backend-api/..#data-types). Subtype of transaction.
* `timestamp` - [date/time](https://navixy.com/docs/navixy-api/user-api/backend-api/..#data-types). When transaction created.
* `user_id` - int. ID of a user which made a transaction.
* `dealer_id` - int. ID of a dealer.
* `tracker_id` - int. Tracker id. 0 if transaction not associated with tracker.
* `amount` - double. Amount of money in transaction, can be negative. e.g. -10.0000 means 10 money units removed from user\`s balance.
* `new_balance` - double. User's money balance after transaction.
* `old_balance` - double. User's money balance before transaction.
* `bonus_amount` - double. Amount of bonus used in transaction, can be negative. e.g. 10.0000 means 10 bonuses units added to user\`s bonus balance.
* `new_bonus` - double. User's bonus balance after transaction.
* `old_bonus` - double. User's bonus balance before transaction.

## API actions

API path: `/transaction`.

### list

Gets list of user's billing transactions for the specified period.

**required sub-user rights**: `payment_create`.

#### Parameters

| name  | description                                             | type                                                                               |
| ----- | ------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| from  | Start date/time for searching.                          | [date/time](https://navixy.com/docs/navixy-api/user-api/backend-api/..#data-types) |
| to    | End date/time for searching. Must be after `from` date. | [date/time](https://navixy.com/docs/navixy-api/user-api/backend-api/..#data-types) |
| limit | Optional. Maximum number of returned transactions.      | int                                                                                |

#### Example

cURL

{% code overflow="wrap" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/transaction/list' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "from": "2021-01-20 08:16:40", "to": "2021-01-28 08:16:40"}'
```

{% endcode %}

#### Response

```json
{
  "success": true,
  "list": [
    {
      "description": "Recharge bonus balance during tracker registration",
      "type": "bonus_charge",
      "subtype": "register",
      "timestamp": "2021-01-28 08:16:40",
      "user_id": 12203,
      "dealer_id": 5001,
      "tracker_id": 303126,
      "amount": -10.0000,
      "new_balance": 800.0000,
      "old_balance": 810.0000,
      "bonus_amount": 10.0000,
      "new_bonus": 10.0000,
      "old_bonus": 0.0000
    }
  ]
}
```

* `list` - array of objects. List of [transactions objects](#transaction-object).

#### Errors

* 211 – Requested time span is too big - more than [report.maxTimeSpan](https://navixy.com/docs/navixy-api/user-api/backend-api/resources/commons/dealer).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://navixy.com/docs/navixy-api/user-api/backend-api/resources/billing/transaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
