GoCardlessClient Mandates API.
A Mandate is a Direct Debit agreement between a customer and a creditor, authorising the creditor to collect payments.
Example
{:ok, mandate} = GoCardlessClient.Resources.Mandates.create(client, %{
scheme: "bacs",
metadata: %{"contract_id" => "C-001"},
links: %{customer_bank_account: "BA123"}
})
Summary
Functions
Cancels a mandate. All future payments against it will also be cancelled.
Eagerly collects all mandates into a list.
Creates a mandate against a customer bank account.
Retrieves a single mandate by ID.
Returns a page of mandates with optional filters (:status, :customer, :created_at[gte], etc.).
Reinstates a cancelled or failed mandate. Not available for all mandate statuses.
Returns a lazy Stream over all pages of mandates.
Updates a mandate's metadata. Only :metadata can be changed.
Functions
@spec cancel(GoCardlessClient.Client.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Cancels a mandate. All future payments against it will also be cancelled.
@spec collect_all(GoCardlessClient.Client.t(), map(), keyword()) :: {:ok, [map()]} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Eagerly collects all mandates into a list.
@spec create(GoCardlessClient.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Creates a mandate against a customer bank account.
@spec get(GoCardlessClient.Client.t(), String.t(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Retrieves a single mandate by ID.
@spec list(GoCardlessClient.Client.t(), map(), keyword()) :: {:ok, %{items: [map()], meta: map()}} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Returns a page of mandates with optional filters (:status, :customer, :created_at[gte], etc.).
@spec reinstate(GoCardlessClient.Client.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Reinstates a cancelled or failed mandate. Not available for all mandate statuses.
@spec stream(GoCardlessClient.Client.t(), map(), keyword()) :: Enumerable.t()
Returns a lazy Stream over all pages of mandates.
@spec update(GoCardlessClient.Client.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Updates a mandate's metadata. Only :metadata can be changed.