Cards 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 Cards
endpoint.
ResourceCard
Bases: BaseModel
Card resource model
Source code in pyrevolut/api/cards/resources/card.py
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 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 |
|
ModelSpendingLimits
Bases: BaseModel
All spending limits set for the card.
Source code in pyrevolut/api/cards/resources/card.py
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 |
|
ModelAllTime
Bases: ModelBaseAmount
The all-time limit for transactions.
Source code in pyrevolut/api/cards/resources/card.py
48 49 50 51 |
|
ModelDay
Bases: ModelBaseAmount
The daily limit for transactions.
Source code in pyrevolut/api/cards/resources/card.py
23 24 25 26 |
|
ModelMonth
Bases: ModelBaseAmount
The monthly limit for transactions.
Source code in pyrevolut/api/cards/resources/card.py
33 34 35 36 |
|
ModelQuarter
Bases: ModelBaseAmount
The quarterly limit for transactions.
Source code in pyrevolut/api/cards/resources/card.py
38 39 40 41 |
|
ModelSingle
Bases: ModelBaseAmount
The limit for a single transaction.
Source code in pyrevolut/api/cards/resources/card.py
18 19 20 21 |
|
ModelWeek
Bases: ModelBaseAmount
The weekly limit for transactions.
Source code in pyrevolut/api/cards/resources/card.py
28 29 30 31 |
|
ModelYear
Bases: ModelBaseAmount
The yearly limit for transactions.
Source code in pyrevolut/api/cards/resources/card.py
43 44 45 46 |
|
RetrieveListOfCards
Get the list of all cards in your organisation. The results are paginated and sorted by the created_at date in reverse chronological order.
Source code in pyrevolut/api/cards/get/retrieve_list_of_cards.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 |
|
Params
Bases: BaseModel
Query parameters for the endpoint.
Source code in pyrevolut/api/cards/get/retrieve_list_of_cards.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 |
|
Response
Bases: ResourceCard
Response model for the endpoint.
Source code in pyrevolut/api/cards/get/retrieve_list_of_cards.py
48 49 50 51 52 53 |
|
RetrieveCardDetails
Get the details of a specific card, based on its ID.
Source code in pyrevolut/api/cards/get/retrieve_card_details.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Params
Bases: BaseModel
Query parameters for the endpoint.
Source code in pyrevolut/api/cards/get/retrieve_card_details.py
13 14 15 16 17 18 |
|
Response
Bases: ResourceCard
Response model for the endpoint.
Source code in pyrevolut/api/cards/get/retrieve_card_details.py
20 21 22 23 24 25 |
|
RetrieveSensitiveCardDetails
Get sensitive details of a specific card, based on its ID. Requires the READ_SENSITIVE_CARD_DATA token scope.
Source code in pyrevolut/api/cards/get/retrieve_sensitive_card_details.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 |
|
Params
Bases: BaseModel
Query parameters for the endpoint.
Source code in pyrevolut/api/cards/get/retrieve_sensitive_card_details.py
16 17 18 19 20 21 |
|
Response
Bases: BaseModel
Response model for the endpoint.
Source code in pyrevolut/api/cards/get/retrieve_sensitive_card_details.py
23 24 25 26 27 28 29 30 31 32 33 34 |
|
CreateCard
Create a new card for an existing member of your Revolut Business team.
When using the API, you can create only virtual cards. To create a physical card, use the Revolut Business app.
Source code in pyrevolut/api/cards/post/create_card.py
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 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 |
|
Body
Bases: BaseModel
Body model for the endpoint.
Source code in pyrevolut/api/cards/post/create_card.py
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 |
|
ModelSpendingLimits
Bases: BaseModel
All spending limits set for the card.
Source code in pyrevolut/api/cards/post/create_card.py
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 |
|
ModelAllTime
Bases: ModelBaseAmount
The all-time limit for transactions.
Source code in pyrevolut/api/cards/post/create_card.py
58 59 60 61 |
|
ModelDay
Bases: ModelBaseAmount
The daily limit for transactions.
Source code in pyrevolut/api/cards/post/create_card.py
33 34 35 36 |
|
ModelMonth
Bases: ModelBaseAmount
The monthly limit for transactions.
Source code in pyrevolut/api/cards/post/create_card.py
43 44 45 46 |
|
ModelQuarter
Bases: ModelBaseAmount
The quarterly limit for transactions.
Source code in pyrevolut/api/cards/post/create_card.py
48 49 50 51 |
|
ModelSingle
Bases: ModelBaseAmount
The limit for a single transaction.
Source code in pyrevolut/api/cards/post/create_card.py
28 29 30 31 |
|
ModelWeek
Bases: ModelBaseAmount
The weekly limit for transactions.
Source code in pyrevolut/api/cards/post/create_card.py
38 39 40 41 |
|
ModelYear
Bases: ModelBaseAmount
The yearly limit for transactions.
Source code in pyrevolut/api/cards/post/create_card.py
53 54 55 56 |
|
check_inputs()
Check the inputs.
Source code in pyrevolut/api/cards/post/create_card.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
Response
Bases: ResourceCard
Response model for the endpoint.
Source code in pyrevolut/api/cards/post/create_card.py
188 189 190 191 192 193 |
|
FreezeCard
Freeze a card to make it temporarily unavailable for spending. You can only freeze a card that is in the state active.
A successful freeze changes the card's state to frozen, and no content is returned in the response.
Source code in pyrevolut/api/cards/post/freeze_card.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
Body
Bases: BaseModel
Request body for the endpoint.
Source code in pyrevolut/api/cards/post/freeze_card.py
15 16 17 18 19 20 |
|
Response
Bases: BaseModel
Response model for the endpoint.
Source code in pyrevolut/api/cards/post/freeze_card.py
22 23 24 25 26 27 |
|
UnfreezeCard
Unfreeze a card to re-enable spending for that card. You can only unfreeze a card that is in the state frozen.
A successful unfreeze changes the card's state back to active, and no content is returned in the response.
Source code in pyrevolut/api/cards/post/unfreeze_card.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
Body
Bases: BaseModel
Request body for the endpoint.
Source code in pyrevolut/api/cards/post/unfreeze_card.py
15 16 17 18 19 20 |
|
Response
Bases: BaseModel
Response model for the endpoint.
Source code in pyrevolut/api/cards/post/unfreeze_card.py
22 23 24 25 26 27 |
|
UpdateCardDetails
Update details of a specific card, based on its ID. Updating a spending limit does not reset the spending counter.
Source code in pyrevolut/api/cards/patch/update_card_details.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 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 |
|
Body
Bases: BaseModel
The body of the request.
Source code in pyrevolut/api/cards/patch/update_card_details.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 |
|
ModelSpendingLimits
Bases: BaseModel
All spending limits set for the card.
Source code in pyrevolut/api/cards/patch/update_card_details.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 |
|
ModelAllTime
Bases: ModelBaseAmount
The all-time limit for transactions.
Source code in pyrevolut/api/cards/patch/update_card_details.py
55 56 57 58 |
|
ModelDay
Bases: ModelBaseAmount
The daily limit for transactions.
Source code in pyrevolut/api/cards/patch/update_card_details.py
30 31 32 33 |
|
ModelMonth
Bases: ModelBaseAmount
The monthly limit for transactions.
Source code in pyrevolut/api/cards/patch/update_card_details.py
40 41 42 43 |
|
ModelQuarter
Bases: ModelBaseAmount
The quarterly limit for transactions.
Source code in pyrevolut/api/cards/patch/update_card_details.py
45 46 47 48 |
|
ModelSingle
Bases: ModelBaseAmount
The limit for a single transaction.
Source code in pyrevolut/api/cards/patch/update_card_details.py
25 26 27 28 |
|
ModelWeek
Bases: ModelBaseAmount
The weekly limit for transactions.
Source code in pyrevolut/api/cards/patch/update_card_details.py
35 36 37 38 |
|
ModelYear
Bases: ModelBaseAmount
The yearly limit for transactions.
Source code in pyrevolut/api/cards/patch/update_card_details.py
50 51 52 53 |
|
check_inputs()
Check the inputs.
Source code in pyrevolut/api/cards/patch/update_card_details.py
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 |
|
Response
Bases: ResourceCard
Response model for the endpoint.
Source code in pyrevolut/api/cards/patch/update_card_details.py
148 149 150 151 152 153 |
|
TerminateCard
Terminate a specific card, based on its ID.
Once the card is terminated, it will not be returned by the API.
A successful response does not get any content in return.
Source code in pyrevolut/api/cards/delete/terminate_card.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/cards/delete/terminate_card.py
15 16 17 18 |
|
Response
Bases: BaseModel
Response model for the endpoint.
Source code in pyrevolut/api/cards/delete/terminate_card.py
20 21 22 23 |
|