Dexter
Dexter
Docs

API Reference

All endpoints are served from the Dexter settlement API at x402.dexter.cash.

Charge Endpoints

POST /mpp/prepare

Get a fee payer address and fresh blockhash for building a charge transaction.

Request:

{
  "network": "mainnet-beta"
}

Response:

{
  "feePayer": "DexterFeePayer...",
  "blockhash": "...",
  "lastValidBlockHeight": 123456789
}

POST /mpp/settle

Submit a signed transaction for fee payer co-signing, simulation, broadcast, and confirmation.

Request:

{
  "transaction": "base64-encoded-transaction",
  "network": "mainnet-beta"
}

Response (success):

{
  "ok": true,
  "signature": "tx-signature...",
  "recipient": "SellerWallet...",
  "amount": "10000",
  "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}

Response (failure):

{
  "ok": false,
  "error": "simulation_failed",
  "details": "..."
}

GET /mpp/stats

Live settlement statistics.

Response:

{
  "prepare": { "total": 1500, "today": 42 },
  "settle": {
    "total": 1200,
    "today": 38,
    "success": 1180,
    "fail": 20,
    "successRate": "98.3%"
  },
  "recentSettlements": [
    {
      "signature": "...",
      "recipient": "...",
      "amount": "10000",
      "network": "mainnet-beta",
      "payer": "...",
      "at": "2026-04-11T12:00:00Z"
    }
  ],
  "lastSettlement": "2026-04-11T12:00:00Z"
}

Session Endpoints

POST /mpp/session/open

Open a payment channel between a buyer and seller.

Request:

{
  "buyer_wallet": "BuyerWallet...",
  "buyer_swig_address": "BuyerSwigWallet...",
  "seller_wallet": "SellerWallet...",
  "deposit_atomic": "1000000",
  "network": "mainnet-beta"
}

Response:

{
  "ok": true,
  "channel_id": "uuid-v4",
  "session_pubkey": "SessionSigningKey...",
  "state": "open"
}

POST /mpp/session/voucher

Sign a payment voucher for a cumulative amount within an open session.

Request:

{
  "channel_id": "uuid-v4",
  "cumulative_amount": "30000",
  "server_nonce": "nonce-from-seller"
}

Response:

{
  "ok": true,
  "voucher": {
    "channel_id": "uuid-v4",
    "cumulative_amount": "30000",
    "sequence": 3,
    "signature": "ed25519-signature-base64",
    "signer": "SessionSigningKey...",
    "server_nonce": "nonce-from-seller"
  }
}

POST /mpp/session/close

Close a session and settle on-chain. Executes a TransferChecked from the buyer's Swig wallet to the seller for the cumulative amount consumed.

Request:

{
  "channel_id": "uuid-v4"
}

Response:

{
  "ok": true,
  "signature": "on-chain-tx-signature",
  "settled_amount": "30000",
  "voucher_count": 3,
  "state": "closed"
}

Onboarding Endpoints

Onboarding endpoints are served from x402.dexter.cash/api/sessions/.

All onboarding requests require a SIGN-IN-WITH-X header containing a CAIP-122/SIWS wallet ownership proof (Ed25519 signature).

POST /api/sessions/onboard

Start the onboarding process. Creates a Swig smart wallet and initiates delegation role provisioning.

Headers:

SIGN-IN-WITH-X: <encoded-siwx-payload>
Content-Type: application/json

Request:

{
  "wallet": "BuyerWallet...",
  "network": "mainnet-beta"
}

Response:

{
  "ok": true,
  "swig_address": "NewSwigWallet...",
  "status": "pending_confirmation",
  "create_tx_signatures": ["tx-sig-1", "tx-sig-2"]
}

POST /api/sessions/onboard/confirm

Confirm Swig wallet provisioning after the on-chain transaction is confirmed.

Headers:

SIGN-IN-WITH-X: <encoded-siwx-payload>
Content-Type: application/json

Request:

{
  "wallet": "BuyerWallet...",
  "swig_address": "SwigWallet..."
}

Response:

{
  "ok": true,
  "status": "confirmed",
  "swig_address": "SwigWallet...",
  "role_id": 1
}

GET /api/sessions/onboard/status

Check onboarding status for a wallet.

Headers:

SIGN-IN-WITH-X: <encoded-siwx-payload>

Query Parameters:

  • wallet (required): Buyer wallet address
  • network (optional): Solana cluster, defaults to mainnet-beta

Response:

{
  "ok": true,
  "status": "confirmed",
  "swig_address": "SwigWallet...",
  "role_id": 1
}

Error Codes

CodeMeaning
simulation_failedTransaction simulation failed on Solana
invalid_transactionTransaction violates security policy
blockhash_expiredBlockhash is no longer valid
session_not_foundChannel ID does not exist
session_not_openSession is not in an open state
insufficient_balanceBuyer wallet balance below required amount
swig_role_not_foundBuyer does not have an active Swig delegation role
siwx_invalidSIWx wallet ownership proof failed verification
amount_not_monotonicVoucher cumulative amount is not increasing
underpaymentVoucher amount below the minimum price per unit
signer_mismatchVoucher signed by a different key than previous vouchers in the channel

On this page