GoCardlessClient.Resources.Exports (GoCardlessClient v2.0.0)

Copy Markdown View Source

GoCardless Exports API.

Pre-generated data exports (CSV format) triggered from the GoCardless Dashboard. Poll or use webhooks to detect when an export is ready, then download via download_url.

Export statuses

  • initialising — export is being queued
  • queued — waiting to be processed
  • processing — being generated
  • ready — available for download at download_url
  • failed — generation failed

Example

{:ok, export} = GoCardlessClient.Resources.Exports.get(client, "EX123")
if export["status"] == "ready" do
  # download from export["download_url"]
end

Summary

Functions

Eagerly collects all exports into a list.

Retrieves a single export by ID.

Returns a page of exports.

Returns a lazy Stream over all pages of exports.

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

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

Retrieves a single export 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 exports.

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

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

Returns a lazy Stream over all pages of exports.