Inttegro.Payouts (inttegro v0.2.0)

Copy Markdown View Source

Schedules and manages transfers from an application balance.

Payout creation is asynchronous. The returned payout records its current state but does not by itself prove that the destination received funds. Use lookup and balance transactions for reconciliation, and reuse an idempotency key when retrying the same logical payout.

Summary

Functions

Cancel a payout that is still scheduled for a future execution time. A payout that has started processing, completed, was already canceled, or whose execution time has passed cannot be canceled.

Disables automatic payouts for your application by switching the payout schedule to manual mode. When automatic payouts are disabled, the system will not automatically schedule payouts - you must manually trigger them using the /payouts/schedule endpoint. Balance transactions must still be at least 7 days old before they can be paid out, but the payout will only occur when you explicitly request it.

Re-enable automatic payouts for your application. Inttegro restores the configured automatic payout schedule so eligible balance transactions can be queued without a manual scheduling request.

Retrieve the current state of a payout by ID. Use this to monitor execution, inspect timestamps, review bundled balance transactions, and reconcile the final amount that moved to the destination account.

Retrieve a page of payouts for the authenticated application.

Create and schedule a payout to move funds from your available balance to a connected financial account. The request chooses the destination, caps the maximum amount that may leave your balance, and optionally delays execution until a future timestamp.

Configure which financial account should be used for payouts in each currency. This endpoint accepts a map of currency codes to financial account IDs. Each financial account must be owned by your application, have push operations enabled, and its currency must match the currency key in the destinations map.

Retrieve the current payout settings for your application, including configured payout destinations and schedule information.

Functions

cancel(client, request, options \\ [])

Cancel a payout that is still scheduled for a future execution time. A payout that has started processing, completed, was already canceled, or whose execution time has passed cannot be canceled.

Parameters

Returns

Returns {:ok, Inttegro.Payouts.Payout.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Payouts.CancelRequest.new!(request_attributes)

case Inttegro.Payouts.cancel(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

disable(client, options \\ [])

@spec disable(Inttegro.Client.t(), keyword()) ::
  {:ok, Inttegro.Payouts.SettingsMutation.t()} | {:error, Exception.t()}

Disables automatic payouts for your application by switching the payout schedule to manual mode. When automatic payouts are disabled, the system will not automatically schedule payouts - you must manually trigger them using the /payouts/schedule endpoint. Balance transactions must still be at least 7 days old before they can be paid out, but the payout will only occur when you explicitly request it.

Parameters

  • client — an authenticated Inttegro.Client.
  • options — request options such as :idempotency_key and additional :headers.

Returns

Returns {:ok, Inttegro.Payouts.SettingsMutation.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

Inttegro.Payouts.disable(client)

enable(client, options \\ [])

@spec enable(Inttegro.Client.t(), keyword()) ::
  {:ok, Inttegro.Payouts.SettingsMutation.t()} | {:error, Exception.t()}

Re-enable automatic payouts for your application. Inttegro restores the configured automatic payout schedule so eligible balance transactions can be queued without a manual scheduling request.

Parameters

  • client — an authenticated Inttegro.Client.
  • options — request options such as :idempotency_key and additional :headers.

Returns

Returns {:ok, Inttegro.Payouts.SettingsMutation.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

Inttegro.Payouts.enable(client)

lookup(client, request, options \\ [])

Retrieve the current state of a payout by ID. Use this to monitor execution, inspect timestamps, review bundled balance transactions, and reconcile the final amount that moved to the destination account.

Parameters

Returns

Returns {:ok, Inttegro.Payouts.Payout.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Payouts.LookupRequest.new!(request_attributes)

case Inttegro.Payouts.lookup(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

page(client, request, options \\ [])

Retrieve a page of payouts for the authenticated application.

Parameters

Returns

Returns {:ok, Inttegro.Payouts.Page.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Payouts.PageRequest.new!(request_attributes)

case Inttegro.Payouts.page(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

schedule(client, request, options \\ [])

Create and schedule a payout to move funds from your available balance to a connected financial account. The request chooses the destination, caps the maximum amount that may leave your balance, and optionally delays execution until a future timestamp.

Parameters

Returns

Returns {:ok, Inttegro.Payouts.Payout.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Payouts.ScheduleRequest.new!(request_attributes)

case Inttegro.Payouts.schedule(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

set_destinations(client, request, options \\ [])

Configure which financial account should be used for payouts in each currency. This endpoint accepts a map of currency codes to financial account IDs. Each financial account must be owned by your application, have push operations enabled, and its currency must match the currency key in the destinations map.

Parameters

Returns

Returns {:ok, Inttegro.Payouts.SettingsMutation.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Payouts.SetDestinationsRequest.new!(request_attributes)

case Inttegro.Payouts.set_destinations(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

settings(client, options \\ [])

@spec settings(Inttegro.Client.t(), keyword()) ::
  {:ok, Inttegro.Payouts.SettingsLookup.t()} | {:error, Exception.t()}

Retrieve the current payout settings for your application, including configured payout destinations and schedule information.

Parameters

  • client — an authenticated Inttegro.Client.
  • options — request options such as :idempotency_key and additional :headers.

Returns

Returns {:ok, Inttegro.Payouts.SettingsLookup.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

Inttegro.Payouts.settings(client)