Skip to content

Payout Links 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 Payout Links endpoint.


Bases: BaseModel

Payout Link resource model.

Source code in pyrevolut/api/payout_links/resources/payout_link.py
 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
class ResourcePayoutLink(BaseModel):
    """
    Payout Link resource model.
    """

    id: Annotated[UUID, Field(description="The ID of the payout link.")]
    state: Annotated[
        EnumPayoutLinkState,
        Field(
            description="""
            The state that the payout link is in. Possible states are:

                created:
                    The payout link has been created, but the amount has not yet been blocked.
                failed:
                    The payout link couldn't be generated due to a failure during transaction booking.
                awaiting:
                    The payout link is awaiting approval.
                active:
                    The payout link can be redeemed.
                expired:
                    The payout link cannot be redeemed because it wasn't claimed before its expiry date.
                cancelled:
                    The payout link cannot be redeemed because it was cancelled.
                processing:
                    The payout link has been redeemed and is being processed.
                processed:
                    The payout link has been redeemed and the money has been transferred to the recipient.
            """
        ),
    ]
    created_at: Annotated[
        DateTime,
        Field(
            description="The date and time the payout link was created in ISO 8601 format."
        ),
    ]
    updated_at: Annotated[
        DateTime,
        Field(
            description="The date and time the payout link was last updated in ISO 8601 format."
        ),
    ]
    counterparty_name: Annotated[
        str, Field(description="The name of the counterparty provided by the sender.")
    ]
    counterparty_id: Annotated[
        UUID | None,
        Field(
            description="""
            The ID of the counterparty created based on the recipient's details.

            By default, the newly created counterparty is hidden from your counterparties list.
            To automatically save it when the link is claimed, pass the save_counterparty parameter set to true.
            Alternatively, you can add the recipient to your counterparties later from the list of transactions 
            in the Business app.
            """
        ),
    ] = None
    save_counterparty: Annotated[
        bool,
        Field(
            description="""
            Indicates whether you chose to save the recipient as your counterparty upon link claim. 
            If false then the counterparty will not show up on your counterparties list, 
            for example, when you retrieve your counterparties. 
            However, you can still retrieve this counterparty by its ID.

            If you didn't choose to save the counterparty on link creation, you can still do it 
            from your transactions list in the Business app.
            """
        ),
    ]
    request_id: Annotated[
        str,
        Field(
            description="The ID of the request, provided by the sender.",
        ),
    ]
    expiry_date: Annotated[
        DateTime,
        Field(description="The datetime the payout link expires in ISO 8601 format."),
    ]
    payout_methods: Annotated[
        list[EnumPayoutLinkPaymentMethod],
        Field(
            description="""
            The list of payout methods that the recipient can use to claim the payout, where:

                revolut:
                    Revolut peer-to-peer (P2P) transfer

                bank_account:
                    External bank transfer

                card:
                    Card transfer
            """
        ),
    ]
    account_id: Annotated[UUID, Field(description="The ID of the sender's account.")]
    amount: Annotated[
        float,
        Field(
            description="""
            The amount of money to be transferred.
            The amount must be between £1 and £2,500, or equivalent in the selected currency.
            """
        ),
    ]
    currency: Annotated[
        Currency,
        Field(description="ISO 4217 currency code in upper case."),
    ]
    transaction_id: Annotated[
        UUID | None,
        Field(
            description="""
            The ID of the created transaction. Returned only if the payout has been claimed.
            """
        ),
    ] = None
    url: Annotated[
        HttpUrl | None,
        Field(
            description="The URL of the payout link. Returned only for active payout links."
        ),
    ] = None
    reference: Annotated[
        str,
        Field(
            description="The reference for the payout transaction, provided by the sender."
        ),
    ]
    transfer_reason_code: Annotated[
        EnumTransferReasonCode | None,
        Field(
            description="""
            The reason code for the transaction. 
            Transactions to certain countries and currencies might require you to 
            provide a transfer reason. 
            You can check available reason codes with the getTransferReasons operation.

            If a transfer reason is not required for the given currency and country, 
            this field is ignored.
            """
        ),
    ] = None
    cancellation_reason: Annotated[
        EnumPayoutLinkCancellationReason | None,
        Field(
            description="""
            The reason why the payout link was cancelled. Possible reasons are:

                too_many_name_check_attempts:
                    The name check failed too many times.
            """
        ),
    ] = None

Get all the links that you have created, or use the query parameters to filter the results.

The links are sorted by the created_at date in reverse chronological order.

The returned links are paginated. The maximum number of payout links 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 payout link returned in the previous response.

Note

This feature is available in the UK and the EEA.

Source code in pyrevolut/api/payout_links/get/retrieve_list_of_payout_links.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
class RetrieveListOfPayoutLinks:
    """
    Get all the links that you have created, or use the query parameters to filter the results.

    The links are sorted by the created_at date in reverse chronological order.

    The returned links are paginated. The maximum number of payout links 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 payout link returned in the previous response.

    Note
    ----
    This feature is available in the UK and the EEA.
    """

    ROUTE = "/1.0/payout-links"

    class Params(BaseModel):
        """
        The query parameters for the request.
        """

        state: Annotated[
            EnumPayoutLinkState | None,
            Field(
                description="""
                The state that the payout link is in. Possible states are:

                    created:
                        The payout link has been created, but the amount has not yet been blocked.
                    failed:
                        The payout link couldn't be generated due to a failure during transaction booking.
                    awaiting:
                        The payout link is awaiting approval.
                    active:
                        The payout link can be redeemed.
                    expired:
                        The payout link cannot be redeemed because it wasn't claimed before its expiry date.
                    cancelled:
                        The payout link cannot be redeemed because it was cancelled.
                    processing:
                        The payout link has been redeemed and is being processed.
                    processed:
                        The payout link has been redeemed and the money has been transferred to the recipient.
                """,
            ),
        ] = None
        created_before: Annotated[
            DateTime | None,
            Field(
                description="""
                Retrieves links with created_at < created_before. 
                The default value is the current date and time at which you are calling the endpoint.

                Provided in ISO 8601 format.
                """
            ),
        ] = None
        limit: Annotated[
            int | None,
            Field(
                description="""
                The maximum number of links returned per page.
                To get to the next page, make a new request and use the 
                created_at date of the last payout link returned in the previous 
                response as the value for created_before.              

                If not provided, the default value is 100.  
                """,
                ge=1,
                le=100,
            ),
        ] = None

    class Response(ResourcePayoutLink):
        """
        The response model for the request.
        """

        pass

Params

Bases: BaseModel

The query parameters for the request.

Source code in pyrevolut/api/payout_links/get/retrieve_list_of_payout_links.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
class Params(BaseModel):
    """
    The query parameters for the request.
    """

    state: Annotated[
        EnumPayoutLinkState | None,
        Field(
            description="""
            The state that the payout link is in. Possible states are:

                created:
                    The payout link has been created, but the amount has not yet been blocked.
                failed:
                    The payout link couldn't be generated due to a failure during transaction booking.
                awaiting:
                    The payout link is awaiting approval.
                active:
                    The payout link can be redeemed.
                expired:
                    The payout link cannot be redeemed because it wasn't claimed before its expiry date.
                cancelled:
                    The payout link cannot be redeemed because it was cancelled.
                processing:
                    The payout link has been redeemed and is being processed.
                processed:
                    The payout link has been redeemed and the money has been transferred to the recipient.
            """,
        ),
    ] = None
    created_before: Annotated[
        DateTime | None,
        Field(
            description="""
            Retrieves links with created_at < created_before. 
            The default value is the current date and time at which you are calling the endpoint.

            Provided in ISO 8601 format.
            """
        ),
    ] = None
    limit: Annotated[
        int | None,
        Field(
            description="""
            The maximum number of links returned per page.
            To get to the next page, make a new request and use the 
            created_at date of the last payout link returned in the previous 
            response as the value for created_before.              

            If not provided, the default value is 100.  
            """,
            ge=1,
            le=100,
        ),
    ] = None

Response

Bases: ResourcePayoutLink

The response model for the request.

Source code in pyrevolut/api/payout_links/get/retrieve_list_of_payout_links.py
84
85
86
87
88
89
class Response(ResourcePayoutLink):
    """
    The response model for the request.
    """

    pass

Get the information about a specific link by its ID.

Note

This feature is available in the UK and the EEA.

Source code in pyrevolut/api/payout_links/get/retrieve_payout_link.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class RetrievePayoutLink:
    """
    Get the information about a specific link by its ID.

    Note
    ----
    This feature is available in the UK and the EEA.
    """

    ROUTE = "/1.0/payout-links/{payout_link_id}"

    class Params(BaseModel):
        """
        The query parameters for the request.
        """

        pass

    class Response(ResourcePayoutLink):
        """
        The response model for the request.
        """

        pass

Params

Bases: BaseModel

The query parameters for the request.

Source code in pyrevolut/api/payout_links/get/retrieve_payout_link.py
17
18
19
20
21
22
class Params(BaseModel):
    """
    The query parameters for the request.
    """

    pass

Response

Bases: ResourcePayoutLink

The response model for the request.

Source code in pyrevolut/api/payout_links/get/retrieve_payout_link.py
24
25
26
27
28
29
class Response(ResourcePayoutLink):
    """
    The response model for the request.
    """

    pass

Create a payout link to send money even when you don't have the full banking details of the counterparty. After you have created the link, send it to the recipient so that they can claim the payment.

Note

This feature is available in the UK and the EEA.

Source code in pyrevolut/api/payout_links/post/create_payout_link.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
class CreatePayoutLink:
    """
    Create a payout link to send money even when you don't have the full
    banking details of the counterparty.
    After you have created the link, send it to the recipient so that
    they can claim the payment.

    Note
    ----
    This feature is available in the UK and the EEA.
    """

    ROUTE = "/1.0/payout-links"

    class Body(BaseModel):
        """
        The request body model for the request.
        """

        counterparty_name: Annotated[
            str,
            Field(
                description="""
                The name of the counterparty provided by the sender.                
                """,
            ),
        ]
        save_counterparty: Annotated[
            bool | None,
            Field(
                description="""
                Indicates whether to save the recipient as your counterparty upon link claim. 
                If false then the counterparty will not show up on your counterparties list, 
                for example, when you retrieve your counterparties. 
                However, you will still be able to retrieve this counterparty by its ID.

                If you don't choose to save the counterparty on link creation, you can do it later 
                from your transactions list in the Business app.

                If not provided, the default value is false.
                """,
            ),
        ] = None
        request_id: Annotated[
            str,
            Field(
                description="""
                The ID of the request, provided by the sender.

                To ensure that a link payment is not processed multiple times if there
                are network or system errors, the same request_id should be used for 
                requests related to the same link.
                """,
                max_length=40,
            ),
        ]
        account_id: Annotated[
            UUID,
            Field(
                description="""
                The ID of the sender's account.
                """,
            ),
        ]
        amount: Annotated[
            float,
            Field(
                description="""
                The amount of money to be transferred.
                The amount must be between £1 and £2,500, or equivalent in the selected currency.
                """,
            ),
        ]
        currency: Annotated[
            Currency,
            Field(
                description="""
                ISO 4217 currency code in upper case.
                """,
            ),
        ]
        reference: Annotated[
            str,
            Field(
                description="""
                The reference for the payout transaction, provided by the sender.
                """,
            ),
        ]
        payout_methods: Annotated[
            list[EnumPayoutLinkPaymentMethod],
            Field(
                description="""
                The list of payout methods that the recipient can use to claim the payout, where:

                    revolut:
                        Revolut peer-to-peer (P2P) transfer

                    bank_account:
                        External bank transfer

                    card:
                        Card transfer
                """
            ),
        ]
        expiry_period: Annotated[
            Duration | None,
            Field(
                description="""
                Possible values: >= P1D and <= P7D

                Default value: P7D

                The period after which the payout link expires if not claimed before, 
                provided in ISO 8601 format.

                The default and maximum value is 7 days from the link creation.
                """,
            ),
        ] = None
        transfer_reason_code: Annotated[
            EnumTransferReasonCode | None,
            Field(
                description="""
                The reason code for the transaction. 
                Transactions to certain countries and currencies might require you to 
                provide a transfer reason. 
                You can check available reason codes with the getTransferReasons operation.

                If a transfer reason is not required for the given currency and country, 
                this field is ignored.
                """
            ),
        ] = None

    class Response(ResourcePayoutLink):
        """
        The response model for the request.
        """

        pass

Body

Bases: BaseModel

The request body model for the request.

Source code in pyrevolut/api/payout_links/post/create_payout_link.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
 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
class Body(BaseModel):
    """
    The request body model for the request.
    """

    counterparty_name: Annotated[
        str,
        Field(
            description="""
            The name of the counterparty provided by the sender.                
            """,
        ),
    ]
    save_counterparty: Annotated[
        bool | None,
        Field(
            description="""
            Indicates whether to save the recipient as your counterparty upon link claim. 
            If false then the counterparty will not show up on your counterparties list, 
            for example, when you retrieve your counterparties. 
            However, you will still be able to retrieve this counterparty by its ID.

            If you don't choose to save the counterparty on link creation, you can do it later 
            from your transactions list in the Business app.

            If not provided, the default value is false.
            """,
        ),
    ] = None
    request_id: Annotated[
        str,
        Field(
            description="""
            The ID of the request, provided by the sender.

            To ensure that a link payment is not processed multiple times if there
            are network or system errors, the same request_id should be used for 
            requests related to the same link.
            """,
            max_length=40,
        ),
    ]
    account_id: Annotated[
        UUID,
        Field(
            description="""
            The ID of the sender's account.
            """,
        ),
    ]
    amount: Annotated[
        float,
        Field(
            description="""
            The amount of money to be transferred.
            The amount must be between £1 and £2,500, or equivalent in the selected currency.
            """,
        ),
    ]
    currency: Annotated[
        Currency,
        Field(
            description="""
            ISO 4217 currency code in upper case.
            """,
        ),
    ]
    reference: Annotated[
        str,
        Field(
            description="""
            The reference for the payout transaction, provided by the sender.
            """,
        ),
    ]
    payout_methods: Annotated[
        list[EnumPayoutLinkPaymentMethod],
        Field(
            description="""
            The list of payout methods that the recipient can use to claim the payout, where:

                revolut:
                    Revolut peer-to-peer (P2P) transfer

                bank_account:
                    External bank transfer

                card:
                    Card transfer
            """
        ),
    ]
    expiry_period: Annotated[
        Duration | None,
        Field(
            description="""
            Possible values: >= P1D and <= P7D

            Default value: P7D

            The period after which the payout link expires if not claimed before, 
            provided in ISO 8601 format.

            The default and maximum value is 7 days from the link creation.
            """,
        ),
    ] = None
    transfer_reason_code: Annotated[
        EnumTransferReasonCode | None,
        Field(
            description="""
            The reason code for the transaction. 
            Transactions to certain countries and currencies might require you to 
            provide a transfer reason. 
            You can check available reason codes with the getTransferReasons operation.

            If a transfer reason is not required for the given currency and country, 
            this field is ignored.
            """
        ),
    ] = None

Response

Bases: ResourcePayoutLink

The response model for the request.

Source code in pyrevolut/api/payout_links/post/create_payout_link.py
148
149
150
151
152
153
class Response(ResourcePayoutLink):
    """
    The response model for the request.
    """

    pass

Cancel a payout link. You can only cancel a link that hasn't been claimed yet. A successful request does not get any content in response.

Note

This feature is available in the UK and the EEA.

Source code in pyrevolut/api/payout_links/post/cancel_payout_link.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
28
29
class CancelPayoutLink:
    """
    Cancel a payout link.
    You can only cancel a link that hasn't been claimed yet.
    A successful request does not get any content in response.

    Note
    ----
    This feature is available in the UK and the EEA.
    """

    ROUTE = "/1.0/payout-links/{payout_link_id}/cancel"

    class Body(BaseModel):
        """
        The request body model for the request.
        """

        pass

    class Response(BaseModel):
        """
        The response model for the request.
        """

        pass

Body

Bases: BaseModel

The request body model for the request.

Source code in pyrevolut/api/payout_links/post/cancel_payout_link.py
17
18
19
20
21
22
class Body(BaseModel):
    """
    The request body model for the request.
    """

    pass

Response

Bases: BaseModel

The response model for the request.

Source code in pyrevolut/api/payout_links/post/cancel_payout_link.py
24
25
26
27
28
29
class Response(BaseModel):
    """
    The response model for the request.
    """

    pass