Use these APIs to build a customer-facing ecommerce frontend (mobile app / SPA). This includes authentication, checkout, and orders.
All ecommerce API endpoints are under:
https://{client_slug}.shrigo.com/api
/categories
/products
/products/{product}
/products/hot-sales
/products/new-arrivals
Protected endpoints require a Bearer token. Obtain it via login.
/login| Field | Type | Required | Description |
|---|---|---|---|
| login | string | Yes | Email or phone |
| password | string | Yes | Password |
| device_name | string | No | Optional device identifier (max 100) |
Success response: contains access_token.
Send token on protected endpoints:
Authorization: Bearer <access_token>
/registerCreate a new customer account. After registration, user must verify email before logging in.
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Full name |
| string | Yes | Email address | |
| phone | string | No | 10 Digits Phone number |
| password | string | Yes | Minimum 8 characters |
| password_confirmation | string | Yes | Must match password |
/auth/googleSign in using a Google ID token. If the customer does not exist, it is created automatically.
| Field | Type | Required | Description |
|---|---|---|---|
| id_token | string | Yes | Google Sign-In ID token from client |
| device_name | string | No | Optional device identifier (max 100) |
/forgot-passwordSends a password reset email if the account exists. Always returns a generic success message.
| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Registered email address |
/resend-verificationRe-sends the email verification link for an unverified customer. Always returns a generic success message.
| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Customer email address |
/logout/mepayment_url, redirect user there.return_url with status.status=pending, poll payment status until final./payment-options
Returns enabled gateways for this vendor (example keys: COD, Fonepay, Khalti, eSewa).
/delivery-locations
Returns delivery locations configured by the vendor (used for checkout address selection). For digital delivery vendors, you can skip this.
Example response:
{
"success": true,
"message": "Delivery locations.",
"data": [
{ "location": "Kathmandu", "price": 100, "cod_available": true, "is_district": false },
{ "location": "Lalitpur", "price": 120, "cod_available": false, "is_district": false }
]
}
/checkoutImportant:
return_url is required so the backend can redirect users back after payment.
| Field | Required | Description |
|---|---|---|
| products | Yes |
Cart lines (array or JSON string). Each line must include productId and quantity.
Optional keys per line:
|
| payment_option | Yes | Gateway key from payment-options |
| name | Depends | Required for physical delivery vendors. Not required for digital delivery. |
| phone | Depends | Required for physical delivery vendors (10 digits). |
| location | Depends | Required for physical delivery vendors (delivery location). |
| street | Depends | Required for physical delivery vendors. |
| i_agree | Yes | Must be accepted |
| return_url | Yes | Where to send the user after payment |
| coupon | No | Coupon code |
| order_note | No | Max 500 chars |
Tip: The easiest way to ensure you send the correct payload is to use the interactive docs at /docs/api and copy the example request.
Each object inside products can include the following keys:
| Key | Type | Required | When to send |
|---|---|---|---|
| productId | number | Yes | Product ID from catalog APIs. |
| quantity | number | Yes | Quantity to order (must be ≤ available stock). |
| size | string | No | Only if the product has size variants and user selected a size. |
| color | string | No | Only if the product has color variants and user selected a color. |
| type | string | No | Only if the product uses a third variant dimension (e.g. material/type). |
| customFieldValue | string | No | Send when product requires a custom field (label configured by vendor). Example: “Happy Birthday”. |
| design (multipart) | file | When is_custom=true |
Required for custom products as a multipart part (not base64 in JSON). Field name: designs[{lineIndex}][0], where lineIndex is the zero-based index of that line in the products array. Slots [1], [2], … reserved for future multi-image support. Do not include a design key inside each product object. JPG, PNG, or WebP; max 5MB.
|
Example request (JSON):
{
"products": [
{ "productId": 123, "quantity": 2, "size": "M", "color": "Black" }
],
"payment_option": "Fonepay",
"name": "John Doe",
"phone": "9812345678",
"location": "Kathmandu",
"street": "New Road",
"coupon": null,
"order_note": "Please call before delivery",
"i_agree": true,
"return_url": "https://your-frontend.com/payment/result"
}
Example response (online payment):
{
"success": true,
"message": "Validation successful. Proceed to payment.",
"data": {
"amount": 200,
"payment_url": "https://gateway.example/...",
"payment_reference": "ABC123..."
}
}
Example response (COD/no online payment):
{
"success": true,
"message": "Order placed successfully.",
"data": {
"amount": 200,
"payment_url": null
}
}
Backend redirects the user back to your return_url with:
transaction_id (payment reference)status: success, failed, or pending/checkout/payment-status/{transactionId}
Response status values: pending, success, failed,
expired.
Example response:
{
"success": true,
"message": "Payment status.",
"data": {
"transaction_id": "ABC123...",
"status": "pending",
"order_id": null
}
}
/orders/orders/{order}
/orders/{order}/cancel