canonical: https://jentic.com/apis/alpha.layer2financial.dev/layer2financial

# Alpha Layer2financial Layer2 API Specification

Jentic publishes the only available OpenAPI specification for Layer2 API Specification, keeping it validated and agent-ready. The Layer2 Financial API is a developer platform for moving money between fiat and digital-asset accounts, with endpoints for customer onboarding, deposits, withdrawals, transfers, exchanges, settlements, and subscription management. It exposes 57 OAuth 2.0 secured operations across applications, accounts, counterparties, and document upload, including quote-based and market-rate exchanges between supported currencies. The API is designed for fintechs and treasury platforms that need to orchestrate cross-rail payments and reconcile settlement events programmatically.

## For AI agents

Move funds between fiat and crypto accounts with Layer2 Financial: create deposits, withdrawals, transfers, exchanges, and settlements through 57 OAuth 2.0 endpoints. Suitable for agents handling treasury, payout, and customer onboarding workflows.

## Scope

Does not handle card acceptance, merchant checkout, or in-person POS payments - use for fiat and crypto account-to-account movement only.

## Capabilities

- Onboard customers and submit KYC applications via the `/v1/applications` and `/v1/customers` endpoints
- Create and accept deposits, withdrawals, and inter-account transfers with explicit two-step confirmation
- Quote and execute fiat-to-crypto exchanges using `/v1/exchanges/quote` and `/v1/exchanges/market`
- Register counterparty bank and wallet details for outbound payouts
- Upload supporting documents to `/v1/documents/{id}` for compliance review
- Subscribe to settlement and transfer notifications via `/v1/subscriptions`
- Reconcile completed settlements and ledger movements through dedicated settlement endpoints

## Use cases

### Fiat-to-Crypto Treasury Operations

Treasury teams use Layer2 Financial to move balances between USD operating accounts and digital-asset wallets without building separate banking and crypto integrations. The two-step quote-then-accept exchange flow lets the team lock in a rate, review the all-in cost, and only commit on acceptance. Settlement endpoints expose the resulting ledger entries for accounting reconciliation.

Example prompt: Create an exchange quote for 50000 USD to USDC, present the quoted rate to the operator, then call accept on the quote and poll the settlement endpoint until the entry is finalised.

### Customer Onboarding and KYC

Fintech platforms onboard end customers through the applications and customers resources, attaching identity documents via the document upload endpoint. The API tracks application state through review and approval, exposing the customer record only when KYC is complete. Counterparty registration follows so that approved customers can immediately initiate transfers.

Example prompt: Create an application for a new customer with their personal details, upload a passport scan to `/v1/documents/{id}`, and poll the application until status transitions to approved.

### Outbound Payouts to Counterparties

Operations teams pay vendors, contractors, and partner accounts by registering counterparty bank or wallet records once, then issuing withdrawals or transfers against them. Each payout requires explicit acceptance, which separates instruction from execution and gives the operator a final review step before funds move.

Example prompt: Look up an existing counterparty by name, create a withdrawal of 2500 USD against that counterparty, then accept the withdrawal once the operator confirms.

### AI Agent Treasury Assistant via Jentic

Through Jentic, an AI agent can field natural-language requests like 'send 1000 USDC to our cold wallet counterparty' and resolve them to the correct Layer2 endpoints with the correct OAuth token. Jentic's your Jentic One instance keeps the OAuth client secret and refresh token isolated from the agent context, so the agent only ever holds a scoped, short-lived access token.

Example prompt: Search Jentic for 'send a stablecoin payout', load the Layer2 withdrawal operation schema, and execute the call with counterparty_id, amount, and currency parameters.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v1/withdrawals` | Create a withdrawal to a counterparty |
| POST | `/v1/withdrawals/{id}/accept` | Accept and release a pending withdrawal |
| POST | `/v1/transfers` | Move funds between internal accounts |
| POST | `/v1/exchanges/quote` | Get a rate-locked exchange quote |
| POST | `/v1/exchanges/market` | Execute a market-rate exchange |
| POST | `/v1/deposits` | Create an inbound deposit instruction |
| POST | `/v1/documents/{id}` | Upload a KYC or compliance document |
| POST | `/v1/subscriptions` | Subscribe to settlement and event notifications |

## Key resources

- **Applications** — Submit and track customer onboarding applications
- **Customers** — Manage approved customer records and their accounts
- **Deposits** — Create and accept inbound funding events
- **Withdrawals** — Create and accept outbound payouts to counterparties
- **Transfers** — Move funds between internal Layer2 accounts
- **Exchanges** — Quote and execute currency conversions including crypto
- **Counterparty** — Register and manage external bank and wallet destinations
- **Settlements** — Read finalised ledger entries for reconciliation
- **Subscriptions** — Configure event subscriptions for downstream systems
- **Documents** — Upload KYC and supporting compliance documents

## Why Jentic

- **Setup:** Wiring the Layer2 API by hand means running its OAuth2 token exchange against alpha.layer2financial.dev and encoding withdrawal, transfer, exchange, and deposit calls with your own retry handling. Through Jentic you install once, import the Layer2 API from the API Directory, store the OAuth2 credentials once, and your agent calls it.
- **Permission scoping:** The Layer2 API puts the resource id in the URL path (`/v1/withdrawals/{id}/accept`, `/v1/documents/{id}`), so a rule can pin your agent to accepting one withdrawal or updating one document. You choose the operations it may call, so creating transfers, exchanges, or deposits is not included unless you add them.
- **Credential handling:** Your Layer2 OAuth2 credentials are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a transfer' or 'get an exchange quote', and Jentic returns the matching Layer2 operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Stripe API** — Card-first payments and payouts platform without native crypto rails
- **Plaid API** — Bank account verification and transaction data to feed Layer2 onboarding
- **Exchange Rates API** — Reference fiat exchange rates for pre-trade pricing comparisons

## FAQ

### Why is there no official OpenAPI spec for Layer2 API Specification?

Layer2 Financial does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Layer2 API Specification via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Layer2 API Specification use?

Layer2 uses OAuth 2.0 client credentials. Through Jentic, the client ID and secret stay encrypted in your Jentic One instance and the agent only sees a scoped access token at call time, so refresh tokens never enter the agent context.

### Can I send a USD-to-USDC exchange with the Layer2 API Specification?

Yes. Call POST `/v1/exchanges/quote` to lock in a rate, review the returned quote, and then POST to `/v1/exchanges/{id}/accept` to commit. Market-rate exchanges go through POST `/v1/exchanges/market` when no prior quote is needed.

### What are the rate limits for the Layer2 API Specification?

Specific rate limits are not published in the spec. Layer2 enforces account-level throttling tied to your environment tier (sandbox versus production). Build retry-with-backoff for 429 responses and contact Layer2 to raise limits for production workloads.

### How do I create a payout to a counterparty through Jentic?

Search Jentic with the query 'send a stablecoin payout', load the schema for POST `/v1/withdrawals`, and execute it with counterparty_id, amount, and currency. Then call POST `/v1/withdrawals/{id}/accept` to release the funds.

### Does Layer2 API Specification handle KYC document uploads?

Yes. After creating a customer application, upload identity documents to POST `/v1/documents/{id}.` Layer2 reviews them as part of the application workflow before transitioning the customer to an active state.

### Can I limit what my agent is allowed to do with the Layer2 Financial API?

Yes. Because you self-host Jentic One, your own rules decide which Layer2 operations and credentials the agent may use, so you can allow it to accept a single withdrawal via POST `/v1/withdrawals/{id}/accept` or upload one document via POST `/v1/documents/{id}` without granting anything else. Since the resource id sits in the URL path, a rule can pin the agent to a specific record. Creating transfers, exchanges, or deposits stays off limits unless you explicitly add those operations.
