API module for all Unit payment types.
Supported rails
- ACH (credit/debit, standard/same-day, SEC codes)
- Wire (domestic Fedwire — final and irrevocable)
- Book (internal, instant, free)
- Push to Card (Visa/Mastercard fast disbursement)
- Bulk (multi-rail batch)
- Received ACH (incoming, with advance and return support)
Summary
Functions
Advance a received ACH payment (early fund availability).
Cancel a Pending payment.
Create an ACH payment.
Create a book payment (instant, free, internal transfer).
Create a bulk payment batch (ACH, Wire, and/or Book in one call).
Create a Push to Card payment (fast funds to a Visa/Mastercard debit card).
Create a wire (Fedwire) payment.
Get a payment by ID.
Get a bulk payment batch by ID.
Get a received ACH payment by ID.
List payments.
List received ACH payments.
Return a received ACH payment.
Update a payment's tags.
Functions
@spec advance_received_ach( String.t(), keyword() ) :: {:ok, Unit.Resource.Payment.t()} | {:error, term()}
Advance a received ACH payment (early fund availability).
@spec cancel( String.t(), keyword() ) :: {:ok, Unit.Resource.Payment.t()} | {:error, term()}
Cancel a Pending payment.
@spec create_ach( map(), keyword() ) :: {:ok, Unit.Resource.Payment.t()} | {:error, term()}
Create an ACH payment.
Required params
:account_id,:amount,:direction("Credit"or"Debit"),:description:counterparty_idOR:counterparty(inline map)
Optional
:same_day,:addenda,:sec_code,:tags,:idempotency_key
@spec create_book( map(), keyword() ) :: {:ok, Unit.Resource.Payment.t()} | {:error, term()}
Create a book payment (instant, free, internal transfer).
Required params
:account_id,:counterparty_account_id,:amount,:description
Create a bulk payment batch (ACH, Wire, and/or Book in one call).
The bulkPayments.finished webhook fires when all payments are processed.
@spec create_push_to_card( map(), keyword() ) :: {:ok, Unit.Resource.Payment.t()} | {:error, term()}
Create a Push to Card payment (fast funds to a Visa/Mastercard debit card).
Required params
:account_id,:amount,:description:card_number,:expiry_month,:expiry_year,:name,:network
@spec create_wire( map(), keyword() ) :: {:ok, Unit.Resource.Payment.t()} | {:error, term()}
Create a wire (Fedwire) payment.
Wire payments are final and irrevocable once sent.
Required params
:account_id,:amount,:description:counterparty—%{routing_number:, account_number:, account_type:, name:, address:}
Optional
:tags,:idempotency_key
@spec get( String.t(), keyword() ) :: {:ok, Unit.Resource.Payment.t()} | {:error, term()}
Get a payment by ID.
Get a bulk payment batch by ID.
@spec get_received_ach( String.t(), keyword() ) :: {:ok, Unit.Resource.Payment.t()} | {:error, term()}
Get a received ACH payment by ID.
@spec list(keyword()) :: {:ok, [Unit.Resource.Payment.t()], map()} | {:error, term()}
List payments.
Filter options
:account_id,:customer_id,:status,:type,:direction:since,:until,:tags
@spec list_received_ach(keyword()) :: {:ok, [Unit.Resource.Payment.t()], map()} | {:error, term()}
List received ACH payments.
@spec return_received_ach(String.t(), String.t(), keyword()) :: {:ok, Unit.Resource.Payment.t()} | {:error, term()}
Return a received ACH payment.
@spec update(String.t(), map(), keyword()) :: {:ok, Unit.Resource.Payment.t()} | {:error, term()}
Update a payment's tags.