Webhooks 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 Webhooks
endpoint.
ResourceWebhook
Bases: BaseModel
Webhook resource model.
Source code in pyrevolut/api/webhooks/resources/webhook.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
ResourcePayoutLinkCreated
Bases: BaseModel
Payout Link Created resource model.
Source code in pyrevolut/api/webhooks/resources/payout_link_created.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
ResourcePayoutLinkStateChanged
Bases: BaseModel
Payout Link State Changed resource model.
Source code in pyrevolut/api/webhooks/resources/payout_link_state_changed.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
ResourceTransactionCreated
Bases: BaseModel
Transaction Created resource model.
Source code in pyrevolut/api/webhooks/resources/transaction_created.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 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 |
|
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/webhooks/resources/transaction_created.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 |
|
ModelCounterparty
Bases: BaseModel
The counterparty of the transaction.
Source code in pyrevolut/api/webhooks/resources/transaction_created.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
ResourceTransactionStateChanged
Bases: BaseModel
Transaction state changed resource model.
Source code in pyrevolut/api/webhooks/resources/transaction_state_changed.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
ResourceWebhookPayload
Bases: BaseModel
Webhook payload resource model.
Source code in pyrevolut/api/webhooks/resources/webhook_payload.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
RetrieveListOfWebhooks
Get the list of all your existing webhooks and their details.
Source code in pyrevolut/api/webhooks/get/retrieve_list_of_webhooks.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Params
Bases: BaseModel
The query parameters for the request.
Source code in pyrevolut/api/webhooks/get/retrieve_list_of_webhooks.py
13 14 15 16 17 18 |
|
Response
Bases: ResourceWebhook
The response model for the request.
Source code in pyrevolut/api/webhooks/get/retrieve_list_of_webhooks.py
20 21 22 23 24 25 |
|
RetrieveWebhook
Get the information about a specific webhook by ID.
Source code in pyrevolut/api/webhooks/get/retrieve_webhook.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
The query parameters for the request.
Source code in pyrevolut/api/webhooks/get/retrieve_webhook.py
15 16 17 18 19 20 |
|
Response
Bases: ResourceWebhook
The response model for the request.
Source code in pyrevolut/api/webhooks/get/retrieve_webhook.py
22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
RetrieveListOfFailedWebhooks
Get the list of all your failed webhook events, or use the query parameters to filter the results.
The events are sorted by the created_at date in reverse chronological order.
The returned failed events are paginated. The maximum number of events 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 event returned in the previous response.
Source code in pyrevolut/api/webhooks/get/retrieve_list_of_failed_webhooks.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 |
|
Params
Bases: BaseModel
The query parameters for the request.
Source code in pyrevolut/api/webhooks/get/retrieve_list_of_failed_webhooks.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 |
|
Response
Bases: BaseModel
The response model for the request.
Source code in pyrevolut/api/webhooks/get/retrieve_list_of_failed_webhooks.py
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 |
|
CreateWebhook
Create a new webhook to receive event notifications to the specified URL. Provide a list of event types that you want to subscribe to and a URL for the webhook. Only HTTPS URLs are supported.
Source code in pyrevolut/api/webhooks/post/create_webhook.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 |
|
Body
Bases: BaseModel
The body of the request.
Source code in pyrevolut/api/webhooks/post/create_webhook.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 |
|
Response
Bases: ResourceWebhook
The response model for the request.
Source code in pyrevolut/api/webhooks/post/create_webhook.py
44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
RotateWebhookSecret
Rotate a signing secret for a specific webhook.
Source code in pyrevolut/api/webhooks/post/rotate_webhook_secret.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 |
|
Body
Bases: BaseModel
The body of the request.
Source code in pyrevolut/api/webhooks/post/rotate_webhook_secret.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
Response
Bases: ResourceWebhook
The response model for the request.
Source code in pyrevolut/api/webhooks/post/rotate_webhook_secret.py
34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
UpdateWebhook
Update an existing webhook. Change the URL to which event notifications are sent or the list of event types to be notified about.
You must specify at least one of these two. The fields that you don't specify are not updated.
Source code in pyrevolut/api/webhooks/patch/update_webhook.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 |
|
Body
Bases: BaseModel
The body of the request.
Source code in pyrevolut/api/webhooks/patch/update_webhook.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
Response
Bases: ResourceWebhook
The response model for the request.
Source code in pyrevolut/api/webhooks/patch/update_webhook.py
43 44 45 46 47 48 |
|
DeleteWebhook
Delete a specific webhook.
A successful response does not get any content in return.
Source code in pyrevolut/api/webhooks/delete/delete_webhook.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Params
Bases: BaseModel
The query params of the request.
Source code in pyrevolut/api/webhooks/delete/delete_webhook.py
13 14 15 16 17 18 |
|
Response
Bases: BaseModel
The response model for the request.
Source code in pyrevolut/api/webhooks/delete/delete_webhook.py
20 21 22 23 24 25 |
|