Reference
shared.services.payment_providers.revolut.entities ¶
RevolutAccountReference ¶
RevolutBusinessAccountConfig
dataclass
¶
RevolutBusinessAccountConfig(
base_url,
api_credentials_secret_name,
private_key,
private_key_secret_name,
client_id,
issuer,
webhook_signing_secret=None,
webhook_signing_secret_name=None,
)
RevolutBusinessAccountName ¶
Bases: AlanBaseEnum
RevolutBusinessAccountNamesAvailableByCountry ¶
RevolutCounterPartyInfo
dataclass
¶
RevolutPrevoyancePaymentAccount
dataclass
¶
RevolutTransactionCreatedEvent
dataclass
¶
RevolutTransactionCreatedEvent(
business_account_name,
transaction_id,
type,
request_id,
created_at,
updated_at,
state,
legs=list(),
reason_code=None,
completed_at=None,
scheduled_for=None,
reference=None,
related_transaction_id=None,
raw_event=None,
)
Event for Revolut TransactionCreated webhooks.
Emitted when a new transaction is created in Revolut. https://developer.revolut.com/docs/guides/manage-accounts/webhooks/about-webhooks#transaction-created-event ⧉
business_account_name
instance-attribute
¶
Revolut Business Account name passed as query string business_account_name to the webhook controller
completed_at
class-attribute
instance-attribute
¶
The date and time the transaction was completed, mandatory for completed state only.
legs
class-attribute
instance-attribute
¶
The legs of a transaction. There are 2 legs between your Revolut accounts and 1 leg in other cases.
reason_code
class-attribute
instance-attribute
¶
The optional reason code for declined or failed transaction state.
reference
class-attribute
instance-attribute
¶
The payment reference provided by the user.
related_transaction_id
class-attribute
instance-attribute
¶
The ID of the related transaction. Only applicable when type=refund.
scheduled_for
class-attribute
instance-attribute
¶
The optional date the transaction was scheduled for.
RevolutTransactionPaymentResponse ¶
Bases: RevolutTransferResponse
The Revolut OpenAPI spec lacks the undocumented expected_processing_time field, add it here.
Counterparty of RevolutTransactionPaymentRequest
RevolutTransactionStateChangedEvent
dataclass
¶
RevolutTransactionStateChangedEvent(
business_account_name,
transaction_id,
request_id,
old_state,
new_state,
updated_at,
raw_event=None,
)
Event for Revolut TransactionStateChanged webhooks.
Emitted when an existing transaction changes state. https://developer.revolut.com/docs/guides/manage-accounts/webhooks/about-webhooks#transaction-state-changed-event ⧉
business_account_name
instance-attribute
¶
Revolut Business Account name passed as query string business_account_name to the webhook controller
transaction_id
instance-attribute
¶
The ID of the updated transaction. (id in JSON payload)
updated_at
instance-attribute
¶
The date and time the transaction was last updated. (from timestamp in payload)
shared.services.payment_providers.revolut.errors ¶
PotentialSwiftError ¶
Bases: RevolutError
A special case of RevolutError. Raised when we think it may be fixable by resetting the SWIFT. Context: many calls to /counterparty fail because we supply the wrong SWIFT number. We don't get details from the 400 response from Revolut, but we want to communicate that it's possibly caused by a SWIFT problem.
Source code in shared/services/payment_providers/revolut/errors.py
RevolutError ¶
Bases: Exception
A generic revolut exception we should handle
Source code in shared/services/payment_providers/revolut/errors.py
RevolutInternalError ¶
Bases: RevolutError
Revolut issue, we can't act on it
Source code in shared/services/payment_providers/revolut/errors.py
RevolutNotAuthorizedError ¶
Bases: RevolutError
The access token is not valid.
We have a scheduled job running every 15 minutes to rotate the access token as it is valid for less than 1h. If the command failed to run for some reason, the token won't have been rotated, and will thus be expired / invalid.
Source code in shared/services/payment_providers/revolut/errors.py
RevolutNotFoundError ¶
Bases: RevolutError
Resource does not exist on Revolut, it is up to us to decide whether we take this error into account or not
Source code in shared/services/payment_providers/revolut/errors.py
RevolutParallelRequestsError ¶
shared.services.payment_providers.revolut.helpers ¶
EEA_COUNTRIES
module-attribute
¶
EEA_COUNTRIES = [
"AT",
"AX",
"BE",
"BG",
"CY",
"CZ",
"DE",
"DK",
"EA",
"EE",
"ES",
"FI",
"FR",
"GB",
"GF",
"GI",
"GP",
"GR",
"HR",
"HU",
"IC",
"IE",
"IT",
"LT",
"LU",
"LV",
"MF",
"MQ",
"MT",
"NL",
"PL",
"PT",
"RE",
"RO",
"SE",
"SI",
"SK",
"YT",
"NO",
"IS",
"LI",
"JE",
"GG",
"IM",
]
PREVOYANCE_BANK_ACCOUNT_CONFIG_MAPPING
module-attribute
¶
PREVOYANCE_BANK_ACCOUNT_CONFIG_MAPPING = {
alan_insurance: RevolutPrevoyancePaymentAccount(
cnp=cnp_claims,
lamie=lamie_claims,
alan=alan_prevoyance_claims,
)
}
get_revolut_account_id ¶
Source code in shared/services/payment_providers/revolut/helpers.py
get_revolut_config_from_business_account_name ¶
Source code in shared/services/payment_providers/revolut/helpers.py
is_transaction_on_accounts ¶
Check if a Revolut transaction is linked to any of the given account IDs
Source code in shared/services/payment_providers/revolut/helpers.py
shared.services.payment_providers.revolut.openapi ¶
business_1_0 ¶
RevolutAccount ¶
Bases: BaseModel
created_at
instance-attribute
¶
The date and time the account was created in ISO 8601 ⧉ format.
public
instance-attribute
¶
Indicates whether the account is visible to other businesses on Revolut.
updated_at
instance-attribute
¶
The date and time the account was last updated in ISO 8601 ⧉ format.
RevolutAccountBankDetailsItem ¶
RevolutAccountBankDetailsItems ¶
Bases: RootModel[list[RevolutAccountBankDetailsItem]]
RevolutAccountCurrency ¶
Bases: RootModel[str]
RevolutAccountNameValidationReasonAU ¶
Bases: BaseModel
code
class-attribute
instance-attribute
¶
The reason code. Possible values for AU:
- close_match (business accounts): The provided name is similar to the account name.
The actual name is returned. Mismatched account type is corrected.
- 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.
RevolutAccountNameValidationReasonEUR ¶
Bases: BaseModel
code
class-attribute
instance-attribute
¶
The reason code. Possible values for EUR:
- close_match: The provided name is similar to the account name.
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.
RevolutAccountNameValidationReasonRO ¶
Bases: BaseModel
code
class-attribute
instance-attribute
¶
The reason code. Possible values for RO:
- cannot_be_checked: The account cannot be checked.
RevolutAccountNameValidationReasonUK ¶
Bases: BaseModel
code
class-attribute
instance-attribute
¶
The reason code. Possible values for UK:
- 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.
RevolutAccounts ¶
Bases: RootModel[list[RevolutAccount]]
RevolutAmount1 ¶
RevolutAmountWithCurrency ¶
RevolutBankCountryCode ¶
Bases: RootModel[str]
RevolutBeneficiaryAddress ¶
Bases: BaseModel
country
instance-attribute
¶
The country of the counterparty, provided as a 2-letter ISO 3166 ⧉ code.
region
class-attribute
instance-attribute
¶
The name of the region (state or province), for example, Ontario for Canada.
RevolutBusinessMerchantCategory ¶
Bases: StrEnum
RevolutCancellationReason ¶
Bases: Enum
too_many_name_check_attempts
class-attribute
instance-attribute
¶
RevolutCardCanBeUnlocked ¶
Bases: RootModel[bool]
root
instance-attribute
¶
Returned for locked cards (state=locked).
Indicates whether the card can be unlocked ⧉ manually (via API or in-app).
If true, you'll still need the necessary scope or permission ⧉ to unlock the card.
Info
Cards can be locked for various reasons. For example, a card can be locked by the user, due to spending period settings, or automatically by the system. Only certain types of lock can be lifted manually.
RevolutCardContact ¶
Bases: RootModel[UUID]
RevolutCardContacts ¶
Bases: RootModel[list[RevolutCardContact]]
RevolutCardCreatedResponse ¶
Bases: BaseModel
categories
class-attribute
instance-attribute
¶
The list of merchant categories that are available for card spending. If this parameter is not specified, categories are not restricted.
countries
class-attribute
instance-attribute
¶
The list of countries where the card can be used, specified as 2-letter ISO 3166 ⧉ codes.
created_at
instance-attribute
¶
The date and time the card was created in ISO 8601 ⧉ format.
holder_id
class-attribute
instance-attribute
¶
The ID of the team member who is the holder of the card. If the card belongs to the business, this will be empty.
For more information, see the guides: Manage Cards - Create a virtual card ⧉.
merchant_controls
class-attribute
instance-attribute
¶
The merchant-level controls for card spending.
They block or allow the card to only transact with specific merchants:
- allow: permits only the specified merchants (cannot be used if the categories parameter is set)
- block: blocks the specified merchants (can be used with or without categories)
spending_period
class-attribute
instance-attribute
¶
The controls for the card's spending period.
They specify the dates when the card becomes available or unavailable for spending, and define what happens after the end date.
updated_at
instance-attribute
¶
The date and time the card was last updated in ISO 8601 ⧉ format.
virtual
instance-attribute
¶
Specifies whether the card is virtual (true) or physical (false).
RevolutCardInvitationAccounts ¶
Bases: RootModel[list[UUID]]
RevolutCardInvitationCardId ¶
Bases: RootModel[UUID]
root
instance-attribute
¶
The ID of the card issued after this invitation was claimed.
Note
Only returned for invitations in state redeemed.
RevolutCardInvitationCategories ¶
Bases: RootModel[list[RevolutBusinessMerchantCategory]]
root
instance-attribute
¶
The list of merchant categories that will be available for card spending. If this parameter is not specified, categories are not restricted.
RevolutCardInvitationCountries ¶
Bases: RootModel[list[RevolutCardInvitationCountry]]
root
instance-attribute
¶
The list of countries where the team member will be able to use the card. Specified as 2-letter ISO 3166 ⧉ codes.
RevolutCardInvitationCreatedAt ¶
Bases: RootModel[AwareDatetime]
root
instance-attribute
¶
The date and time the card invitation was created in ISO 8601 ⧉ format.
RevolutCardInvitationCreatedHolderId ¶
Bases: RootModel[UUID]
root
instance-attribute
¶
The ID of the team member to be assigned as the holder of the card after the invitation is claimed.
RevolutCardInvitationCreatedResponse ¶
Bases: BaseModel
RevolutCardInvitationExpiryDate ¶
Bases: RootModel[AwareDatetime]
root
instance-attribute
¶
The date and time after which this card invitation expires if not claimed or cancelled before then. Specified in ISO 8601 ⧉ format.
Note
Only returned for invitations in state created.
Tip
For other states, to find out when a card invitation transitioned to its final state ⧉, check the updated_at value.
RevolutCardInvitationHolderId ¶
Bases: RootModel[UUID]
root
instance-attribute
¶
The ID of the team member to be assigned as the holder of the card after the invitation is claimed.
Note
If the team member has been deleted since the invitation was created, the holder_id is not returned.
RevolutCardInvitationId ¶
Bases: RootModel[UUID]
RevolutCardInvitationLabel ¶
Bases: RootModel[str]
RevolutCardInvitationMerchantControls ¶
Bases: BaseModel
merchant_ids
instance-attribute
¶
The list of IDs of merchants to which the control applies.
Tip
To find merchant IDs, check transaction details (→ merchant.id).
You can fetch transaction details for a specific transaction ⧉ or for all transactions ⧉.
RevolutCardInvitationResponse ¶
Bases: BaseModel
RevolutCardInvitationSpendProgram ¶
Bases: RootModel[RevolutSpendProgram]
RevolutCardInvitationSpendingLimits ¶
Bases: RootModel[RevolutSpendingLimits]
RevolutCardInvitationSpendingPeriod ¶
Bases: RootModel[RevolutCardInvitationSpendingPeriod4 | RevolutCardInvitationSpendingPeriod5]
root
instance-attribute
¶
The controls for the card's spending period.
They specify the dates when the card will become available or unavailable for spending, and define what happens after the end date.
RevolutCardInvitationSpendingPeriod1 ¶
Bases: BaseModel
end_date
class-attribute
instance-attribute
¶
The end date (inclusive) of the spending period, in ISO 8601 ⧉ format (YYYY-MM-DD).
Uses the timezone set by the business ⧉, or defaults to Europe/London.
end_date_action
class-attribute
instance-attribute
¶
The action to take after the end date of the spending period.
start_date
instance-attribute
¶
The start date (inclusive) of the spending period, in ISO 8601 ⧉ format (YYYY-MM-DD).
Uses the timezone set by the business ⧉, or defaults to Europe/London.
RevolutCardInvitationSpendingPeriod2 ¶
Bases: BaseModel
end_date
instance-attribute
¶
The end date (inclusive) of the spending period, in ISO 8601 ⧉ format (YYYY-MM-DD).
Uses the timezone set by the business ⧉, or defaults to Europe/London.
end_date_action
instance-attribute
¶
The action to take after the end date of the spending period.
start_date
class-attribute
instance-attribute
¶
The start date (inclusive) of the spending period, in ISO 8601 ⧉ format (YYYY-MM-DD).
Uses the timezone set by the business ⧉, or defaults to Europe/London.
RevolutCardInvitationSpendingPeriod3 ¶
Bases: BaseModel
RevolutCardInvitationSpendingPeriod4 ¶
RevolutCardInvitationSpendingPeriod5 ¶
RevolutCardInvitationState ¶
RevolutCardInvitationUpdatedAt ¶
Bases: RootModel[AwareDatetime]
root
instance-attribute
¶
The date and time the card invitation was last updated in ISO 8601 ⧉ format.
RevolutCardInvitationUpdatedResponse ¶
Bases: BaseModel
RevolutCardInvitationVirtual ¶
Bases: RootModel[bool]
root
instance-attribute
¶
Specifies whether the issued card will be a virtual (true) or physical (false) one.
RevolutCardInvitationsResponse ¶
Bases: RootModel[list[RevolutCardInvitationResponse]]
RevolutCardProduct ¶
RevolutCardReference ¶
RevolutCardReferences ¶
Bases: RootModel[list[RevolutCardReference]]
root
instance-attribute
¶
References for the card. Up to 5 name-value pairs assigned to the card for tracking.
Info
Each time the card is used, the references are recorded in the transaction details ⧉ (card.references), helping track transactions made with this card.
The names must be unique. The references can be amended ⧉ up to 10 times.
References are only supported for cards owned by the business (i.e. company ⧉ or auto-issued cards ⧉).
They are not supported for team member cards ⧉ (i.e. with holder_id present).
Note
The references recorded on a transaction are those assigned to the card at the time the transaction took place. If the references are amended, they will only be applied to future transactions. Existing transaction are not affected.
RevolutCardResponse ¶
Bases: BaseModel
categories
class-attribute
instance-attribute
¶
The list of merchant categories that are available for card spending. If not specified, categories are not restricted.
countries
class-attribute
instance-attribute
¶
The list of countries where the card can be used, specified as 2-letter ISO 3166 ⧉ codes.
created_at
instance-attribute
¶
The date and time the card was created in ISO 8601 ⧉ format.
holder_id
class-attribute
instance-attribute
¶
The ID of the team member who is the holder of the card. If the card belongs to the business, this will be empty.
For more information, see the guides: Manage Cards - Create a virtual card ⧉.
merchant_controls
class-attribute
instance-attribute
¶
The merchant-level controls for card spending.
They block or allow the card to only transact with specific merchants:
- allow: permits only the specified merchants (cannot be used if the categories parameter is set)
- block: blocks the specified merchants (can be used with or without categories)
spending_period
class-attribute
instance-attribute
¶
The controls for the card's spending period.
They specify the dates when the card becomes available or unavailable for spending, and define what happens after the end date.
updated_at
instance-attribute
¶
The date and time the card was last updated in ISO 8601 ⧉ format.
virtual
instance-attribute
¶
Specifies whether the card is virtual (true) or physical (false).
RevolutCardState ¶
Bases: StrEnum
RevolutCardsResponse ¶
Bases: RootModel[list[RevolutCardResponse]]
RevolutCategory ¶
RevolutChargeBearer ¶
RevolutCode ¶
Bases: StrEnum
account_does_not_exist
class-attribute
instance-attribute
¶
company_account_close_match
class-attribute
instance-attribute
¶
company_account_name_matched
class-attribute
instance-attribute
¶
individual_account_close_match
class-attribute
instance-attribute
¶
individual_account_name_matched
class-attribute
instance-attribute
¶
RevolutCode4 ¶
Bases: StrEnum
business_expense_and_claims
class-attribute
instance-attribute
¶
fund_transfer_and_intracompany_payment
class-attribute
instance-attribute
¶
gifts_and_donations
class-attribute
instance-attribute
¶
government_services_and_tax
class-attribute
instance-attribute
¶
investment_dividend_and_interest
class-attribute
instance-attribute
¶
loan_and_loan_repayment
class-attribute
instance-attribute
¶
payment_for_goods_and_services
class-attribute
instance-attribute
¶
rental_and_property
class-attribute
instance-attribute
¶
service_provider_and_software
class-attribute
instance-attribute
¶
travel_and_transportation
class-attribute
instance-attribute
¶
RevolutCode5 ¶
Bases: StrEnum
RevolutControlType ¶
RevolutCounterparties ¶
Bases: RootModel[list[RevolutCounterparty]]
RevolutCounterparty ¶
Bases: BaseModel
accounts
class-attribute
instance-attribute
¶
The list of public accounts associated with this counterparty.
cards
class-attribute
instance-attribute
¶
The list of cards associated with this counterparty.
created_at
instance-attribute
¶
The date and time the counterparty was created in ISO 8601 ⧉ format.
updated_at
instance-attribute
¶
The date and time the counterparty was last updated in ISO 8601 ⧉ format.
RevolutCounterpartyAccount ¶
Bases: BaseModel
account_no
class-attribute
instance-attribute
¶
The bank account number of the counterparty.
bic
class-attribute
instance-attribute
¶
The BIC number of the counterparty's account if applicable.
bsb_code
class-attribute
instance-attribute
¶
The BSB number of the counterparty's account if applicable.
clabe
class-attribute
instance-attribute
¶
The CLABE number of the counterparty's account if applicable.
iban
class-attribute
instance-attribute
¶
The IBAN number of the counterparty's account if applicable.
ifsc
class-attribute
instance-attribute
¶
The IFSC number of the counterparty's account if applicable.
recipient_charges
class-attribute
instance-attribute
¶
Indicates the possibility of the recipient charges.
Caution
This field is deprecated and should be disregarded. It is returned for legacy purposes only.
routing_number
class-attribute
instance-attribute
¶
The routing number of the counterparty's account if applicable.
sort_code
class-attribute
instance-attribute
¶
The sort code of the counterparty's account if applicable.
RevolutCounterpartyCard ¶
Bases: BaseModel
RevolutCounterpartyError ¶
RevolutCounterpartyErrorParams ¶
RevolutCountryCode ¶
Bases: RootModel[str]
root
instance-attribute
¶
The counterparty's bank country, provided as a 2-letter ISO 3166 ⧉ code.
RevolutCountryCodeCard ¶
Bases: RootModel[str]
root
instance-attribute
¶
The country of the card issuer, provided as a 2-letter ISO 3166 ⧉ code.
RevolutCountryCodeMerchant ¶
Bases: RootModel[str]
root
instance-attribute
¶
The bank country of the merchant, provided as an ISO 3166 ⧉ code. Typically 3 letters, though in some cases, card networks might provide it as a 2-letter code.
RevolutCreateCounterpartyRequest ¶
Bases: BaseModel
account_no
class-attribute
instance-attribute
¶
The bank account number of the counterparty.
bic
class-attribute
instance-attribute
¶
The BIC number of the counterparty's account. This field is required for non-SEPA IBAN/SWIFT.
bsb_code
class-attribute
instance-attribute
¶
The BSB number of the counterparty's account. This field is required for AUD accounts.
clabe
class-attribute
instance-attribute
¶
The CLABE number of the counterparty's account. This field is required for SWIFT MX.
company_name
class-attribute
instance-attribute
¶
The name of the counterparty, provided when the counterparty is a company (business account type) and is not being added via Revtag.
If specified, individual_name and name must be empty.
Caution
The company_name must contain at least 2 letters (not just characters).
For example, names like 12 will fail validation because they are two characters but not two letters.
iban
class-attribute
instance-attribute
¶
The IBAN number of the counterparty's account. This field is displayed for IBAN countries.
ifsc
class-attribute
instance-attribute
¶
The IFSC number of the counterparty's account. This field is required for INR accounts.
name
class-attribute
instance-attribute
¶
The name of the counterparty, provided when the counterparty is being added via Revtag.
If specified, individual_name and company_name must be empty.
Note
The name that you provide must match or closely match the actual name associated with the account that you're trying to add.
Otherwise, the creation fails and a 404 error is returned.
profile_type
class-attribute
instance-attribute
¶
The type of the Revolut profile. Indicates whether the counterparty is a personal or business account. Provide it when adding a Revolut counterparty via Revtag.
routing_number
class-attribute
instance-attribute
¶
The routing number of the counterparty's account. This field is required for USD accounts.
sort_code
class-attribute
instance-attribute
¶
The sort code of the counterparty's account. This field is required for GBP accounts.
RevolutCreatePaymentDraftRequest ¶
Bases: BaseModel
schedule_for
class-attribute
instance-attribute
¶
The scheduled date of the payment draft in ISO 8601 ⧉ format.
RevolutCreatePaymentDraftResponse ¶
RevolutCreatePayoutLinkRequest ¶
Bases: BaseModel
reference
instance-attribute
¶
The reference for the payout link. A piece of text or number you provide to help identify what the payment relates to. It can be used, for example, for reconciliation or tracking purposes.
You might include an invoice number, account or transaction ID, or any other reference meaningful to you or the recipient.
request_id
instance-attribute
¶
The ID of the request, provided by the sender.
Caution
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.
save_counterparty
class-attribute
instance-attribute
¶
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.
RevolutCreateWebhookRequest ¶
Bases: BaseModel
events
class-attribute
instance-attribute
¶
A list of event types to subscribe to. If you don't provide it, you're automatically subscribed to the default event types ⧉.
url
instance-attribute
¶
A valid webhook URL to which to send event notifications. The supported protocol is https.
RevolutCurrency ¶
Bases: RootModel[str]
RevolutCurrentChargeOptions ¶
RevolutEndDateAction ¶
RevolutError ¶
RevolutErrorUnauthorized ¶
Bases: RevolutErrorWithStatus
RevolutErrorUnprocessableEntity ¶
RevolutErrorWithStatus ¶
RevolutEstimatedTime ¶
Bases: BaseModel
RevolutExchangePartFrom ¶
Bases: BaseModel
amount
class-attribute
instance-attribute
¶
The amount of currency. Specify only if you want to sell currency.
RevolutExchangePartTo ¶
RevolutExchangeRateResponse ¶
Bases: BaseModel
rate_date
instance-attribute
¶
The date of the proposed exchange rate in ISO 8601 ⧉ format.
RevolutExchangeReason ¶
RevolutExchangeReasonCode ¶
Bases: RootModel[str]
root
instance-attribute
¶
The reason code for the exchange.
Depending on the country and the amount of funds to be exchanged, you might be required to provide an exchange reason.
You can check available reason codes with the GET /exchange-reasons operation ⧉.
If an exchange reason is not required, this field is ignored.
RevolutExchangeReasons ¶
Bases: RootModel[list[RevolutExchangeReason]]
RevolutExchangeRequest ¶
Bases: BaseModel
reference
class-attribute
instance-attribute
¶
The reference for the exchange transaction, provided by you. It helps you to identify the transaction if you want to look it up later.
request_id
instance-attribute
¶
The ID of the request, provided by you. It helps you identify the transaction in your system.
Caution
To ensure that an exchange transaction 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 transaction.
RevolutExchangeResponse ¶
Bases: BaseModel
completed_at
class-attribute
instance-attribute
¶
The date and time the transaction was completed in ISO 8601 ⧉ format.
created_at
class-attribute
instance-attribute
¶
The date and time the transaction was created in ISO 8601 ⧉ format.
reason_code
class-attribute
instance-attribute
¶
The reason why the transaction was failed or declined.
Present only when the state parameter of the transaction is declined or failed.
type
class-attribute
instance-attribute
¶
The type of the transaction. For money exchange, it is exchange.
RevolutExpense ¶
Bases: BaseModel
completed_at
class-attribute
instance-attribute
¶
The date and time the expense was completed in ISO 8601 ⧉ format.
expense_date
instance-attribute
¶
The expense data depends on the type of the expense and whether it has been completed.
Typically, it's the date and time of the expense transaction ⧉ in ISO 8601 ⧉ format.
- If the transaction related to the expense is completed, it is the date and time of its completion (completed_at ⧉).
- Otherwise, it is the date and time of its creation (created_at ⧉).
For reimbursements, it's the payment date provided in the reimbursement request.
labels
instance-attribute
¶
The labels added to the expense, organised in groups.
You can have up to 5 label groups, with max. 1 label per group.
The labels are provided as an object, where each key is the name of a label group, and each value is a single-element array containing the selected label from that group.
payer
class-attribute
instance-attribute
¶
The name of the team member ⧉ who made the transaction, refund request, or ATM withdrawal, or the name of the business if the related transaction is of type fee.
splits
instance-attribute
¶
The splits of the expense.
A single expense can be divided into multiple parts (splits), for example, to allocate different portions of the expense to different categories.
submitted_at
class-attribute
instance-attribute
¶
The date and time the expense was submitted in ISO 8601 ⧉ format.
transaction_id
class-attribute
instance-attribute
¶
The ID of the transaction ⧉ related to the expense. Not available for transactions of type external.
RevolutExpenseSplit ¶
RevolutExpenseTransactionType ¶
Bases: StrEnum
mileage_reimbursement
class-attribute
instance-attribute
¶
RevolutExpenses ¶
Bases: RootModel[list[RevolutExpense]]
RevolutFee ¶
RevolutIndividualName ¶
RevolutIndividualName1 ¶
RevolutIndividualName7 ¶
RevolutIndividualName8 ¶
RevolutLabelGroup ¶
Bases: RootModel[list[str]]
RevolutMerchantControls ¶
Bases: BaseModel
merchant_ids
instance-attribute
¶
The list of IDs of merchants to which the control applies.
Tip
To find merchant IDs, check transaction details (→ merchant.id).
You can fetch transaction details for a specific transaction ⧉ or for all transactions ⧉.
RevolutMerchantControls1 ¶
Bases: BaseModel
merchant_ids
instance-attribute
¶
The list of IDs of merchants to which the control applies.
Tip
To find merchant IDs, check transaction details (→ merchant.id).
You can fetch transaction details for a specific transaction ⧉ or for all transactions ⧉.
RevolutMerchantControlsSchema ¶
Bases: BaseModel
merchant_ids
instance-attribute
¶
The list of IDs of merchants to which the control applies.
Tip
To find merchant IDs, check transaction details (→ merchant.id).
You can fetch transaction details for a specific transaction ⧉ or for all transactions ⧉.
RevolutPaymentDraftResponse ¶
Bases: BaseModel
scheduled_for
class-attribute
instance-attribute
¶
The scheduled date of the payment draft in ISO 8601 ⧉ format.
RevolutPaymentDraftsResponse ¶
RevolutPaymentInfo ¶
Bases: BaseModel
current_charge_options
instance-attribute
¶
The explanation of conversion process.
error_message
class-attribute
instance-attribute
¶
The description of the error message.
id
instance-attribute
¶
The ID of the payment.
Do not confuse it with the payment draft ID ⧉ or transaction ID ⧉.
RevolutPaymentOrderInfo ¶
Bases: BaseModel
scheduled_for
class-attribute
instance-attribute
¶
The scheduled date of the payment draft in ISO 8601 ⧉ format.
RevolutPaymentReceiver ¶
Bases: BaseModel
account_id
class-attribute
instance-attribute
¶
The ID of the receiving counterparty's account. Used for bank transfers.
If the counterparty has multiple payment methods available, use it to specify the account to which you want to send the money.
card_id
class-attribute
instance-attribute
¶
The ID of the receiving counterparty's card. Used for card transfers.
If the counterparty has multiple payment methods available, use it to specify the card to which you want to send the money.
RevolutPaymentRequest ¶
Bases: BaseModel
account_id
instance-attribute
¶
The ID of the account to pay from.
Note
You can specify only one account ID for multiple payments in the same payment draft.
reference
instance-attribute
¶
The reference for the payment. A piece of text or number you provide to help identify what the payment relates to. It can be used, for example, for reconciliation or tracking purposes.
You might include an invoice number, account or transaction ID, or any other reference meaningful to you.
RevolutPaymentState ¶
Bases: StrEnum
RevolutPaymentSystem ¶
Bases: StrEnum
RevolutPayoutLink ¶
RevolutPayoutLinkAccountId ¶
Bases: RootModel[UUID]
RevolutPayoutLinkAdditionalProps ¶
Bases: BaseModel
cancellation_reason
class-attribute
instance-attribute
¶
The reason for which the payout link was cancelled.
counterparty_id
class-attribute
instance-attribute
¶
The ID of the counterparty created based on the recipient's details.
Note
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.
transaction_id
class-attribute
instance-attribute
¶
The ID of the created transaction. Returned only if the payout has been claimed.
RevolutPayoutLinkAmount ¶
Bases: RootModel[float]
root
instance-attribute
¶
The amount of money to be transferred.
Note
The amount must be between £1 and £2,500, or equivalent in the selected currency.
RevolutPayoutLinkCounterpartyName ¶
Bases: RootModel[str]
RevolutPayoutLinkExpiryDate ¶
Bases: RootModel[AwareDatetime]
root
instance-attribute
¶
The date and time after which the payout link expires in ISO 8601 format ⧉. If the recipient doesn't claim the money before then, the payout link expires and is no longer available.
The default and maximum value is the date and time of creating the link + 7 days.
RevolutPayoutLinkExpiryPeriod ¶
Bases: RootModel[timedelta]
root
instance-attribute
¶
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.
RevolutPayoutLinkInitialProps ¶
Bases: BaseModel
created_at
instance-attribute
¶
The date and time the payout link was created in ISO 8601 format ⧉.
save_counterparty
instance-attribute
¶
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.
updated_at
instance-attribute
¶
The date and time the payout link was last updated in ISO 8601 format ⧉.
url
class-attribute
instance-attribute
¶
The URL of the payout link. Returned only for active payout links.
RevolutPayoutLinkPayoutMethods ¶
Bases: RootModel[list[RevolutPayoutMethod]]
root
instance-attribute
¶
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
Note
- This payout method is available in the UK and the EEA.
- This payout method is not available in Sandbox.
RevolutPayoutLinkReference ¶
Bases: RootModel[str]
RevolutPayoutLinkRequestId ¶
Bases: RootModel[str]
RevolutPayoutLinkState ¶
Bases: StrEnum
RevolutPayoutLinks ¶
Bases: RootModel[list[RevolutPayoutLink]]
RevolutPayoutMethod ¶
RevolutProfileType ¶
RevolutRecipientCharges ¶
RevolutRole ¶
Bases: BaseModel
created_at
instance-attribute
¶
The date and time the role was created in ISO 8601 ⧉ format.
id
instance-attribute
¶
The ID of the role. This can be a UUID or other default role such as OWNER.
updated_at
instance-attribute
¶
The date and time the role was last updated in ISO 8601 ⧉ format.
RevolutScheme ¶
RevolutSpendProgram ¶
RevolutSpendingLimitPeriodic ¶
RevolutSpendingLimitSingleTransaction ¶
RevolutSpendingLimits ¶
Bases: BaseModel
RevolutSpendingLimitsSchema ¶
Bases: BaseModel
RevolutSpendingPeriodSchema ¶
Bases: RootModel[RevolutSpendingPeriodSchema1 | RevolutSpendingPeriodSchema2]
RevolutSpendingPeriodSchema1 ¶
Bases: BaseModel
end_date
class-attribute
instance-attribute
¶
The end date (inclusive) of the spending period, in ISO 8601 ⧉ format (YYYY-MM-DD).
Uses the timezone set by the business ⧉, or defaults to Europe/London.
end_date_action
class-attribute
instance-attribute
¶
The action to take after the end date of the spending period.
start_date
instance-attribute
¶
The start date (inclusive) of the spending period, in ISO 8601 ⧉ format (YYYY-MM-DD).
Uses the timezone set by the business ⧉, or defaults to Europe/London.
RevolutSpendingPeriodSchema2 ¶
Bases: BaseModel
end_date
instance-attribute
¶
The end date (inclusive) of the spending period, in ISO 8601 ⧉ format (YYYY-MM-DD).
Uses the timezone set by the business ⧉, or defaults to Europe/London.
end_date_action
instance-attribute
¶
The action to take after the end date of the spending period.
start_date
class-attribute
instance-attribute
¶
The start date (inclusive) of the spending period, in ISO 8601 ⧉ format (YYYY-MM-DD).
Uses the timezone set by the business ⧉, or defaults to Europe/London.
RevolutSpentAmount ¶
RevolutState ¶
RevolutState1 ¶
RevolutTaxRate ¶
Bases: BaseModel
RevolutTeamMember ¶
Bases: BaseModel
created_at
instance-attribute
¶
The date and time the team member was created in ISO 8601 ⧉ format.
role_id
instance-attribute
¶
The ID of the team member's role ⧉. This can be a UUID or other default role such as Owner.
updated_at
instance-attribute
¶
The date and time the team member was last updated in ISO 8601 ⧉ format.
RevolutTeamMemberState ¶
Bases: StrEnum
RevolutTransaction ¶
Bases: BaseModel
completed_at
class-attribute
instance-attribute
¶
The date and time the transaction was completed in ISO 8601 ⧉ format.
This is required when the transaction state is completed.
created_at
instance-attribute
¶
The date and time the transaction was created in ISO 8601 ⧉ format.
legs
instance-attribute
¶
The legs of the transaction: - For transactions between your Revolut accounts, there can be 2 legs, for example, an internal transfer made out of the GBP account and into the EUR account. - For transactions in other cases, there is only 1 leg.
reason_code
class-attribute
instance-attribute
¶
The reason code when the transaction state is declined or failed.
related_transaction_id
class-attribute
instance-attribute
¶
The ID of the original transaction to which this transaction is related. Returned, for example, when this transaction is a refund of the related transaction, or for transactions related to cashback.
request_id
class-attribute
instance-attribute
¶
The request ID that you provided previously.
scheduled_for
class-attribute
instance-attribute
¶
The scheduled date of the payment, if applicable. Provided in ISO 8601 ⧉ format.
updated_at
instance-attribute
¶
The date and time the transaction was last updated in ISO 8601 ⧉ format.
RevolutTransactionCard ¶
Bases: BaseModel
references
class-attribute
instance-attribute
¶
Card references (references ⧉).
Note
These are the references that were assigned to the card at the time the transaction was made. Any update ⧉ to card references does not affect existing transactions.
RevolutTransactionCounterparty ¶
Bases: BaseModel
account_id
class-attribute
instance-attribute
¶
The ID of the counterparty account.
RevolutTransactionCounterpartyAccountType ¶
RevolutTransactionLeg ¶
Bases: BaseModel
account_id
instance-attribute
¶
The ID of the account that the transaction is associated with.
balance
class-attribute
instance-attribute
¶
The total balance of the account that the transaction is associated with.
bill_amount
class-attribute
instance-attribute
¶
The billing amount for cross-currency payments.
RevolutTransactionLimitCurrency ¶
Bases: RootModel[str]
root
instance-attribute
¶
The currency of the spending limit, provided as ISO 4217 ⧉ code in upper case.
RevolutTransactionMerchant ¶
Bases: BaseModel
category_code
class-attribute
instance-attribute
¶
The category code of the merchant.
RevolutTransactionPaymentRequest ¶
Bases: BaseModel
reference
class-attribute
instance-attribute
¶
The reference for the payment. A piece of text or number you provide to help identify what the payment relates to. It can be used, for example, for reconciliation or tracking purposes.
You might include an invoice number, account or transaction ID, or any other reference meaningful to you.
If the provided reference is longer than 140 characters, it will be truncated. Note that some recipient banks might truncate the reference even further.
request_id
instance-attribute
¶
The ID of the transaction, provided by you.
Caution
Always provide a unique request ID for each individual payment. This allows you to safely retry the payment in the event of any network issues; if the payment was successful, a second attempt with the same request ID won't be processed.
RevolutTransactionState ¶
Bases: StrEnum
RevolutTransactionType ¶
Bases: StrEnum
RevolutTransactions ¶
Bases: RootModel[list[RevolutTransaction]]
RevolutTransferReason ¶
Bases: BaseModel
RevolutTransferReasonCode ¶
Bases: RootModel[str]
root
instance-attribute
¶
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 GET /transfer-reasons operation ⧉.
If a transfer reason is not required for the given currency and country, this field is ignored.
RevolutTransferReasons ¶
Bases: RootModel[list[RevolutTransferReason]]
RevolutTransferRequest ¶
Bases: BaseModel
reference
class-attribute
instance-attribute
¶
The reference for the funds transfer.
request_id
instance-attribute
¶
The ID of the request, provided by you. It helps you identify the transaction in your system.
Caution
To ensure that a transfer 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 transfer.
source_account_id
instance-attribute
¶
The ID of the source account that you transfer the funds from.
target_account_id
instance-attribute
¶
The ID of the target account that you transfer the funds to.
RevolutTransferResponse ¶
Bases: BaseModel
completed_at
class-attribute
instance-attribute
¶
The date and time the transaction was completed in ISO 8601 ⧉ format.
created_at
instance-attribute
¶
The date and time the transaction was created in ISO 8601 ⧉ format.
RevolutType ¶
RevolutType4 ¶
RevolutUnit ¶
RevolutUpdateWebhookRequest ¶
Bases: BaseModel
url
class-attribute
instance-attribute
¶
A valid webhook URL to which to send event notifications. The supported protocol is https.
RevolutUrl ¶
Bases: RootModel[AnyUrl]
root
instance-attribute
¶
A valid webhook URL to which to send event notifications. The supported protocol is https.
RevolutValidateAccountNameRequest ¶
RevolutValidateAccountNameRequestAU ¶
Bases: BaseModel
bsb
instance-attribute
¶
The BSB (Bank-State-Branch) number for the counterparty's account. Used to identify the bank and branch in Australia.
company_name
class-attribute
instance-attribute
¶
The name of the business counterparty.
Required when the account type is business (individual_name is not specified).
individual_name
class-attribute
instance-attribute
¶
The name of the individual counterparty, split into first name and last name.
Required when the account type is personal (company_name isn't specified).
RevolutValidateAccountNameRequestEUR ¶
Bases: BaseModel
bic
class-attribute
instance-attribute
¶
The BIC (Bank Identifier Code) for the counterparty's account. Also known as the SWIFT code. It can be provided, for example, when the automatic BIC detection fails and the check is unsuccessful.
company_name
class-attribute
instance-attribute
¶
The name of the business counterparty.
Required when the account type is business (individual_name is not specified).
iban
instance-attribute
¶
The IBAN (International Bank Account Number) for the counterparty's account.
individual_name
class-attribute
instance-attribute
¶
The name of the individual counterparty, split into first name and last name.
Required when the account type is personal (company_name isn't specified).
recipient_country
instance-attribute
¶
The counterparty's bank country, provided as a 2-letter ISO 3166 ⧉ code.
recipient_currency
instance-attribute
¶
The counterparty account’s currency, provided as a 3-letter ISO 4217 ⧉ code.
For VoP, the possible value is EUR.
RevolutValidateAccountNameRequestRO ¶
Bases: BaseModel
bic
class-attribute
instance-attribute
¶
The BIC (Bank Identifier Code) for the counterparty's account. Also known as the SWIFT code. This value is optional. It can be provided, for example, when the automatic BIC detection fails and the check is unsuccessful.
company_name
class-attribute
instance-attribute
¶
The name of the business counterparty.
Required when the account type is business (individual_name is not specified).
ⓘ Note that for RO ⧉, the name you provide helps identify the request, but is not used for the actual check. The API simply returns the partially masked name associated with the IBAN for you to validate. Therefore, the returned name may differ from the one you provide.
iban
instance-attribute
¶
The IBAN (International Bank Account Number) for the counterparty's account.
individual_name
class-attribute
instance-attribute
¶
The name of the individual counterparty, split into first name and last name.
Required when the account type is personal (company_name isn't specified).
ⓘ Note that for RO ⧉, the name you provide helps identify the request, but is not used for the actual check. The API simply returns the partially masked name associated with the IBAN for you to validate. Therefore, the returned name may differ from the one you provide.
recipient_country
instance-attribute
¶
The counterparty's bank country, provided as a 2-letter ISO 3166 ⧉ code.
For RO CoP, the possible value is RO.
recipient_currency
instance-attribute
¶
The counterparty account’s currency, provided as a 3-letter ISO 4217 ⧉ code.
For RO CoP, the possible value is RON.
RevolutValidateAccountNameRequestUK ¶
Bases: BaseModel
company_name
class-attribute
instance-attribute
¶
The name of the business counterparty.
Required when the account type is business (individual_name is not specified).
individual_name
class-attribute
instance-attribute
¶
The name of the individual counterparty, split into first name and last name.
Required when the account type is personal (company_name isn't specified).
RevolutValidateAccountNameResponse ¶
RevolutValidateAccountNameResponseAU ¶
Bases: BaseModel
company_name
class-attribute
instance-attribute
¶
The name of the recipient when the account type is business.
Provided only if individual_name is not specified.
When the name is a close match, the actual full name is returned. Otherwise, the name you provided is returned.
Mismatched name type is corrected
The mismatched name type in the request is corrected in the response.
This means that, for example, if an individual recipient's name was provided under company_name, in the response it is returned under individual_name.
individual_name
class-attribute
instance-attribute
¶
The name of the recipient when the account type is personal.
Provided only if company_name is not specified.
When the name is a close match, the actual first and last names are returned. Otherwise, the name you provided is returned.
Mismatched name type is corrected
The mismatched name type in the request is corrected in the response.
This means that, for example, if an individual recipient's name was provided under company_name, in the response it is returned under individual_name.
result_code
instance-attribute
¶
The result of the check.
Possible values for AU:
- matched: The name matches the provided details.
For personal accounts, this also covers close matches, in which case the actual name is returned.
- close_match (business account): The name is similar to the provided value.
- not_matched: The name doesn'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.
RevolutValidateAccountNameResponseEUR ¶
Bases: BaseModel
company_name
class-attribute
instance-attribute
¶
The name of the recipient when the account type is business.
Provided only if individual_name is not specified.
When the name is a close match, the actual name is returned. Otherwise, the name you provided is returned.
Mismatched name type is not corrected
The name type in the response is returned as it was provided in the request.
For example, if an individual recipient's name was provided under company_name, in the response it's still returned under company_name (instead of individual_name).
individual_name
class-attribute
instance-attribute
¶
The name of the recipient when the account type is personal.
Provided only if company_name is not specified.
When the name is a close match, the actual name is returned. Otherwise, the name you provided is returned.
Mismatched name type is not corrected
The name type in the response is returned as it was provided in the request.
For example, if an individual recipient's name was provided under company_name, in the response it's still returned under company_name (instead of individual_name).
result_code
instance-attribute
¶
The result of the check.
Possible values for EUR:
- matched: The name matches the provided details.
- close_match: The recipient's name is similar to the provided value.
The actual name is returned.
- not_matched: The name and account type don't match the provided values.
The name provided in the request is returned.
- cannot_be_checked: The check cannot be performed and retries won't help.
For example, the recipient's bank doesn't support VoP.
- 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.
RevolutValidateAccountNameResponseRO ¶
Bases: BaseModel
company_name
class-attribute
instance-attribute
¶
The partially masked name of the recipient when the account type is business.
Provided only if individual_name is not specified.
Name considerations
- The name you provide helps identify the request, but is not used for the actual check. The API simply returns the partial name associated with the IBAN for you to validate. Therefore, the returned name may differ from the one you provided.
- Mismatched name type is not corrected.
This means that the name type in the response is returned as it was provided in the request.
For example, if an individual recipient's name was provided under
company_name, in the response it's still returned undercompany_name(instead ofindividual_name).
individual_name
class-attribute
instance-attribute
¶
The partial name of the recipient when the account type is personal, that is, the first name and the last name's initial.
Provided only if company_name is not specified.
Name considerations
- The name you provide helps identify the request, but is not used for the actual check. The API simply returns the partial name associated with the IBAN for you to validate. Therefore, the returned name may differ from the one you provided.
- Mismatched name type is not corrected.
This means that the name type in the response is returned as it was provided in the request.
For example, if an individual recipient's name was provided under
company_name, in the response it's still returned undercompany_name(instead ofindividual_name).
result_code
instance-attribute
¶
The result of the check.
For RO CoP, the API checks if an account exists for the provided IBAN.
Possible results are:
- matched: An account with the provided IBAN was found.
When this status is returned, the API also returns a partial name of the account holder.
Use this returned name to validate your recipient's details.
- 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.
RevolutValidateAccountNameResponseUK ¶
Bases: BaseModel
company_name
class-attribute
instance-attribute
¶
The name of the recipient when the account type is business.
Provided only if individual_name is not specified.
When the name is a close match, the actual full name is returned, otherwise, the name you provided is returned.
individual_name
class-attribute
instance-attribute
¶
The name of the recipient when the account type is personal.
Provided only if company_name is not specified.
When the name is a close match, the actual first and last names are returned in full.
result_code
instance-attribute
¶
The result of the check.
Possible values for UK:
- matched: The name and account type match the provided details.
- close_match: The name and/or account type are similar to the provided values:
- The name is a match, but the account type is incorrect.
For example, an individual recipient's name was provided under company_name.
The actual account type is returned.
- The name is similar to the provided values.
Account type is correct.
The actual name is returned.
- The name is similar to the provided values, and the account type is incorrect.
The actual values are returned.
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.
RevolutWebhookEvent ¶
Bases: BaseModel
created_at
instance-attribute
¶
The date and time the event was created in ISO 8601 ⧉ format.
last_sent_date
class-attribute
instance-attribute
¶
The date and time the last attempt at the event delivery occurred in ISO 8601 ⧉ format.
updated_at
instance-attribute
¶
The date and time the event was last updated in ISO 8601 ⧉ format.
webhook_url
instance-attribute
¶
The valid webhook URL that event notifications are sent to. The supported protocol is https.
RevolutWebhookEventType ¶
RevolutWebhookEvents ¶
Bases: RootModel[list[RevolutWebhookEvent]]
RevolutWebhookSigningSecretRotateRequest ¶
Bases: BaseModel
expiration_period
class-attribute
instance-attribute
¶
The expiration period for the signing secret in ISO 8601 format ⧉. If set, when you rotate the secret, it continues to be valid until the expiration period has passed. Otherwise, on rotation, the secret is invalidated immediately. The maximum value is 7 days.
RevolutWebhookV1 ¶
RevolutWebhookV2 ¶
Bases: BaseModel
url
instance-attribute
¶
The valid webhook URL that event notifications are sent to. The supported protocol is https.
RevolutWebhookV2Basic ¶
Bases: BaseModel
url
instance-attribute
¶
The valid webhook URL that event notifications are sent to. The supported protocol is https.
RevolutWebhooks ¶
Bases: RootModel[list[RevolutWebhookV2Basic]]
fix_openapi_spec ¶
Fix invalid OpenAPI spec issues for datamodel-codegen compatibility.
Fixes:
- Removes invalid minimum/maximum constraints from string-typed fields
(these constraints are only valid for numeric types in JSON Schema)
- Fixes invalid discriminator definitions that lack propertyName and oneOf
- Converts ::: admonition syntax to MkDocs Material !!! syntax
Usage
python fix_openapi_spec.py input.yaml > output.yaml python fix_openapi_spec.py input.yaml | datamodel-codegen --input-file-type openapi ...
convert_admonitions ¶
Convert ::: admonition syntax to MkDocs Material !!! syntax.
Handles: - :::note ... ::: -> !!! note\n ... - ::::::note ... :::::: (nested containers) -> flattened !!! note - Nested admonitions are flattened to the same level
Source code in shared/services/payment_providers/revolut/openapi/fix_openapi_spec.py
fix_invalid_discriminator ¶
Fix invalid discriminator definitions.
OpenAPI 3.0 discriminators must have a propertyName and be used with oneOf/anyOf. If we find a discriminator with only mapping (no propertyName), convert it to oneOf.
Source code in shared/services/payment_providers/revolut/openapi/fix_openapi_spec.py
fix_openapi_spec ¶
fix_schema_object ¶
Recursively fix schema objects by removing invalid constraints.
Removes minimum/maximum from string-typed fields since these
constraints are only valid for numeric types in JSON Schema.
Source code in shared/services/payment_providers/revolut/openapi/fix_openapi_spec.py
fix_string_values ¶
Recursively fix string values in the spec.
Converts ::: admonition syntax to MkDocs Material !!! syntax in description fields.
Source code in shared/services/payment_providers/revolut/openapi/fix_openapi_spec.py
is_numeric ¶
main ¶
Source code in shared/services/payment_providers/revolut/openapi/fix_openapi_spec.py
shared.services.payment_providers.revolut.revolut_business_api_client ¶
ConfiguredResponse
module-attribute
¶
RevolutAuth ¶
Bases: AuthBase
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
RevolutBusinessApiClient ¶
This class wraps the Revolut Business API and provides a single point of entry for all Revolut Business API calls.
It also provides better typing over the raw API using the OpenAPI generated models, which rely on Pydantic for validation.
Implements the following Nullable patterns: - Nullables: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#nullables ⧉ - Parameterless instantiation: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#instantiation ⧉ - Thin wrapper: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#thin-wrapper ⧉ - Embedded stub: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#embedded-stub ⧉
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
RealApi ¶
Bases: RevolutBusinessApiProtocol
API client that calls the real API.
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
add_counterparty ¶
https://developer.revolut.com/docs/business/add-counterparty ⧉
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
create_payment ¶
https://developer.revolut.com/docs/business/create-payment ⧉
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
get_transaction ¶
https://developer.revolut.com/docs/business/get-transaction ⧉
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
get_transactions ¶
https://developer.revolut.com/docs/business/get-transactions ⧉
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
rotate_access_token ¶
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
StubbedApi ¶
Bases: RevolutBusinessApiProtocol
Embedded stub for Revolut Business API, replicates the same interface as the Revolut Business API.
Can be configured with test data for get_transaction.
https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#embedded-stub ⧉
Implements the following Nullable patterns: - Output tracking: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#output-tracking ⧉ - Configurable responses: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#configurable-responses ⧉
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
add_counterparty ¶
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
create_payment ¶
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
get_transaction ¶
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
get_transactions ¶
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
rotate_access_token ¶
add_counterparty ¶
add_counterparty(
*,
company_name=None,
first_name=None,
last_name=None,
iban,
bic,
bank_country=None,
address
)
Create a new counterparty in Revolut.
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
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 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
add_counterparty_legacy ¶
add_counterparty_legacy(
*,
company_name=None,
first_name=None,
last_name=None,
iban,
bic,
bank_country=None,
address
)
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
create
classmethod
¶
Normal factory
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
create_null
classmethod
¶
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
create_payment ¶
create_payment(
*,
request_id,
account_id,
receiver_counterparty_id,
receiver_account_id,
amount,
reference=None
)
Trigger a payment using Revolut.
The payment will be sent to the recipient described by receiver_counterparty_id.
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
get_supported_currency ¶
get_transaction ¶
Get transactions from Revolut.
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
get_transactions ¶
Get transactions from Revolut.
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
parse_transfer_type
staticmethod
¶
Source code in shared/services/payment_providers/revolut/revolut_business_api_client.py
RevolutBusinessApiProtocol ¶
TrackedRequest
module-attribute
¶
shared.services.payment_providers.revolut.revolut_webhooks ¶
Decorator for validating Revolut webhook signatures.
Revolut webhooks are signed using HMAC-SHA256. The signature is computed as: 1. Concatenate: version.timestamp.raw_payload 2. Compute HMAC-SHA256 of this string using the signing secret 3. Compare with signature from Revolut-Signature header
See: https://developer.revolut.com/docs/guides/manage-accounts/webhooks/verify-the-payload-signature ⧉
RevolutWebhooks ¶
Decorator for incoming Revolut webhooks.
Validates webhook signatures to ensure requests are authentic.
Usage:
@app.route("/my_revolut_webhook", methods=["POST"])
@RevolutWebhooks.webhook_handler()
def revolut_webhook_controller():
...
is_signature_valid
staticmethod
¶
Validate Revolut webhook signature using HMAC-SHA256.
The signature is computed as follows: 1. payload_to_sign = v1.{timestamp}.{raw_payload} 2. hmac_signature = HMAC-SHA256(signing_secret, payload_to_sign) 3. expected_signature = v1={hmac_signature}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signing_secret
|
str
|
The webhook signing secret from Revolut |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if signature is valid, False otherwise |
Source code in shared/services/payment_providers/revolut/revolut_webhooks.py
webhook_handler
staticmethod
¶
Handle Revolut webhook requests and validate their signature.
The business account name is extracted from the query parameter to fetch the appropriate signing secret for that account.
Returns:
| Type | Description |
|---|---|
callable
|
Decorated function that validates webhook signatures |