API Reference TreasuryPrime v#1.0.0

Copy Markdown View Source

Modules

An unofficial, complete Elixir client for the Treasury Prime banking API (the Ledger product) — bank accounts, ACH, wires, book transfers, FedNow, cards, account opening / KYC, check deposit (RDC), check issuing, webhooks, sandbox simulations, and more.

Bank accounts: balances, ownership, locking, interest rates, statements, tax documents, and transaction history.

The entry point for opening a new bank account. An account application ties together one or more TreasuryPrime.PersonApplications (for a personal account) or a TreasuryPrime.BusinessApplication plus its associated person applications (for a business account), an TreasuryPrime.AccountProduct, and optionally an initial TreasuryPrime.Deposit. Once approved, account_id is populated with the newly created TreasuryPrime.Account.

Read-only history of lock/unlock events for accounts. To actually lock or unlock an account, use TreasuryPrime.Account.lock/3 and TreasuryPrime.Account.unlock/2 (which PATCH the account itself) — this resource only lets you list/inspect what happened, e.g. for an audit trail.

Reserves an account number / routing number pair ahead of an account being fully opened — useful when you need to give a customer their future account number immediately (e.g. to print on a welcome packet or set up payroll direct deposit) before the underlying TreasuryPrime.AccountApplication has finished processing.

Account products are bank-configured templates (interest rate tiers, fee schedules, eligibility rules) that TreasuryPrime.Accounts are created under. They're configured by your bank partner / in the Bank Console, so this resource is read-only — use it to look up which products are available to offer when submitting an TreasuryPrime.AccountApplication.

ACH transfers — electronic transfers between bank accounts at different banks, originated through Treasury Prime (for incoming, externally originated ACH, see TreasuryPrime.IncomingAch).

Adds a new owner, signer, or authorized user to an already open account (as opposed to person_applications passed at TreasuryPrime.AccountApplication.create/3 time, which is for people added during initial account opening).

A single month's average account balance, as returned by TreasuryPrime.Account.average_balances/3. Not independently listable/fetchable — always scoped to an account.

Book transfers — instant transfers between two accounts at the same bank (no ACH/wire rails involved, so they settle immediately and have no network fees). Common uses: moving money between a customer's sub-accounts, or from a customer account to your own operating/reserve account at the same bank.

The canonical, current record for a business associated with one or more accounts — created automatically when its TreasuryPrime.BusinessApplication is approved.

Captures identifying/KYB information for a business as part of opening a business account, including its beneficial owners, control persons, and signers (each represented by a TreasuryPrime.PersonApplication). Once approved, business_id is populated with the resulting TreasuryPrime.Business.

Debit card issuance and lifecycle management (virtual and physical), powered by Treasury Prime's card processor partnership (Marqeta).

Registers a webhook-like HTTP endpoint that Treasury Prime calls synchronously, in real time, for every authorization on a TreasuryPrime.CardProduct that references it (via the card product's card_auth_loop_endpoint_id) — letting you accept or reject each card transaction yourself (e.g. for velocity limits, custom fraud rules, or balance checks beyond what card_controls supports).

Read-only log of every card network event — authorization requests, authorization holds, captures/clearings, reversals, and declines (with a decline reason). Each transaction's full lifecycle on the card network is visible here, complementing the higher-level TreasuryPrime.Transaction record on the account ledger.

Card products are bank/processor-configured templates that TreasuryPrime.Cards are issued under (network, BIN range, default controls, the card_auth_loop_endpoint_id used for real-time authorization decisions, etc.). Configured by your bank partner — this resource lets you list/inspect them and update a small set of fields (such as card_auth_loop_endpoint_id); there's no create/2.

Check issuing — mail a physical paper check from one of your accounts.

Remote Deposit Capture (RDC) — deposit a check by uploading photos of the front and back.

Holds everything needed to talk to the Treasury Prime API: credentials, which environment to call, and HTTP transport configuration.

Optional convenience for building a TreasuryPrime.Client from application configuration / environment variables, instead of constructing one by hand at every call site.

A counterparty represents the external bank account on the other side of an ACH or wire transfer — i.e. who you're sending money to, or pulling money from. Created once and then referenced by counterparty_id from TreasuryPrime.Ach.create/3 and TreasuryPrime.Wire.create/3.

A single day's closing account balance, as returned by TreasuryPrime.Account.daily_balances/3. Not independently listable/fetchable — always scoped to an account.

An initial funding deposit for a new account, created during account opening and referenced via deposit_id on a TreasuryPrime.AccountApplication. Once the account application is approved, the deposit is processed and funds become the account's opening balance.

Deposit sweep program enrollment — configures an account to automatically sweep balances above/below target thresholds into a network of partner banks, typically to extend FDIC insurance coverage beyond the standard $250,000 per-bank limit (see also TreasuryPrime.ReserveAccount and the Enhanced FDIC Insurance guide).

Represents a card provisioned into a mobile digital wallet (Apple Pay / Google Pay) — called a "Token" in the Treasury Prime API reference, and reachable at the digital_wallet_token path.

Associates an uploaded TreasuryPrime.File with a person, business, or account application as supporting documentation (e.g. a government ID, articles of incorporation, or a proof-of-address letter) — typically used to satisfy a manual KYC/KYB review request.

The exception struct raised/returned for every failure mode of this library: HTTP-level errors returned by the Treasury Prime API, transport failures (DNS, TLS, timeouts, connection refused), and client-side validation errors (e.g. a missing required field) caught before a request is even sent.

FedNow instant payments — the Federal Reserve's real-time gross settlement service. Supports both sending and receiving, 24/7/365, with funds available within seconds. Unlike ACH and wire, FedNow payments are irrevocable the moment they're sent and are not subject to banking-hours cutoffs. Availability depends on your bank partner's FedNow participation.

Raw file storage, used as the building block for check deposit images (TreasuryPrime.CheckDeposit) and supporting KYC/KYB documentation (TreasuryPrime.Document).

Green Dot cash loads ("Prime Cash") — let your customers add cash to their account at 90,000+ retail locations (Walmart, CVS, Walgreens, ...). Your application generates a barcode for the customer to present at the register; once the retailer accepts the cash, the load completes and funds post to the account.

Internal HTTP orchestration layer shared by every resource module. Not part of the public API — use the resource modules (TreasuryPrime.Account, TreasuryPrime.Ach, etc.) instead.

Behaviour for the HTTP transport used by TreasuryPrime.Client.

Default TreasuryPrime.HTTPClient adapter, built entirely on Erlang's built-in :httpc (part of the :inets application) and :ssl. This means treasury_prime has no required HTTP dependency at all — no Req, no Finch, no Hackney.

Helpers for working with Treasury Prime's idempotency support.

Read-only visibility into ACH transfers originated by a third party outside of Treasury Prime (the reverse of TreasuryPrime.Ach, which is for transfers you originate).

Read-only visibility into wires sent to you by a third party (the reverse of TreasuryPrime.Wire, which is for wires you send). Funds from an incoming wire post as a TreasuryPrime.Transaction on the recipient's account. This resource is read-only — there's no way to create, update, or return an incoming wire via the API (wires are irrevocable once sent).

An invoice/virtual account number — an additional account number that routes deposits into an existing TreasuryPrime.Account, without being a separate ledger account itself. Useful for giving each customer/invoice its own receiving account number so incoming ACH/wire credits can be automatically reconciled to the right invoice or sub-customer, while all the money ultimately lands in one underlying account.

Triggers and tracks a KYC (Know Your Customer) / KYB (Know Your Business) evaluation for a TreasuryPrime.PersonApplication or TreasuryPrime.BusinessApplication, using one of your bank partner's configured TreasuryPrime.KycProducts (i.e. their chosen identity-verification vendor integration).

KYC products represent the identity-verification vendor integration(s) your bank partner has configured (e.g. a specific KYC/KYB provider with specific evaluation rules). Read-only — pass a kyc_product_id from here to TreasuryPrime.Kyc.create/3.

Manual holds place a temporary hold on funds in an account — reducing its available_balance (but not current_balance) by amount until the hold is released or it expires. Commonly used to reserve funds for a pending obligation (e.g. a check that hasn't cleared yet, a disputed transaction under investigation) without actually moving money.

Helper for the client access token step of Marqeta.js — the widget that lets you display a Marqeta-issued virtual card's PAN/CVV directly to a cardholder via secure iframes, without that data ever touching your servers (reducing your PCI compliance scope).

Helper for obtaining the single-use access token Marqeta's embedded widgets (UX Toolkit, Activate Card, Set PIN, ...) need before they can be instantiated on a page.

Network transfers move funds between two accounts you're authorized on, whether they sit at the same bank or at different banks within your Treasury Prime OneKey banking network — settling in near real time. They are Treasury Prime's answer to "book transfer, but the two accounts don't have to share a bank." Setting this up typically requires coordinating reserve/settlement accounts with Treasury Prime and your bank partners.

A single page of results from a list/* call, plus everything needed to fetch subsequent pages.

The canonical, current record for an individual associated with one or more accounts (as an owner, signer, or authorized user) — created automatically when their TreasuryPrime.PersonApplication is approved.

Captures identifying/KYC information for an individual as part of opening an account — either the primary applicant on a personal account, or an owner/signer/beneficial-owner on a business account. Once the associated TreasuryPrime.AccountApplication (and any required TreasuryPrime.Kyc evaluation) is approved, person_id is populated with the resulting TreasuryPrime.Person.

Reserve accounts are special-purpose accounts (e.g. holding loss reserves, prefunding, or program collateral) that you manage on behalf of your program with your bank partner. Unlike TreasuryPrime.Account, reserve accounts support delete/2.

Shared plumbing used internally by every resource module (TreasuryPrime.Account, TreasuryPrime.Ach, TreasuryPrime.Card, ...) to implement list/2, get/2, create/2, update/3, and delete/2 in terms of TreasuryPrime.HTTP.

Look up information about a bank by ABA routing number — useful for validating a routing number before creating a TreasuryPrime.Counterparty, or for displaying the receiving bank's name in your UI.

Configures the boilerplate content (legal name, support contact info, APY/footnote disclosures required by Regulation DD, branding) used when generating account statements via TreasuryPrime.Account.generate_statement/3. Once configured, you no longer need to pass that boilerplate on every statement generation call.

A tax document (e.g. a 1099-INT) generated/filed for an account.

Drives Treasury Prime's sandbox-only simulation endpoint, which lets you force state transitions and synthetic events that would otherwise require waiting on a real bank/network partner — e.g. moving an ACH straight to "settled", simulating a card authorization request, triggering a FedNow receipt, or completing a Green Dot cash load.

Ledger transactions — the append-only record of everything that's happened to an account's balance (deposits, withdrawals, holds, holds being released, interest, fees, reversals, ...).

Registers a URL to be notified whenever a given event fires. See TreasuryPrime.WebhookEvent for the shape of what gets POSTed to your url, and TreasuryPrime.WebhookSignature for verifying authenticity.

Represents the body of an incoming webhook notification from Treasury Prime.

Validates that an incoming webhook request genuinely originated from Treasury Prime.

Outgoing domestic and international wire transfers. For wires sent to you, see TreasuryPrime.IncomingWire.