GoCardless Bank Authorisations API.
Bank Authorisations are created during Open Banking flows. When a customer needs to authorise via their bank (Instant Bank Payment or Verified Mandate), a Bank Authorisation is created and the customer is redirected to their bank.
Example
{:ok, auth} = GoCardlessClient.Resources.BankAuthorisations.create(client, %{
authorisation_type: "payment",
links: %{billing_request: "BRQ123"}
})
# Redirect customer to auth["authorisation_url"]
# Then poll or use webhooks to detect completion:
{:ok, updated} = GoCardlessClient.Resources.BankAuthorisations.get(client, auth["id"])
IO.inspect(updated["status"]) # "authorised", "denied", "expired", etc.
Summary
Functions
Creates a Bank Authorisation for a Billing Request.
Retrieves a Bank Authorisation by ID. Poll this to detect status changes.
Functions
@spec create(GoCardlessClient.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Creates a Bank Authorisation for a Billing Request.
Params
:authorisation_type—"mandate"or"payment"(required):redirect_uri— where to redirect after bank auth (optional)links.billing_request— Billing Request ID (required)
@spec get(GoCardlessClient.Client.t(), String.t(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Retrieves a Bank Authorisation by ID. Poll this to detect status changes.