Skip to content

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
class ResourceCounterparty(BaseModel):
    """
    Counterparty resource model.
    """

    class ModelAccount(BaseModel):
        """A public account associated with this counterparty."""

        id: Annotated[
            UUID,
            Field(description="The ID of the counterparty's account."),
        ]
        name: Annotated[
            str | None,
            Field(description="The name of the counterparty."),
        ] = None
        bank_country: Annotated[
            CountryAlpha2 | None,
            Field(description="The country of the bank as the 2-letter ISO 3166 code."),
        ]
        currency: Annotated[
            Currency,
            Field(description="ISO 4217 currency code in upper case."),
        ]
        type: Annotated[
            EnumAccountType,
            Field(description="Indicates the type of account."),
        ]
        account_no: Annotated[
            str | None,
            Field(description="The bank account number of the counterparty."),
        ] = None
        iban: Annotated[
            str | None,
            Field(
                description="The IBAN number of the counterparty's account if applicable."
            ),
        ] = None
        sort_code: Annotated[
            str | None,
            Field(
                description="The sort code of the counterparty's account if applicable."
            ),
        ] = None
        routing_number: Annotated[
            str | None,
            Field(
                description="The routing number of the counterparty's account if applicable."
            ),
        ] = None
        bic: Annotated[
            str | None,
            Field(
                description="The BIC number of the counterparty's account if applicable."
            ),
        ] = None
        clabe: Annotated[
            str | None,
            Field(
                description="The CLABE number of the counterparty's account if applicable."
            ),
        ] = None
        ifsc: Annotated[
            str | None,
            Field(
                description="The IFSC number of the counterparty's account if applicable."
            ),
        ] = None
        bsb_code: Annotated[
            str | None,
            Field(
                description="The BSB code of the counterparty's account if applicable."
            ),
        ] = None
        recipient_charges: Annotated[
            EnumRecipientCharges | None,
            Field(description="Indicates the possibility of the recipient charges."),
        ] = None

    class ModelCard(BaseModel):
        """The list of cards associated with this counterparty."""

        id: Annotated[
            UUID,
            Field(description="The ID of the counterparty's card."),
        ]
        name: Annotated[
            str,
            Field(description="The name of the counterparty."),
        ]
        last_digits: Annotated[
            str,
            Field(description="The last four digits of the card number."),
        ]
        scheme: Annotated[
            EnumCardScheme,
            Field(description="The card brand."),
        ]
        country: Annotated[
            CountryAlpha2,
            Field(
                description="The country of the card issuer as the 2-letter ISO 3166 code."
            ),
        ]
        currency: Annotated[
            Currency,
            Field(description="ISO 4217 currency code in upper case."),
        ]

    id: Annotated[
        UUID,
        Field(description="The ID of the counterparty."),
    ]
    name: Annotated[
        str,
        Field(description="The name of the counterparty."),
    ]
    revtag: Annotated[
        str | None,
        Field(description="The Revtag of the counterparty."),
    ] = None
    profile_type: Annotated[
        EnumProfileType | None,
        Field(
            description="The type of the Revolut profile. Used when adding an existing Revolut user via Revtag."
        ),
    ] = None
    country: Annotated[
        CountryAlpha2 | None,
        Field(
            description="The bank country of the counterparty as the 2-letter ISO 3166 code."
        ),
    ] = None
    state: Annotated[
        EnumProfileState,
        Field(description="Indicates the state of the counterparty."),
    ]
    created_at: Annotated[
        DateTime,
        Field(
            description="The date and time the counterparty was created in ISO 8601 format."
        ),
    ]
    updated_at: Annotated[
        DateTime,
        Field(
            description="The date and time the counterparty was last updated in ISO 8601 format."
        ),
    ]
    accounts: Annotated[
        list[ModelAccount] | None,
        Field(
            description="The list of public accounts associated with this counterparty."
        ),
    ] = None
    cards: Annotated[
        list[ModelCard] | None,
        Field(description="The list of cards associated with this counterparty."),
    ] = None

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
class ModelAccount(BaseModel):
    """A public account associated with this counterparty."""

    id: Annotated[
        UUID,
        Field(description="The ID of the counterparty's account."),
    ]
    name: Annotated[
        str | None,
        Field(description="The name of the counterparty."),
    ] = None
    bank_country: Annotated[
        CountryAlpha2 | None,
        Field(description="The country of the bank as the 2-letter ISO 3166 code."),
    ]
    currency: Annotated[
        Currency,
        Field(description="ISO 4217 currency code in upper case."),
    ]
    type: Annotated[
        EnumAccountType,
        Field(description="Indicates the type of account."),
    ]
    account_no: Annotated[
        str | None,
        Field(description="The bank account number of the counterparty."),
    ] = None
    iban: Annotated[
        str | None,
        Field(
            description="The IBAN number of the counterparty's account if applicable."
        ),
    ] = None
    sort_code: Annotated[
        str | None,
        Field(
            description="The sort code of the counterparty's account if applicable."
        ),
    ] = None
    routing_number: Annotated[
        str | None,
        Field(
            description="The routing number of the counterparty's account if applicable."
        ),
    ] = None
    bic: Annotated[
        str | None,
        Field(
            description="The BIC number of the counterparty's account if applicable."
        ),
    ] = None
    clabe: Annotated[
        str | None,
        Field(
            description="The CLABE number of the counterparty's account if applicable."
        ),
    ] = None
    ifsc: Annotated[
        str | None,
        Field(
            description="The IFSC number of the counterparty's account if applicable."
        ),
    ] = None
    bsb_code: Annotated[
        str | None,
        Field(
            description="The BSB code of the counterparty's account if applicable."
        ),
    ] = None
    recipient_charges: Annotated[
        EnumRecipientCharges | None,
        Field(description="Indicates the possibility of the recipient charges."),
    ] = None

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
class ModelCard(BaseModel):
    """The list of cards associated with this counterparty."""

    id: Annotated[
        UUID,
        Field(description="The ID of the counterparty's card."),
    ]
    name: Annotated[
        str,
        Field(description="The name of the counterparty."),
    ]
    last_digits: Annotated[
        str,
        Field(description="The last four digits of the card number."),
    ]
    scheme: Annotated[
        EnumCardScheme,
        Field(description="The card brand."),
    ]
    country: Annotated[
        CountryAlpha2,
        Field(
            description="The country of the card issuer as the 2-letter ISO 3166 code."
        ),
    ]
    currency: Annotated[
        Currency,
        Field(description="ISO 4217 currency code in upper case."),
    ]

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
class 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.
    """

    ROUTE = "/1.0/counterparties"

    class Params(BaseModel):
        """
        Query parameters for the endpoint.
        """

        name: Annotated[
            str | None,
            Field(
                description="""
                The name of the counterparty to retrieve. It does not need to be an exact match, 
                partial match is also supported.
                """
            ),
        ] = None
        account_no: Annotated[
            str | None,
            Field(
                description="""
                The exact account number of the counterparty to retrieve.
                """
            ),
        ] = None
        sort_code: Annotated[
            str | None,
            Field(
                description="""
                The exact sort code of the counterparty to retrieve.
                Only allowed in combination with the account_no parameter.                
                """
            ),
        ] = None
        iban: Annotated[
            str | None,
            Field(
                description="""
                The exact IBAN of the counterparty to retrieve.
                """
            ),
        ] = None
        bic: Annotated[
            str | None,
            Field(
                description="""
                The exact BIC of the counterparty to retrieve. Only allowed in combination with the iban parameter.
                """
            ),
        ] = None
        created_before: Annotated[
            DateTime | None,
            Field(
                description="""
                Retrieves counterparties 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 counterparties returned per page.
                To get to the next page, make a new request and use the 
                created_at date of the last card returned in the previous 
                response as the value for created_before.              

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

        @model_validator(mode="after")
        def check_inputs(self) -> "RetrieveListOfCounterparties.Params":
            """
            Validate the input parameters.
            """
            if self.sort_code and not self.account_no:
                raise ValueError(
                    "The sort_code parameter is only allowed in combination with the account_no parameter."
                )
            if self.bic and not self.iban:
                raise ValueError(
                    "The bic parameter is only allowed in combination with the iban parameter."
                )
            return self

    class Response(ResourceCounterparty):
        """
        Response model for the endpoint.
        """

        pass

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
class Params(BaseModel):
    """
    Query parameters for the endpoint.
    """

    name: Annotated[
        str | None,
        Field(
            description="""
            The name of the counterparty to retrieve. It does not need to be an exact match, 
            partial match is also supported.
            """
        ),
    ] = None
    account_no: Annotated[
        str | None,
        Field(
            description="""
            The exact account number of the counterparty to retrieve.
            """
        ),
    ] = None
    sort_code: Annotated[
        str | None,
        Field(
            description="""
            The exact sort code of the counterparty to retrieve.
            Only allowed in combination with the account_no parameter.                
            """
        ),
    ] = None
    iban: Annotated[
        str | None,
        Field(
            description="""
            The exact IBAN of the counterparty to retrieve.
            """
        ),
    ] = None
    bic: Annotated[
        str | None,
        Field(
            description="""
            The exact BIC of the counterparty to retrieve. Only allowed in combination with the iban parameter.
            """
        ),
    ] = None
    created_before: Annotated[
        DateTime | None,
        Field(
            description="""
            Retrieves counterparties 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 counterparties returned per page.
            To get to the next page, make a new request and use the 
            created_at date of the last card returned in the previous 
            response as the value for created_before.              

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

    @model_validator(mode="after")
    def check_inputs(self) -> "RetrieveListOfCounterparties.Params":
        """
        Validate the input parameters.
        """
        if self.sort_code and not self.account_no:
            raise ValueError(
                "The sort_code parameter is only allowed in combination with the account_no parameter."
            )
        if self.bic and not self.iban:
            raise ValueError(
                "The bic parameter is only allowed in combination with the iban parameter."
            )
        return self

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
@model_validator(mode="after")
def check_inputs(self) -> "RetrieveListOfCounterparties.Params":
    """
    Validate the input parameters.
    """
    if self.sort_code and not self.account_no:
        raise ValueError(
            "The sort_code parameter is only allowed in combination with the account_no parameter."
        )
    if self.bic and not self.iban:
        raise ValueError(
            "The bic parameter is only allowed in combination with the iban parameter."
        )
    return self

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
class Response(ResourceCounterparty):
    """
    Response model for the endpoint.
    """

    pass

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
class RetrieveCounterparty:
    """Get the information about a specific counterparty by ID."""

    ROUTE = "/1.0/counterparty/{counterparty_id}"

    class Params(BaseModel):
        """
        Query parameters for the endpoint.
        """

        pass

    class Response(ResourceCounterparty):
        """
        Response model for the endpoint.
        """

        pass

Params

Bases: BaseModel

Query parameters for the endpoint.

Source code in pyrevolut/api/counterparties/get/retrieve_counterparty.py
11
12
13
14
15
16
class Params(BaseModel):
    """
    Query parameters for the endpoint.
    """

    pass

Response

Bases: ResourceCounterparty

Response model for the endpoint.

Source code in pyrevolut/api/counterparties/get/retrieve_counterparty.py
18
19
20
21
22
23
class Response(ResourceCounterparty):
    """
    Response model for the endpoint.
    """

    pass

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
class 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
    """

    ROUTE = "/1.0/counterparty"

    class Body(BaseModel):
        """Request body for the endpoint."""

        class ModelIndividualName(BaseModel):
            """
            The name of the individual counterparty.
            Use when company_name isn't specified.
            """

            first_name: Annotated[
                str | None,
                Field(description="The first name of the individual counterparty."),
            ] = None
            last_name: Annotated[
                str | None,
                Field(description="The last name of the individual counterparty."),
            ] = None

        class ModelAddress(BaseModel):
            """
            The address of the counterparty.
            """

            street_line1: Annotated[
                str | None,
                Field(description="Street line 1 information."),
            ] = None
            street_line2: Annotated[
                str | None,
                Field(description="Street line 2 information."),
            ] = None
            region: Annotated[
                str | None,
                Field(description="The name of the region."),
            ] = None
            city: Annotated[
                str | None,
                Field(description="The name of the city."),
            ] = None
            country: Annotated[
                CountryAlpha2,
                Field(
                    description="The country of the counterparty as the 2-letter ISO 3166 code."
                ),
            ]
            postcode: Annotated[
                str,
                Field(description="The postcode of the counterparty address."),
            ]

        company_name: Annotated[
            str | None,
            Field(
                description="""
                The name of the company counterparty. 
                Use when individual_name or name isn't specified and profile_type is business.
                """
            ),
        ] = None
        profile_type: Annotated[
            EnumProfileType | None,
            Field(
                description="""
                The type of the Revolut profile. Used when adding an existing Revolut user via Revtag.
                """
            ),
        ] = None
        name: Annotated[
            str | None,
            Field(
                description="""
                The name of the counterparty that you create for an existing Revolut user via Revtag. 
                Provide the value only when you specify personal for profile_type.                
                """
            ),
        ] = None
        individual_name: Annotated[
            ModelIndividualName | None,
            Field(
                description="""
                The name of the individual counterparty. 
                Use when company_name isn't specified.
                """
            ),
        ] = None
        bank_country: Annotated[
            CountryAlpha2 | None,
            Field(description="The country of the bank as the 2-letter ISO 3166 code."),
        ] = None
        currency: Annotated[
            Currency | None,
            Field(description="ISO 4217 currency code in upper case."),
        ] = None
        revtag: Annotated[
            str | None,
            Field(
                description="""
                The Revtag of the counterparty to add.                
                """
            ),
        ] = None
        account_no: Annotated[
            str | None,
            Field(
                description="""
                The bank account number of the counterparty.               
                """
            ),
        ] = None
        iban: Annotated[
            str | None,
            Field(
                description="""
                The IBAN number of the counterparty's account. This field is displayed for IBAN countries.               
                """
            ),
        ] = None
        sort_code: Annotated[
            str | None,
            Field(
                description="""
                The sort code of the counterparty's account. This field is required for GBP accounts.           
                """
            ),
        ] = None
        routing_number: Annotated[
            str | None,
            Field(
                description="""
                The routing number of the counterparty's account. This field is required for USD accounts.               
                """
            ),
        ] = None
        bic: Annotated[
            str | None,
            Field(
                description="""
                The BIC number of the counterparty's account. This field is required for non-SEPA IBAN/SWIFT.             
                """
            ),
        ] = None
        clabe: Annotated[
            str | None,
            Field(
                description="""
                The CLABE number of the counterparty's account. This field is required for SWIFT MX.               
                """
            ),
        ] = None
        isfc: Annotated[
            str | None,
            Field(
                description="""
                The ISFC number of the counterparty's account. This field is required for INR accounts.               
                """
            ),
        ] = None
        bsb_code: Annotated[
            str | None,
            Field(
                description="""
                The BSB code of the counterparty's account. This field is required for AUD accounts.               
                """
            ),
        ] = None
        address: Annotated[
            ModelAddress | None,
            Field(description="The address of the counterparty."),
        ] = None

        @model_validator(mode="after")
        def check_inputs(self) -> "CreateCounterparty.Body":
            """Validate the input data."""

            # Company name check
            if self.profile_type == EnumProfileType.BUSINESS and (
                self.individual_name is None or self.name is None
            ):
                assert (
                    self.company_name is not None
                ), "company_name is required for business profile type."

            # Name check
            if self.profile_type == EnumProfileType.PERSONAL:
                assert (
                    self.name is not None
                ), "name is required for personal profile type."

            # Profile type check
            if self.profile_type is not None:
                assert (
                    self.revtag is not None
                ), "revtag is required when profile_type is specified."
            else:
                assert (
                    self.revtag is None
                ), "revtag is not required when profile_type is not specified."

            # Individual name check
            # if self.company_name is None:
            #     assert (
            #         self.individual_name is not None
            #     ), "individual_name is required when company_name is not specified."

            # Sort code check
            if self.currency == "GBP":
                assert (
                    self.sort_code is not None
                ), "sort_code is required for GBP accounts."

            # Routing number check
            if self.currency == "USD":
                assert (
                    self.routing_number is not None
                ), "routing_number is required for USD accounts."

            # IFSC check
            if self.currency == "INR":
                assert self.isfc is not None, "isfc is required for INR accounts."

            # BSB code check
            if self.currency == "AUD":
                assert (
                    self.bsb_code is not None
                ), "bsb_code is required for AUD accounts."

            return self

    class Response(ResourceCounterparty):
        """Response model for the endpoint."""

        pass

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
class Body(BaseModel):
    """Request body for the endpoint."""

    class ModelIndividualName(BaseModel):
        """
        The name of the individual counterparty.
        Use when company_name isn't specified.
        """

        first_name: Annotated[
            str | None,
            Field(description="The first name of the individual counterparty."),
        ] = None
        last_name: Annotated[
            str | None,
            Field(description="The last name of the individual counterparty."),
        ] = None

    class ModelAddress(BaseModel):
        """
        The address of the counterparty.
        """

        street_line1: Annotated[
            str | None,
            Field(description="Street line 1 information."),
        ] = None
        street_line2: Annotated[
            str | None,
            Field(description="Street line 2 information."),
        ] = None
        region: Annotated[
            str | None,
            Field(description="The name of the region."),
        ] = None
        city: Annotated[
            str | None,
            Field(description="The name of the city."),
        ] = None
        country: Annotated[
            CountryAlpha2,
            Field(
                description="The country of the counterparty as the 2-letter ISO 3166 code."
            ),
        ]
        postcode: Annotated[
            str,
            Field(description="The postcode of the counterparty address."),
        ]

    company_name: Annotated[
        str | None,
        Field(
            description="""
            The name of the company counterparty. 
            Use when individual_name or name isn't specified and profile_type is business.
            """
        ),
    ] = None
    profile_type: Annotated[
        EnumProfileType | None,
        Field(
            description="""
            The type of the Revolut profile. Used when adding an existing Revolut user via Revtag.
            """
        ),
    ] = None
    name: Annotated[
        str | None,
        Field(
            description="""
            The name of the counterparty that you create for an existing Revolut user via Revtag. 
            Provide the value only when you specify personal for profile_type.                
            """
        ),
    ] = None
    individual_name: Annotated[
        ModelIndividualName | None,
        Field(
            description="""
            The name of the individual counterparty. 
            Use when company_name isn't specified.
            """
        ),
    ] = None
    bank_country: Annotated[
        CountryAlpha2 | None,
        Field(description="The country of the bank as the 2-letter ISO 3166 code."),
    ] = None
    currency: Annotated[
        Currency | None,
        Field(description="ISO 4217 currency code in upper case."),
    ] = None
    revtag: Annotated[
        str | None,
        Field(
            description="""
            The Revtag of the counterparty to add.                
            """
        ),
    ] = None
    account_no: Annotated[
        str | None,
        Field(
            description="""
            The bank account number of the counterparty.               
            """
        ),
    ] = None
    iban: Annotated[
        str | None,
        Field(
            description="""
            The IBAN number of the counterparty's account. This field is displayed for IBAN countries.               
            """
        ),
    ] = None
    sort_code: Annotated[
        str | None,
        Field(
            description="""
            The sort code of the counterparty's account. This field is required for GBP accounts.           
            """
        ),
    ] = None
    routing_number: Annotated[
        str | None,
        Field(
            description="""
            The routing number of the counterparty's account. This field is required for USD accounts.               
            """
        ),
    ] = None
    bic: Annotated[
        str | None,
        Field(
            description="""
            The BIC number of the counterparty's account. This field is required for non-SEPA IBAN/SWIFT.             
            """
        ),
    ] = None
    clabe: Annotated[
        str | None,
        Field(
            description="""
            The CLABE number of the counterparty's account. This field is required for SWIFT MX.               
            """
        ),
    ] = None
    isfc: Annotated[
        str | None,
        Field(
            description="""
            The ISFC number of the counterparty's account. This field is required for INR accounts.               
            """
        ),
    ] = None
    bsb_code: Annotated[
        str | None,
        Field(
            description="""
            The BSB code of the counterparty's account. This field is required for AUD accounts.               
            """
        ),
    ] = None
    address: Annotated[
        ModelAddress | None,
        Field(description="The address of the counterparty."),
    ] = None

    @model_validator(mode="after")
    def check_inputs(self) -> "CreateCounterparty.Body":
        """Validate the input data."""

        # Company name check
        if self.profile_type == EnumProfileType.BUSINESS and (
            self.individual_name is None or self.name is None
        ):
            assert (
                self.company_name is not None
            ), "company_name is required for business profile type."

        # Name check
        if self.profile_type == EnumProfileType.PERSONAL:
            assert (
                self.name is not None
            ), "name is required for personal profile type."

        # Profile type check
        if self.profile_type is not None:
            assert (
                self.revtag is not None
            ), "revtag is required when profile_type is specified."
        else:
            assert (
                self.revtag is None
            ), "revtag is not required when profile_type is not specified."

        # Individual name check
        # if self.company_name is None:
        #     assert (
        #         self.individual_name is not None
        #     ), "individual_name is required when company_name is not specified."

        # Sort code check
        if self.currency == "GBP":
            assert (
                self.sort_code is not None
            ), "sort_code is required for GBP accounts."

        # Routing number check
        if self.currency == "USD":
            assert (
                self.routing_number is not None
            ), "routing_number is required for USD accounts."

        # IFSC check
        if self.currency == "INR":
            assert self.isfc is not None, "isfc is required for INR accounts."

        # BSB code check
        if self.currency == "AUD":
            assert (
                self.bsb_code is not None
            ), "bsb_code is required for AUD accounts."

        return self

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
class ModelAddress(BaseModel):
    """
    The address of the counterparty.
    """

    street_line1: Annotated[
        str | None,
        Field(description="Street line 1 information."),
    ] = None
    street_line2: Annotated[
        str | None,
        Field(description="Street line 2 information."),
    ] = None
    region: Annotated[
        str | None,
        Field(description="The name of the region."),
    ] = None
    city: Annotated[
        str | None,
        Field(description="The name of the city."),
    ] = None
    country: Annotated[
        CountryAlpha2,
        Field(
            description="The country of the counterparty as the 2-letter ISO 3166 code."
        ),
    ]
    postcode: Annotated[
        str,
        Field(description="The postcode of the counterparty address."),
    ]

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
class ModelIndividualName(BaseModel):
    """
    The name of the individual counterparty.
    Use when company_name isn't specified.
    """

    first_name: Annotated[
        str | None,
        Field(description="The first name of the individual counterparty."),
    ] = None
    last_name: Annotated[
        str | None,
        Field(description="The last name of the individual counterparty."),
    ] = None

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
@model_validator(mode="after")
def check_inputs(self) -> "CreateCounterparty.Body":
    """Validate the input data."""

    # Company name check
    if self.profile_type == EnumProfileType.BUSINESS and (
        self.individual_name is None or self.name is None
    ):
        assert (
            self.company_name is not None
        ), "company_name is required for business profile type."

    # Name check
    if self.profile_type == EnumProfileType.PERSONAL:
        assert (
            self.name is not None
        ), "name is required for personal profile type."

    # Profile type check
    if self.profile_type is not None:
        assert (
            self.revtag is not None
        ), "revtag is required when profile_type is specified."
    else:
        assert (
            self.revtag is None
        ), "revtag is not required when profile_type is not specified."

    # Individual name check
    # if self.company_name is None:
    #     assert (
    #         self.individual_name is not None
    #     ), "individual_name is required when company_name is not specified."

    # Sort code check
    if self.currency == "GBP":
        assert (
            self.sort_code is not None
        ), "sort_code is required for GBP accounts."

    # Routing number check
    if self.currency == "USD":
        assert (
            self.routing_number is not None
        ), "routing_number is required for USD accounts."

    # IFSC check
    if self.currency == "INR":
        assert self.isfc is not None, "isfc is required for INR accounts."

    # BSB code check
    if self.currency == "AUD":
        assert (
            self.bsb_code is not None
        ), "bsb_code is required for AUD accounts."

    return self

Response

Bases: ResourceCounterparty

Response model for the endpoint.

Source code in pyrevolut/api/counterparties/post/create_counterparty.py
255
256
257
258
class Response(ResourceCounterparty):
    """Response model for the endpoint."""

    pass

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
class 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.
    """

    ROUTE = "/1.0/account-name-validation"

    class Body(BaseModel):
        """
        Request body for the endpoint.
        """

        class ModelIndividualName(BaseModel):
            """The name of the individual counterparty. Use when company_name isn't specified."""

            first_name: Annotated[
                str | None,
                Field(description="The first name of the individual counterparty."),
            ] = None
            last_name: Annotated[
                str | None,
                Field(description="The last name of the individual counterparty."),
            ] = None

        account_no: Annotated[
            str,
            Field(
                description="The account number of the counterparty.",
            ),
        ]
        sort_code: Annotated[
            str,
            Field(
                description="The sort code of the counterparty's account.",
            ),
        ]
        company_name: Annotated[
            str | None,
            Field(
                description="The name of the business counterparty. Use when individual_name is not specified.",
            ),
        ] = None
        individual_name: Annotated[
            ModelIndividualName | None,
            Field(
                description="The name of the individual counterparty. Use when company_name is not specified.",
            ),
        ] = None

        @model_validator(mode="after")
        def check_inputs(self) -> "ValidateAccountName.Body":
            """
            Ensure that either the individual_name or company_name is provided.
            """
            if not self.company_name and not self.individual_name:
                raise ValueError(
                    "You must provide either the company_name or individual_name."
                )
            if self.company_name and self.individual_name:
                raise ValueError(
                    "You must provide either the company_name or individual_name, not both."
                )
            return self

    class Response(BaseModel):
        """
        Response model for the endpoint.
        """

        class ModelIndividualName(BaseModel):
            """The name of the individual counterparty. Use when company_name isn't specified."""

            first_name: Annotated[
                str | None,
                Field(description="The first name of the individual counterparty."),
            ] = None
            last_name: Annotated[
                str | None,
                Field(description="The last name of the individual counterparty."),
            ] = None

        class ModelReason(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.
            """

            type: Annotated[
                EnumAccountNameMatchReasonType | None,
                Field(
                    description="""
                    The reason type. Possible values:

                        uk_cop:
                            The CoP reason
                    """,
                ),
            ] = None
            code: Annotated[
                EnumAccountNameMatchReasonCode | None,
                Field(
                    description="""
                    The reason code. Possible values:

                        close_match:
                            The provided name is similar to the account name, the account type is correct.
                            The actual name is returned.
                        individual_account_name_matched:
                            The names match but the counterparty is an individual, not a business.
                        company_account_name_matched:
                            The names match but the counterparty is a business, not an individual.
                        individual_account_close_match:
                            The provided name is similar to the account name, and the account type is incorrect
                            - the counterparty is an individual, not a business. The actual name is returned.
                        company_account_close_match:
                            The provided name is similar to the account name, and the account type is incorrect
                            - the counterparty is a business, not an individual. The actual name is returned.
                        not_matched:
                            The account details don't match the provided values.
                        account_does_not_exist:
                            The account does not exist.
                        account_switched:
                            The account has been switched using the Current Account Switching Service.
                            Please contact the recipient for updated account details.
                        cannot_be_checked:
                            The account cannot be checked.
                    """,
                ),
            ] = None

        result_code: Annotated[
            EnumAccountNameMatchCode,
            Field(
                description="""
                The result of the account name check. Possible values:

                    matched:
                        The name and account type match the provided values.
                    close_match:
                        The name and account type are similar to the provided values.
                        The actual values are returned.
                    not_matched:
                        The name and account type don't match the provided values.
                    cannot_be_checked:
                        The check cannot be performed and retries won't help.
                        For example, the recipient's bank doesn't support CoP.
                    temporarily_unavailable:
                        The check cannot be performed right now.
                        For example, the recipient's bank didn't respond to our request.
                        You should retry the request later.
                """
            ),
        ]
        reason: Annotated[
            ModelReason | None,
            Field(
                description="""
                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.
                """,
            ),
        ] = None
        company_name: Annotated[
            str | None,
            Field(
                description="The name of the business counterparty. Use when individual_name is not specified.",
            ),
        ] = None
        individual_name: Annotated[
            ModelIndividualName | None,
            Field(
                description="The name of the individual counterparty. Use when company_name is not specified.",
            ),
        ] = None

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
class Body(BaseModel):
    """
    Request body for the endpoint.
    """

    class ModelIndividualName(BaseModel):
        """The name of the individual counterparty. Use when company_name isn't specified."""

        first_name: Annotated[
            str | None,
            Field(description="The first name of the individual counterparty."),
        ] = None
        last_name: Annotated[
            str | None,
            Field(description="The last name of the individual counterparty."),
        ] = None

    account_no: Annotated[
        str,
        Field(
            description="The account number of the counterparty.",
        ),
    ]
    sort_code: Annotated[
        str,
        Field(
            description="The sort code of the counterparty's account.",
        ),
    ]
    company_name: Annotated[
        str | None,
        Field(
            description="The name of the business counterparty. Use when individual_name is not specified.",
        ),
    ] = None
    individual_name: Annotated[
        ModelIndividualName | None,
        Field(
            description="The name of the individual counterparty. Use when company_name is not specified.",
        ),
    ] = None

    @model_validator(mode="after")
    def check_inputs(self) -> "ValidateAccountName.Body":
        """
        Ensure that either the individual_name or company_name is provided.
        """
        if not self.company_name and not self.individual_name:
            raise ValueError(
                "You must provide either the company_name or individual_name."
            )
        if self.company_name and self.individual_name:
            raise ValueError(
                "You must provide either the company_name or individual_name, not both."
            )
        return self

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
class ModelIndividualName(BaseModel):
    """The name of the individual counterparty. Use when company_name isn't specified."""

    first_name: Annotated[
        str | None,
        Field(description="The first name of the individual counterparty."),
    ] = None
    last_name: Annotated[
        str | None,
        Field(description="The last name of the individual counterparty."),
    ] = None

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
@model_validator(mode="after")
def check_inputs(self) -> "ValidateAccountName.Body":
    """
    Ensure that either the individual_name or company_name is provided.
    """
    if not self.company_name and not self.individual_name:
        raise ValueError(
            "You must provide either the company_name or individual_name."
        )
    if self.company_name and self.individual_name:
        raise ValueError(
            "You must provide either the company_name or individual_name, not both."
        )
    return self

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
class Response(BaseModel):
    """
    Response model for the endpoint.
    """

    class ModelIndividualName(BaseModel):
        """The name of the individual counterparty. Use when company_name isn't specified."""

        first_name: Annotated[
            str | None,
            Field(description="The first name of the individual counterparty."),
        ] = None
        last_name: Annotated[
            str | None,
            Field(description="The last name of the individual counterparty."),
        ] = None

    class ModelReason(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.
        """

        type: Annotated[
            EnumAccountNameMatchReasonType | None,
            Field(
                description="""
                The reason type. Possible values:

                    uk_cop:
                        The CoP reason
                """,
            ),
        ] = None
        code: Annotated[
            EnumAccountNameMatchReasonCode | None,
            Field(
                description="""
                The reason code. Possible values:

                    close_match:
                        The provided name is similar to the account name, the account type is correct.
                        The actual name is returned.
                    individual_account_name_matched:
                        The names match but the counterparty is an individual, not a business.
                    company_account_name_matched:
                        The names match but the counterparty is a business, not an individual.
                    individual_account_close_match:
                        The provided name is similar to the account name, and the account type is incorrect
                        - the counterparty is an individual, not a business. The actual name is returned.
                    company_account_close_match:
                        The provided name is similar to the account name, and the account type is incorrect
                        - the counterparty is a business, not an individual. The actual name is returned.
                    not_matched:
                        The account details don't match the provided values.
                    account_does_not_exist:
                        The account does not exist.
                    account_switched:
                        The account has been switched using the Current Account Switching Service.
                        Please contact the recipient for updated account details.
                    cannot_be_checked:
                        The account cannot be checked.
                """,
            ),
        ] = None

    result_code: Annotated[
        EnumAccountNameMatchCode,
        Field(
            description="""
            The result of the account name check. Possible values:

                matched:
                    The name and account type match the provided values.
                close_match:
                    The name and account type are similar to the provided values.
                    The actual values are returned.
                not_matched:
                    The name and account type don't match the provided values.
                cannot_be_checked:
                    The check cannot be performed and retries won't help.
                    For example, the recipient's bank doesn't support CoP.
                temporarily_unavailable:
                    The check cannot be performed right now.
                    For example, the recipient's bank didn't respond to our request.
                    You should retry the request later.
            """
        ),
    ]
    reason: Annotated[
        ModelReason | None,
        Field(
            description="""
            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.
            """,
        ),
    ] = None
    company_name: Annotated[
        str | None,
        Field(
            description="The name of the business counterparty. Use when individual_name is not specified.",
        ),
    ] = None
    individual_name: Annotated[
        ModelIndividualName | None,
        Field(
            description="The name of the individual counterparty. Use when company_name is not specified.",
        ),
    ] = None

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
class ModelIndividualName(BaseModel):
    """The name of the individual counterparty. Use when company_name isn't specified."""

    first_name: Annotated[
        str | None,
        Field(description="The first name of the individual counterparty."),
    ] = None
    last_name: Annotated[
        str | None,
        Field(description="The last name of the individual counterparty."),
    ] = None

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
class ModelReason(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.
    """

    type: Annotated[
        EnumAccountNameMatchReasonType | None,
        Field(
            description="""
            The reason type. Possible values:

                uk_cop:
                    The CoP reason
            """,
        ),
    ] = None
    code: Annotated[
        EnumAccountNameMatchReasonCode | None,
        Field(
            description="""
            The reason code. Possible values:

                close_match:
                    The provided name is similar to the account name, the account type is correct.
                    The actual name is returned.
                individual_account_name_matched:
                    The names match but the counterparty is an individual, not a business.
                company_account_name_matched:
                    The names match but the counterparty is a business, not an individual.
                individual_account_close_match:
                    The provided name is similar to the account name, and the account type is incorrect
                    - the counterparty is an individual, not a business. The actual name is returned.
                company_account_close_match:
                    The provided name is similar to the account name, and the account type is incorrect
                    - the counterparty is a business, not an individual. The actual name is returned.
                not_matched:
                    The account details don't match the provided values.
                account_does_not_exist:
                    The account does not exist.
                account_switched:
                    The account has been switched using the Current Account Switching Service.
                    Please contact the recipient for updated account details.
                cannot_be_checked:
                    The account cannot be checked.
            """,
        ),
    ] = None

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
class DeleteCounterparty:
    """Delete a counterparty with the given ID.
    When a counterparty is deleted, you cannot make any payments to the counterparty.
    """

    ROUTE = "/1.0/counterparty/{counterparty_id}"

    class Params(BaseModel):
        """
        Query parameters for the endpoint.
        """

        pass

    class Response(BaseModel):
        """
        Response model for the endpoint.
        """

        pass

Params

Bases: BaseModel

Query parameters for the endpoint.

Source code in pyrevolut/api/counterparties/delete/delete_counterparty.py
11
12
13
14
15
16
class Params(BaseModel):
    """
    Query parameters for the endpoint.
    """

    pass

Response

Bases: BaseModel

Response model for the endpoint.

Source code in pyrevolut/api/counterparties/delete/delete_counterparty.py
18
19
20
21
22
23
class Response(BaseModel):
    """
    Response model for the endpoint.
    """

    pass