Skip to content

XRP Facilitator

The XRP Facilitator handles verification and settlement for XRP scheme payments.

Base URL

https://walletapi.fluxapay-qa.xyz/api/facilitator

Endpoints

MethodPathDescription
POST/api/facilitator/verifyValidate a signed XRP payment
POST/api/facilitator/settleSubmit and settle an XRP payment

Verify

POST /api/facilitator/verify

Request

Format A — base64 payload:

json
{
  "paymentPayload": "<base64-encoded X-Payment JSON>"
}

Format B — direct object:

json
{
  "payment": {
    "network": "xrpl-mainnet",
    "txHash": "ABC123...",
    "signedTransaction": "120000...",
    "account": "rSenderAddress",
    "destination": "rReceiverAddress",
    "amount": "1000000",
    "currency": "XRP"
  },
  "signature": "120000..."
}

Response (success)

json
{
  "isValid": true,
  "payer": "rSenderAddress",
  "network": "xrpl-mainnet",
  "currency": "XRP",
  "amount": "1000000",
  "amountDrops": "1000000",
  "nonce": "ABC123...",
  "txHash": "ABC123..."
}

Response (failure)

json
{
  "isValid": false,
  "invalidReason": "destination_mismatch_with_signed_transaction"
}

Settle

POST /api/facilitator/settle

Takes the same request format as verify.

The facilitator submits the signed transaction to XRPL via RPC (submit with tx_blob), records the onchain_tx_hash, and returns the engine result. Finality is confirmed asynchronously — the settle endpoint does not immediately mark the payment as used.

Response (success)

json
{
  "success": true,
  "txHash": "ABC123...",
  "transaction": "ABC123...",
  "network": "xrpl-mainnet",
  "paymentRequestId": "x402r:xrpl-mainnet:ABC123...",
  "alreadySettled": false,
  "alreadySubmitted": false,
  "engineResult": "tesSUCCESS",
  "engineMessage": "The transaction was applied."
}

Response (already settled)

json
{
  "success": true,
  "txHash": "ABC123...",
  "transaction": "ABC123...",
  "network": "xrpl-mainnet",
  "paymentRequestId": "x402r:xrpl-mainnet:ABC123...",
  "alreadySettled": true,
  "alreadySubmitted": false,
  "engineResult": null,
  "engineMessage": null
}

Error Scenarios

ErrorHTTPDescription
feature_not_enabled404FEATURE_RIPPLE_WALLET is not enabled
invalid_signed_transaction400Failed to decode the transaction blob
invalid_transaction_type400Transaction is not a Payment type
tx_hash_mismatch400Computed hash doesn't match provided txHash
account_mismatch_with_signed_transaction400Hint account doesn't match decoded tx
destination_mismatch_with_signed_transaction400Hint destination doesn't match decoded tx
amount_mismatch_with_signed_transaction400Hint amount doesn't match decoded tx
currency_mismatch400Currency is not XRP
payment_record_not_found404No matching payment record for the txHash
amount_mismatch_with_payment_record400Amount doesn't match payment record
destination_mismatch_with_payment_record400Destination doesn't match pay_to
invalid_payment_record_status409Record not in signed or used status
ripple_signature_expired409Transaction expired (tefMAX_LEDGER)
ripple_submit_rejected409XRPL rejected the transaction
ripple_submit_failed502XRPL RPC call failed

Key Constants

ConstantValueDescription
RIPPLE_NETWORKxrpl-mainnetNetwork identifier
RIPPLE_EPOCH_OFFSET_SECONDS946684800Unix epoch to Ripple epoch offset (2000-01-01)
RIPPLE_RPC_URLhttps://s1.ripple.com:51234Default XRPL JSON-RPC endpoint
RIPPLE_TOKEN_ADDRESSXRPAsset identifier

Released under the MIT License.