Skip to content

The public C ABI exposes Revolut backend opening, token-store ownership, 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:

Exposed Surface

SurfaceFunctions
Token storegln_create_file_revolut_token_store, gln_destroy_revolut_token_store
OAuth setupgln_revolut_oauth_authorize_url, gln_revolut_oauth_exchange_code, gln_revolut_oauth_refresh, gln_revolut_oauth_status, gln_revolut_delete_token
Provider state cleanupgln_revolut_delete_transfer_idempotency_state
Recipientsgln_revolut_list_recipients, gln_revolut_create_recipient, gln_revolut_delete_recipient
Payment draftsgln_revolut_list_payment_drafts, gln_revolut_get_payment_draft, gln_revolut_create_payment_draft, gln_revolut_delete_payment_draft
Backend open/closegln_open_revolut_backend, gln_close_backend
Backend metadatagln_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.client_id = "revolut-client-id";
config.redirect_uri = "https://app.example/oauth/callback";
config.client_assertion_kid = "assertion-key-id";
config.environment_or_null = "sandbox";
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,
    client_assertion_key_pem_secret,
    state_store,
    token_store,
    &backend,
    &error);
InputMeaning
gln_revolut_config_tOAuth client id, redirect URI, assertion key id, environment, optional profile/plugin/diagnostic fields.
gln_secret_t*Client assertion private key PEM.
gln_state_store_t*Durable backend state.
gln_revolut_token_store_t*Token storage handle.

The token store and state store must outlive the backend handle using them.

Token Store

gln_revolut_token_store_t* token_store = NULL;
gln_error_t error = {0};
gln_default_error(&error);
gln_status_t status = gln_create_file_revolut_token_store(
    "revolut-token-store",
    NULL,
    &token_store,
    &error);

Release it with gln_destroy_revolut_token_store after closing every backend that uses it.

OAuth Setup

Revolut OAuth operations use the opened backend and persist token state through the configured token storage. Public result JSON and typed status fields never include access tokens, refresh tokens, client assertions, private-key bytes, 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.