Authentication
CashierLogic uses JWT-based authentication for API access.
Login
POST /auth/api/login
Content-Type: application/json
{ "email": "you@example.com", "password": "your-password" }
Returns { accessToken, refreshToken }.
Refresh Token
POST /auth/api/refresh
Content-Type: application/json
{ "refreshToken": "your-refresh-token" }
Checkout API
Initiate Checkout
POST /checkout/initiate
Content-Type: application/json
{
"shopDomain": "your-store.myshopify.com",
"mode": "overlay",
"totalAmount": "1500.00",
"currency": "INR",
"customer": { "email": "customer@example.com", "phone": "+919876543210" },
"cartItems": [{ "variantId": "123", "quantity": 1, "price": "1500.00", "title": "Product" }],
"returnUrl": "https://your-store.com/thank-you",
"cancelUrl": "https://your-store.com/cart"
}
Update Contact
POST /checkout/contact
{ "ref": "CPI-xxx-yyy", "phone": "+919876543210", "email": "customer@example.com" }
Update Address
POST /checkout/address
{ "ref": "CPI-xxx-yyy", "firstName": "John", "lastName": "Doe", "line1": "123 Main St", "city": "Mumbai", "state": "Maharashtra", "pincode": "400001" }
Initiate Payment
POST /checkout/payment
{ "ref": "CPI-xxx-yyy", "method": "upi" }
Get Session Status
GET /checkout/status?ref=CPI-xxx-yyy
Dashboard API
Get Overview Stats
GET /api/dashboard/overview?shop=your-store.myshopify.com&period=7d
Get Orders
GET /api/dashboard/orders?shop=your-store.myshopify.com&page=1
Update Settings
PUT /api/dashboard/settings?shop=your-store.myshopify.com
Content-Type: application/json
{ "codEnabled": true, "codFee": 50, "brandColor": "#966FE2" }
Webhooks
Cyberpay Payment Webhook
POST /webhooks/cyberpay
Received automatically from the payment gateway when payment status changes.
Health Check
GET /health
Returns { status: "ok", uptime: 12345, version: "1.0.0" }.