Orders
An order is a single charge request and its lifecycle. Every charge creates one. Use these endpoints to list your orders, fetch one with its payment and settlements, issue refunds and cancel orders that have not been paid.
The order model
See Charges for the full field list. The lifecycle status is one of:
- Name
created- Type
- Description
Persisted, awaiting a payment instruction.
- Name
pending- Type
- Description
Payment in flight (processing or awaiting confirmations).
- Name
paid- Type
- Description
Fully settled.
- Name
expired- Type
- Description
Not paid before expiry.
- Name
canceled- Type
- Description
Canceled before payment.
- Name
failed- Type
- Description
The payment attempt failed terminally.
- Name
refunded- Type
- Description
Fully refunded.
- Name
partially_refunded- Type
- Description
Part of the amount has been returned;
refunded_amountis between0andamount.
Three fields describe the settle-on-received opt-in (direct-settlement channels only, see Charges):
- Name
settle_on_received- Type
- boolean
- Description
truefor an order that settles at the amount actually received;falsefor every other order. Immutable.
- Name
min_received_amount- Type
- string
- Description
The stamped minimum cumulative received amount that settles the order. Present only when
settle_on_receivedistrue.
- Name
received_amount- Type
- string
- Description
Cumulative gross amount credited for the order:
"0"until it settles, then what actually arrived, growing with each later transfer credited aspayment.additional_received. This is the authoritative current value for reconciliation. Always"0"and meaningless for exact-mode orders.
Two fields report what a settled order leaves you, for reconciliation:
- Name
fee- Type
- string
- Description
The platform fee the order bears as of now, as a decimal string: the fee charged at payment, plus the fee of each later
payment.additional_receivedtransfer, less what refunds returned. Only a refund of a custodial order returns fee, pro rata to the amount refunded (a full refund returns all of it). A direct-settlement order is refunded from your own account and its platform fee is not returned, so itsfeedoes not change on a refund or chargeback."0"on a settled order that is charged no fee, such as an order on your own Stripe key. Absent on an order that has not settled and on a test-mode order (test orders never settle): treat it as optional.
- Name
net- Type
- string
- Description
What you keep from the order as of now: the gross credited for it (
amount;received_amountfor asettle_on_receivedorder; what actually arrived when an on-chain order was overpaid, since the surplus is credited to you) lessrefunded_amountlessfee. Present exactly whenfeeis. On a direct-settlement order the money sits in your own account or wallet, not a fluxa balance, and fees your provider charges there are in neitherfeenornet. Because a direct-settlement order keeps its platform fee after a refund,netcan be negative: a fully refunded order shows minus thefee. Do not assume it is non-negative.
Both are derived from the ledger each time the order is read; a webhook carries them as they stood when the event happened (see Webhooks).
List orders
Signed locally — your secret stays in this browser and is never sent or stored.
No keys yet? Create an API key pair in the merchant portal — the secret is shown only once. Open the merchant portal →
Return a paginated list of your orders, oldest first (by creation time).
Optional attributes
- Name
status- Type
- string
- Description
Filter by order status (e.g.
paid).
- Name
merchant_order_id- Type
- string
- Description
Return only the order with exactly this
merchant_order_id(at most one per account).
- Name
paid_from- Type
- timestamp
- Description
Return only orders paid at or after this time (RFC 3339 with a time zone, e.g.
2026-11-01T00:00:00Z).
- Name
paid_to- Type
- timestamp
- Description
Return only orders paid before this time.
paid_from/paid_toform the half-open window[paid_from, paid_to), so consecutive windows (one day after another) never count an order twice. Either bound excludes orders that were never paid; a refunded order stays in the window it was paid in. Combine withstatusif needed. A timestamp that is not RFC 3339, or apaid_tobeforepaid_from, is400 invalid_filter. URL-encode a+hh:mmoffset as%2B, or useZ.
- Name
limit- Type
- integer
- Description
Page size. Default
20, max200.
- Name
offset- Type
- integer
- Description
Records to skip. Default
0.
Request
curl -G "$BASE/api/v1/orders" \
-d status=paid -d limit=20 \
-H "X-Api-Key: $KEY_ID" \
-H "X-Timestamp: $TS" \
-H "X-Signature: $SIG"
Response
{
"data": [
{
"id": "ord_2Zx9Qw8sUaM2",
"merchant_order_id": "order-1001",
"channel_code": "usdt_trc20",
"amount": "49.90",
"refunded_amount": "0",
"settle_on_received": false,
"received_amount": "0",
"currency": "USDT",
"status": "paid",
"fee": "0.25",
"net": "49.65",
"paid_at": "2026-06-11T08:30:00Z",
"created_at": "2026-06-11T08:25:00Z"
}
],
"total": 134,
"limit": 20,
"offset": 0
}
Retrieve an order
Signed locally — your secret stays in this browser and is never sent or stored.
No keys yet? Create an API key pair in the merchant portal — the secret is shown only once. Open the merchant portal →
Fetch one of your orders by id. The response includes the latest payment attempt, any settlements (on-chain sweeps), and checkout_url — the last hosted-checkout link issued for the order, when applicable.
Request
curl "$BASE/api/v1/orders/ord_2Zx9Qw8sUaM2" \
-H "X-Api-Key: $KEY_ID" \
-H "X-Timestamp: $TS" \
-H "X-Signature: $SIG"
Response
{
"order": {
"id": "ord_2Zx9Qw8sUaM2",
"status": "paid",
"amount": "49.90",
"currency": "USDT",
"channel_code": "usdt_trc20"
},
"payment": {
"id": "pay_7K2mQ",
"status": "succeeded",
"channel_ref": "0x9f3c...a1",
"amount": "49.90",
"currency": "USDT"
},
"settlements": [
{
"id": "stl_4Hn8Lp",
"status": "confirmed",
"amount": "49.65",
"fee": "0.25",
"to_address": "TQmsxC...merchantWallet",
"tx_hash": "0x7ad2...e9"
}
],
"checkout_url": ""
}
Refund an order
Signed locally — your secret stays in this browser and is never sent or stored.
No keys yet? Create an API key pair in the merchant portal — the secret is shown only once. Open the merchant portal →
Refund support depends on the order’s channel. Custodial orders can be refunded only where supported by the adapter; LianLian currently does not support Fluxa refunds. Orders paid with your own Stripe key are refunded on your Stripe account with that key. On-chain and Stripe Connect orders cannot be refunded through Fluxa (see below).
Refund a paid (or partially refunded) order. Omit amount to refund the full remaining balance, or pass a decimal amount for a partial refund. The order becomes refunded once fully returned, otherwise partially_refunded.
Optional attributes
- Name
amount- Type
- string
- Description
Amount to refund, as a decimal string. Omit to refund the full remaining balance.
- Name
reason- Type
- string
- Description
Free-text reason recorded with the refund.
- Name
idempotency_key- Type
- string
- Description
Your key for this refund attempt (an
Idempotency-Keyheader takes precedence over the body field, as for payouts). A retry that reuses the key returns the order exactly as the first attempt left it instead of refunding again. Strongly recommended for partial refunds: without a key, a retried request after a timed-out response is a second refund.
Orders paid on your own Stripe key. The refund is created on your own Stripe account with the key you saved in the portal, against the order's payment, and your idempotency key is passed to Stripe as its Idempotency-Key (scoped to the order, as refund:<order_id> key=<your key>), so a retry never refunds twice there either. The order records Stripe's cumulative refunded amount and payment.refunded (with reason: "refund") is sent once per change, whether the API call or Stripe's charge.refunded reaches fluxa first; duplicated or out-of-order Stripe events change nothing. Your fluxa balance is not touched. A restricted key (rk_) needs write access to Refunds. If the key is no longer saved for that environment the refund returns 409 refund_unsupported without calling Stripe; once Stripe has withdrawn funds of the order for a dispute (reported as payment.refunded with reason: "dispute") it returns 409 refund_disputed without calling Stripe, because Stripe's refund total does not count the withdrawn funds, and you handle the order in your Stripe Dashboard; if Stripe settled the order with Konbini (or another method Stripe refunds only after emailing the customer for bank details, such as PromptPay, Boleto or a bank transfer) it returns 409 refund_method_unsupported without calling Stripe, and you refund it in your Stripe Dashboard (PayPay is refunded to the wallet at once and goes through fluxa as usual; an order whose Konbini voucher is still unpaid is pending and returns 409 not_refundable); if Stripe charged the customer in a different currency or amount than the order (for example with Adaptive Pricing on your account) it returns 409 refund_charge_mismatch without asking Stripe to refund, and you refund that order in your Stripe Dashboard; if Stripe refuses it (more than is left on the charge, a disputed charge, a key without permission) it returns 502 provider_refund_failed, no refund exists on Stripe and the order is unchanged; fix the cause and retry with a new idempotency key, because Stripe answers a reused key with its first (failed) answer for 24 hours. If its result cannot be confirmed it returns 502 provider_refund_unconfirmed: the refund may exist on Stripe, so check the order before retrying, and retry only with the same idempotency key. Refunds you make in your Stripe Dashboard keep syncing to the order as before; a Konbini refund made there is recorded, and payment.refunded sent, only once the customer has submitted their bank details and Stripe starts paying it out, not when you create it (your Stripe endpoint needs the events listed in Settlement modes).
Other direct-settlement (settlement_mode: "direct") orders cannot be refunded through fluxa — they settle directly to your own account, so fluxa never held the funds and returns 409 refund_unsupported. Refund on-chain orders off-platform. Refund Stripe Connect orders from your own Stripe Dashboard: fluxa picks up the refund from Stripe, updates the order to refunded / partially_refunded and sends the payment.refunded webhook, without touching your fluxa balance. A Konbini refund is picked up only once the customer has submitted their bank details and Stripe starts paying it out.
Request
curl "$BASE/api/v1/orders/ord_2Zx9Qw8sUaM2/refund" \
-H "X-Api-Key: $KEY_ID" \
-H "X-Timestamp: $TS" \
-H "X-Signature: $SIG" \
-H "Content-Type: application/json" \
-d '{ "amount": "10.00", "reason": "partial refund" }'
Response
{
"order": {
"id": "ord_2Zx9Qw8sUaM2",
"status": "partially_refunded",
"amount": "49.90",
"refunded_amount": "10.00",
"settle_on_received": false,
"received_amount": "0",
"currency": "USDT"
}
}
Cancel an order
Signed locally — your secret stays in this browser and is never sent or stored.
No keys yet? Create an API key pair in the merchant portal — the secret is shown only once. Open the merchant portal →
Cancel an order that has not been paid (created or pending) so that fluxa never credits it, for example after you freeze a payer. The order becomes canceled, any on-chain deposit address it held is released, and order.canceled is sent (opt-in). There is no request body.
For an embedded Stripe charge (presentation: "embedded"), fluxa cancels the PaymentIntent at Stripe in the background, usually within seconds and retrying for up to a few hours if Stripe is unavailable. Until then the client secret you handed to the browser may still be confirmed, so close the payment page when you cancel. A Stripe hosted checkout page (the default redirect presentation) is closed the same way: fluxa expires the open Checkout Session and voids an unpaid Konbini voucher at Stripe in the background. A hosted page of any other channel is not closed at the provider: a payer who already has the link may still be able to pay until that page expires on its own. A payment that lands on a canceled order is never credited and never turns the order paid: the platform operator is alerted to reconcile it. If a payment completes before the cancel, the cancel answers 409 order_not_cancelable and the order is paid as usual.
The call is idempotent: cancelling an order that is already canceled returns 200 with the same order and sends no second order.canceled, so you can retry safely. A paid, refunded, partially_refunded, expired or failed order returns 409 order_not_cancelable. Another merchant's order, or a live order seen through a test-mode key (and the reverse), returns 404 order_not_found, exactly like an unknown id.
Request
curl -X POST "$BASE/api/v1/orders/ord_2Zx9Qw8sUaM2/cancel" \
-H "X-Api-Key: $KEY_ID" \
-H "X-Timestamp: $TS" \
-H "X-Signature: $SIG"
Response
{
"order": {
"id": "ord_2Zx9Qw8sUaM2",
"status": "canceled",
"amount": "49.90",
"refunded_amount": "0",
"settle_on_received": false,
"received_amount": "0",
"currency": "USD"
}
}
Get a payment link
Signed locally — your secret stays in this browser and is never sent or stored.
No keys yet? Create an API key pair in the merchant portal — the secret is shown only once. Open the merchant portal →
Get a payable hosted-checkout link for an unpaid order, for example to show the payer of a subscription invoice a link that still works: a Stripe Checkout page lives at most 24 hours, while the order can stay payable longer. There is no request body.
The call is idempotent. While the order's current link stays payable for at least 15 more minutes it is returned as is (reissued: false) and the provider is not called. A link that has expired, expires within 15 minutes, or whose expiry is unknown is replaced by a new provider session (reissued: true); the new link keeps the charge's return_url and cancel_url, the order's checkout_url points at it, and the replaced page is closed with the order. Concurrent calls get the same link. expires_at is when the returned link stops being payable (null when the channel does not say). Show the link right away rather than storing it: call again when the payer comes back.
An order that is paid, partially_refunded, refunded, expired, canceled or failed, or whose deadline has passed, returns 409 order_not_payable. An embedded charge, or a channel without a hosted checkout (on-chain), returns 400 not_redirect_channel. Another merchant's order, or a live order seen through a test-mode key (and the reverse), returns 404 order_not_found.
Request
curl -X POST "$BASE/api/v1/orders/ord_2Zx9Qw8sUaM2/payment-link" \
-H "X-Api-Key: $KEY_ID" \
-H "X-Timestamp: $TS" \
-H "X-Signature: $SIG"
Response
{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_…",
"expires_at": "2026-12-02T09:30:00Z",
"reissued": false
}