xcladeDocs
Storefront GraphQL

Advanced Features

Multi-currency regions, localization, Automatic Persisted Queries, ID Rabbit verification, and order transfers

Advanced Features

1. Multi-Region & Multi-Currency Pricing

xclade supports 135+ currencies and multi-region tax rules natively. Query available regions once at startup (cached for 30 minutes in Redis):

query StoreRegions {
  regions {
    regions {
      id
      name
      currency_code
      countries {
        iso_2
        display_name
      }
    }
  }
}

Pass the selected region_id when creating carts (createCart(input: { region_id })) and querying catalog prices (pricing_context: { region_id }). For authenticated B2B company buyers, customer-group override price lists automatically layer on top of base region pricing.


2. Localized Storefronts (X-Xclade-Locale)

Fetch active store locales (cached for 60 minutes):

query ActiveLocales {
  locales {
    code
    name
  }
}

Send X-Xclade-Locale: fr-FR (or call xclade.setLocale('fr-FR') in @xclade/sdk). Redis response cache keys automatically partition by locale so localized responses never collide.


3. Automatic Persisted Queries (APQ)

/graphql enables gqlgen's APQ extension (512-entry LRU hash cache) alongside GET transport:

  1. Client sends a GET /graphql request with extensions={"persistedQuery":{"version":1,"sha256Hash":"..."}} and X-Xclade-Request: true.
  2. If the hash is warm on the pod, the query executes immediately without transmitting the query string.
  3. On a cache miss (PersistedQueryNotFound), the client retries once with both query and sha256Hash to register it.

4. ID Rabbit Age (21+) & Identity Verification

Stores selling age-restricted or high-fraud goods can enforce pre-checkout verification via ID Rabbit:

  1. Query cartIdrabbitStatus(cart_id) before allowing checkout submission.
  2. When required === true and checkout_decision !== "allow", invoke createCartIdrabbitSession(cart_id, redirect_url) and redirect the shopper to idrabbit.verification_url.
  3. When ID Rabbit posts the signed webhook to POST /webhooks/idrabbit, the cart's verification state updates automatically and completeCart(cart_id) succeeds.
  4. Attempting completeCart before verification completes safely returns IDRABBIT_VERIFICATION_REQUIRED.

5. Order Ownership Transfers

Support B2B team handoffs or gift/account merges with built-in order transfer mutations:

  1. requestOrderTransfer(order_id, description) — Generates a secure transfer token.
  2. acceptOrderTransfer(order_id, token) or declineOrderTransfer(order_id, token) — Recipient accepts or declines.
  3. cancelOrderTransfer(order_id) — Original requester or Store Admin cancels before acceptance.

On this page