GoCardlessClient.Resources.BillingRequests (GoCardlessClient v2.0.0)

Copy Markdown View Source

GoCardlessClient Billing Requests API.

Billing Requests power Open Banking (Pay by Bank) and Variable Recurring Payments. They can collect a one-off payment, set up a mandate, or both simultaneously.

Example — instant bank payment

{:ok, br} = GoCardlessClient.Resources.BillingRequests.create(client, %{
  payment_request: %{amount: 5000, currency: "GBP", description: "Order #1234"}
})

Example — mandate + instant first payment

{:ok, br} = GoCardlessClient.Resources.BillingRequests.create(client, %{
  payment_request: %{amount: 10000, currency: "GBP"},
  mandate_request: %{currency: "GBP", scheme: "bacs"}
})

Summary

Functions

Cancels a Billing Request before it is fulfilled.

Changes the currency of a Billing Request.

Eagerly collects all Billing Requests into a list.

Collects bank account details for a Billing Request (server-side flow).

Collects customer details for a Billing Request (server-side flow).

Confirms the payer details for a Billing Request.

Creates a Billing Request. Accepts :payment_request, :mandate_request, or both.

Triggers the fallback flow for a Billing Request.

Fulfils a Billing Request, creating the payment and/or mandate.

Retrieves a single Billing Request by ID.

Returns a page of Billing Requests with optional filters.

Sends a notification to the customer for a Billing Request.

Selects the institution (bank) for Open Banking authorisation.

Returns a lazy Stream over all pages of Billing Requests.

Updates a Billing Request's metadata.

Functions

cancel(client, id, params \\ %{}, opts \\ [])

Cancels a Billing Request before it is fulfilled.

change_currency(client, id, params \\ %{}, opts \\ [])

@spec change_currency(GoCardlessClient.Client.t(), String.t(), map(), keyword()) ::
  {:ok, map()}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Changes the currency of a Billing Request.

collect_all(client, params \\ %{}, opts \\ [])

@spec collect_all(GoCardlessClient.Client.t(), map(), keyword()) ::
  {:ok, [map()]}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Eagerly collects all Billing Requests into a list.

collect_bank_account(client, id, params \\ %{}, opts \\ [])

@spec collect_bank_account(GoCardlessClient.Client.t(), String.t(), map(), keyword()) ::
  {:ok, map()}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Collects bank account details for a Billing Request (server-side flow).

collect_customer_details(client, id, params \\ %{}, opts \\ [])

@spec collect_customer_details(
  GoCardlessClient.Client.t(),
  String.t(),
  map(),
  keyword()
) ::
  {:ok, map()}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Collects customer details for a Billing Request (server-side flow).

confirm_payer_details(client, id, params \\ %{}, opts \\ [])

@spec confirm_payer_details(GoCardlessClient.Client.t(), String.t(), map(), keyword()) ::
  {:ok, map()}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Confirms the payer details for a Billing Request.

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

Creates a Billing Request. Accepts :payment_request, :mandate_request, or both.

fallback(client, id, params \\ %{}, opts \\ [])

@spec fallback(GoCardlessClient.Client.t(), String.t(), map(), keyword()) ::
  {:ok, map()}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Triggers the fallback flow for a Billing Request.

fulfil(client, id, params \\ %{}, opts \\ [])

Fulfils a Billing Request, creating the payment and/or mandate.

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

Retrieves a single Billing Request by ID.

list(client, params \\ %{}, opts \\ [])

@spec list(GoCardlessClient.Client.t(), map(), keyword()) ::
  {:ok, %{items: [map()], meta: map()}}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Returns a page of Billing Requests with optional filters.

notify(client, id, params \\ %{}, opts \\ [])

Sends a notification to the customer for a Billing Request.

select_institution(client, id, params \\ %{}, opts \\ [])

@spec select_institution(GoCardlessClient.Client.t(), String.t(), map(), keyword()) ::
  {:ok, map()}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Selects the institution (bank) for Open Banking authorisation.

stream(client, params \\ %{}, opts \\ [])

@spec stream(GoCardlessClient.Client.t(), map(), keyword()) :: Enumerable.t()

Returns a lazy Stream over all pages of Billing Requests.

update(client, id, params, opts \\ [])

Updates a Billing Request's metadata.