Stable Points (SP)

Plug‑and‑play Commerce & Rewards rails for any Web3 project — powered by Spree Finance's 2M+ merchant network.

Spree API (EVM) Technical Reference

Introduction

Stable Points (SP) are commerce‑stable reward points, pegged at $1.00 ≈ 100 SP, accepted across a network of 2M+ merchants out of the box. Brands can also issue Branded SP (their own label of stable points) while inheriting Spree’s compliance controls (whitelists, roles, freeze, fee policies).

The public /build API constructs unsigned transactions you sign and broadcast. This keeps custody and signing with you (or your users) and makes it ideal for wallets, dapps, and servers that manage their own keys.

Key operational guarantees:

  • Walled‑garden controls: mint, transfer, and redeem are gated by whitelists/roles to support compliant usage.

  • Multi‑chain: uniform patterns across EVM and Solana.

  • Composable: pair /build with read‑only /evm routes to check balances, allowances, and pending redemptions.

Base URL & patterns

  • Staging base: https://api.stg.spree.finance

  • Production: provided during onboarding.

Route families (this guide focuses on the first):

  • 🔓 /build/* — build unsigned tx for client signing & broadcasting (no auth)

  • 📖 /evm/* — read‑only state for EVM (optional pairing for UX, helpful for reading on-chain metrics)

Address formats

  • EVM: 0x‑prefixed hex.

  • Solana: Base58.

Request/response shape (build routes)

Request (POST/PUT/DELETE):

key must equal the wallet address that will sign the transaction.

Success response (build):

  • EVM: transaction may be a 0x‑hex serialized unsigned tx, or tx may contain a params object (to, data, value, gas, ...).

  • Solana: transaction is base64 (VersionedTransaction/Message) for @solana/web3.js.

Error response:


Prerequisites & conventions

  • Whitelists: Users and programs must be on the relevant mint, transfer, and redeem whitelists.

  • Roles: Admins manage whitelists/fees; executor finalizes redemptions; freezer can freeze/unfreeze.

  • Allowances (EVM): For mint/redeem flows, users must approve the factory/points as spender for the relevant token.

  • Units: Always pass amounts as integer base units (e.g., wei for EVM; token decimals for Solana mints).

  • Basket mode (EVM): Set expectedBasketMode to true only if the factory is configured for basket mint/redeem.


EVM — Public /build endpoints

Base prefix: /build/evm/chain/{chainId}

5.1 Core token operations

Approve (ERC‑20)

Transfer (ERC‑20)

Transfer‑from (ERC‑20)

5.2 Factory — Mint & Redeem

Mint

Redeem — create

Redeem — cancel

Redeem — finalize (executor)

5.3 Whitelist management (factory & points)

  • Mint whitelist

    • PUT /build/evm/chain/{chainId}/factory/{factoryAddr}/whitelist/mint/user/{userAddr}

    • DELETE /build/evm/chain/{chainId}/factory/{factoryAddr}/whitelist/mint/user/{userAddr}

  • Redeem whitelist

    • PUT /build/evm/chain/{chainId}/factory/{factoryAddr}/whitelist/redeem/user/{userAddr}

    • DELETE /build/evm/chain/{chainId}/factory/{factoryAddr}/whitelist/redeem/user/{userAddr}

  • Transfer whitelist (points)

    • PUT /build/evm/chain/{chainId}/points/{pointsAddr}/whitelist/transfer/user/{userAddr}

    • DELETE /build/evm/chain/{chainId}/points/{pointsAddr}/whitelist/transfer/user/{userAddr}

All calls use:

5.4 Roles & controls

Grant role

Revoke role

Consideration: roleType ∈ { freezer, manager, executor }

Freeze / Unfreeze

5.5 Fees & vaults

Update mint fee (bps)

Update redeem fee (bps)

Create vault


6) Solana — Public /build endpoints

Base prefix: /build/solana

6.1 Core token operations

Mint

Transfer

6.2 Redemption

Create

Cancel

Finalize (executor)

6.3 Whitelists

6.4 Authority updates

6.5 Freeze / Unfreeze

6.6 Fees


7) End‑to‑end flows (EVM & Solana)

A) EVM — USDC → SP mint, then transfer

  1. Approve USDC

  1. Mint SP

  1. Transfer SP (if needed)

Ensure both sender & recipient are on the transfer whitelist for the points contract.

B) EVM — Redeem SP back to USDC

  1. Approve SP to factory.

  2. Create redeem request

  1. Finalize (executor)

C) Solana — Mint → Transfer → Redeem


8) Signing & broadcasting examples

8.1 EVM (ethers v6)

8.2 Solana (web3.js)


9) Errors & troubleshooting

Tips

  • Always re‑check allowance, whitelists, and freeze status before submitting.

  • If broadcast fails with underpriced gas or blockhash expired, rebuild the tx.

  • Keep amount as integer base units; don’t send decimals.


10) Roles & glossary

  • manager — manages whitelists and fees.

  • executor — finalizes redemption requests.

  • freezer — can freeze/unfreeze contracts.

  • points — the ERC‑20/SPL points token (e.g., SP).

  • factory — contract managing mints/redeems, vaults, fees, and roles.

  • basket mode — factory setting enabling basket‑based mint/redeem.


11) Copy‑paste cURL (staging)

Approve (EVM)

Mint (EVM)

Mint (Solana)


Compliance & business notes

  • Why whitelists? They enforce a controlled, compliant rewards perimeter (mint/transfer/redeem) aligned with merchant acceptance and brand policies.

  • Executor custody: Redemption finalization is an admin path that coordinates vault movements and fiat settlement for merchant payouts.

  • Branded SP: Partners can issue their own label on top of SP/stable collateral, reuse the same /build flows, and inherit the network acceptance footprint.

For production launch (domains, chainlists, and operational thresholds), the Spree team will provide environment and policy details.

Last updated