Skip to content

The operation surface is built around gln_backend_t and gln_backend_result_t. Backend operation calls produce one caller-owned result envelope, and every typed list, row, string, error view, and interrupt view derived from that envelope is borrowed from it.

Call Contract

Operation functions such as gln_retrieve_accounts and gln_submit_transfer return gln_status_t to report whether an envelope was produced.

Function returnout_resultCaller action
GLN_OKNon-null envelopeInspect gln_get_backend_result_status, gln_get_backend_result_outcome, and gln_get_backend_result_kind.
non-GLN_OKNo envelopeTreat the return as an argument/allocation level failure for the call itself.

When an envelope exists, the envelope is the source of truth for the operation result:

Envelope accessorMeaning
gln_get_backend_result_statusProvider/domain status represented as gln_status_t.
gln_get_backend_result_outcomeCoarse outcome: success, action required, rejected, or error.
gln_get_backend_result_kindTyped payload kind.
gln_get_backend_result_errorBorrowed structured error when the outcome is rejected or error.
gln_get_backend_result_interrupt_infoBorrowed interrupt information when action is required.
gln_take_backend_result_continuationTransfers the continuation handle out of the envelope.

Destroy every produced envelope with gln_destroy_backend_result.

For action-required envelopes, gln_get_backend_result_status identifies the specific pending action: GLN_ERR_TAN_REQUIRED, GLN_ERR_DECOUPLED_PENDING, or GLN_ERR_VOP_CONFIRMATION_REQUIRED. gln_get_backend_result_kind is GLN_BACKEND_RESULT_KIND_UNKNOWN until the operation is resumed and returns a success payload.

Result Kinds and Accessors

Result kindAccessorHandle
GLN_BACKEND_RESULT_KIND_OPAQUE_JSONgln_get_backend_result_opaque_jsonconst char*
GLN_BACKEND_RESULT_KIND_ACCOUNTSgln_get_backend_result_accountsconst gln_accounts_t*
GLN_BACKEND_RESULT_KIND_BALANCESgln_get_backend_result_balancesconst gln_balances_t*
GLN_BACKEND_RESULT_KIND_TRANSACTIONSgln_get_backend_result_transactionsconst gln_transactions_t*
GLN_BACKEND_RESULT_KIND_TAN_MODESgln_get_backend_result_tan_modesconst gln_tan_modes_t*
GLN_BACKEND_RESULT_KIND_TAN_MODE_SELECTIONgln_get_backend_result_tan_mode_selectionconst gln_tan_mode_selection_t*
GLN_BACKEND_RESULT_KIND_TAN_MEDIAgln_get_backend_result_tan_mediaconst gln_tan_media_t*
GLN_BACKEND_RESULT_KIND_HOLDINGSgln_get_backend_result_holdingsconst gln_holdings_t*
GLN_BACKEND_RESULT_KIND_STANDING_ORDERSgln_get_backend_result_standing_ordersconst gln_standing_orders_t*
GLN_BACKEND_RESULT_KIND_STANDING_ORDER_SUBMISSIONgln_get_backend_result_standing_order_submissionconst gln_standing_order_submission_t*
GLN_BACKEND_RESULT_KIND_PREPAID_TOPUP_SUBMISSIONgln_get_backend_result_prepaid_topup_submissionconst gln_prepaid_topup_submission_t*
GLN_BACKEND_RESULT_KIND_TRANSFER_SUBMISSIONgln_get_backend_result_transfer_submissionconst gln_transfer_submission_t*
GLN_BACKEND_RESULT_KIND_BATCH_TRANSFER_SUBMISSIONgln_get_backend_result_batch_transfer_submissionconst gln_batch_transfer_submission_t*
GLN_BACKEND_RESULT_KIND_DIRECT_DEBIT_SUBMISSIONgln_get_backend_result_direct_debit_submissionconst gln_direct_debit_submission_t*
GLN_BACKEND_RESULT_KIND_BANK_INFOgln_get_backend_result_bank_infoconst gln_bank_info_t*

Calling a typed get_* accessor on a non-matching kind returns NULL. gln_get_backend_result_opaque_json returns a borrowed string only for GLN_BACKEND_RESULT_KIND_OPAQUE_JSON. Typed success envelopes do not carry an opaque JSON payload; consume them through the matching typed accessor.

Backend Support

gln_check_backend_operation_support answers against the opened backend handle. gln_get_backend_operation_name and gln_parse_backend_operation_name convert between enum values and stable operation names.

Operation nameSupported backends
get_tan_modesFinTS
set_tan_modeFinTS
list_tan_mediaFinTS
list_accountsFinTS, EBICS
list_balancesFinTS, EBICS
list_transactionsFinTS, EBICS
list_holdingsFinTS
list_standing_ordersFinTS
submit_prepaid_topupFinTS
add_standing_orderFinTS
resumeFinTS
submit_transferFinTS, EBICS
submit_instant_transferFinTS
submit_batch_transferFinTS, EBICS
submit_direct_debitFinTS, EBICS
submit_direct_debit_batchFinTS, EBICS
modify_standing_orderFinTS
delete_standing_orderFinTS
infoFinTS

Example: Inspect an Envelope

gln_backend_result_t* result = NULL;
gln_status_t call_status = gln_retrieve_accounts(backend, &result);
if (call_status != GLN_OK) {
    return 1;
}

if (gln_get_backend_result_outcome(result) == GLN_BACKEND_OUTCOME_SUCCESS &&
    gln_get_backend_result_kind(result) == GLN_BACKEND_RESULT_KIND_ACCOUNTS) {
    const gln_accounts_t* accounts = gln_get_backend_result_accounts(result);
    for (size_t i = 0; i < gln_get_accounts_count(accounts); ++i) {
        const gln_account_t* account = gln_get_account_at(accounts, i);
        const char* iban = gln_get_account_iban(account);
        (void)iban;
    }
} else if (gln_get_backend_result_outcome(result) == GLN_BACKEND_OUTCOME_ACTION_REQUIRED) {
    const gln_interrupt_info_t* interrupt = gln_get_backend_result_interrupt_info(result);
    gln_continuation_t* continuation = gln_take_backend_result_continuation(result);
    (void)interrupt;
    gln_destroy_continuation(continuation);
} else {
    const gln_error_t* error = gln_get_backend_result_error(result);
    (void)error;
}

gln_destroy_backend_result(result);

Continuation and Resume Flow

  1. Call an operation and inspect the produced envelope.
  2. If gln_get_backend_result_outcome(result) is GLN_BACKEND_OUTCOME_ACTION_REQUIRED, read gln_get_backend_result_interrupt_info(result).
  3. Take the continuation with gln_take_backend_result_continuation(result).
  4. Save it with gln_save_continuation if the user may leave the process, or destroy the original result envelope if the caller is resuming immediately and has copied any interrupt fields it still needs.
  5. Build gln_continuation_input_t with gln_default_continuation_input.
  6. Call gln_resume_continuation with the backend, continuation, optional interactive secret, input struct, and a fresh gln_backend_result_t**.
  7. Destroy the resumed result envelope and the continuation handle.

gln_take_backend_result_continuation transfers ownership. After it returns, the caller must eventually call gln_destroy_continuation.