GoCardlessClient.Resources.MandateImportEntries (GoCardlessClient v2.0.0)

Copy Markdown View Source

GoCardless Mandate Import Entries API.

Individual mandate records within a Mandate Import batch. Add entries before submitting the import.

Example

{:ok, _entry} = GoCardlessClient.Resources.MandateImportEntries.add(client, %{
  record_identifier: "CUST-001",
  amendment: %{
    original_creditor_id: "OLD-CR-001",
    original_creditor_name: "Old Provider Ltd",
    original_mandate_reference: "OLD-REF-001"
  },
  customer: %{
    given_name: "Alice",
    family_name: "Smith",
    email: "alice@example.com",
    address_line1: "1 Example St",
    city: "London",
    postal_code: "EC1A 1BB",
    country_code: "GB"
  },
  bank_account: %{
    account_holder_name: "Alice Smith",
    sort_code: "200000",
    account_number: "55779911"
  },
  links: %{mandate_import: "IM123"}
})

Summary

Functions

Adds a mandate entry to a mandate import batch.

Eagerly collects all entries into a list.

Lists all mandate import entries for a given import. Filter by :mandate_import (required).

Returns a lazy Stream over all entries for a given import.

Functions

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

Adds a mandate entry to a mandate import batch.

Params

  • :record_identifier — your internal reference for this entry (required)
  • :amendment — contains original_creditor_id, original_creditor_name, original_mandate_reference (required)
  • :customer — customer details map (required)
  • :bank_account — bank account details map (required)
  • links.mandate_import — Mandate Import ID (required)

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

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

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

Lists all mandate import entries for a given import. Filter by :mandate_import (required).

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

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

Returns a lazy Stream over all entries for a given import.