OrbitDocs

API overview

The Merchant API stores plans and subscriptions and submits pulls to Soroban.

Edit this page on GitHub

The Merchant API is the off-chain side of Orbit. The contract enforces the money movement. The API keeps the records that a dashboard, checkout and keeper need.

Base URL

The API is self-hosted from the monorepo:

cd Orbit/apps/backend
cp .env.example .env     # add Supabase URL and service-role key
npm install
node index.js            # http://localhost:3001
VariableDefaultPurpose
SUPABASE_URLNoneSupabase project URL (schema in apps/backend/schema.sql)
SUPABASE_SERVICE_ROLE_KEYNoneSupabase service-role key
ORBIT_CONTRACT_IDNoneContract to invoke; required for /trigger-pull
SOROBAN_RPC_URLhttps://soroban-testnet.stellar.orgSoroban RPC endpoint
STELLAR_NETWORK_PASSPHRASETest SDF Network ; September 2015 (Networks.TESTNET)Network the transactions are signed for
PORT3001Port the Express server listens on
TX_POLL_TIMEOUT_MS30000Transaction confirmation polling window in milliseconds for /trigger-pull
TX_POLL_INTERVAL_MS1000Delay in milliseconds between transaction confirmation polls

See transaction confirmation for polling outcomes and the timeout response.

Conventions

  • JSON in and out. Send Content-Type: application/json.
  • IDs are UUIDs. Wallets are Stellar strkeys.
  • usdc_amount is an integer in raw units (7 decimals), the same value the contract uses.
  • Timestamps are ISO 8601 UTC.
  • Errors have the shape { "error": "message" }. See Errors.

Authentication

The MVP API has no API keys yet. Run it on a private network or behind your own auth proxy. Scoped secret keys are on the roadmap.

Endpoints

MethodPathPurpose
POST/plansCreate a plan
GET/plans/{id}Retrieve a plan for checkout
POST/subscriptionsRecord a subscription after the on-chain handshake
GET/subscribersList a merchant's subscribers
POST/trigger-pullSign and submit pull_funds

Data model

On this page