{
  "version": "1.0",
  "service": {
    "name": "Cryptorefills Gift Card Store (Solana)",
    "description": "Buy gift cards, mobile top-ups, and digital products with USDC SPL on Solana mainnet. 10,001+ brands across 180 countries.",
    "url": "https://solana.x402.cryptorefills.com"
  },
  "payment": {
    "protocol": "x402",
    "scheme": "exact",
    "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
    "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "assetSymbol": "USDC",
    "assetDecimals": 6,
    "note": "This host serves Solana mainnet only. The bare x402.<root> host serves Base + Solana with X-Preferred-Network selection. Prices are set by the product; amount is returned in PAYMENT-REQUIRED on the first POST."
  },
  "networks": [
    {
      "id": "solana",
      "default": true,
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "assetSymbol": "USDC",
      "assetDecimals": 6,
      "signing": "Build an SPL token Transfer instruction to the ATA derived from (owner=payTo, mint=asset). Partially-sign the versioned transaction with your wallet. The facilitator countersigns as feePayer (extra.feePayer in PAYMENT-REQUIRED) and broadcasts. Payload shape: { transaction: <base64-encoded partially-signed tx> }.",
      "extra_required": ["feePayer"],
      "phase2_must_echo": "X-Session-Id header from the 402 response (the Solana payload is opaque, so the gateway needs the session id to route the resubmit)."
    }
  ],
  "request_headers": {
    "X-Session-Id": "Required on Phase 2. Echoed verbatim from the X-Session-Id response header on the 402."
  },
  "response_headers": {
    "PAYMENT-REQUIRED": "Phase 1 only. base64url-encoded JSON, x402 v2 PaymentRequired envelope.",
    "X-Session-Id":     "Phase 1 only. UUID identifying this payment session."
  },
  "flow": [
    "1. GET /v1/brands?country_code=us — discover brand names available in a country.",
    "2. GET /v1/catalog?country_code=us&brand_name=<brand_name> — get product_id values and pricing for that brand.",
    "3. GET /v1/price?product_id=<id>&country_code=<cc>&brand_name=<bn>&product_value=<amount> — REQUIRED for range products before placing an order.",
    "4. POST /v1/orders — server responds 402 with PAYMENT-REQUIRED header (Solana JSON) and an X-Session-Id header.",
    "5. Build + partially-sign an SPL Transfer transaction to the ATA derived from payTo+asset. Encode the signature payload as base64url JSON.",
    "6. Re-POST /v1/orders with PAYMENT-SIGNATURE header AND X-Session-Id — server verifies, settles via the facilitator, returns 200 with order receipt.",
    "7. Poll GET /v1/orders/{order_id} until status='completed'. Voucher codes appear in deliveries[]."
  ],
  "openapi": "https://solana.x402.cryptorefills.com/openapi.json"
}
