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_amount is between 0 and amount.

Three fields describe the settle-on-received opt-in (direct-settlement channels only, see Charges):

  • Name
    settle_on_received
    Type
    boolean
    Description

    true for an order that settles at the amount actually received; false for 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_received is true.

  • 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 as payment.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_received transfer, 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 its fee does 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_amount for a settle_on_received order; what actually arrived when an on-chain order was overpaid, since the surplus is credited to you) less refunded_amount less fee. Present exactly when fee is. 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 neither fee nor net. Because a direct-settlement order keeps its platform fee after a refund, net can be negative: a fully refunded order shows minus the fee. 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).


GET/api/v1/orders

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_to form 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 with status if needed. A timestamp that is not RFC 3339, or a paid_to before paid_from, is 400 invalid_filter. URL-encode a +hh:mm offset as %2B, or use Z.

  • Name
    limit
    Type
    integer
    Description

    Page size. Default 20, max 200.

  • Name
    offset
    Type
    integer
    Description

    Records to skip. Default 0.

Request

GET
/api/v1/orders
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
}

GET/api/v1/orders/:id

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

GET
/api/v1/orders/ord_2Zx9Qw8sUaM2
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": ""
}

POST/api/v1/orders/:id/refund

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-Key header 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.

Request

POST
/api/v1/orders/ord_2Zx9Qw8sUaM2/refund
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"
  }
}

POST/api/v1/orders/:id/cancel

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

POST
/api/v1/orders/ord_2Zx9Qw8sUaM2/cancel
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"
  }
}

POST/api/v1/orders/:id/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

POST
/api/v1/orders/ord_2Zx9Qw8sUaM2/payment-link
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
}