ClearBank.MultiCurrency.Payments (ClearBank v1.0.0)

Copy Markdown View Source

Multi-currency international payment sending.

Supports single and bulk high-value international payments via SWIFT and local clearing schemes, depending on currency and destination.

Examples

# Single international payment
{:ok, result} = ClearBank.MultiCurrency.Payments.send(client, %{
  account_id: "mccy-acct-uuid",
  amount: "1000.00",
  currency: "EUR",
  creditor_name: "ACME GmbH",
  creditor_iban: "DE89370400440532013000",
  creditor_bic: "COBADEFFXXX",
  remittance_information: "Invoice EUR-001"
})

# Cancel a full batch
{:ok, _} = ClearBank.MultiCurrency.Payments.cancel_batch(client, "batch-uuid")

# Cancel a single payment in a batch
{:ok, _} = ClearBank.MultiCurrency.Payments.cancel_payment(client, "batch-uuid", "e2e-id")

Summary

Functions

Cancels all payments in a batch by batch ID.

Cancels a single payment within a batch by end-to-end ID.

Funds a multi-currency account (simulation only).

Sends a single international payment.

Sends multiple international payments in a single batch.

Functions

cancel_batch(client, batch_id)

@spec cancel_batch(ClearBank.Client.t(), String.t()) :: ClearBank.HTTP.result()

Cancels all payments in a batch by batch ID.

cancel_payment(client, batch_id, end_to_end_id)

@spec cancel_payment(ClearBank.Client.t(), String.t(), String.t()) ::
  ClearBank.HTTP.result()

Cancels a single payment within a batch by end-to-end ID.

fund_account_sim(client, account_unique_id, params)

@spec fund_account_sim(ClearBank.Client.t(), String.t(), map()) ::
  ClearBank.HTTP.result()

Funds a multi-currency account (simulation only).

This endpoint is only available in the simulation environment to inject test funds into an account.

send(client, params)

Sends a single international payment.

Required params

  • :account_id - source multi-currency account UUID
  • :amount - decimal string
  • :currency - ISO 4217 code
  • :creditor_name - beneficiary name
  • :creditor_iban - beneficiary IBAN (or :creditor_account_number + :creditor_sort_code for UK)
  • :creditor_bic - beneficiary BIC/SWIFT

Optional params

  • :end_to_end_id - end-to-end reference
  • :remittance_information - payment narrative
  • :creditor_address - map with :street_name, :town_name, :country

send_bulk(client, payments)

@spec send_bulk(ClearBank.Client.t(), [map()]) :: ClearBank.HTTP.result()

Sends multiple international payments in a single batch.

Params

  • payments - list of payment maps (same fields as send/2)