Suward
Quickstart
QUICKSTART

Quickstart

From signup to your first confirmed payment in one evening. One REST API, a hosted checkout, and status you poll for. No SDK to learn and nothing to self-host.

PendingSafeFinalized

Sign up → Project → API key → Create payment → Checkout → Check status

Today you poll the API for status. Webhooks are in development, so this guide uses a poll loop instead of a callback handler. Webhooks: Soon

01

Step 1. Sign up and create a project

Create an account, then an organization and a project. Payments, balances and API keys all live at the project level, so one project keeps its own books separate from the next.

Sign up takes you straight into your dashboard, where you manage projects, API keys, payments and balances.

02

Step 2. Create an API key

Inside your project, create a v2 API key. You pass it in the X-Api-Key header on every server-to-server call. Keys carry their own rate limit and can be rotated, and you revoke one by its prefix.

Suward authenticates two ways: a cookie session (HttpOnly accessToken and refreshToken) for the browser dashboard, and the X-Api-Key header for server integration. Keep the key on your backend and never ship it to the browser.

03

Step 3. Create a payment

One payment is one asset on one network. Send the amount, the asset, an optional externalId (your order reference) and a callbackUrl. The response hands back a unique deposit address for this payment alone.

Pass your own externalId as the order key. Send the same externalId again and Suward returns the existing payment instead of opening a second one, so a retried request never double-counts an order. Money values are strings, not floats. A single payment caps at 60,000.

curl -X POST https://api.suward.com/v1/projects/{projectId}/payments \
-H "X-Api-Key: <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"amount":"100.00","asset":"USDT","externalId":"order-42","isTest":false}'
04

Step 4. Show the checkout

Two ways to collect the payment. Redirect the buyer to the hosted Suward page, which shows the QR address, a watching-mempool indicator and a countdown. Or render your own UI from the address, amount and asset and monitor the status yourself.

There is no embeddable widget or JS SDK yet, only the hosted redirect. The hosted checkout URL is included in the payment response.

05

Step 5. Check payment status

Poll the payment until it reaches a terminal status. The status comes in two levels: status (the top line, e.g. PENDING, ACCEPTED, SUCCESS, FAILED) and subStatus (the on-chain detail: Pending → Safe → Finalized). The public GET /v1/payments/{paymentId} suits a checkout page; the project-scoped path returns the full picture.

Read status names dynamically from GET /v1/paymentStatuses rather than hardcoding them, so your integration survives a future status change.

# Public endpoint — no auth needed for the checkout page
curl https://api.suward.com/v1/payments/{paymentId}
06

Step 6. Read your balance

After a payment reaches SUCCESS, the amount is credited to your project balance. Balances are split into safe and accepted, stored as Decimal128, and never go negative.

curl https://api.suward.com/v1/projects/{projectId}/balances \
-H "X-Api-Key: <API_KEY>"

What's next

Dig into the full API reference, browse the assets and networks you can charge in, set up key rotation and rate limits, and read how reorg protection holds a payment to finality. Balances and withdrawals are documented separately.

When webhooks ship, you will be able to swap polling for push notifications. For now, polling is the way.