Skip to content
Ayra Docs

REST API

Ayra’s REST API opens after the private beta. It will give server-to-server access to the same data the admin shows (customers and their wallets, ledgers, referrals, reviews, segments, opportunities and the event stream) with app-level API keys issued per store, JSON over HTTPS, cursor pagination and per-key rate limits. Until then, use the JavaScript API on the storefront, the metafields Ayra writes to Shopify, and Shopify Flow triggers for automation.

https://api.ayra.one/v1/ with the major version in the path. Dates in ISO 8601, money as { amount, currencyCode }, IDs as strings.

Per-store API keys created in Ayra → Settings → API, sent as a bearer token. Keys carry scopes (read:customers, write:wallet, read:events, …) chosen at creation and can be rotated without downtime.

ResourceMethodsNotes
/customers/{id}GETProfile with wallet, tier, stage, segments
/customers/{id}/ledgerGET, POSTPoints and credit lines; POST grants or deducts with a reason (audited)
/customers/{id}/timelineGETSignals, opportunities and actions with reasons
/referralsGETCodes, links and reward status
/reviewsGET, POST, PATCHReviews and moderation (with the Reviews module)
/segments and /segments/{id}/customersGETLive segment membership
/opportunitiesGETOpen opportunities by type and priority
/eventsGETThe ay:* event stream with cursor pagination
/exportsPOST, GETTrigger and fetch the CSV exports described on Uninstall & export

Per-key limits with RateLimit-* headers; errors as { code, message, details } with the same codes as the JavaScript API.

  • Webhooks: outbound webhooks after private beta; the GDPR webhooks that exist today.
  • Events

Something missing or wrong on this page? Ask us and we will fix the docs.