Skip to main content

API Reference

The Stackfront backend exposes a REST API that the SDK communicates with. You can also call these endpoints directly if you need to integrate outside of the React Native SDK.

Base URL

EnvironmentURL
Sandboxhttps://api.sandbox.stackfront.io
Productionhttps://api.stackfront.io

Authentication

There are two authentication modes depending on the endpoint:

SDK Endpoints (mobile app → Stackfront API)

X-Developer-Api-Key: sf_test_xxx or sf_live_xxx
X-Shop-Domain: mystore.myshopify.com

Merchant Endpoints (Shopify admin → Stackfront API)

Authenticated via Shopify session OAuth token (handled automatically by the Shopify app).

Developer Endpoints (developer dashboard → Stackfront API)

Authenticated via JWT bearer token obtained from the OTP-based auth flow.

Content-Type

All requests and responses use application/json.

Errors

Standard error response format:
{
  "message": "Human-readable error description"
}
HTTP status codes:
CodeMeaning
200Success
400Bad request (validation error)
401Unauthorized (missing or invalid auth)
403Forbidden (feature not enabled or sandbox limit hit)
404Not found
422Unprocessable entity (business rule violation)
429Rate limited
500Internal server error

Rate Limits

Endpoint GroupLimit
SDK config50 requests/minute per developer API key (sandbox)
SDK events100 requests/minute
All others1000 requests/minute

Pagination

List endpoints use page and pageSize query parameters:
ParameterDefaultDescription
page1Page number (1-indexed)
pageSize20Items per page (max 100)

Endpoints

SDK Configuration

MethodPathDescription
GET/api/v1/sdk/configFetch SDK configuration (branding, feature flags, storefront token, etc.)

SDK Push Notifications

MethodPathDescription
POST/api/v1/sdk/devices/registerRegister a device for push notifications
POST/api/v1/sdk/devices/unsubscribeUnsubscribe a device from push
POST/api/v1/sdk/devices/link-customerLink a device to a customer account
GET/api/v1/sdk/notifications/preferencesGet notification preferences
PUT/api/v1/sdk/notifications/preferencesUpdate notification preferences
POST/api/v1/sdk/notifications/track-openTrack a push notification open

SDK Events & Analytics

MethodPathDescription
POST/api/v1/sdk/eventsTrack an analytics event

SDK Loyalty

MethodPathDescription
GET/api/v1/sdk/loyalty/accountGet customer loyalty account
GET/api/v1/sdk/loyalty/transactionsGet loyalty transaction history
POST/api/v1/sdk/loyalty/redeemRedeem loyalty points
GET/api/v1/sdk/loyalty/referralGet customer referral link
POST/api/v1/sdk/loyalty/referral/trackTrack a referral conversion

SDK Reviews

MethodPathDescription
GET/api/v1/sdk/reviews/{productId}Get reviews for a product
POST/api/v1/sdk/reviewsSubmit a review
POST/api/v1/sdk/reviews/{id}/mediaUpload review media (image/video)
POST/api/v1/sdk/reviews/{id}/helpfulMark a review as helpful

SDK Social Proof

MethodPathDescription
POST/api/v1/sdk/social-proof/product-viewTrack a product view
GET/api/v1/sdk/social-proof/product/{productId}Get social proof data for a product

SDK Stories

MethodPathDescription
GET/api/v1/sdk/storiesGet active story groups with stories
POST/api/v1/sdk/stories/viewedMark a story as viewed
POST/api/v1/sdk/stories/tappedTrack a story tap
POST/api/v1/sdk/stories/poll-responseSubmit a story poll response

SDK Integrations

MethodPathDescription
GET/api/v1/sdk/integrations/{slug}/{dataType}Get integration data (e.g., loyalty points from Smile.io)

Merchant Auth

MethodPathDescription
GET/auth/shopifyInitiate Shopify OAuth
GET/auth/shopify/callbackShopify OAuth callback

Merchant Status & Setup

MethodPathDescription
GET/api/v1/merchants/me/statusGet merchant setup status
POST/api/v1/merchants/me/registerComplete merchant registration
POST/api/v1/merchants/me/storefront-tokenSave Shopify Storefront API token
POST/api/v1/merchants/me/reprovisionRe-run provisioning

Merchant Billing

MethodPathDescription
GET/api/v1/merchants/me/plansList available merchant plans
GET/api/v1/merchants/me/billing/statusGet billing status
POST/api/v1/merchants/me/billing/upgradeUpgrade merchant plan
GET/billing/confirmBilling confirmation callback

Merchant Branding & Content

MethodPathDescription
GET/api/v1/merchants/me/brandingGet branding config
PATCH/api/v1/merchants/me/brandingUpdate branding config
POST/api/v1/merchants/me/branding/logoUpload logo
POST/api/v1/merchants/me/branding/splashUpload splash screen
GET/api/v1/merchants/me/home-layoutGet home layout
PUT/api/v1/merchants/me/home-layoutUpdate home layout
GET/api/v1/merchants/me/bannersList banners
POST/api/v1/merchants/me/bannersCreate banner
PUT/api/v1/merchants/me/banners/{id}Update banner
DELETE/api/v1/merchants/me/banners/{id}Delete banner
PATCH/api/v1/merchants/me/banners/reorderReorder banners
GET/api/v1/merchants/me/popupsList popups
POST/api/v1/merchants/me/popupsCreate popup
PUT/api/v1/merchants/me/popups/{id}Update popup
DELETE/api/v1/merchants/me/popups/{id}Delete popup
GET/api/v1/merchants/me/announcementsList announcements
POST/api/v1/merchants/me/announcementsCreate announcement
PUT/api/v1/merchants/me/announcements/{id}Update announcement
DELETE/api/v1/merchants/me/announcements/{id}Delete announcement
PATCH/api/v1/merchants/me/announcements/reorderReorder announcements
GET/api/v1/merchants/me/featuresGet feature flags
PATCH/api/v1/merchants/me/featuresUpdate feature flags

Merchant Campaigns & Push

MethodPathDescription
GET/api/v1/merchants/me/campaignsList push campaigns
POST/api/v1/merchants/me/campaignsCreate campaign
PUT/api/v1/merchants/me/campaigns/{id}Update campaign
POST/api/v1/merchants/me/campaigns/{id}/publishPublish campaign
POST/api/v1/merchants/me/campaigns/{id}/cancelCancel campaign
GET/api/v1/merchants/me/campaigns/{id}/analyticsCampaign analytics
GET/api/v1/merchants/me/campaigns/recurringList recurring campaigns
POST/api/v1/merchants/me/campaigns/recurringCreate recurring campaign
PATCH/api/v1/merchants/me/campaigns/recurring/{id}/toggleToggle recurring campaign
DELETE/api/v1/merchants/me/campaigns/recurring/{id}Delete recurring campaign
GET/api/v1/merchants/me/notifications/summaryNotification summary

Merchant Analytics

MethodPathDescription
GET/api/v1/merchants/me/analytics/overviewOverview dashboard data
GET/api/v1/merchants/me/analytics/sessionsSession analytics
GET/api/v1/merchants/me/analytics/revenueRevenue analytics
GET/api/v1/merchants/me/analytics/funnelConversion funnel
GET/api/v1/merchants/me/analytics/pushPush notification analytics
GET/api/v1/merchants/me/analytics/storiesStories analytics
GET/api/v1/merchants/me/analytics/devicesDevice analytics
GET/api/v1/merchants/me/analytics/loyaltyLoyalty analytics
GET/api/v1/merchants/me/analytics/realtimeReal-time analytics
GET/api/v1/merchants/me/analytics/exportExport analytics CSV

Merchant Abandoned Cart

MethodPathDescription
GET/api/v1/merchants/me/abandoned-cart/configGet abandoned cart config
PUT/api/v1/merchants/me/abandoned-cart/configUpdate abandoned cart config
PATCH/api/v1/merchants/me/abandoned-cart/config/toggleToggle abandoned cart
GET/api/v1/merchants/me/abandoned-cart/analyticsAbandoned cart analytics
GET/api/v1/merchants/me/abandoned-cart/cartsList abandoned carts

Merchant Loyalty

MethodPathDescription
GET/api/v1/merchants/me/loyalty/configGet loyalty config
PUT/api/v1/merchants/me/loyalty/configUpdate loyalty config
GET/api/v1/merchants/me/loyalty/tiersList loyalty tiers
POST/api/v1/merchants/me/loyalty/tiersCreate tier
PUT/api/v1/merchants/me/loyalty/tiers/{id}Update tier
DELETE/api/v1/merchants/me/loyalty/tiers/{id}Delete tier
GET/api/v1/merchants/me/loyalty/customersList loyalty customers
POST/api/v1/merchants/me/loyalty/customers/{customerId}/adjustAdjust customer points
GET/api/v1/merchants/me/loyalty/analyticsLoyalty analytics

Merchant Reviews

MethodPathDescription
GET/api/v1/merchants/me/reviewsList all reviews (with filters)
GET/api/v1/merchants/me/reviews/{id}Get review detail
PATCH/api/v1/merchants/me/reviews/{id}/approveApprove review
PATCH/api/v1/merchants/me/reviews/{id}/rejectReject review
POST/api/v1/merchants/me/reviews/{id}/replyReply to review
GET/api/v1/merchants/me/reviews/analyticsReviews analytics

Merchant Segments

MethodPathDescription
GET/api/v1/merchants/me/segmentsList customer segments
POST/api/v1/merchants/me/segmentsCreate segment
GET/api/v1/merchants/me/segments/{id}/estimateEstimate segment size
PUT/api/v1/merchants/me/segments/{id}Update segment
DELETE/api/v1/merchants/me/segments/{id}Delete segment

Merchant Social Proof

MethodPathDescription
GET/api/v1/merchants/me/social-proof/configGet social proof config
PUT/api/v1/merchants/me/social-proof/configUpdate social proof config

Merchant Stories

MethodPathDescription
GET/api/v1/merchants/me/story-groupsList story groups
POST/api/v1/merchants/me/story-groupsCreate story group
PUT/api/v1/merchants/me/story-groups/{id}Update story group
DELETE/api/v1/merchants/me/story-groups/{id}Delete story group
PATCH/api/v1/merchants/me/story-groups/reorderReorder story groups
GET/api/v1/merchants/me/story-groups/{groupId}/storiesList stories in group
POST/api/v1/merchants/me/story-groups/{groupId}/storiesCreate story
PUT/api/v1/merchants/me/story-groups/{groupId}/stories/{id}Update story
DELETE/api/v1/merchants/me/story-groups/{groupId}/stories/{id}Delete story
PATCH/api/v1/merchants/me/story-groups/{groupId}/stories/reorderReorder stories
GET/api/v1/merchants/me/story-groups/{id}/analyticsStory group analytics
GET/api/v1/merchants/me/stories/{id}/analyticsIndividual story analytics
GET/api/v1/merchants/me/stories/summaryStories summary

Merchant Integrations

MethodPathDescription
GET/api/v1/merchants/me/integrationsList available integrations
GET/api/v1/merchants/me/integrations/{slug}Get integration detail
POST/api/v1/merchants/me/integrations/{slug}/connectConnect integration
GET/api/v1/merchants/me/integrations/{slug}/statusCheck integration status
POST/api/v1/merchants/me/integrations/{slug}/syncTrigger manual sync
DELETE/api/v1/merchants/me/integrations/{slug}/disconnectDisconnect integration

Developer Auth

MethodPathDescription
POST/api/v1/auth/register/requestRequest OTP for registration
POST/api/v1/auth/register/verifyVerify OTP and complete registration
POST/api/v1/auth/login/requestRequest OTP for login
POST/api/v1/auth/login/verifyVerify OTP and receive JWT
POST/api/v1/auth/logoutInvalidate session
POST/api/v1/auth/refreshRefresh JWT token

Developer Profile & API Keys

MethodPathDescription
GET/api/v1/developers/meGet developer profile
PATCH/api/v1/developers/meUpdate developer profile
GET/api/v1/developers/me/planGet current plan
GET/api/v1/developers/me/slotsGet merchant slot usage
GET/api/v1/developers/me/api-keysList API keys
POST/api/v1/developers/me/api-keysCreate API key
DELETE/api/v1/developers/me/api-keys/{id}Revoke API key
GET/api/v1/developers/me/api-keys/{id}/usageGet API key usage stats

Developer Analytics

MethodPathDescription
GET/api/v1/developers/me/analytics/overviewDeveloper overview analytics
GET/api/v1/developers/me/analytics/merchantsPer-merchant analytics
GET/api/v1/developers/me/analytics/usageAPI usage analytics

Developer Billing

MethodPathDescription
GET/api/v1/developer/plansList developer plans
GET/api/v1/developer/billing/statusGet billing status
POST/api/v1/developer/billing/checkoutCreate checkout session

Webhooks (Shopify → Stackfront)

MethodPathDescription
POST/webhooks/{*topic}Shopify webhook receiver
POST/api/v1/webhooks/onesignalOneSignal delivery webhook
POST/webhooks/stripeStripe billing webhook