GoCardlessClient.Resources.PayoutItems (GoCardlessClient v2.0.0)

Copy Markdown View Source

GoCardless Payout Items API.

Line items within a payout — shows exactly what contributed to or was deducted from a payout amount. Use this for detailed payout reconciliation.

Item types

TypeDescription
payment_paid_outA payment that cleared
payment_failedA previously included payment that failed
payment_charged_backA chargeback
payment_refundedA refund issued to a customer
refund_funds_returnedRefund returned to GoCardless
gocardless_feeGoCardless transaction fee
app_feePartner app fee
app_fee_refundRefund of app fee
revenue_shareRevenue share for partners
surcharge_feeSurcharge for a failed payment
fxFX conversion fee/gain
taxTax on GoCardless fees

Note: Payout items for payouts older than 6 months are archived. Contact GoCardless support to access historical items.

Example

{:ok, %{items: line_items}} = GoCardlessClient.Resources.PayoutItems.list(
  client,
  %{payout: "PO123"}
)

total_payments = line_items
  |> Enum.filter(&(&1["type"] == "payment_paid_out"))
  |> Enum.sum_by(&(&1["amount"]["amount"]))

Summary

Functions

Eagerly collects all payout items into a list.

Returns all line items for a specific payout.

Returns a lazy Stream over all payout items for a payout.

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 payout items 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()}

Returns all line items for a specific payout.

The :payout filter (payout ID) is required.

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

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

Returns a lazy Stream over all payout items for a payout.