Transactions Pydantic Models
In order to simplify and standardize the data that is passed between the client and the Revolut Business API, PyRevolut uses Pydantic models to define the structure of the data.
Below are the Pydantic models used by the Transactions
endpoint.
ResourceTransaction
Bases: BaseModel
Transaction resource model.
Source code in pyrevolut/api/transactions/resources/transaction.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
ModelCard
Bases: BaseModel
The card details (only for card transfers).
Source code in pyrevolut/api/transactions/resources/transaction.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
ModelLeg
Bases: BaseModel
The legs of the transaction:
- For transactions between your Revolut accounts,
there can be 2 legs, for example, an internal transfer made out of
the GBP account and into the EUR account.
- For transactions in other cases, there is only 1 leg.
Source code in pyrevolut/api/transactions/resources/transaction.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
ModelCounterparty
Bases: BaseModel
The counterparty of the transaction.
Source code in pyrevolut/api/transactions/resources/transaction.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
ModelMerchant
Bases: BaseModel
The information about the merchant (only for card transfers)
Source code in pyrevolut/api/transactions/resources/transaction.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
RetrieveListOfTransactions
Retrieve the historical transactions based on the provided query criteria.
The transactions are sorted by the created_at date in reverse chronological order, and they're paginated. The maximum number of transactions returned per page is specified by the count parameter. To get the next page of results, make a new request and use the created_at date from the last item of the previous page as the value for the to parameter.
Note
The API returns a maximum of 1,000 transactions per request.
Note
To be compliant with PSD2 SCA regulations, businesses on the Revolut Business Freelancer plans can only access information older than 90 days within 5 minutes of the first authorisation.
Source code in pyrevolut/api/transactions/get/retrieve_list_of_transactions.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
Params
Bases: BaseModel
The query parameters for the request.
Source code in pyrevolut/api/transactions/get/retrieve_list_of_transactions.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
Response
Bases: ResourceTransaction
The response model for the request.
Source code in pyrevolut/api/transactions/get/retrieve_list_of_transactions.py
107 108 109 110 111 112 |
|
RetrieveTransaction
Retrieve the details of a specific transaction. The details can include, for example, cardholder details for card payments.
You can retrieve a transaction with its details either by its transaction ID or by the request ID that was provided for this transaction at the time of its creation, for example, when you created a payment.
To retrieve a transaction by its transaction ID, use:
/transaction/{transaction_id}
To retrieve a transaction by a request ID provided at transaction creation, use:
/transaction/{request_id}?id_type=request_id
Source code in pyrevolut/api/transactions/get/retrieve_transaction.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
Params
Bases: BaseModel
The query parameters for the request.
Source code in pyrevolut/api/transactions/get/retrieve_transaction.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
Response
Bases: ResourceTransaction
The response model for the request.
Source code in pyrevolut/api/transactions/get/retrieve_transaction.py
43 44 45 46 47 48 |
|