Counterparties 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 Counterparties
endpoint.
ResourceCounterparty
Bases: BaseModel
Counterparty resource model.
Source code in pyrevolut/api/counterparties/resources/counterparty.py
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 |
|
ModelAccount
Bases: BaseModel
A public account associated with this counterparty.
Source code in pyrevolut/api/counterparties/resources/counterparty.py
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 |
|
ModelCard
Bases: BaseModel
The list of cards associated with this counterparty.
Source code in pyrevolut/api/counterparties/resources/counterparty.py
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 |
|
RetrieveListOfCounterparties
Get all the counterparties that you have created, or use the query parameters to filter the results.
The counterparties are sorted by the created_at date in reverse chronological order.
The returned counterparties are paginated. The maximum number of counterparties returned per page is specified by the limit parameter. To get to the next page, make a new request and use the created_at date of the last counterparty returned in the previous response.
Source code in pyrevolut/api/counterparties/get/retrieve_list_of_counterparties.py
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 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 |
|
Params
Bases: BaseModel
Query parameters for the endpoint.
Source code in pyrevolut/api/counterparties/get/retrieve_list_of_counterparties.py
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 |
|
check_inputs()
Validate the input parameters.
Source code in pyrevolut/api/counterparties/get/retrieve_list_of_counterparties.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
Response
Bases: ResourceCounterparty
Response model for the endpoint.
Source code in pyrevolut/api/counterparties/get/retrieve_list_of_counterparties.py
110 111 112 113 114 115 |
|
RetrieveCounterparty
Get the information about a specific counterparty by ID.
Source code in pyrevolut/api/counterparties/get/retrieve_counterparty.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Params
Bases: BaseModel
Query parameters for the endpoint.
Source code in pyrevolut/api/counterparties/get/retrieve_counterparty.py
11 12 13 14 15 16 |
|
Response
Bases: ResourceCounterparty
Response model for the endpoint.
Source code in pyrevolut/api/counterparties/get/retrieve_counterparty.py
18 19 20 21 22 23 |
|
CreateCounterparty
Create a new counterparty to transact with.
In the Sandbox environment, you cannot add real people and businesses as Revolut counterparties. To help you simulate Create a counterparty requests for counterparties of profile type personal, we created some test accounts. Look inside for test Revtags.
To add a counterparty via Revtag, use one of these pairs for the name and revtag fields respectively:
Test User 1 & john1pvki
Test User 2 & john2pvki
...
Test User 9 & john9pvki
Source code in pyrevolut/api/counterparties/post/create_counterparty.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 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 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
Body
Bases: BaseModel
Request body for the endpoint.
Source code in pyrevolut/api/counterparties/post/create_counterparty.py
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 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
ModelAddress
Bases: BaseModel
The address of the counterparty.
Source code in pyrevolut/api/counterparties/post/create_counterparty.py
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 |
|
ModelIndividualName
Bases: BaseModel
The name of the individual counterparty. Use when company_name isn't specified.
Source code in pyrevolut/api/counterparties/post/create_counterparty.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
check_inputs()
Validate the input data.
Source code in pyrevolut/api/counterparties/post/create_counterparty.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
Response
Bases: ResourceCounterparty
Response model for the endpoint.
Source code in pyrevolut/api/counterparties/post/create_counterparty.py
255 256 257 258 |
|
ValidateAccountName
Use Confirmation of Payee (CoP) to validate a UK counterparty's account name against their account number and sort code when adding a counterparty or making a transfer to a new or existing counterparty.
Note
Confirmation of Payee is an account name checking system in the UK that helps clients to make sure payments aren't sent to the wrong bank or building society account.
When performing the check, you must specify the account type by providing the name for either an individual (personal account) or a company (business account).
Caution
The CoP check does not protect you against all kinds of fraud. It only checks if the name you provided for an account matches that account's details. Even if the counterparty's details match, you should still exercise due caution when transferring funds.
This functionality is only available to UK-based businesses.
Source code in pyrevolut/api/counterparties/post/validate_account_name.py
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 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 |
|
Body
Bases: BaseModel
Request body for the endpoint.
Source code in pyrevolut/api/counterparties/post/validate_account_name.py
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 |
|
ModelIndividualName
Bases: BaseModel
The name of the individual counterparty. Use when company_name isn't specified.
Source code in pyrevolut/api/counterparties/post/validate_account_name.py
41 42 43 44 45 46 47 48 49 50 51 |
|
check_inputs()
Ensure that either the individual_name or company_name is provided.
Source code in pyrevolut/api/counterparties/post/validate_account_name.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
Response
Bases: BaseModel
Response model for the endpoint.
Source code in pyrevolut/api/counterparties/post/validate_account_name.py
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 |
|
ModelIndividualName
Bases: BaseModel
The name of the individual counterparty. Use when company_name isn't specified.
Source code in pyrevolut/api/counterparties/post/validate_account_name.py
98 99 100 101 102 103 104 105 106 107 108 |
|
ModelReason
Bases: BaseModel
A code which explains why a given result was returned. For example, it might happen that the details you provided match the account details, but you specified the counterparty as an individual, and the account type is business.
Source code in pyrevolut/api/counterparties/post/validate_account_name.py
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 |
|
DeleteCounterparty
Delete a counterparty with the given ID. When a counterparty is deleted, you cannot make any payments to the counterparty.
Source code in pyrevolut/api/counterparties/delete/delete_counterparty.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Params
Bases: BaseModel
Query parameters for the endpoint.
Source code in pyrevolut/api/counterparties/delete/delete_counterparty.py
11 12 13 14 15 16 |
|
Response
Bases: BaseModel
Response model for the endpoint.
Source code in pyrevolut/api/counterparties/delete/delete_counterparty.py
18 19 20 21 22 23 |
|