Post Your First Journal in 5 Minutes
This is the shortest path from zero to a real double-entry entry in the ledger. You will create sandbox credentials, exchange them for a short-lived access token, post a journal, and read it back. If you only do one thing to evaluate Paprel, do this.
Using an AI coding agent? Skip to the prompt for it.
You need: a terminal with curl and jq, plus a Paprel sandbox workspace (self-serve, no sales call).
0. Create sandbox credentials (1 min)
Sign in at sandbox.paprel.com and create an App Connect client for your sandbox company. Grant it at least the account list, journal list, and journal add permissions (accounting:account-list, accounting:journal-list, accounting:journal-add). Copy these values while the client secret is visible:
- Token URL — use the exact URL shown for the client
client_idclient_secret- Partner domain: for the sandbox this is always
sandbox.paprel.com
Keep the secret server-side. Do not put it in browser code, a VITE_* variable, or a public repository.
1. Exchange credentials for a token (1 min)
Set the copied values, then use the OAuth 2.0 client credentials grant:
export APP_CONNECT_TOKEN_URL="https://api-sandbox.paprel.com/v1/app-connect/oauth/token"
export APP_CONNECT_CLIENT_ID="<your client_id>"
export APP_CONNECT_CLIENT_SECRET="<your client_secret>"
export PARTNER_DOMAIN="sandbox.paprel.com"
export PAPREL_API_BASE="https://api-sandbox.paprel.com"
export ACCESS_TOKEN="$(curl --fail --silent --show-error \
-X POST "$APP_CONNECT_TOKEN_URL" \
-H "content-type: application/json" \
-H "x-partner-domain: $PARTNER_DOMAIN" \
--data "$(jq -n \
--arg client_id "$APP_CONNECT_CLIENT_ID" \
--arg client_secret "$APP_CONNECT_CLIENT_SECRET" \
'{grant_type:"client_credentials", client_id:$client_id, client_secret:$client_secret}')" \
| jq -er '.access_token | select(type == "string" and length > 0)')"
Confirm that the exchange returned a token before continuing:
test -n "$ACCESS_TOKEN" && test "$ACCESS_TOKEN" != "null" && echo "Token ready"
The access token is short-lived and company-scoped. Cache it until shortly before expiry, then run the exchange again. Your client_secret is never sent on journal API calls.
2. Post a balanced journal (2 min)
A journal needs at least two lines whose debits and credits balance. Each line requires an account UUID and a description; account_code is metadata and does not resolve an account for posting.
Fetch the chart of accounts and choose an active cash account and a revenue account belonging to this company:
curl --fail --silent --show-error "$PAPREL_API_BASE/v1/accounting/accounts?is_archived=false" \
-H "authorization: Bearer $ACCESS_TOKEN" \
-H "x-partner-domain: $PARTNER_DOMAIN" \
| jq '.data[] | {id, account, account_number, account_code, currency}'
Copy the selected id values below. Use your company's base currency for this first journal; a foreign-currency journal also requires exchange_rate (base-currency units per journal-currency unit). Choose an open accounting date permitted by your company's transaction locks.
export CASH_ACCOUNT_ID="<cash account id from the response>"
export REVENUE_ACCOUNT_ID="<revenue account id from the response>"
export JOURNAL_CURRENCY="USD"
export JOURNAL_DATE="$(date +%F)"
Here we record 100.00 of revenue: debit Cash and credit Revenue. Do not use receivable or payable control accounts for a manual journal; those are posted through document and payment workflows.
JOURNAL_RESPONSE="$(curl --fail --silent --show-error "$PAPREL_API_BASE/v1/accounting/journals" \
-H "authorization: Bearer $ACCESS_TOKEN" \
-H "x-partner-domain: $PARTNER_DOMAIN" \
-H "content-type: application/json" \
--data "$(jq -n \
--arg cash_account "$CASH_ACCOUNT_ID" \
--arg revenue_account "$REVENUE_ACCOUNT_ID" \
--arg currency "$JOURNAL_CURRENCY" \
--arg date "$JOURNAL_DATE" \
'{
currency: $currency,
date: $date,
description: "First journal",
lines: [
{account_id: $cash_account, description: "Cash received", debit: "100.00"},
{account_id: $revenue_account, description: "Revenue earned", credit: "100.00"}
],
posted: true
}')")"
export JOURNAL_ANCHOR_ID="$(printf '%s' "$JOURNAL_RESPONSE" | jq -er '.data.journal.anchor_id | select(type == "string" and length > 0)')"
test -n "$JOURNAL_ANCHOR_ID" || { echo "No journal anchor returned; stop before continuing." >&2; false; }
printf '%s\n' "$JOURNAL_RESPONSE" | jq '.data.journal | {anchor_id, identifier, is_posted}'
The response's data.journal includes anchor_id, identifier, and is_posted: true. Keep anchor_id as the stable journal identity across versions. If debits and credits do not balance, the API rejects the request.
3. Read it back (1 min)
Confirm the entry is in the ledger of record:
curl --fail --silent --show-error "$PAPREL_API_BASE/v1/accounting/journals/$JOURNAL_ANCHOR_ID" \
-H "authorization: Bearer $ACCESS_TOKEN" \
-H "x-partner-domain: $PARTNER_DOMAIN"
The detail request reads back this specific journal by its stable anchor. Check its lines and posting state. That's the whole loop: product event → balanced journal → system of record you can report on.
What just happened
- You posted a balanced double-entry journal over plain REST.
- It was validated before it hit the ledger — unbalanced entries are rejected, not silently corrected.
- It's now part of an append-only, exportable audit trail.
Hand this to your AI agent
Using Claude Code, Cursor or another coding agent? Paste this prompt and let it run the steps on this page. It reads this guide for the details, stays in the sandbox, and asks before it creates anything.
Post one balanced journal in my Paprel sandbox company and
read it back.
Read first:
https://paprel.com/documentation/guides/post-your-first-journal-in-5-minutes
https://paprel.com/openapi.json (request and response schemas)
Rules for every step:
- Use only https://api-sandbox.paprel.com. Refuse any other
API host.
- Read APP_CONNECT_CLIENT_ID and APP_CONNECT_CLIENT_SECRET
from my environment. If either is missing, stop and tell
me how to set it.
- Never print, log or commit the client secret or an access
token. Keep a token in memory or a shell variable only.
- Send these headers on every request:
x-partner-domain: sandbox.paprel.com
User-Agent: a name that identifies this script
- Request bodies are JSON. When a call fails, show me the
HTTP status and the code in the response's error.message.
- Do not retry a failed write.
Steps:
1. POST /v1/app-connect/oauth/token with the JSON body
{"grant_type": "client_credentials", "client_id": "...",
"client_secret": "..."}. Keep access_token.
2. GET /v1/accounting/accounts?is_archived=false. Each row
has id, account (its name), account_type, account_subtype
and currency. Show me:
- cash accounts: account_subtype "cashEquivalents"
- revenue accounts: account_type "revenue"
Never offer account_subtype "receivables" or "payables".
If a revenue account is named "salesRevenue", suggest it.
Ask me to choose one of each, in the same currency.
3. Build the journal: today's date as YYYY-MM-DD, that
currency, "description": "First journal", "posted": true,
and two lines. Each line has account_id, a description,
and an amount as a string: debit "100.00" on the cash
account, credit "100.00" on the revenue account. Show me
the body and wait for my yes.
4. POST /v1/accounting/journals. Keep data.journal.anchor_id
from the response.
5. GET /v1/accounting/journals/{anchor_id}. Show me
anchor_id, identifier and is_posted from data.
Next steps
- Before launch: Production checklist — shared checks plus partner-specific requirements.
- Go deeper: Build Embedded Accounting in 20 Minutes — company, chart of accounts, invoicing, payments, and a live P&L.
- Understand token handling: Authentication and tokens — credential storage, expiry, permissions, and error handling.
- Browse the surface: the API reference documents the current public operations.
- Other credential paths: API credentials use this same token exchange and the same headers, for reads and writes; see authentication and tokens.
- Use an SDK: generate a typed client from the OpenAPI spec; SDKs and client libraries has this same flow in TypeScript, Python, Go, Java and PHP, plus the
@paprel/embed-*npm packages for UI.