GoCardless Mandate Imports API.
Used to bulk-import mandates migrated from another payment provider.
Workflow
- Create a mandate import:
create/3 - Add individual mandate entries:
GoCardlessClient.Resources.MandateImportEntries.add/3 - Submit the import for processing:
submit/3 - GoCardless processes the import and sends webhooks
You can cancel/3 an import at any time before submission.
Example
{:ok, import} = GoCardlessClient.Resources.MandateImports.create(client, %{
scheme: "bacs"
})
# Add entries...
{:ok, submitted} = GoCardlessClient.Resources.MandateImports.submit(client, import["id"])
Summary
Functions
Cancels a mandate import. Can only be cancelled before submission.
Creates a new mandate import batch.
Retrieves a single mandate import by ID.
Submits a mandate import for processing. All entries must be added before calling this.
Functions
@spec cancel(GoCardlessClient.Client.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Cancels a mandate import. Can only be cancelled before submission.
@spec create(GoCardlessClient.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Creates a new mandate import batch.
Params
:scheme— target scheme e.g."bacs","sepa_core"(required)
@spec get(GoCardlessClient.Client.t(), String.t(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Retrieves a single mandate import by ID.
@spec submit(GoCardlessClient.Client.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Submits a mandate import for processing. All entries must be added before calling this.