Payment Drafts Asynchronous Endpoints
This Payment Drafts
endpoint provides asynchronous methods to interact with the payment drafts of the authenticated user.
Example usage of the Payment Drafts endpoint object:
import asyncio
from pyrevolut.client import AsyncClient
CREDS_JSON_LOC = "path/to/creds.json"
client = AsyncClient(
creds_loc=CREDS_JSON_LOC,
sandbox=True,
)
async def run():
async with client:
drafts = await client.PaymentDrafts.get_all_payment_drafts()
print(drafts)
asyncio.run(run())
EndpointPaymentDraftsAsync
Bases: BaseEndpointAsync
The async Payment Drafts API
Create a payment draft to request an approval for a payment from a business owner or admin before the payment is executed. The business owner or admin must manually approve it in the Revolut Business User Interface.
You can also retrieve one or all payment drafts, and delete a payment draft.
Source code in pyrevolut/api/payment_drafts/endpoint/asynchronous.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 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 |
|
create_payment_draft(account_id, counterparty_ids=[], counterparty_account_ids=[], counterparty_card_ids=[], amounts=[], currencies=[], references=[], title=None, schedule_for=None, **kwargs)
async
Create a payment draft.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
account_id |
UUID
|
The ID of the account to pay from. |
required |
counterparty_ids |
list[UUID]
|
The IDs of the counterparty accounts. Each ID corresponds to a payment. |
[]
|
counterparty_account_ids |
list[UUID | None]
|
The IDs of the counterparty accounts. Each ID corresponds to a payment. If the counterparty has multiple payment methods available, use it to specify the account to which you want to send the money. Otherwise, use None. |
[]
|
counterparty_card_ids |
list[UUID | None]
|
The IDs of the counterparty cards. Each ID corresponds to a payment. If the counterparty has multiple payment methods available, use it to specify the card to which you want to send the money. Otherwise, use None. |
[]
|
amounts |
list[float]
|
The amounts of the payments. |
[]
|
currencies |
list[str]
|
The ISO 4217 currency codes in upper case. |
[]
|
references |
list[str]
|
The references for the payments. |
[]
|
title |
str
|
The title of the payment draft. |
None
|
schedule_for |
date | Date | str
|
The scheduled date of the payment draft in ISO 8601 format. |
None
|
Returns:
Type | Description |
---|---|
dict | Response
|
A dict with the information about the payment draft created. |
Source code in pyrevolut/api/payment_drafts/endpoint/asynchronous.py
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 |
|
delete_payment_draft(payment_draft_id, **kwargs)
async
Delete a payment draft with the given ID. You can delete a payment draft only if it isn't processed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
payment_draft_id |
UUID
|
The ID of the payment draft. |
required |
Returns:
Type | Description |
---|---|
dict | Response
|
A dict with the information about the payment draft deleted. |
Source code in pyrevolut/api/payment_drafts/endpoint/asynchronous.py
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 |
|
get_all_payment_drafts(**kwargs)
async
Get a list of all the payment drafts that aren't processed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None |
|
required |
Returns:
Type | Description |
---|---|
dict | Response
|
A dict with the information about the payment drafts. |
Source code in pyrevolut/api/payment_drafts/endpoint/asynchronous.py
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 |
|
get_payment_draft(payment_draft_id, **kwargs)
async
Get the information about a specific payment draft by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
payment_draft_id |
UUID
|
The ID of the payment draft. |
required |
Returns:
Type | Description |
---|---|
dict | Response
|
A dict with the information about the payment draft. |
Source code in pyrevolut/api/payment_drafts/endpoint/asynchronous.py
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 |
|