Payment Flow — Happy Path
This page describes the standard end-to-end payment flow in Fluxis: from creating a payment request through on-chain detection, asynchronous processing, and webhook delivery. For non-standard outcomes (underpayment, expiration, failed transactions), see Payment Flows — Edge Cases.
Architecture overview
Fluxis payment processing spans four cooperating services:
Code
| Service | Role |
|---|---|
| Core API | Creates payment requests, assigns vault addresses, generates NASPIP tokens, exposes REST endpoints |
| Cron | Polls blockchains every 3 seconds for ERC-20 Transfer events to active vault addresses |
| Transaction Worker | Consumes the transactions SQS queue and runs the 3-hop payment lifecycle |
| Crypto Service | External service for vault management, consolidation, and settlement (post-payment) |
Merchants interact only with the Core API and account-level webhooks. Blockchain monitoring and transaction confirmation happen asynchronously.
Prerequisites
Before a payment can succeed, the merchant hierarchy must be configured:
Code
- Organization and Account — See Merchant Sign Up.
- Point of Sale — An
online_fixedPoS (e-commerce) orcashier_fixedPoS (physical register). See Point of Sale. - Authentication — Bearer token +
x-fluxis-api-keyon protected routes. See Authentication & Configuration. - Webhook (recommended) — Register at account scope:
POST /v1/account/{accountID}/webhook. See Webhooks.
Step 1 — Create a payment request
Create a payment request through the Point of Sale endpoint — not a standalone /v1/payment-requests route:
Code
Code
Hosted checkout alternative
When the payer should choose their asset from the PoS payment_options, use POST /v1/pos/{posID}/payment-request-checkout. The payment request starts in pending status and transitions to created once the payer selects a UAI. See Creating Payment Requests.
What Fluxis does internally
Code
On creation, Fluxis:
- Validates the PoS and resolves the UAI
- Assigns a unique vault address from the pre-deployed pool
- Sets status to
createdand an 8-minute expiration timestamp - Caches the vault address in Redis for fast cron lookups
- Returns a NASPIP token for QR code / payment link display
Example response:
Code
Step 2 — Customer pays on-chain
The customer scans the NASPIP token (QR code or link) and sends the exact amount to the vault address on the configured network. Fluxis does not hold custody during this step — the payment goes directly to the vault smart contract.
Your application should:
- Display the NASPIP token and a countdown based on
expiration - Poll
GET /v1/pos/{posID}/payment-request/{paymentRequestID}or wait for webhooks - Not fulfill the order until the payment reaches a terminal status
Step 3 — Cron detects the transfer
The cron service runs a blockchain reading job every 3 seconds on supported networks (Polygon, Base, Avalanche, Arbitrum):
Code
Key details:
- Uses
eth_getLogswith adaptive chunking to query ERC-20Transferevents efficiently - Filters transactions where the recipient (
to) matches an active vault address cached in Redis - Enqueues matched transactions to the
transactionsSQS queue with event typetransaction_incoming_payment
Step 4 — Three-hop SQS worker
The transaction worker processes each payment through three sequential SQS hops:
Code
Hop 1 — transaction_incoming_payment
- Validates payment request is in
createdorprocessing - Updates status to
processing - Sends a webhook with status
processing - Enqueues hop 2 with a finality delay (default 256 seconds on Polygon, configurable per network)
Hop 2 — transaction_check_update_payment_request
After the finality delay:
- Calls
GetTransactionto verify on-chain status (pending / confirmed / failed) - Uses the amount from cron's
eth_getLogsdetection (not fromGetTransaction, which fails on proxy/router transactions) - Compares received amount vs expected amount:
- Equal →
completed - Less →
underpaid - Greater →
overpaid
- Equal →
- Sends a webhook with the final status
- Enqueues hop 3 immediately and releases the vault
Hop 3 — transaction_confirm_payment_request
- Runs only for
completedoroverpaidpayments - Creates an internal Transaction record (fees, addresses, ledger entry)
- Updates payment request status to
confirmed - Does not send a webhook (see webhook matrix in Edge Cases)
Underpaid payments
Hop 3 does not run for underpaid payments — no internal transaction is created. See Edge Cases — Underpaid.
Step 5 — Webhook notifications
Fluxis delivers webhooks at account scope when payment request status changes during hops 1 and 2:
Code
| Webhook-delivered status | When |
|---|---|
processing | Cron detected an on-chain transfer to the vault |
completed | Confirmed after finality; amount matches expected |
underpaid | Confirmed after finality; received less than expected |
overpaid | Confirmed after finality; received more than expected |
Verify every webhook with HMAC-SHA256 before processing. See Webhook Signature Verification and Webhooks.
Payment request states
Code
| State | Description | Merchant action |
|---|---|---|
pending | Created via checkout; payer has not selected a UAI yet | Show checkout / asset picker |
created | Vault assigned; awaiting on-chain payment (8-minute window) | Display NASPIP token; poll or use webhooks |
processing | Transfer detected; awaiting blockchain finality | Inform customer payment is being confirmed |
completed | Full payment confirmed after finality | Fulfill order |
confirmed | Internal ledger transaction created | Payment is settled in Fluxis accounting |
underpaid | Confirmed but amount is less than expected | See Edge Cases |
overpaid | Confirmed but amount exceeds expected | See Edge Cases |
expired | No payment received before expiration | Create a new payment request |
Do not fulfill on processing
Wait for completed, underpaid, or overpaid before fulfilling orders. The processing status means a transfer was detected but has not yet reached finality.
Timing and expiration
Two different timeouts apply depending on the flow:
| Flow | Timeout | Applies to |
|---|---|---|
| Payment request | 8 minutes | From vault assignment (created status) until expiration |
| Payment intention | 5 minutes | Cashier PoS flow (cashier_fixed / cashier_open) before the merchant creates the payment request |
Expiration cron
A background job runs every 30 seconds to mark payment requests with status created and expiration < now as expired. Transactions broadcast near the deadline may still be detected while the vault remains cached briefly after expiration.
For the cashier flow, the merchant creates a payment intention via POST /v1/pos/{posID}/payment-intention with a 5-minute window. Once confirmed, Fluxis creates the payment request with the standard 8-minute payment window.
End-to-end sequence
Code
Monitoring options
| Method | Endpoint / setup | Best for |
|---|---|---|
| Webhooks (recommended) | POST /v1/account/{accountID}/webhook | Production — real-time status updates |
| Polling | GET /v1/pos/{posID}/payment-request/{paymentRequestID} | Development or webhook fallback |
| Transactions list | GET /v1/transactions?page=1&page_size=50 | Reconciliation after confirmed |
Related documentation
- Creating Payment Requests — Integration guide with API examples
- Payment Requests — States, fields, and checkout flow
- Payment Flows — Edge Cases — Underpaid, overpaid, expired, failed transactions, refunds
- Webhooks — Registration and payload format
- Webhook Signature Verification — HMAC verification and test workflow
- NASPIP — Token format and wallet compatibility
- API Reference — Point of Sale — Interactive endpoint documentation