ShopIQ
ShopIQ - AI E-Commerce Website Builder

Language

Englishहिंदीঅসমীয়া
চাইন আপ

ShopIQ API Documentation

A comprehensive guide for integrating with the ShopIQ API — account management, third-party integrations, website deployment, AI image generation, and more.

API v2 — StableLast updated: May 2026

Overview

The ShopIQ API is a RESTful JSON API that allows third-party partners to programmatically manage accounts, connect integrations, generate auto-login URLs, deploy AI-powered e-commerce websites, and generate/enhance product images using AI on the ShopIQ platform.

Key Concepts

Partner API Key

Each partner receives a unique API key for authentication. All requests must include this key.

Account (Admin)

Represents a ShopIQ user account. Partners can create, read, update, and delete accounts.

Integration

A connection between a ShopIQ account and a third-party service (e.g., your platform).

Webhooks

Asynchronous notifications sent to your server when long-running operations (like website deployment) complete.

Image API

AI-powered image generation and enhancement. Create product images from text prompts or enhance existing images.

Points & Billing

Image API operations consume points from your balance. Cost varies by plan tier and processing mode.

Base URLs

EnvironmentBase URL
Developmenthttps://api-development.shopiq.dev
Productionhttps://api.shopiq.app
Partner Image APIhttps://api.shopiq.app/partner/v1

Content Type

All request and response bodies use JSON. Set the Content-Type header to application/json for all requests with a body.

Authentication

All API requests require authentication via an API key. Your API key is issued when your partner account is created. Include it in every request using one of the following methods:

Option 1: x-api-key Header (Recommended)

http
GET /api/v2/third-party/isAccountCreated?email=user@example.com
Host: api-development.shopiq.dev
x-api-key: your-api-key-here

Option 2: Authorization Bearer Header

http
GET /api/v2/third-party/isAccountCreated?email=user@example.com
Host: api-development.shopiq.dev
Authorization: Bearer your-api-key-here

Image API Authentication

The Image API uses dedicated partner API keys with the prefix sq_live_ for production or sq_test_ for testing. These keys are managed through the Partner Dashboard and are separate from the account management API key.

http
POST /partner/v1/image/create
Host: api.shopiq.app
X-API-Key: sq_live_your-key-here
Content-Type: application/json
HeaderDescriptionRequired
x-api-keyYour partner API key.Yes (or use Authorization)
AuthorizationBearer token format: Bearer Yes (or use x-api-key)
Content-TypeMust be application/json for POST/PUT/DELETE requests.Yes
X-API-KeyPartner Image API key (sq_live_* or sq_test_*) for /partner/v1/* endpoints.Yes (Image API only)

Authentication Errors

json
// 401 — No API key provided
{
  "success": false,
  "message": "API key required. Provide via X-API-Key header."
}

// 401 — Invalid API key
{
  "success": false,
  "message": "Invalid or revoked API key"
}

// 403 — Partner deactivated
{
  "success": false,
  "message": "Partner account is inactive"
}

// 401 — Expired API key
{
  "success": false,
  "message": "API key has expired"
}

// 403 — IP not whitelisted
{
  "success": false,
  "message": "Request IP not in API key whitelist"
}

Rate Limiting

API requests are rate-limited per partner to ensure fair usage and platform stability. Limits are configured per partner account.

LimitDefaultDescription
Requests per minute60Maximum number of requests allowed within a 60-second window.
Requests per day10,000Maximum number of requests allowed within a 24-hour window.

Rate Limit Error Response

json
// 429 — Too Many Requests
{
  "success": false,
  "message": "Rate limit exceeded: 60 requests per minute"
}

// 429 — Daily limit exceeded
{
  "success": false,
  "message": "Daily rate limit exceeded: 10000 requests per day"
}

Rate limits are applied per API key for the Image API. Each key has its own per-minute and per-day counters.

Error Handling

The API uses standard HTTP status codes. All error responses follow a consistent JSON structure.

Error Response Format

json
{
  "success": false,
  "message": "Human-readable error description.",
  "timestamp": "2025-07-15T10:30:00.000Z"
}

HTTP Status Codes

CodeMeaningWhen It Occurs
200OKRequest succeeded. Response body contains the result.
201CreatedResource successfully created (e.g., new account).
202AcceptedRequest accepted for async processing (e.g., website deployment). Result delivered via webhook.
400Bad RequestMissing or invalid parameters in the request.
401UnauthorizedMissing or invalid API key.
402Payment RequiredInsufficient points balance for the requested operation.
403ForbiddenAPI key is valid but lacks permission for this endpoint, or partner is deactivated.
404Not FoundThe requested resource (account, integration) does not exist.
409ConflictResource already exists (e.g., duplicate account, website already built).
422Unprocessable EntityImage generation blocked by safety filters.
429Too Many RequestsRate limit exceeded. Check retryAfter field.
500Internal Server ErrorUnexpected server error. Contact support if persistent.
503Service UnavailableAI service temporarily unavailable due to high demand. Retry shortly.

Account Model

The Account (Admin) model represents a user on the ShopIQ platform. This is the data structure used by the Create Account and Update Account endpoints.

Personal Details

FieldTypeRequiredDescription
emailstringYesEmail address of the account holder. Must be unique across the platform.
mobileNumberobjectYesPhone number object. Must be unique across the platform.
mobileNumber.valuestringYesThe phone number digits (e.g., "9876543210").
mobileNumber.countryCodenumberYesCountry calling code (e.g., 91 for India).
firstNamestringNoUser's first name.
lastNamestringNoUser's last name.
profilePicturestringNoURL of the user's profile picture.
currencystringNoDefault currency symbol. Defaults to "₹".
domainsstring[]NoList of custom domains associated with the account.
legalNamestringNoUser's full legal name.
aboutstringNoShort description or bio.
socialMediaobject[]NoArray of social media profiles. Each object: { name: string, url: string }.

Business Details

FieldTypeRequiredDescription
businessNamestringNoName of the business.
typeOfBusinessstringNoPrimary type of business.
businessCategorystringNoMain business category.
businessSubCategorystring[]NoList of business sub-categories.
addressobjectNoBusiness address object.
address.addLineOnestringNoAddress line 1.
address.addLineTwostringNoAddress line 2.
address.citystringNoCity name.
address.statestringNoState or province.
address.countrystringNoCountry name.
address.pincodestringNoPostal / ZIP code.
logoUrlstringNoURL of the business logo.
faviconstringNoURL of the website favicon.

Example Request Body

json
{
  "email": "sarah@novaretail.com",
  "mobileNumber": {
    "value": "9876543210",
    "countryCode": 91
  },
  "firstName": "Sarah",
  "lastName": "Mitchell",
  "businessName": "Nova Retail",
  "typeOfBusiness": "Retail",
  "businessCategory": "Fashion & Clothing",
  "address": {
    "addLineOne": "42 Commerce Street",
    "city": "Mumbai",
    "state": "Maharashtra",
    "country": "India",
    "pincode": "400001"
  }
}

API Endpoints

1. Create Account

POST/api/v2/third-party/createAccount

Creates a new user account on the ShopIQ platform. The email and mobile number must be unique — if either already exists, a 409 Conflict error is returned.

Request Body

ParameterTypeRequiredDescription
emailstringYesEmail address. Must be unique.
mobileNumberobjectYesObject with value (string) and countryCode (number). Must be unique.
firstNamestringNoUser's first name.
lastNamestringNoUser's last name.
businessNamestringNoName of the business.
...NoAll other Account Model fields are accepted.

Example Request

bash
curl -X POST https://api-development.shopiq.dev/api/v2/third-party/createAccount \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key-here" \
  -d '{
    "email": "sarah@novaretail.com",
    "mobileNumber": {
      "value": "9876543210",
      "countryCode": 91
    },
    "firstName": "Sarah",
    "lastName": "Mitchell",
    "businessName": "Nova Retail"
  }'

Success Response — 201 Created

json
{
  "success": true,
  "message": "Account created successfully",
  "accountId": "665a1f2e3b4c5d6e7f8a9b0c",
  "data": {
    "_id": "665a1f2e3b4c5d6e7f8a9b0c",
    "email": "encrypted_value",
    "firstName": "Sarah",
    "lastName": "Mitchell",
    "businessName": "Nova Retail",
    "createdByPartner": "yourPartnerName",
    ...
  }
}

Error Responses

json
// 400 — Missing required fields
{
  "success": false,
  "message": "Missing required fields: email and mobileNumber (with value and countryCode)."
}

// 409 — Duplicate account
{
  "success": false,
  "message": "Account with this email or mobile number already exists."
}

// 500 — Server error
{
  "success": false,
  "message": "Internal server error",
  "error": "Detailed error message"
}

2. Delete Account

DELETE/api/v2/third-party/deleteAccount

Permanently deletes a ShopIQ account. This action is irreversible. The account ID can be passed as a query parameter or in the request body.

Parameters

ParameterLocationTypeRequiredDescription
accountIdquery or bodystringYesThe unique identifier of the account to delete.

Example Request

bash
curl -X DELETE "https://api-development.shopiq.dev/api/v2/third-party/deleteAccount?accountId=665a1f2e3b4c5d6e7f8a9b0c" \
  -H "x-api-key: your-api-key-here"

Success Response — 200 OK

json
{
  "success": true,
  "message": "Account permanently deleted."
}

Error Responses

json
// 400 — Missing accountId
{
  "success": false,
  "message": "accountId is required."
}

// 404 — Account not found
{
  "success": false,
  "message": "Account not found."
}

3. Update Account

PUT/api/v2/third-party/updateAccount

Updates an existing ShopIQ account. Only the fields included in the request body will be modified — all other fields remain unchanged. If email or mobile number is updated, the new values are re-encrypted and re-hashed automatically.

Parameters

ParameterLocationTypeRequiredDescription
accountIdquery or bodystringYesThe unique identifier of the account to update.
...bodyNoAny Account Model field to update.

Example Request

bash
curl -X PUT https://api-development.shopiq.dev/api/v2/third-party/updateAccount \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key-here" \
  -d '{
    "accountId": "665a1f2e3b4c5d6e7f8a9b0c",
    "firstName": "Sarah",
    "businessName": "Nova Retail Premium"
  }'

Success Response — 200 OK

json
{
  "success": true,
  "message": "Account updated successfully",
  "data": {
    "_id": "665a1f2e3b4c5d6e7f8a9b0c",
    "email": "sarah@novaretail.com",
    "firstName": "Sarah",
    "businessName": "Nova Retail Premium",
    "mobileNumber": {
      "value": "9876543210",
      "countryCode": 91
    },
    ...
  }
}

Error Responses

json
// 400 — Missing accountId
{
  "success": false,
  "message": "accountId is required to update."
}

// 404 — Account not found
{
  "success": false,
  "message": "Account not found."
}

4. Get Account by ID

GET/api/v2/third-party/getAccount/{accountId}

Retrieves the full details of a specific ShopIQ account. Encrypted fields (email, phone) are automatically decrypted in the response.

Path Parameters

ParameterTypeRequiredDescription
accountIdstringYesThe unique identifier of the account.

Example Request

bash
curl -X GET https://api-development.shopiq.dev/api/v2/third-party/getAccount/665a1f2e3b4c5d6e7f8a9b0c \
  -H "x-api-key: your-api-key-here"

Success Response — 200 OK

json
{
  "success": true,
  "data": {
    "_id": "665a1f2e3b4c5d6e7f8a9b0c",
    "email": "sarah@novaretail.com",
    "mobileNumber": {
      "value": "9876543210",
      "countryCode": 91
    },
    "firstName": "Sarah",
    "lastName": "Mitchell",
    "businessName": "Nova Retail",
    "identifier": "nova-retail-abc123",
    ...
  }
}

Error Responses

json
// 404 — Account not found
{
  "success": false,
  "message": "Account not found."
}

5. Check if Account Exists

GET/api/v2/third-party/isAccountCreated

Checks whether an account with the given email or phone number already exists on ShopIQ. At least one of email or phone must be provided. Both can be provided to check either.

Query Parameters

ParameterTypeRequiredDescription
emailstringConditionalEmail address to check. Required if phone is not provided.
phonestringConditionalPhone number to check. Required if email is not provided.

Example Request

bash
curl -X GET "https://api-development.shopiq.dev/api/v2/third-party/isAccountCreated?email=sarah@novaretail.com&phone=9876543210" \
  -H "x-api-key: your-api-key-here"

Success Response — 200 OK

json
// Account exists
{
  "success": true,
  "isCreated": true,
  "message": "Account exists."
}

// Account does not exist
{
  "success": true,
  "isCreated": false,
  "message": "Account does not exist."
}

Error Responses

json
// 400 — Neither email nor phone provided
{
  "success": false,
  "message": "You must provide either an email or phone query parameter."
}

6. Connect Integration

POST/api/v2/third-party/connectIntegration

Links a ShopIQ account to a supported third-party integration. Each integration has its own set of required credentials. All credentials are encrypted at rest on ShopIQ servers. If the integration already exists on the account, it will be updated with the new credentials.

Request Body

ParameterTypeRequiredDescription
shopIQAccountIdstringYesThe ShopIQ account ID to connect.
integrationNamestringYesName of the integration (see supported integrations below).
credentialsobjectYesKey-value pairs of the required credentials for the integration.

Supported Integrations

Each integration requires specific credentials. The table below lists all currently supported integrations and their required credential fields.

Integration NameDisplay NameRequired Credentials
yourIntegrationYour IntegrationapiKey (string), userId (string)

Contact the ShopIQ team to register your platform as a supported integration.

Example Request

bash
curl -X POST https://api-development.shopiq.dev/api/v2/third-party/connectIntegration \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key-here" \
  -d '{
    "shopIQAccountId": "665a1f2e3b4c5d6e7f8a9b0c",
    "integrationName": "yourIntegration",
    "credentials": {
      "apiKey": "pk_live_abc123def456",
      "userId": "usr_789xyz"
    }
  }'

Success Response — 200 OK

json
{
  "success": true,
  "message": "ShopIQ account successfully linked with Your Integration.",
  "integration": {
    "name": "yourIntegration",
    "displayName": "Your Integration",
    "connectedAt": "2025-07-15T10:30:00.000Z",
    "access": true
  }
}

Error Responses

json
// 400 — Missing required fields
{
  "success": false,
  "message": "Missing required fields: shopIQAccountId, integrationName, and credentials are mandatory.",
  "example": {
    "shopIQAccountId": "your-account-id",
    "integrationName": "yourIntegration",
    "credentials": {
      "apiKey": "your-api-key",
      "userId": "your-user-id"
    }
  },
  "supportedIntegrations": ["yourIntegration"]
}

// 400 — Invalid credentials type
{
  "success": false,
  "message": "credentials must be a JSON object."
}

// 400 — Unsupported integration
{
  "success": false,
  "message": "Unsupported integration: 'unknownService'. Supported integrations: yourIntegration",
  "supportedIntegrations": ["yourIntegration"]
}

// 400 — Missing specific credentials
{
  "success": false,
  "message": "Missing required credentials for Your Integration: apiKey, userId",
  "requiredCredentials": ["apiKey", "userId"]
}

// 404 — Account not found
{
  "success": false,
  "message": "ShopIQ Account not found."
}

7. Disconnect Integration

POST/api/v2/third-party/disconnectIntegration

Disconnects a third-party integration from a ShopIQ account. This is a soft-disable — the integration record is preserved for history but access is revoked. The integration can be reconnected at any time using the Connect Integration endpoint.

Request Body

ParameterTypeRequiredDescription
shopIQAccountIdstringYesThe ShopIQ account ID.
integrationNamestringYesName of the integration to disconnect.

Example Request

bash
curl -X POST https://api-development.shopiq.dev/api/v2/third-party/disconnectIntegration \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key-here" \
  -d '{
    "shopIQAccountId": "665a1f2e3b4c5d6e7f8a9b0c",
    "integrationName": "yourIntegration"
  }'

Success Response — 200 OK

json
{
  "success": true,
  "message": "Integration 'yourIntegration' has been disconnected."
}

Error Responses

json
// 400 — Missing fields
{
  "success": false,
  "message": "Missing required fields: shopIQAccountId and integrationName are mandatory."
}

// 400 — Unsupported integration
{
  "success": false,
  "message": "Unsupported integration: 'unknownService'.",
  "supportedIntegrations": ["yourIntegration"]
}

// 404 — Account not found
{
  "success": false,
  "message": "ShopIQ Account not found."
}

// 404 — Integration not connected
{
  "success": false,
  "message": "Integration 'yourIntegration' is not connected to this account."
}

8. Get Integration Status

GET/api/v2/third-party/integrationStatus

Retrieves the connection status of integrations for a ShopIQ account. You can query a specific integration by name or omit the name to list all connected integrations.

Query Parameters

ParameterTypeRequiredDescription
shopIQAccountIdstringYesThe ShopIQ account ID.
integrationNamestringNoSpecific integration to check. If omitted, returns all integrations.

Example — Check Specific Integration

bash
curl -X GET "https://api-development.shopiq.dev/api/v2/third-party/integrationStatus?shopIQAccountId=665a1f2e3b4c5d6e7f8a9b0c&integrationName=yourIntegration" \
  -H "x-api-key: your-api-key-here"

Response — Specific Integration (Connected)

json
{
  "success": true,
  "connected": true,
  "integration": {
    "name": "yourIntegration",
    "displayName": "Your Integration",
    "connectedAt": "2025-07-15T10:30:00.000Z",
    "access": true
  }
}

Response — Specific Integration (Not Connected)

json
{
  "success": true,
  "connected": false,
  "message": "Integration 'yourIntegration' is not connected."
}

Example — List All Integrations

bash
curl -X GET "https://api-development.shopiq.dev/api/v2/third-party/integrationStatus?shopIQAccountId=665a1f2e3b4c5d6e7f8a9b0c" \
  -H "x-api-key: your-api-key-here"

Response — All Integrations

json
{
  "success": true,
  "integrations": [
    {
      "name": "yourIntegration",
      "displayName": "Your Integration",
      "connectedAt": "2025-07-15T10:30:00.000Z",
      "access": true
    }
  ],
  "supportedIntegrations": ["yourIntegration"]
}

Error Responses

json
// 400 — Missing shopIQAccountId
{
  "success": false,
  "message": "shopIQAccountId query parameter is required."
}

// 404 — Account not found
{
  "success": false,
  "message": "ShopIQ Account not found."
}

9. Generate Auto-Login URL

POST/api/v2/third-party/generateAutoLoginUrl

Generates a one-click login URL for a ShopIQ account. The URL contains a signed JWT token valid for 7 days. The user can be identified by account ID, email, or phone number — provide at least one.

Request Body

ParameterTypeRequiredDescription
accountIdstringConditionalShopIQ account ID. Required if email and phone are not provided.
emailstringConditionalAccount email. Required if accountId and phone are not provided.
phonestringConditionalAccount phone number. Required if accountId and email are not provided.

At least one identifier must be provided. If multiple are provided, priority order is: accountId > email > phone.

Example Request

bash
curl -X POST https://api-development.shopiq.dev/api/v2/third-party/generateAutoLoginUrl \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key-here" \
  -d '{
    "accountId": "665a1f2e3b4c5d6e7f8a9b0c"
  }'

Success Response — 200 OK

json
{
  "success": true,
  "message": "Auto-login URL generated successfully.",
  "redirectUrl": "https://d5ys1oo7li3y6.cloudfront.net/chat?token=eyJhbGciOiJIUzI1NiIs..."
}

Error Responses

json
// 400 — No identifier provided
{
  "success": false,
  "message": "Must provide accountId, email, or phone to generate a login link."
}

// 404 — Account not found
{
  "success": false,
  "message": "Account not found."
}

10. Create & Deploy Website

POST/api/v2/third-party/createAndDeploy
ASYNCReturns 202 immediately. Progress delivered via webhooks.

Triggers the AI-powered website creation and deployment pipeline for a ShopIQ account. This is an asynchronous operation — the API responds immediately with a 202 status, and progress updates are delivered to your webhook URL as the build progresses.

Request Body

ParameterTypeRequiredDescription
accountIdstringYesThe ShopIQ account ID.
businessCategorystring[]YesArray of product categories (1–5). See Supported Categories section.
brandNamestringYesThe brand name for the store.
webhookUrlstringYesURL to receive deployment status webhooks.
brandLogostringNoURL of the brand logo. If omitted, a text-based logo is generated.
websiteTypestringNoType of website. Only "ecommerce" is supported currently.
webhookSecretstringNoSecret for HMAC-SHA256 webhook signature verification.

Example Request

bash
curl -X POST https://api-development.shopiq.dev/api/v2/third-party/createAndDeploy \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key-here" \
  -d '{
    "accountId": "665a1f2e3b4c5d6e7f8a9b0c",
    "businessCategory": ["Fashion & Clothing", "Footwear"],
    "brandName": "Nova Retail",
    "brandLogo": "https://example.com/nova-logo.png",
    "webhookUrl": "https://your-server.com/webhooks/shopiq",
    "webhookSecret": "whsec_your_secret_here"
  }'

Success Response — 202 Accepted

json
{
  "success": true,
  "message": "Website creation started. Webhook will notify on completion.",
  "identifier": "nova-retail-abc123",
  "productionUrl": "https://nova-retail-abc123.shopiq.app",
  "previewUrl": "https://nova-retail-abc123.dev.shopiq.app",
  "status": "building"
}

Error Responses

json
// 400 — Missing required fields
{
  "success": false,
  "message": "accountId, businessCategory (array), brandName, and webhookUrl are required"
}

// 400 — Invalid website type
{
  "success": false,
  "message": "Only 'ecommerce' websiteType is supported at this time."
}

// 400 — Invalid categories
{
  "success": false,
  "message": "Invalid categories: Gaming, Crypto",
  "validCategories": ["Fashion & Clothing", "Footwear", ...]
}

// 400 — Too many categories
{
  "success": false,
  "message": "Maximum 5 categories allowed per store."
}

// 404 — Account not found
{
  "success": false,
  "message": "Account not found"
}

// 409 — Website already exists
{
  "success": false,
  "message": "Website already exists for this account"
}

Supported E-Commerce Categories

The following categories are valid for the businessCategory field in the /createAndDeploy endpoint. You may select 1 to 5 categories per store. Values are case-sensitive and must match exactly.

Fashion & Clothing
Footwear
Accessories
Bags & Luggage
Jewelry & Watches
Beauty & Skincare
Health & Wellness
Sports & Fitness
Electronics & Gadgets
Home & Furniture
Kitchen & Dining
Toys & Games
Books & Stationery
Food & Beverages
Pet Supplies
Baby & Kids
Automotive & Parts
Art & Crafts
Music & Instruments
Outdoor & Camping

Webhook Events

When using the /createAndDeploy endpoint, ShopIQ sends webhook notifications to your specified URL as the deployment progresses. If you provided a webhookSecret, each webhook includes an HMAC-SHA256 signature in the x-shopiq-signature header for verification.

Webhook Signature Verification

javascript
const crypto = require("crypto");

function verifyWebhook(body, signature, secret) {
  const expected = "sha256=" + crypto
    .createHmac("sha256", secret)
    .update(JSON.stringify(body))
    .digest("hex");
  return signature === expected;
}

// In your webhook handler:
app.post("/webhooks/shopiq", (req, res) => {
  const signature = req.headers["x-shopiq-signature"];
  const isValid = verifyWebhook(req.body, signature, "whsec_your_secret_here");

  if (!isValid) {
    return res.status(401).send("Invalid signature");
  }

  console.log("Event:", req.body.event);
  res.status(200).send("OK");
});

Event Types

EventDescriptionWhen
website.buildingAI has started building the website.Immediately after pipeline starts.
website.createdWebsite generated successfully. Deploying to production.After AI generation completes.
deployment.successWebsite is live and accessible at the production URL.After successful deployment.
deployment.failedDeployment failed. Check the error field for details.If any step in the pipeline fails.

Webhook Payload Examples

json
// website.building
{
  "event": "website.building",
  "accountId": "665a1f2e3b4c5d6e7f8a9b0c",
  "identifier": "nova-retail-abc123",
  "message": "AI is building your website...",
  "timestamp": "2025-07-15T10:30:00.000Z"
}

// website.created
{
  "event": "website.created",
  "accountId": "665a1f2e3b4c5d6e7f8a9b0c",
  "identifier": "nova-retail-abc123",
  "previewUrl": "https://nova-retail-abc123.dev.shopiq.app",
  "message": "Website created. Deploying to production...",
  "timestamp": "2025-07-15T10:32:00.000Z"
}

// deployment.success
{
  "event": "deployment.success",
  "accountId": "665a1f2e3b4c5d6e7f8a9b0c",
  "identifier": "nova-retail-abc123",
  "productionUrl": "https://nova-retail-abc123.shopiq.app",
  "previewUrl": "https://nova-retail-abc123.dev.shopiq.app",
  "message": "Website is live!",
  "timestamp": "2025-07-15T10:35:00.000Z"
}

// deployment.failed
{
  "event": "deployment.failed",
  "accountId": "665a1f2e3b4c5d6e7f8a9b0c",
  "identifier": "nova-retail-abc123",
  "error": "GitHub Actions deployment failed",
  "timestamp": "2025-07-15T10:35:00.000Z"
}

Image API

PARTNER APIBase path: /partner/v1 — Authenticated via X-API-Key header

The Image API enables partners to generate new images from text prompts and enhance existing images using AI.

Key Features

Image Create

Generate product images, lifestyle shots, logos, and more from text prompts. Supports multiple aspect ratios and resolutions.

Image Enhance

Improve existing images — fix lighting, remove backgrounds, upscale quality, or apply specific edits using natural language.

Two Processing Modes

'Fast' mode for quick generation with template prompts. 'Thinking' mode uses AI to craft optimal prompts before generation.

Multiple Resolutions

Output images at 1K (1024px), 2K (2048px), or 4K (4096px) resolution. Higher resolutions produce sharper, more detailed results.

Authentication

The Image API uses dedicated partner API keys (prefixed with sq_live_ or sq_test_). These are managed through the Partner Dashboard. Include the key in the X-API-Key header or as a Bearer token in the Authorization header.

Supported Parameters

ParameterValuesDescription
aspectRatio1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3Output image aspect ratio. Default: 1:1
modefast, thinkingProcessing mode. 'fast' uses template prompts, 'thinking' uses AI for prompt optimization. Default: fast
resolution1k, 2k, 4kOutput resolution. 1k=1024px, 2k=2048px, 4k=4096px. Default: 1k

Response Format

All Image API responses follow the standard ShopIQ response format with additional fields for points usage and processing metrics.

json
{
  "success": true,
  "message": "Success",
  "data": {
    "imageUrl": "https://...",
    "mode": "fast",
    "resolution": "1k",
    "pointsUsed": 8,
    "tier": "starter",
    "costPerOperation": 8,
    "remainingBalance": 4992,
    "processingTimeMs": 12500,
    "totalTimeMs": 13200
  },
  "timestamp": "2025-07-15T10:30:00.000Z"
}

11. Image Create

POST/partner/v1/image/create

Generate a new image from a text prompt. The prompt is processed either directly (fast mode) or enhanced by AI (thinking mode) before being sent to the image generation model. The generated image is uploaded to S3 and a public URL is returned.

Request Body

ParameterTypeRequiredDescription
promptstringYesText description of the image to generate. Min 3 characters, max 4000 characters.
aspectRatiostringNoOutput aspect ratio. One of: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3. Default: 1:1
modestringNoProcessing mode. 'fast' (direct generation) or 'thinking' (AI-enhanced prompt). Default: fast
resolutionstringNoOutput resolution. '1k' (1024px), '2k' (2048px), or '4k' (4096px). Default: 1k

Processing Modes Explained

ModeHow It WorksBest ForCost
fastYour prompt is lightly wrapped with quality markers and sent directly to image model for generation.Quick iterations, simple prompts, when you already have a detailed prompt.6–8 points (varies by tier)
thinkingYour prompt is first sent to AI which analyzes it and generates a highly-detailed, optimized prompt. That enhanced prompt is then sent to image model.Complex scenes, when you want the best possible output, short/vague prompts that need expansion.11–15 points (varies by tier)

Example Request — Fast Mode

bash
curl -X POST https://api-partners.shopiq.app/partner/v1/image/create \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sq_live_your-key-here" \
  -d '{
    "prompt": "A premium leather handbag on a marble surface with soft studio lighting, luxury fashion photography",
    "aspectRatio": "1:1",
    "mode": "fast",
    "resolution": "1k"
  }'

Example Request — Thinking Mode

bash
curl -X POST https://api-partners.shopiq.app/partner/v1/image/create \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sq_live_your-key-here" \
  -d '{
    "prompt": "minimalist sneaker product shot for an e-commerce store",
    "aspectRatio": "4:3",
    "mode": "thinking",
    "resolution": "2k"
  }'

Success Response — 200 OK

json
{
  "success": true,
  "message": "Success",
  "data": {
    "imageUrl": "https://your-bucket.s3.ap-south-1.amazonaws.com/partners/abc123/generated/uuid.png",
    "mode": "fast",
    "resolution": "1k",
    "pointsUsed": 8,
    "tier": "starter",
    "costPerOperation": 8,
    "remainingBalance": 4992,
    "processingTimeMs": 11234,
    "totalTimeMs": 11890
  },
  "timestamp": "2025-07-15T10:30:00.000Z"
}

Error Responses

json
// 400 — Invalid prompt
{
  "success": false,
  "message": "Prompt is required and must be at least 3 characters"
}

// 400 — Prompt too long
{
  "success": false,
  "message": "Prompt must be less than 4000 characters"
}

// 400 — Invalid aspect ratio
{
  "success": false,
  "message": "Invalid aspect ratio. Supported: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3"
}

// 400 — Invalid mode
{
  "success": false,
  "message": "Invalid mode. Supported: fast, thinking"
}

// 400 — Invalid resolution
{
  "success": false,
  "message": "Invalid resolution. Supported: 1k, 2k, 4k"
}

// 402 — Insufficient points
{
  "success": false,
  "message": "Insufficient points. Required: 8 (starter tier, fast mode), Available: 3. Please top up your account."
}

// 422 — Safety filter blocked
{
  "success": false,
  "message": "Image generation was blocked by safety filters: [reason]"
}

// 503 — Service unavailable
{
  "success": false,
  "message": "Service temporarily unavailable due to high demand. Please retry in a few seconds."
}

// 500 — Generation failed
{
  "success": false,
  "message": "Image generation failed. Please try again."
}

Notes

  • Points are automatically refunded if image generation fails after deduction.
  • Request timeout is 2 minutes. Complex prompts in thinking mode may take 30–60 seconds.
  • Generated images are stored permanently on S3 with public-read access and 1-year cache headers.
  • If AI fails in thinking mode, the system automatically falls back to fast mode.

12. Image Enhance

POST/partner/v1/image/enhance

Enhance one or more existing images using AI. Provide image URLs and an optional natural language request describing the desired improvements. The images are downloaded, processed through the AI pipeline, and the enhanced results are uploaded to S3.

Request Body

ParameterTypeRequiredDescription
imagesstring[]YesArray of image URLs to enhance. Must be valid HTTP/HTTPS URLs. Min 1, max 4 images.
userRequeststringNoNatural language description of desired enhancements. Max 2000 characters. If omitted, general quality enhancement is applied.
aspectRatiostringNoOutput aspect ratio. One of: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3. Default: 1:1
modestringNoProcessing mode. 'fast' (template-based) or 'thinking' (AI analyzes images and crafts prompt). Default: fast
resolutionstringNoOutput resolution. '1k' (1024px), '2k' (2048px), or '4k' (4096px). Default: 1k

Processing Modes for Enhancement

ModeHow It WorksBest For
fastA template-based enhancement prompt is generated from your userRequest and sent to image model along with the images.Quick quality improvements, batch processing, when you have specific instructions.
thinkingAI analyzes the actual images, identifies issues, and crafts a detailed enhancement prompt tailored to the specific content. That prompt is then sent to Image model.Complex edits, when you want AI to determine the best approach, product photography cleanup.

Example Request — Fast Mode

bash
curl -X POST https://api-partners.shopiq.app/partner/v1/image/enhance \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sq_live_your-key-here" \
  -d '{
    "images": [
      "https://example.com/product-photo-raw.jpg"
    ],
    "userRequest": "Remove the background and place on a clean white surface with soft shadows. Make colors more vibrant.",
    "aspectRatio": "1:1",
    "mode": "fast",
    "resolution": "2k"
  }'

Example Request — Thinking Mode with Multiple Images

bash
curl -X POST https://api-partners.shopiq.app/partner/v1/image/enhance \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sq_live_your-key-here" \
  -d '{
    "images": [
      "https://example.com/product-front.jpg",
      "https://example.com/product-side.jpg"
    ],
    "userRequest": "Create a professional e-commerce product listing image",
    "aspectRatio": "4:3",
    "mode": "thinking",
    "resolution": "1k"
  }'

Example Request — No User Request (Auto-Enhance)

bash
curl -X POST https://api-partners.shopiq.app/partner/v1/image/enhance \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sq_live_your-key-here" \
  -d '{
    "images": [
      "https://example.com/low-quality-photo.jpg"
    ],
    "mode": "thinking"
  }'

Success Response — 200 OK

json
{
  "success": true,
  "message": "Success",
  "data": {
    "imageUrls": [
      "https://your-bucket.s3.ap-south-1.amazonaws.com/partners/abc123/enhanced/uuid1.png",
      "https://your-bucket.s3.ap-south-1.amazonaws.com/partners/abc123/enhanced/uuid2.png"
    ],
    "mode": "thinking",
    "resolution": "1k",
    "pointsUsed": 15,
    "tier": "starter",
    "costPerOperation": 15,
    "remainingBalance": 4985,
    "processingTimeMs": 18500,
    "totalTimeMs": 19200
  },
  "timestamp": "2025-07-15T10:30:00.000Z"
}

Error Responses

json
// 400 — No images provided
{
  "success": false,
  "message": "At least one image URL is required in the 'images' array"
}

// 400 — Too many images
{
  "success": false,
  "message": "Maximum 4 images per request"
}

// 400 — Invalid URLs
{
  "success": false,
  "message": "All images must be valid HTTP/HTTPS URLs"
}

// 400 — User request too long
{
  "success": false,
  "message": "User request must be less than 2000 characters"
}

// 400 — Failed to download image
{
  "success": false,
  "message": "Failed to download image: [error details]"
}

// 402 — Insufficient points
{
  "success": false,
  "message": "Insufficient points. Required: 15 (starter tier, thinking mode), Available: 10. Please top up your account."
}

// 422 — Safety filter blocked
{
  "success": false,
  "message": "Enhancement blocked by safety filters: [reason]"
}

// 503 — Service unavailable
{
  "success": false,
  "message": "Service temporarily unavailable. Please retry shortly."
}

// 500 — Enhancement failed
{
  "success": false,
  "message": "Image enhancement failed. Please try again."
}

Notes

  • Images are downloaded from the provided URLs. Ensure they are publicly accessible.
  • Maximum image download size is 50MB per image.
  • Supported input formats: JPEG, PNG, GIF, WebP.
  • Output is always PNG format for maximum quality.
  • Points are automatically refunded if enhancement fails after deduction.
  • The number of output images may differ from input — the model may combine or produce additional variations.
  • If AI fails in thinking mode, the system automatically falls back to fast mode.

13. Image Usage Stats

GET/partner/v1/image/usage

Retrieve usage statistics for the Image API, including call counts, points balance, current pricing tier, and active point buckets. This endpoint does not consume any points.

Request

bash
curl -X GET https://api-partners.shopiq.app/partner/v1/image/usage \
  -H "X-API-Key: sq_live_your-key-here"

Success Response — 200 OK

json
{
  "success": true,
  "message": "Success",
  "data": {
    "last30Days": {
      "imageCreations": 142,
      "imageEnhancements": 87,
      "totalCalls": 229
    },
    "points": {
      "balance": 18750,
      "totalUsed": 6250,
      "monthlyUsage": {
        "month": "2025-07",
        "used": 3200
      }
    },
    "currentPricing": {
      "tier": "growth",
      "imageCreateFast": 7.25,
      "imageCreateThinking": 14,
      "imageEnhanceFast": 7.25,
      "imageEnhanceThinking": 14
    },
    "activeBuckets": [
      {
        "packageId": "pack_25000",
        "tier": "growth",
        "remainingPoints": 18750,
        "originalPoints": 25000,
        "purchasedAt": "2025-07-01T00:00:00.000Z"
      }
    ],
    "allTierPricing": {
      "starter": {
        "tier": "starter",
        "createFast": 8,
        "createThinking": 15,
        "enhanceFast": 8,
        "enhanceThinking": 15
      },
      "growth": {
        "tier": "growth",
        "createFast": 7.25,
        "createThinking": 14,
        "enhanceFast": 7.25,
        "enhanceThinking": 14
      },
      "scale": {
        "tier": "scale",
        "createFast": 6,
        "createThinking": 11,
        "enhanceFast": 6,
        "enhanceThinking": 11
      }
    },
    "supportedResolutions": ["1k", "2k", "4k"],
    "defaultResolution": "1k"
  },
  "timestamp": "2025-07-15T10:30:00.000Z"
}

Response Fields

FieldTypeDescription
last30Days.imageCreationsnumberNumber of image create calls in the last 30 days.
last30Days.imageEnhancementsnumberNumber of image enhance calls in the last 30 days.
points.balancenumberCurrent total points balance across all buckets.
points.totalUsednumberTotal points consumed since account creation.
points.monthlyUsageobjectPoints used in the current calendar month.
currentPricingobject | nullPricing for the current active bucket. Null if no active buckets.
activeBucketsarrayList of point buckets with remaining balance, ordered by purchase date (FIFO).
allTierPricingobjectComplete pricing table for all tiers for reference.

Image API Pricing Tiers

The Image API uses a points-based billing system. Points are purchased in packages (buckets), and each package corresponds to a pricing tier. The cost per operation depends on which tier your points come from. Points are consumed in FIFO order — the oldest bucket is used first.

Available Packages

PackagePointsPriceTier
Starter5,000₹5,000starter
Growth25,000₹25,000growth
Scale1,00,000₹1,00,000scale

Cost Per Operation by Tier

OperationStarter (₹5K)Growth (₹25K)Scale (₹1L)
Image Create — Fast8 points7.25 points6 points
Image Create — Thinking15 points14 points11 points
Image Enhance — Fast8 points7.25 points6 points
Image Enhance — Thinking15 points14 points11 points

How Billing Works

  • FIFO Bucket System: Points are deducted from the oldest active bucket first. The cost is determined by the tier of the bucket being deducted from.
  • Multiple Buckets: You can have multiple active buckets from different tiers. If your oldest bucket runs out mid-operation, the remaining cost is deducted from the next bucket.
  • Automatic Refunds: If an operation fails after points are deducted, the points are automatically refunded to your account.
  • No Expiry: Purchased points do not expire. Use them at your own pace.

Example: Cost Calculation

text
Scenario: You have a Growth bucket (25,000 points)

• Image Create (fast mode):  7.25 points per call
  → 25,000 ÷ 7.25 = ~3,448 images

• Image Create (thinking mode): 14 points per call
  → 25,000 ÷ 14 = ~1,785 images

• Image Enhance (fast mode): 7.25 points per call
  → 25,000 ÷ 7.25 = ~3,448 enhancements

• Image Enhance (thinking mode): 14 points per call
  → 25,000 ÷ 14 = ~1,785 enhancements

Image API Test Mode

When using a test API key (prefixed with sq_test_), the Image API operates in test mode. In this mode:

  • No AI models are triggered — responses are instant.
  • No points are deducted from your balance.
  • Static placeholder images are returned instead of generated images.
  • All validation rules still apply (prompt length, aspect ratio, etc.).
  • Rate limiting still applies to prevent abuse.
  • Responses include a testMode: true flag.

Test Mode Response Example

json
{
  "success": true,
  "message": "Success",
  "data": {
    "imageUrl": "https://placehold.co/1024x1024/1a1a2e/ffffff/png?text=ShopIQ+Test%0AImage+Create%0A1:1",
    "mode": "fast",
    "resolution": "1k",
    "pointsUsed": 0,
    "tier": "test",
    "costPerOperation": 0,
    "remainingBalance": null,
    "processingTimeMs": 5,
    "totalTimeMs": 5,
    "testMode": true,
    "message": "This is a test response. No AI model was triggered and no points were deducted. Use a live API key (sq_live_*) for actual image generation."
  },
  "timestamp": "2025-07-15T10:30:00.000Z"
}

When to Use Test Mode

Use CaseKey Type
Integration development & testingsq_test_* (test key)
Verifying request/response formatsq_test_* (test key)
CI/CD pipeline testssq_test_* (test key)
Production image generationsq_live_* (live key)
Actual image enhancementsq_live_* (live key)

Creating API Keys

API keys are managed through the Partner Dashboard. You can create up to 10 active keys per account. Each key can be designated as either "live" or "test" environment. Keys can be revoked at any time from the dashboard.


Changelog

v2.2.0May 2026
  • Added /partner/v1/image/create endpoint for AI image generation from text prompts.
  • Added /partner/v1/image/enhance endpoint for AI-powered image enhancement.
  • Added /partner/v1/image/usage endpoint for usage statistics and pricing info.
  • Introduced plan-based pricing tiers (Starter, Growth, Scale) with FIFO bucket system.
  • Added "thinking" mode with AI prompt enhancement for superior image quality.
  • Added multi-resolution support (1K, 2K, 4K output).
  • Added test mode with sq_test_* keys for development without consuming points.
  • Added automatic point refunds on failed operations.
v2.1.0July 2025
  • Added generic /connectIntegration endpoint supporting any registered partner.
  • Added /disconnectIntegration endpoint for soft-disabling integrations.
  • Added /integrationStatus endpoint for checking connection status.
  • Added partner-level API key authentication with per-endpoint permissions.
  • Added rate limiting (per-minute and per-day).
v2.0.0June 2025
  • Added /generateAutoLoginUrl endpoint.
  • Added /createAndDeploy endpoint with webhook-based async deployment.
  • Initial release of third-party API.