Solaris.Banking.SEPA (Solaris v1.0.0)

Copy Markdown View Source

SEPA payment operations: Credit Transfers (SCT), Instant Credit Transfers, and Direct Debits (SDD).

SEPA Credit Transfer (SCT)

Standard EU credit transfers; typically settle next business day.

Instant SCT

Real-time transfers (within seconds). Requires:

  1. Checking recipient bank reachability first
  2. 2FA / change request authorization
  3. Webhook INSTANT_SEPA_CREDIT_TRANSFER_FAILED for failures

SEPA Direct Debit (SDD)

Pull payments from customer accounts. Requires:

  • A signed mandate from the customer
  • Mandate must be active before first SDD

Amounts

All amounts are in cents (smallest currency unit). EUR 10.00 = 1000.

Summary

Functions

Checks if a recipient bank is reachable for Instant SEPA.

Creates a SEPA Credit Transfer for a business account.

Creates a SEPA Direct Debit from a business account.

Creates a SEPA Direct Debit mandate for a business.

Creates an Instant SEPA Credit Transfer for a business.

Creates an Instant SEPA Credit Transfer for a person.

Creates an Instant SCT to a reference account.

Creates a SEPA Credit Transfer for a person's account.

Creates a SEPA Direct Debit from a person's account.

Creates a SEPA Direct Debit mandate for a person.

Lists SEPA credit transfers for a business account.

Lists mandates for a business account.

Lists SEPA credit transfers for a person's account.

Lists mandates for a person's account.

Signs a mandate, activating it for SDD use.

Functions

check_instant_reachability(iban, opts \\ [])

@spec check_instant_reachability(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Solaris.Error.t()}

Checks if a recipient bank is reachable for Instant SEPA.

Must be called before initiating an Instant SCT.

Examples

{:ok, result} = Solaris.Banking.SEPA.check_instant_reachability("DE89370400440532013000")
if result["reachable"], do: proceed_with_instant_transfer()

create_business_credit_transfer(business_id, account_id, attrs, opts \\ [])

@spec create_business_credit_transfer(String.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Creates a SEPA Credit Transfer for a business account.

Examples

{:ok, transfer} = Solaris.Banking.SEPA.create_business_credit_transfer(
  "cbac_123",
  "cacc_456",
  %{
    recipient_iban: "DE89370400440532013000",
    recipient_name: "Vendor GmbH",
    amount: 250_000,
    currency: "EUR",
    reference: "PO-2024-001"
  }
)

create_business_direct_debit(business_id, account_id, attrs, opts \\ [])

@spec create_business_direct_debit(String.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Creates a SEPA Direct Debit from a business account.

create_business_mandate(business_id, account_id, attrs, opts \\ [])

@spec create_business_mandate(String.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Creates a SEPA Direct Debit mandate for a business.

create_instant_business_transfer(business_id, account_id, attrs, opts \\ [])

@spec create_instant_business_transfer(String.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Creates an Instant SEPA Credit Transfer for a business.

create_instant_person_transfer(person_id, account_id, attrs, opts \\ [])

@spec create_instant_person_transfer(String.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Creates an Instant SEPA Credit Transfer for a person.

Requires 2FA/change request. Monitor INSTANT_SEPA_CREDIT_TRANSFER_FAILED webhook for failures.

Examples

{:ok, transfer} = Solaris.Banking.SEPA.create_instant_person_transfer(
  "cper_123",
  "cacc_456",
  %{
    recipient_iban: "DE89370400440532013000",
    recipient_name: "Max Mustermann",
    amount: 5_000,
    currency: "EUR",
    reference: "Fast payment"
  }
)

create_instant_reference_account_transfer(account_id, attrs, opts \\ [])

@spec create_instant_reference_account_transfer(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Creates an Instant SCT to a reference account.

create_person_credit_transfer(person_id, account_id, attrs, opts \\ [])

@spec create_person_credit_transfer(String.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Creates a SEPA Credit Transfer for a person's account.

Triggers a change request (SCA) — returns 202 with change_request_id if not using a trusted IBAN.

Examples

{:ok, transfer} = Solaris.Banking.SEPA.create_person_credit_transfer(
  "cper_123",
  "cacc_456",
  %{
    recipient_iban: "DE89370400440532013000",
    recipient_name: "Max Mustermann",
    amount: 10_000,
    currency: "EUR",
    reference: "Invoice #123",
    end_to_end_id: "E2E-REF-123"
  }
)

create_person_direct_debit(person_id, account_id, attrs, opts \\ [])

@spec create_person_direct_debit(String.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Creates a SEPA Direct Debit from a person's account.

create_person_mandate(person_id, account_id, attrs, opts \\ [])

@spec create_person_mandate(String.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Creates a SEPA Direct Debit mandate for a person.

The mandate must be signed before the first SDD can be initiated.

Examples

{:ok, mandate} = Solaris.Banking.SEPA.create_person_mandate(
  "cper_123",
  "cacc_456",
  %{
    creditor_iban: "DE89370400440532013000",
    creditor_name: "Creditor GmbH",
    mandate_reference: "MREF-001",
    creditor_identifier: "DE98ZZZ09999999999"
  }
)

get_person_mandate(person_id, account_id, mandate_id, opts \\ [])

@spec get_person_mandate(String.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Retrieves a specific mandate.

list_business_credit_transfers(business_id, account_id, opts \\ [])

@spec list_business_credit_transfers(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Lists SEPA credit transfers for a business account.

list_business_mandates(business_id, account_id, opts \\ [])

@spec list_business_mandates(String.t(), String.t(), keyword()) ::
  {:ok, [map()]} | {:error, Solaris.Error.t()}

Lists mandates for a business account.

list_person_credit_transfers(person_id, account_id, opts \\ [])

@spec list_person_credit_transfers(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Lists SEPA credit transfers for a person's account.

list_person_mandates(person_id, account_id, opts \\ [])

@spec list_person_mandates(String.t(), String.t(), keyword()) ::
  {:ok, [map()]} | {:error, Solaris.Error.t()}

Lists mandates for a person's account.

sign_person_mandate(person_id, account_id, mandate_id, opts \\ [])

@spec sign_person_mandate(String.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Solaris.Error.t()}

Signs a mandate, activating it for SDD use.