Error codes
A refused verify answers isValid: false with the code in invalidReason; a failed settle answers success: false with it in errorReason. Both use one vocabulary: the codes the Canton exact scheme and x402 v2 define, plus one of this implementation's own, marked below. Match on the code.
extensions.detail, when present, says which of a code's causes it was, where the code alone leaves two apart. invalidMessage and errorMessage are free text for logs and people: they change between releases, so never match on them.
The payment does not match
The signed transfer is not the payment you asked for. Nothing was submitted, and the same payload will be refused again: the payer has to build a new payment.
invalid_exact_canton_amount_mismatch: The transfer moves a different amount fromamount. The amount must be equal, not merely enough.invalid_exact_canton_merchant_mismatch: The transfer pays someone other thanpayTo.invalid_exact_canton_instrument_id_mismatch: The transfer moves a different instrument fromextra.instrumentId, or the facilitator does not settle that instrument (detailunserved_instrument).invalid_exact_canton_memo_mismatch: The transfer'sx402.memodiffers fromextra.memo, or carries one you did not quote.invalid_exact_canton_expired: The transfer's own deadline (executeBefore) is past, or under 5 seconds away.invalid_exact_canton_preapproval_missing: The transfer would not land directly atpayTo, which needs a liveTransferPreapproval. Without one it becomes an offer the merchant must accept, which the facilitator refuses to relay.invalid_exact_canton_insufficient_inputs: The holdings the transfer spends are missing, repeated, or do not cover the amount.invalid_exact_canton_synchronizer_mismatch: This implementation's own. The transfer was prepared on a different synchronizer fromextra.synchronizerId. The spec defines no code for it; another facilitator may answerinvalid_exact_canton_malformed_payload.invalid_exact_canton_self_payment: The payer is the facilitator's own party.
The payment is not well-formed
invalid_exact_canton_missing_proof: The payload is missingpreparedTransaction,preparedTxHashorsignature.invalid_exact_canton_malformed_payload: The proof does not decode, or is not one transfer through the instrument's realTransferFactory. The detail names the part:undecodable(it will not gunzip),structure_undecodable(it gunzips but cannot be read),payload_shape,unsupported_hashing_scheme, or afactory_detail.invalid_exact_canton_signature_invalid: The signature does not prove the payer signed this transaction:no_payer_key(the party publishes no key the facilitator can use),malformed_encoding(the hash or signature is not in the spec's encoding),hash_mismatch(the hash describes a different transaction) orbad_signature(it verifies under none of the party's keys).
The requirements are wrong
The merchant's side needs fixing, not the payer's.
invalid_payload: The body is not an x402 v2 request:{ x402Version: 2, paymentPayload, paymentRequirements }, withpaymentPayload.accepteda whole set of requirements. Answered with HTTP400.unsupported_scheme: The scheme is notexact.invalid_network: The payment's network differs from the requirements', or is not the network this facilitator settles.invalid_payment_requirements: The requirements are malformed (for example aninstrumentIdwithout itsadmin, or an amount that is not atomic units), or a settle reuses anextra.memothis project has already settled under (detailmemo_already_used).invalid_exact_canton_fee_payer_mismatch:extra.feePayeris not this facilitator's party. Take it fromGET /v2/supported.invalid_exact_canton_merchant_not_registered: Your API key may not receive atpayTo(detaildestination_not_allowed):payTomust be a party your project owns.
Settlement outcomes
settlement_pending: Not a failure. The transaction was relayed and its outcome is not known yet.transactionnames it. What to do: Do not ask for a new payment. Retrying the same payload is safe and answersinvalid_exact_canton_execute_failedif the relay failed, but keeps answeringsettlement_pendingeven once it commits. A verify of a payment already relayed answers the same way, with the transaction inextra. See Pending payments.invalid_exact_canton_execute_failed: The ledger rejected the transaction. Also the answer to a replay of one that failed. What to do: The payer builds a new payment.
Faults
unexpected_canton_ledger_error: The facilitator could not read the ledger: the payer's keys (detailpayer_keys_unavailable) or the ledger's position before submitting (ledger_end_unavailable). Nothing was submitted. What to do: Retry the same payload.unexpected_verify_error: A fault in the facilitator during verify. HTTP500. What to do: Retry.unexpected_settle_error: A fault during settle. HTTP500, or503withRetry-Afterand detailcapacity_exhaustedwhen the facilitator is out of ledger capacity for the day, in which case nothing was submitted. What to do: Retry the same payload, afterRetry-Afterif given.
Defined but not answered
The specs also define invalid_exact_canton_execute_before_too_far, insufficient_funds, invalid_scheme, invalid_transaction_state and invalid_x402_version. The SDK accepts them in an answer, but this facilitator does not send them: a body whose x402Version is not 2 is invalid_payload, and a payer without the funds cannot sign a transfer to begin with.