Skam Docs

API Documentation

Internal and external APIs active in the Skam ecosystem.

1. External APIs (Shopier)

Implemented in packages/shared/src/services/shopier.ts

Shopier Transactions

Processing and fetching recent transactions

Account Balance

Checking the current store balance

Webhooks (WIP)

Endpoints listening to payment success/failure callbacks

Required: Set SHOPIER_PAT (Personal Access Token) in your .env.local.

2. Internal Endpoints

Next.js Route Handlers built on the App Router route.ts architecture.

Apps/Web

/api/shopier/balanceGETFetches current store balance via RSCs
/api/shopier/transactionsGETFetches recent storefront transactions

Apps/Dashboard

/api/admin/metricsGETAggregates Shopier data for admin analytics
/api/webhooks/shopierPOSTSecure listener for live Shopier webhook updates

3. Server Actions (Mutations)

All data mutations use Next.js Server Actions instead of REST API endpoints.

apps/web/actions/Product management, push notifications, order tracking
apps/dashboard/actions/Admin tenant CRUD, bot settings, email triggers

Every action strictly validates input using Zod before executing Supabase Postgres mutations.