Revolut
The public C ABI exposes Revolut product credential setup, backend opening, OAuth
setup, provider state cleanup, recipient operations, and payment-draft
operations. Shared account, transaction, and transfer operations remain
capability-probed through gln_check_backend_operation_support.
Provider/API references:
- Revolut Business API documentation
- RFC 7523: JWT Profile for OAuth 2.0 Client Authentication and Authorization Grants
Exposed Surface
| Surface | Functions |
|---|---|
| Product credential setup | gln_revolut_prepare_product_credentials, gln_revolut_finalize_product_credentials |
| OAuth setup | gln_revolut_oauth_authorize_url, gln_revolut_oauth_exchange_code, gln_revolut_oauth_refresh, gln_revolut_oauth_status, gln_revolut_delete_token |
| Provider state cleanup | gln_revolut_delete_transfer_idempotency_state |
| Recipients | gln_revolut_list_recipients, gln_revolut_create_recipient, gln_revolut_delete_recipient |
| Payment drafts | gln_revolut_list_payment_drafts, gln_revolut_get_payment_draft, gln_revolut_create_payment_draft, gln_revolut_delete_payment_draft |
| Backend open/preflight/close | gln_revolut_product_credentials_preflight, gln_open_revolut_backend, gln_close_backend |
| Backend metadata | gln_get_backend_kind, gln_get_backend_provider_name, gln_check_backend_operation_support |
Do not model Revolut as supporting shared account, balance, transaction, or
transfer submission operations unless gln_check_backend_operation_support
reports support for the opened backend. Revolut-specific recipient and
payment-draft entrypoints return typed backend result envelopes and redacted
provider status/error details.
Open a Backend
gln_revolut_config_t config = {0};
gln_default_revolut_config(&config);
config.product_credential_ref_or_null = "revolut/product/default";
config.product_credential_root_or_null = "C:/ProgramData/Galanthus/RevolutProductCredentials";
config.environment_or_null = "sandbox";
config.storage_root_or_null = "C:/ProgramData/Galanthus/Revolut";
config.profile_name_or_null = "company-profile";
gln_backend_t* backend = NULL;
gln_error_t error = {0};
gln_default_error(&error);
gln_status_t status = gln_open_revolut_backend(
&config,
state_store,
&backend,
&error);
| Input | Meaning |
|---|---|
gln_revolut_config_t | Product credential reference/root, environment, storage root, optional profile/plugin/diagnostic fields. |
gln_state_store_t* | Durable backend state. |
The state store must outlive the backend handle using it.
Product Credential Setup
Use gln_revolut_prepare_product_credentials before Revolut has issued a
ClientID. Prepare creates or reuses a CurrentUser CNG-backed non-exportable
signing certificate, validates reused certificate/key security, writes the
prepared profile, exports public certificate material for Revolut registration,
creates the product token root, and returns setup-safe JSON.
Use gln_revolut_finalize_product_credentials after registering the public
certificate and redirect URI with Revolut. Finalize stores the ClientID for the
existing prepared profile and validates profile/SID/ACL/key/token-root
readiness so gln_revolut_product_credentials_preflight and
gln_open_revolut_backend consume the same profile format.
Setup JSON reports public/setup status only: profile reference, environment, redirect URI, public certificate material/paths, certificate reuse, ClientID presence, token-root readiness, and preflight readiness. It does not expose private keys, private PEM, JWT/client assertions, authorization codes, access tokens, refresh tokens, raw token endpoint bodies, raw security descriptors, or the normal UI token-root path.
Token Persistence
Revolut token persistence is owned by Galanthus. storage_root_or_null provides
the product-scoped root used by the resolver-backed implementation.
OAuth Setup
Revolut OAuth operations use the opened backend and persist token state through Galanthus-owned token storage. Public result JSON and typed status fields never include access tokens, refresh tokens, or authorization URLs.
Use gln_revolut_oauth_authorize_url to prepare an authorization URL for a
caller-managed browser flow, gln_revolut_oauth_exchange_code to validate
state and exchange the authorization code, gln_revolut_oauth_refresh to
refresh persisted token state, gln_revolut_oauth_status to inspect redacted
state, and gln_revolut_delete_token to clear persisted token state.
Provider State Cleanup
Use gln_revolut_delete_transfer_idempotency_state to clear the local Revolut
transfer idempotency cache owned by the opened backend profile. This operation
does not remove OAuth token state; use gln_revolut_delete_token for token
cleanup.
Recipients and Payment Drafts
Recipient list/create/delete and payment-draft list/show/create/delete
operations are exposed as Revolut-specific backend operations. Use the matching
gln_get_backend_result_revolut_* projection for successful envelopes and
release the top-level envelope with gln_destroy_backend_result when finished.
Runtime Checks
int can_list_recipients =
gln_check_backend_operation_support(backend, GLN_BACKEND_OPERATION_REVOLUT_LIST_RECIPIENTS);
int can_create_payment_draft =
gln_check_backend_operation_support(backend, GLN_BACKEND_OPERATION_REVOLUT_CREATE_PAYMENT_DRAFT);
int can_submit_shared_transfer =
gln_check_backend_operation_support(backend, GLN_BACKEND_OPERATION_SUBMIT_TRANSFER);
Probe each operation independently before enabling it for an arbitrary backend handle.