GoCardlessClient.Resources.BillingRequestTemplates (GoCardlessClient v2.0.0)

Copy Markdown View Source

GoCardless Billing Request Templates API.

Reusable templates for creating Billing Requests with pre-defined parameters. Useful for recurring setups where the same mandate/payment configuration is used many times (e.g. a SaaS signup flow).

Example

{:ok, template} = GoCardlessClient.Resources.BillingRequestTemplates.create(client, %{
  name: "Standard Monthly DD",
  mandate_request_currency: "GBP",
  mandate_request_scheme: "bacs",
  redirect_uri: "https://myapp.com/complete"
})

# Later, create a billing request from the template

Summary

Functions

Eagerly collects all Billing Request Templates into a list.

Creates a Billing Request Template.

Retrieves a single Billing Request Template by ID.

Returns a page of Billing Request Templates with optional filters.

Returns a lazy Stream over all pages of Billing Request Templates.

Updates a Billing Request Template. All params are optional.

Functions

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 Request Templates into a list.

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

Creates a Billing Request Template.

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

Retrieves a single Billing Request Template 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 Request Templates with optional filters.

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

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

Returns a lazy Stream over all pages of Billing Request Templates.

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

Updates a Billing Request Template. All params are optional.