Skip to main content

Merchant setup from the terminal

Install the CLI, then sign in with your business email:

peer-pay-cli login --profile live --email owner@example.com

Enter the code from the email at the hidden prompt. The first sign-in creates your merchant account; existing merchants keep their settings and team. --profile live names the profile used in this guide. Without it, login names the profile after your merchant. Either way, login makes the profile active, so later commands can omit --profile.

Use the same email as on the merchant dashboard. If you can access several merchants, login lists them; select one with --merchant-id MERCHANT_ID.

Peer creates the owner's wallets on first sign-in. If login reports walletsProvisioned: false, sign-in still worked; retry with peer-pay-cli merchant provision-wallets --profile live.

Configure your merchant​

peer-pay-cli setup

Setup needs an owner or manager. In a terminal, it offers to sign you in first. The wizard asks for:

  • Business name, logo, industry, and integration path.
  • Fiat payment rails, and whether to accept crypto.
  • Default currency, who pays the fee (MERCHANT, PAYEE, or SPLIT), and the settlement chain and token. For SPLIT, the buyer's share of fees in basis points (5000 = 50%; 0 to 10000 in steps of 1000).
  • Whether to sweep settlements.
  • A production webhook URL. Leave it blank until your handler is deployed.
  • A pricing plan, while your plan is not activated and you can activate it yourself. Choosing your current plan activates it. Managers skip this, and activation waits until the owner verifies their identity in the merchant dashboard.

Use Up/Down (or k/j, Ctrl+P/N) to move and Enter or Space to choose; the current value starts highlighted. For fiat rails, Space toggles a rail, a selects or clears all, and Enter confirms. Esc, Ctrl+C, or Ctrl+D cancels. Yes/no questions default to No. Menus write to stderr, keeping stdout clean for --json. Set NO_COLOR to disable styling.

Setup shows the complete plan and asks before saving anything. Logos must be PNG, JPEG, WebP, or GIF, up to 2 MB. Check the result:

peer-pay-cli merchant get --profile live
peer-pay-cli onboarding get --profile live

Some checklist steps, such as a delivered hosted webhook, complete only after real activity.

Use a setup file​

For repeatable or scripted setup, describe the merchant in JSON. profile (with name) and settings are required; logoFile, tier (PRO; a file that names BASE is rejected), and webhook are optional. A tier equal to your current plan is still sent while the plan is not activated, which activates it. Settings use the API's field names, and omitted fields keep their current values. merchantCheckoutTheme is replaced as a whole, so include every theme value you want to keep. A webhook without events subscribes to every event.

setup.json
{
"profile": {
"name": "Example Store",
"industryType": "ecommerce",
"integrationPath": "CUSTOM_API"
},
"settings": {
"enabledRails": ["venmo", "revolut"],
"defaultPaymentCurrency": "USD",
"feePayer": "MERCHANT",
"destinationChainId": "8453",
"destinationToken": "USDC",
"sweepEnabled": false
},
"logoFile": "./logo.png",
"webhook": {
"url": "https://merchant.example/webhooks/peer-pay",
"events": ["ORDER_FULFILLED"]
}
}

To split fees with the buyer, set settings.feePayer to "SPLIT" and settings.buyerFeeShareBps, such as 5000 for 50:50. See split payment fees.

Preview, then apply:

peer-pay-cli setup --profile live --file setup.json --dry-run
peer-pay-cli setup --profile live --file setup.json --yes

--dry-run validates the input before reading current state, makes no changes, and does not provision a sandbox. --yes applies without the confirmation prompt. Without a terminal, setup needs --file with one of the two. Paths in the file are relative to your working directory.

Setup updates the existing webhook with the same URL instead of adding another. If several webhooks share the URL, pick one with webhooks update first. Writes run in order; if one fails, earlier ones stay applied, so fix the error and rerun the same file.

Verify the hosted sandbox​

Setup also enables your hosted sandbox and saves its API key as the profile live-sandbox; the result's sandboxProfile names it. To create it or switch to it later, run peer-pay-cli sandbox enable, which also makes it the active profile. Return to your merchant with peer-pay-cli use live. See sandbox enable for naming rules.

Register a public HTTPS handler on the sandbox profile and run a test order:

peer-pay-cli webhooks create --profile live-sandbox \
--url https://staging.example/webhooks/peer-pay \
--events ORDER_FULFILLED
peer-pay-cli test-order --profile live-sandbox
peer-pay-cli status --profile live-sandbox
peer-pay-cli webhooks deliveries WEBHOOK_ID --profile live-sandbox

webhooks create shows the signing secret once and saves it in the profile; credentials export --webhook-id WEBHOOK_ID writes it to a file later. Verify sandbox deliveries with the sandbox webhook's secret; a live webhook has its own. webhooks test only checks connectivity, with empty business entities; test-order sends a real sandbox fulfillment.

For a wallet crypto rail, add --refund-to "$BUYER_REFUND_ADDRESS" using a wallet the buyer controls on that chain. This is also required when a crypto-only merchant lets test-order select the rail automatically. Fiat rails need no refund address; no default address is supplied.

To test against a handler on localhost, use the local mock instead. Local tests do not complete the hosted onboarding checklist.

Go live​

  1. Check your settlement settings and enabled payment rails.
  2. Activate your pricing plan if merchant get --profile live shows planActivatedAt: null: merchant tier --profile live --tier PRO. Live orders need an activated plan; a tier alone is not enough. Activation needs the owner's identity verification in the merchant dashboard. An account on the closed Base plan that selects PRO cannot switch back.
  3. Register your production HTTPS handler with webhooks create --profile live.
  4. Export the live credentials to your application's private environment.
  5. Complete the remaining steps in onboarding get --profile live.
peer-pay-cli credentials export --profile live \
--output .env.peer-pay.production --webhook-id WEBHOOK_ID

Do not commit the exported file. The CLI has the same permissions as your role on the dashboard.

Sessions and troubleshooting​

SituationWhat to do
No saved profileRun peer-pay-cli login, or peer-pay-cli serve for local testing.
Session expiredRun login again for that profile. Email sessions otherwise refresh automatically; see sessions.
Owner permission requiredSign in as the merchant owner. An API key cannot replace an owner session.
Wallet provisioning failedRun merchant provision-wallets --profile live. Existing addresses are kept.
Could not reach the APIThe error names the URL. Check your connection and the profile's API URL. For the local mock, start peer-pay-cli serve.
Sign-in configuration errorThe error names the sign-in endpoint and HTTP status. A 404 means the API URL is wrong; retry a 5xx later; for other statuses, contact Peer Pay support.
Sign-in fails with a CAPTCHA challengeThe terminal cannot complete it. Use the merchant dashboard, or pipe an existing access token to login --token-stdin.
Another command owns the profileWait for that command to finish. Locks left by exited commands clear automatically.
Credentials file is invalidRestore it from a backup, or move it aside and run login again; moving it aside loses saved profiles. If a newer CLI wrote it, upgrade with npm install -g @zkp2p/peer-pay-cli.

Credentials live in ~/.config/peer-pay/config.json, or the path in PEER_PAY_CONFIG or --config, with mode 0600. Keep them private. logout --profile live removes the saved profile; it does not rotate API keys or sign out other devices. See profiles for how the CLI picks a profile.

Continue with your coding agent​

After merchant setup, let Codex, Claude Code, OpenCode, or Gemini CLI integrate Peer Pay into your application:

peer-pay-cli handoff --profile live --harness codex --project ./my-store --launch

To continue right after applying guided setup:

peer-pay-cli setup --profile live --harness codex --project ./my-store --launch

See handoff for the supported agents, prompt-only use, and what the instructions contain. While the agent works, the dashboard's onboarding page shows the milestones it reports, what Peer Pay has confirmed (a settled sandbox test order and an accepted webhook), and when the agent needs you.

Merchant referrals​

If another merchant referred you, pass their code when you create your account. It applies only when login creates a new merchant.

peer-pay-cli login --profile live --email owner@example.com --referral-code ABCD2345
peer-pay-cli merchant referral --profile live

merchant referral shows your own code, the wallet that receives your rewards, and the merchants you referred. Your reward is a percentage of each referred merchant's fiat and Apple Pay payment volume, set by their plan, not yours: 0.50% for Pro and 1.00% for Concierge, and 0.30% for a merchant still on the closed Base plan. The rate follows their plan changes. Existing orders keep the fees they were created with. Referrals are unavailable in sandbox.