Zazu.TransferDrafts (zazu v0.2.1)

Copy Markdown View Source

API-initiated transfers.

Creating a transfer draft routes it into the workspace's in-app approval flow — the API never executes a transfer itself. Poll get/2 (status: requestedprocessingcompleted / failed) or subscribe to the transfer.executed webhook.

Summary

Functions

Calls POST /api/transfer_drafts.

Calls GET /api/transfer_drafts/:id.

Functions

create(client, attributes)

@spec create(Zazu.Client.t(), map()) ::
  {:ok, Zazu.Response.t()} | {:error, Exception.t()}

Calls POST /api/transfer_drafts.

Creating a transfer draft routes it into the workspace's in-app approval flow — the API never executes a transfer itself. The draft is created with status "requested" and a nil "transfer" until it is approved in-app.

Required attributes: account_id, amount, and exactly one of beneficiary_id (external transfer) or destination_account_id (own-account move).

get(client, id)

@spec get(Zazu.Client.t(), String.t()) ::
  {:ok, Zazu.Response.t()} | {:error, Exception.t()}

Calls GET /api/transfer_drafts/:id.

Poll this to follow the draft through the in-app approval flow (status: requestedprocessingcompleted / failed) — the API never executes a transfer itself.