GoCardlessClient.Resources.BankAuthorisations (GoCardlessClient v2.0.0)

Copy Markdown View Source

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

create(client, params, opts \\ [])

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)

get(client, id, opts \\ [])

Retrieves a Bank Authorisation by ID. Poll this to detect status changes.