PaperTiger.Resources.Payout (PaperTiger v1.0.2)

Copy Markdown View Source

Handles Payout resource endpoints.

Endpoints

  • POST /v1/payouts - Create payout
  • GET /v1/payouts/:id - Retrieve payout
  • POST /v1/payouts/:id - Update payout
  • GET /v1/payouts - List payouts

Note: Payouts cannot be deleted (can only be canceled).

Payout Object

%{
  id: "po_...",
  object: "payout",
  created: 1234567890,
  amount: 2000,  # cents
  currency: "usd",
  status: "paid",
  arrival_date: 1234567890,
  method: "standard",
  type: "bank_account",
  destination: "ba_...",
  metadata: %{},
  # ... other fields
}

Summary

Functions

Creates a new payout.

Lists all payouts with pagination.

Retrieves a payout by ID.

Updates a payout.

Functions

create(conn)

@spec create(Plug.Conn.t()) :: Plug.Conn.t()

Creates a new payout.

Required Parameters

  • amount - Payout amount in cents
  • currency - Three-letter ISO currency code (e.g., "usd")

Optional Parameters

  • status - Payout status (default: "pending")
  • arrival_date - When the payout arrives
  • method - Payout method: "standard" or "instant" (default: "standard")
  • type - Destination type: "bank_account" or "card"
  • destination - Bank account or card ID
  • metadata - Key-value metadata

list(conn)

@spec list(Plug.Conn.t()) :: Plug.Conn.t()

Lists all payouts with pagination.

Parameters

  • limit - Number of items (default: 10, max: 100)
  • starting_after - Cursor for pagination
  • ending_before - Reverse cursor
  • status - Filter by status (paid, pending, in_transit, canceled, failed)
  • created - Filter by creation date

retrieve(conn, id)

@spec retrieve(Plug.Conn.t(), String.t()) :: Plug.Conn.t()

Retrieves a payout by ID.

update(conn, id)

@spec update(Plug.Conn.t(), String.t()) :: Plug.Conn.t()

Updates a payout.

Note: Only metadata can be updated after creation.

Updatable Fields

  • metadata