Quickstart

This guide walks you from a fresh account to your first paid order. You'll create an API key, sign a request, create a charge, and learn how to be notified when it is paid.

1. Create an API key

If an operator created your account, account creation does not generate a portal password or send a password email. Ask the operator to set an initial password from your merchant detail page. Sign in with it, open Settings → Security → Send email link, then open the one-time link sent to your registered email (valid for one hour) and set your own password. Sign in again before creating an API key. The initial-password session cannot create API keys; changing the password with the old password does not lift that restriction.

Sign in to the merchant portal and create an API key pair. You'll get a key id (pk_test_… for sandbox, pk_live_… for production) and a secret (sk_…) that is shown only once. Start with a pk_test_ key — it runs the full flow without moving real money.

2. Pick a channel

A channel can collect on-chain assets, card payments or local fiat payments such as LianLian. Availability depends on your merchant payment modes and the API key environment. Sign the following request with your own merchant key and use a returned code; a code from another account or environment may be unavailable.

List channels

GET
/api/v1/channels
# See Authentication for how TS / SIG are computed.
curl "$BASE/api/v1/channels" \
  -H "X-Api-Key: $KEY_ID" \
  -H "X-Timestamp: $TS" \
  -H "X-Signature: $SIG"

LianLian hosted checkout

The platform configures LianLian in Fluxa and enables the fiat payment mode for your merchant. Use your own Fluxa API key; you do not need an EveryAPI account or the platform’s LianLian credentials. Select the actual LianLian code, currencies and methods returned by Channels. Channel codes are deployment-specific: lianlian_wechat is not a universal default.

For POST /api/v1/charges, pass that channel, a supported currency, a decimal-string amount and your unique merchant_order_id; omit network. Use method only if it appears in the channel’s methods. Follow instruction.redirect_url, then fulfill only after a verified payment.succeeded or an authenticated order query confirms payment. The browser return URL is not proof of payment. LianLian is custodial: the proceeds credit your Fluxa balance. The current adapter does not support refunds through Fluxa; coordinate them with the operator.

3. Create a charge

Create a charge for an amount in a currency on a channel. merchant_order_id is your idempotency key — reusing it returns the same order instead of creating a duplicate.

The response bundles the order, the payment attempt, and a payer instruction. For an on-chain channel the instruction is a crypto_address: the deposit_address, amount_due, chain/asset, and the required confirmations. See Charges for the full reference.

Create a charge

POST
/api/v1/charges
curl "$BASE/api/v1/charges" \
  -H "X-Api-Key: $KEY_ID" \
  -H "X-Timestamp: $TS" \
  -H "X-Signature: $SIG" \
  -H "Content-Type: application/json" \
  -d '{
    "merchant_order_id": "order-1001",
    "amount": "49.90",
    "currency": "USDT",
    "network": "tron",
    "subject": "Pro plan"
  }'

Response

{
  "order": {
    "id": "ord_2Zx9Qw8sUaM2",
    "merchant_order_id": "order-1001",
    "status": "created",
    "amount": "49.90",
    "currency": "USDT",
    "channel_code": "usdt_trc20"
  },
  "payment": { "id": "pay_7K2m", "status": "initiated" },
  "instruction": {
    "type": "crypto_address",
    "deposit_address": "TQ5...Xy9",
    "amount_due": "49.90",
    "chain": "usdt_trc20",
    "asset": "USDT",
    "required_confirmations": 19
  },
  "idempotent": false
}

4. Direct the payer

Act on the instruction:

  • crypto_address — what an on-chain channel returns. Show the payer deposit_address, amount_due, chain/asset, and the required confirmations. Label amount_due as the amount that must ARRIVE: exchanges deduct their withdrawal fee from the amount sent, so a payer who withdraws exactly that figure lands short and the order parks as underpaid.

  • redirect — send the payer to redirect_url, including for LianLian hosted checkout.

  • client_secret — initialize the supported payment UI with client_secret and publishable_key; see Charges. Keep your Fluxa signing secret on the server.

  • none — inspect the returned order status. Reusing a closed order ID does not create a new payable order; use a new merchant_order_id for a new purchase.

5. Get notified when it's paid

Don't poll in production — register a webhook URL in the portal and fluxa will POST you a signed payment.succeeded event the moment the order settles. See Webhooks to verify the signature. You can also fetch an order any time:

Get an order

GET
/api/v1/orders/:id
curl "$BASE/api/v1/orders/ord_2Zx9" \
  -H "X-Api-Key: $KEY_ID" \
  -H "X-Timestamp: $TS" \
  -H "X-Signature: $SIG"

Verify the raw body before parsing, decrypt if enabled, then require a non-empty string event_id in the event body. Do not trust an unsigned header or fall back to an order/type tuple. Persist the event ID and business changes in one transaction. For settle_on_received, apply only the increase in cumulative received_amount using decimal arithmetic, including when payment.additional_received arrives before payment.succeeded.

Next steps