Crypto payment gateway: what the API does and what stays in the dashboard
A crypto payment gateway has two front doors: the API your code calls, and the dashboard you log in to. They overlap, but not completely, and the gap is deliberate. This post lists, from easyway's own routes, which jobs your code can do, which need a person in the dashboard, and how to hand each integration a key that can do only its part.
The split, task by task
The public API has ten routes under /v1: invoices (create, list, get, cancel), balances, rates, the coin list, and withdrawals (create, list, get). Everything else lives in the dashboard:
| Task | API | Dashboard |
|---|---|---|
| Create, list, look up and cancel invoices | Yes (invoices:write / invoices:read) | Yes |
| Read balances | Yes (balances:read) | Yes, plus the full ledger |
| Exchange rates and the coin list | Yes (any valid key) | Yes |
| Request and track withdrawals | Yes (payouts:write / payouts:read) | Yes (live: 2FA code) |
| Add or remove whitelisted withdrawal addresses | No | Yes (2FA code) |
| Create, rotate or revoke API keys | No | Yes |
| Add webhook endpoints, rotate secrets, send a test | No | Yes |
| See webhook deliveries and retry one by hand | No | Yes |
| Payment links and donation widgets | No | Yes |
| Mark a test invoice paid (sandbox) | No | Yes (test mode only) |
| CSV export of invoices and withdrawals | No (page through the list) | Yes |
The rule behind the table: the API covers what a shop does many times a day without a person watching — take a payment, check it, read the balance, settle. The dashboard keeps everything that changes who can do what or where money and payment notices go: keys, webhook endpoints and withdrawal addresses.
Why keys can't manage keys or addresses
An API key sits in a server's environment, a CI secret or a plugin's settings, and keys leak. If a key could add a withdrawal address, a leaked key could empty the balance. So in live mode a withdrawal made through the API can only go to an address that was already whitelisted in the dashboard, and adding to the whitelist needs two-factor authentication plus a fresh code. The worst a leaked payouts:write key can do is send your money to your own addresses.
The same thinking covers the rest. Minting a live key that can withdraw needs 2FA and a fresh code, and with 2FA on, every live key, and every change to a live webhook endpoint, asks for a code too, because a webhook decides where "this order is paid" notices go. A merchant can have up to 20 active keys per mode, so one per shop or service is practical, and the dashboard shows what each key has done.
Give each key only the scopes it needs
A key carries one or more of five scopes, chosen when it is created in the dashboard:
| Integration | Scopes |
|---|---|
| Shop checkout: create invoices and look them up | invoices:write, invoices:read |
| Accounting export or a reporting job | invoices:read, balances:read, payouts:read |
| Automatic daily settlement to your own wallet | balances:read, payouts:write, payouts:read |
A call outside a key's scopes fails with 403 (missing_scope) and nothing happens, and a wrong or revoked key gets a 401. The rates and coin-list routes work with any valid key, so every integration can price things. Test keys (sk_test_…) and live keys (sk_live_…) see separate invoices and balances; build against test mode, where the dashboard can mark an invoice paid for you (see the sandbox guide).
Check a key in ten seconds
Before wiring a new key into a shop, this script confirms it works and has the scope you expect:
// check.mjs: test a new API key before you build on it. Node 18+, no packages.
// EASYWAY_KEY=sk_test_... node check.mjs
const BASE = "https://api.easyway.cash";
const KEY = process.env.EASYWAY_KEY;
async function get(path) {
const res = await fetch(BASE + path, {
headers: { Authorization: `Bearer ${KEY}` },
signal: AbortSignal.timeout(10_000),
});
const body = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(`${res.status} ${body.error}: ${body.message}`);
return body;
}
try {
const assets = await get("/v1/assets"); // any valid key, no scope needed
console.log(`key works: ${assets.data.length} coins, fee ${assets.fee_bps / 100}%`);
const balances = await get("/v1/balances"); // needs balances:read
for (const b of balances.data) console.log(b.asset, b.available, `(locked ${b.locked})`);
} catch (err) {
console.error(err.message); // "403 forbidden: missing_scope" when the key lacks balances:read
process.exit(1);
}We ran it on Node 22 against the live API with a made-up key: it printed 401 unauthorized: invalid_api_key and exited with code 1, so a deploy script can stop on it. With a real key without balances:read, the first line succeeds and the second call fails with 403 forbidden: missing_scope. Which errors to retry and which to fix is covered in crypto payment API errors.
A sensible first hour
In the dashboard: switch on 2FA, whitelist the wallet(s) you will withdraw to, add your webhook endpoint and copy its secret, and create one test key with only the scopes from the table above. In code: create an invoice, redirect the customer to its payment_url, and fulfil the order when a signed invoice.paid arrives (the quickstart has curl, Node.js, Python and PHP versions, and webhook retries explains duplicates). When it works in test mode, repeat the dashboard steps in live mode. If you never want to write code, a payment link made in the dashboard does the same job.