Skip to content

Devnet only: test USDC, not real money.

Docs menuREST API

Reference

REST API

Read your plans, subscribers and payments from your own server. The dashboard runs on the same API.

Authentication

The API lives at https://api.solloop.app/v1. Send an API key from Developers in the dashboard as a bearer token. Keys start sk_test_ on devnet and sk_live_ on mainnet. A key can do anything your account can, so it belongs on your server and never in a browser or an app.

a request with curl
curl https://api.solloop.app/v1/subscribers/H7q2vzHNemDGuPjgsLgVGUeCx5p9UmNZ2xVvKXi6hbzk \
  -H "Authorization: Bearer sk_test_…"

Conventions

  • Requests and responses are JSON.
  • Amounts are strings in the token's base units. USDC has six decimals, so "49000000" is 49 USDC. Strings, because the numbers can exceed what a JavaScript number holds exactly.
  • Times are ISO 8601 strings in UTC.

Endpoints

EndpointWhat it does
GET /plansYour plans.
GET /plans/:idOne plan.
PATCH /plans/:idChange the name or description. The on-chain terms are fixed.
POST /plans/:id/retireRecord a plan as retired, once the owner's wallet has signed the retire transaction on-chain. The dashboard does both.
GET /subscribersYour subscribers. Filter with ?plan= and ?status=.
GET /subscribers/:addressA wallet's most recent subscription to one of your plans.
GET /paymentsCollections. Filter with ?plan=, ?status=, ?from= and ?to=.
GET /payments/exportThe same, as CSV.
GET /metricsMonthly recurring revenue, active subscribers, churn and totals.
GET /public/plans/:idA plan as the widget sees it. Needs no key.

Errors

An error has one shape. Switch on code, which is stable; the message is for people and may change.

an error response
{
  "error": {
    "code": "not_found",
    "message": "No subscriber with that address."
  }
}
StatuscodeMeaning
400bad_requestSomething in the request is invalid. The message says what.
401unauthorizedNo key, or a key that has been revoked.
404not_foundThere's nothing with that id on your account.
409conflictThe request doesn't fit the current state, such as retiring a plan still active on-chain.
429rate_limitedToo many requests. Wait for the Retry-After header.
503rpc_unreachableWe couldn't reach Solana. Try again shortly.
500internal_errorOur fault. Try again; it is logged.

Rate limits

1,000 requests a minute per API key. Every response carries SolLoop-RateLimit-Limit and SolLoop-RateLimit-Remaining. Past the limit you get a 429 with a Retry-After header in seconds.