OptionalbillingWhich billing model this settle was priced under (Nevermined extension).
Reported whether or not the settle succeeded — so check success before
treating it as evidence of a charge. It is absent entirely against a
Nevermined API that predates the discriminator, which is why it is optional;
treat that case as credits. Read it before creditsRedeemed /
remainingBalance: see the interface docs above for the per-model criterion.
OptionalcreditsNumber of credits redeemed (Nevermined extension). Always the string '0' for
billingModel: 'pay-as-you-go' plans, which hold no credit balance — including
on a settle that charged the buyer successfully.
OptionalerrorReason for settlement failure (only present if success is false)
Network identifier. The discriminator is the rail, not the billing model: for
crypto rails (nvm:erc4337) it is the CAIP-2 chain id (eip155:84532) under
both billing models; for fiat card-delegation rails it is the settling payment
provider (stripe, braintree, visa), not a CAIP-2 value.
OptionalorderReference for the order or per-request charge, if one occurred (Nevermined
extension). On fiat pay-as-you-go this is the per-request charge — the PSP
transaction id (a Stripe PaymentIntent pi_…, a Braintree transaction id);
crypto pay-as-you-go reports its on-chain order in transaction instead. On
credits plans it is set only when the settle had to order credits first
(auto top-up). Treat it as an opaque string and disambiguate by prefix if you
need to.
OptionalpayerAddress of the payer's wallet
OptionalremainingSubscriber's remaining credit balance (Nevermined extension). Always the string
'0' for billingModel: 'pay-as-you-go' plans — the per-request charge is
referenced by orderTx (fiat) or transaction (crypto), not here.
Whether settlement was successful
Blockchain transaction hash (empty string if settlement failed). On crypto
pay-as-you-go plans this is also the reference for the per-request charge.
x402 Settle Response - per x402 facilitator spec
See
https://github.com/coinbase/x402/blob/main/specs/x402-specification-v2.md
Deciding whether the buyer was charged
successalone tells you the settle worked. What to check in addition depends on SettlePermissionsResult.billingModel:credits—success === true && Number(creditsRedeemed) > 0.pay-as-you-go—success === trueplus a non-emptyorderTx(fiat rails) ortransaction(crypto rails).creditsRedeemedandremainingBalanceare always the string'0'on this billing model and carry no information.Do not gate on
creditsRedeemedwithout readingbillingModelfirst: on a pay-as-you-go plancreditsRedeemed > 0can never hold, so a real charge reads as a decline — and retrying a card charge that already succeeded is the one thing to avoid, because repeated attempts feed issuer fraud scoring.Mind the type as well: these fields are strings.
'0'is truthy whileNumber('0') > 0is false, so two plausible-looking checks disagree.If
billingModelis absent, you are talking to a Nevermined API that predates the discriminator: apply thecreditsrule, and never read a missing discriminator as pay-as-you-go.Example