Agent skill

Alpaca Broker Journals

by alpacahq in alpacahq/alpaca-skills

Move cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and reverse-batch journals, the Idempotency-Key header, journal status…

Apache-2.0Auto-check passedBusiness, Finance & HR

Install Alpaca Broker Journals

skills CLI
$ npx skills add alpacahq/alpaca-skills --skill alpaca-broker-journals -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alpacahq/alpaca-skills alpaca-broker-journals --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alpacahq/alpaca-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/broker-api/journals .claude/skills/alpaca-broker-journals && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
alpaca-broker-journals
GitHub stars
154
Token cost
~2.1k tokens
SKILL.md length
811 words
Files
2
Skills in repo
14
Repo updated
First seen
Licence
Apache-2.0

At a glance

Move cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and reverse-batch journals, the Idempotency-Key header, journal status…

  • Works in 8 steps: Endpoints → JNLC vs JNLS → Idempotency-Key header — USE IT → …
  • Internal account-to-account movement in any language
  • SKILL.md covers Reference, 1. Endpoints, 2. JNLC vs JNLS and 3. Idempotency-Key header —…, plus 5 more sections
  • Reaches docs.alpaca.markets

What it does

Alpaca Broker Journals is an agent skill from alpacahq/alpaca-skills. Move cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and reverse-batch journals, the Idempotency-Key header, journal status lifecycle including corrections, and the firm/sweep-account pattern that powers instant funding and share rewards. Use for internal account-to-account movement in any language. For deposits/withdrawals to EXTERNAL banks, use funding-transfers instead.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `reference.md`).

It sits in Business, Finance & HR. The repository describes itself as: Agent skills for Alpaca's Trading API and Broker API: drop-in SKILL.md files for AI coding assistants. The licence is Apache-2.0.

When your agent uses it

  • Internal account-to-account movement in any language

Example prompts

  • “/alpaca-broker-journals”

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Endpoints
  2. JNLC vs JNLS
  3. Idempotency-Key header — USE IT
  4. Batch vs reverse-batch (JNLC only, all-or-nothing)
  5. Status lifecycle
  6. SSE journal events
  7. Constraints & gotchas
  8. The sweep-account funding pattern (why journals exist)

What it can do on your machine

Read from SKILL.md and the folder at commit 39111ab. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • docs.alpaca.markets

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Alpaca Broker Journals loads about 2.1k tokens when it runs. Until then it costs about 117 tokens; SKILL.md has 811 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~117
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alpacahq/alpaca-skills at commit 39111ab, republished under its Apache-2.0 licence (© alpacahq). 811 words, ~2,057 tokens.

Download SKILL.mdSave it as .claude/skills/alpaca-broker-journals/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
alpaca-broker-journals
description
Move cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and reverse-batch journals, the Idempotency-Key header, journal status lifecycle including corrections, and the firm/sweep-account pattern that powers instant funding and share rewards. Use for internal account-to-account movement in any language. For deposits/withdrawals to EXTERNAL banks, use funding-transfers instead.

Alpaca Broker API — Journals

Journals move value between two accounts within your own Alpaca omnibus — typically between a pre-funded firm/sweep account and a user account. They are the engine behind "instant funding," cashback, and share rewards. They never touch the outside banking world (that's alpaca-broker-funding-transfers).

Read alpaca-broker-integration first. Broker API + HTTP Basic auth.

Reference

  • Guide: https://docs.alpaca.markets/docs/funding-via-journals
  • API ref: https://docs.alpaca.markets/reference/createjournal
  • Live schema: alpaca-docs MCP → get-endpoint title "Broker API" path /v1/journals

1. Endpoints

MethodPathPurpose
POST/v1/journalsSingle journal (JNLC cash or JNLS shares)
POST/v1/journals/batchOne source → many destinations (JNLC only)
POST/v1/journals/reverse_batchMany sources → one destination (JNLC only)
GET/v1/journalsList (filters: after, before, status, entry_type, to_account, from_account, limit)
GET/v1/journals/{journal_id}Retrieve one
DELETE/v1/journals/{journal_id}Cancel a pending journal (204)
GET/v2/events/journals/statusSSE journal status stream (v1 is legacy)

2. JNLC vs JNLS

entry_type is exactly "JNLC" or "JNLS".

  • JNLC — cash. Moves USD between accounts. Allowed firm ↔ user, both directions. Not customer-to-customer.
  • JNLS — securities. Moves whole/fractional shares. Allowed firm → user only. Used for signup/referral share rewards.
json
// JNLC (cash)
{ "entry_type": "JNLC", "from_account": "<firm-uuid>", "to_account": "<user-uuid>", "amount": "100.00" }

// JNLS (shares)
{ "entry_type": "JNLS", "from_account": "<firm-uuid>", "to_account": "<user-uuid>", "symbol": "AAPL", "qty": "0.5" }
FieldJNLCJNLSNotes
from_account / to_accountrequiredrequiredaccount UUIDs
amountrequired—decimal string
symbol / qty—requiredqty is a string; fractional allowed
currencyoptionaloptionaldefaults USD
descriptionoptionaloptional≤1024 chars; accepts sandbox fixtures
transmitter_*optional (JNLC)n/aTravel Rule fields

Responses: 200 journal · 403 amount/assets not available · 404 account not found · 422 idempotency-key reused with a different body.

3. Idempotency-Key header — USE IT

Pass an Idempotency-Key header (≤128 chars; a client-generated UUID is recommended) on journal creates.

  • Same key + identical body → returns the original journal (no duplicate).
  • Same key + different body → 422.

Lesson: this is the correct way to make money movement retry-safe. Without it, a network timeout on POST /v1/journals leaves you unsure whether the cash moved — and a blind retry can double-fund. Generate the key deterministically from your own transaction ID and send it on every attempt.

4. Batch vs reverse-batch (JNLC only, all-or-nothing)

Batch — one-to-many (fan a sweep account out to many users):

json
{ "entry_type": "JNLC", "from_account": "<firm-uuid>",
  "entries": [ { "to_account": "<u1>", "amount": "1000" }, { "to_account": "<u2>", "amount": "250" } ] }

Reverse batch — many-to-one (pull cash from many users back to the firm account):

json
{ "entry_type": "JNLC", "to_account": "<firm-uuid>",
  "entries": [ { "from_account": "<u1>", "amount": "10" }, { "from_account": "<u2>", "amount": "100" } ] }

Every entry must validate or the entire batch fails (one bad account ID kills it). The response is an array of BatchJournalResponse (the Journal object + an error_message per entry that failed). Idempotency-Key is supported with the same semantics.

5. Status lifecycle

JournalStatus: queued, sent_to_clearing, pending, executed, rejected, canceled, refused, deleted, correct.

Happy path: queued → sent_to_clearing → executed.

StatusMeaningTerminal
queuedIn queueno
sent_to_clearingSubmitted to books-and-recordsno
pendingNeeds Alpaca ops approval (e.g. hit a JNLC daily limit)no
executedBalances updated — but NOT final, can still be reversed by cashieringno (not final)
rejectedManually rejectedno
refusedFailed preliminary checks; never hit the ledger (e.g. a fast replay failing the balance check)no
canceledCanceled via API/opsFINAL
deletedRemoved from ledgerFINAL
correctA prior executed journal was cancelled and re-created with a corrected amountFINAL

Two critical lessons:

  1. executed ≠ final. Don't treat executed as irreversible — Alpaca cashiering can reverse a journal that wasn't permitted. Reconcile against later events.
  2. correct creates a NEW journal ID. A correction cancels the original and issues a new journal with the corrected amount — it is not an in-place edit. If you reconcile by journal ID, the original ID transitions to correct/cancelled while a different ID carries the real funds. Handle both. (This is why event consumers must be idempotent and ID-keyed — see alpaca-broker-reconciliation-idempotency.)
Show full SKILL.md (247 more words)Show less

6. SSE journal events

GET /v2/events/journals/status pushes JournalStatusEventV2: event_id (ULID, sortable), journal_id, entry_type, status_from, status_to, description, idempotency_key, idempotency_key_type (single|batch), batch_error_message. Replay rules: since required if until set; since_id required if until_id set; can't mix since with since_id. Without a since/since_id, no history is returned. See alpaca-broker-sse-events.

7. Constraints & gotchas

  • Eligibility: the cash-pooling/journals use case requires Alpaca review and possibly a local license — check with counsel.
  • JNLS account states: to_account must be ACTIVE; from_account must be ACTIVE or CLOSE.
  • Sufficient funds: JNLC create → 403 if the amount isn't available; reverse-batch 403 = insufficient balance/assets.
  • Daily limits push to pending (manual ops approval).
  • GET /v1/journals returns 422 if the result set exceeds 100,000 records — always filter with after/before/limit.
  • Delete is pending-only: DELETE succeeds (204) only when pending; an executed journal → 422. To reverse an executed journal, create a mirror journal in the opposite direction, don't try to delete it.
  • Travel Rule: include transmitter info on money-moving journals (required on all incoming deposits regardless of amount).
  • Sandbox fixtures: put fixtures in description (e.g. /fixtures/status=rejected/fixtures/) to simulate rejected/pending outcomes for testing.

8. The sweep-account funding pattern (why journals exist)

The canonical Broker API funding architecture:

Bulk external wire ──> FIRM / SWEEP account (pre-funded) ──JNLC──> user accounts (instant)
user account ──JNLC──> FIRM account ──external wire/ACH──> outside world (withdrawal)

You collect money your own way, hold it in a firm account, and journal it to users instantly rather than running a per-user external transfer. Withdrawals reverse the flow. This is what makes "instant deposit" UX possible on top of slow banking rails.

Related skills: external money in/out → alpaca-broker-funding-transfers; retry-safety & corrections → alpaca-broker-reconciliation-idempotency; decimal handling → alpaca-broker-money-precision; events → alpaca-broker-sse-events.

© alpacahq, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/broker-api/journals of alpacahq/alpaca-skills.

  • SKILL.md
  • reference.md

Open the folder on GitHubat commit 39111ab

Compare with similar skills

Alpaca Broker Journals next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Alpaca Broker Journals compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Alpaca Broker Journals this skillalpacahq/alpaca-skills154—~2.1kAutomated safety check: PassApache-2.0
Technical Analysttradermonty/claude-trading-skills3k4 repos~4.6kAutomated safety check: PassMIT
Theme Detectortradermonty/claude-trading-skills3k2 repos~4.9kAutomated safety check: PassMIT
Creating Financial ModelsChen-zexi/open-ptc-agent7293 repos~1.3kAutomated safety check: PassMIT
Stock APIzhangxiangliang/stock-api2k—~507Automated safety check: PassMIT
Itr Walakaranb192/itr-wala871—~3.6kAutomated safety check: PassMIT

Similar skills

  • Technical Analyst

    tradermonty/claude-trading-skills

    This skill should be used when analyzing weekly price charts for stocks, stock indices, cryptocurrencies, or forex pairs.

    3k GitHub starsUsed in 4 repos~4.6k tokens
    Business, Finance & HRAuto-check passed
  • Theme Detector

    tradermonty/claude-trading-skills

    Detect and analyze trending market themes across sectors. An agent skill from tradermonty/claude-trading-skills.

    3k GitHub starsUsed in 2 repos~4.9k tokens
    Business, Finance & HRAuto-check passed
  • Creating Financial Models

    Chen-zexi/open-ptc-agent

    This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions

    729 GitHub starsUsed in 3 repos~1.3k tokens
    Business, Finance & HRAuto-check passed
  • Stock API

    zhangxiangliang/stock-api

    Fetch real-time stock quotes, K-line (candlestick) history, and search symbols for China A-shares, Hong Kong, and US markets.

    2k GitHub stars~507 tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Itr Wala

    karanb192/itr-wala

    File Indian income tax returns (ITR) for FY 2025-26 / AY 2026-27.

    871 GitHub stars~3.6k tokensUpdated 7 days ago
    Business, Finance & HRAuto-check passed
  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    322 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed

More from alpacahq/alpaca-skills

All 14 skills in this repo
  • Alpaca Broker Account Onboarding

    alpacahq/alpaca-skills

    Open and manage brokerage accounts via the Alpaca Broker API — account creation, KYC/CIP, identity & disclosures, agreements, document upload (incl.

    154 GitHub stars~2.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Alpaca Broker Funding Transfers

    alpacahq/alpaca-skills

    Move money between an Alpaca brokerage account and the EXTERNAL banking world via the Broker API — ACH relationships, wire recipient banks, classic transfers (deposits/withdrawals), the v1beta…

    154 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Alpaca Broker Integration

    alpacahq/alpaca-skills

    Entry point for integrating with the Alpaca Broker API (plus Market Data and Trading APIs) in any programming language.

    154 GitHub stars~3k tokensUpdated 1 mo ago
    Auto-check passed
  • Alpaca Broker Money Precision

    alpacahq/alpaca-skills

    Handle money and numeric precision correctly with the Alpaca API — numbers-as-strings on the wire, decimals vs floats, rounding/truncation before sending amounts, fractional-share precision, and…

    154 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts.

    154 GitHub stars~1.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Keep local state correct against the Alpaca Broker API — idempotency keys, ID-keyed upserts, event snapshotting and dedup, polling rails that have no events, nightly reconciliation/heal jobs, status…

    154 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Alpaca Broker Journals

What does Alpaca Broker Journals do?

Move cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and reverse-batch journals, the Idempotency-Key header, journal status…. Alpaca Broker Journals is an agent skill from alpacahq/alpaca-skills. Move cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and reverse-batch journals, the Idempotency-Key header, journal status lifecycle including corrections, and the firm/sweep-account pattern that powers instant funding and share rewards.

When should I use Alpaca Broker Journals?

Alpaca Broker Journals fits situations like: internal account-to-account movement in any language.

How do I install Alpaca Broker Journals in Claude Code?

Run `npx skills add alpacahq/alpaca-skills --skill alpaca-broker-journals -a claude-code`. Or copy the skill folder (skills/broker-api/journals in alpacahq/alpaca-skills) into .claude/skills/alpaca-broker-journals in your project. Claude Code loads it when a task matches its description.

How do I install Alpaca Broker Journals in Codex?

Run `npx skills add alpacahq/alpaca-skills --skill alpaca-broker-journals -a codex`. Or copy the skill folder (skills/broker-api/journals in alpacahq/alpaca-skills) into .agents/skills/alpaca-broker-journals in your project. Codex loads it when a task matches its description.

Can I use Alpaca Broker Journals in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alpacahq/alpaca-skills --skill alpaca-broker-journals -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/alpaca-broker-journals, .gemini/skills/alpaca-broker-journals, .github/skills/alpaca-broker-journals and .opencode/skills/alpaca-broker-journals in your project.

What does Alpaca Broker Journals need to run?

SKILL.md names no scripts, command-line tools or credentials: Alpaca Broker Journals is instructions for the agent only.

Does Alpaca Broker Journals access the network?

SKILL.md names 1 domain. In commands or code: docs.alpaca.markets; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Alpaca Broker Journals safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Alpaca Broker Journals use?

Alpaca Broker Journals is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Alpaca Broker Journals use?

About 2.1k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Alpaca Broker Journals?

Skills that share tags, products or a category with Alpaca Broker Journals: Technical Analyst (tradermonty/claude-trading-skills, 3k stars), Theme Detector (tradermonty/claude-trading-skills, 3k stars), Creating Financial Models (Chen-zexi/open-ptc-agent, 729 stars) and Stock API (zhangxiangliang/stock-api, 2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Alpaca Broker Journals?

alpacahq (a GitHub organization) maintains it in alpacahq/alpaca-skills, which has 154 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on September 8, 2026.

Source: alpacahq/alpaca-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.