Back to Documentation

API Reference

Complete REST API, MCP tools, and webhook documentation for zalink.ai

Base URL

https://api.zalink.ai

Authentication

All API requests require authentication. Include your API key as a Bearer token in the Authorization header. For OAuth flows, redirect users to the platform authorization URL.

Bearer Token

Authorization: Bearer YOUR_API_KEY

OAuth 2.0 Flow

  1. 1.Redirect to /oauth/connect/:platform with state param
  2. 2.User authorizes on the platform
  3. 3.Callback received at /oauth/callback/:platform
  4. 4.Tokens stored and encrypted server-side

Code Examples

curl -X GET "https://api.zalink.ai/api/stores/STORE_ID/products?limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

REST Endpoints

Store

GET
/api/stores/:id

Get store details and connection status

PUT
/api/stores/:id/settings

Update store settings (business, shipping, tax, AI)

Products

GET
/api/stores/:id/products

List products with pagination and filters

GET
/api/stores/:id/products/:productId

Get a single product by ID

Orders

GET
/api/stores/:id/orders

List orders with date range and status filters

GET
/api/stores/:id/orders/:orderId

Get order details including line items

Customers

GET
/api/stores/:id/customers

List customers with search and pagination

GET
/api/stores/:id/customers/:customerId

Get customer profile and order history

Cart

POST
/api/stores/:id/cart

Create a new cart with items

PUT
/api/stores/:id/cart/:cartId

Update cart items or apply coupons

DELETE
/api/stores/:id/cart/:cartId

Delete a cart

Analytics

GET
/api/stores/:id/analytics/realtime

Real-time visitors, active carts, and revenue

GET
/api/stores/:id/analytics/daily

Daily aggregated sales and traffic metrics

GET
/api/stores/:id/analytics/products

Top products by views, sales, and revenue

GET
/api/stores/:id/analytics/customers

Customer acquisition and retention data

GET
/api/stores/:id/analytics/ai

AI interaction metrics and conversion rates

Promotions

GET
/api/stores/:id/promotions

List all promotions

POST
/api/stores/:id/promotions

Create a new promotion or coupon

PUT
/api/stores/:id/promotions/:promoId

Update an existing promotion

DELETE
/api/stores/:id/promotions/:promoId

Delete a promotion

MCP Tools

Model Context Protocol tools available for AI assistants like Claude.

search_productsget_productget_categoriescreate_cartadd_to_cartcheckoutget_order_statusget_store_policiesvalidate_couponget_active_promotions

Public API (ACP)

Agentic Commerce Protocol endpoints for ChatGPT and other AI agents.

GET
/acp/stores/:id

Store info and capabilities

GET
/acp/stores/:id/products/search

Search products with filters

POST
/acp/stores/:id/cart

Create cart for checkout

POST
/acp/stores/:id/checkout

Generate checkout URL

Webhook Events

Events dispatched to your registered webhook URL.

order.createdorder.updatedorder.completedorder.cancelledproduct.createdproduct.updatedproduct.deletedcustomer.createdcustomer.updatedapp.uninstalled

Error Codes

CodeNameDescription
400Bad RequestInvalid parameters or request body
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions for this resource
404Not FoundResource does not exist
429Too Many RequestsRate limit exceeded, retry after cooldown
500Server ErrorInternal error, contact support if persistent

Rate Limits

Limits are enforced per API key. Headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

EndpointLimit
Dashboard API100 req/min
OAuth Endpoints20 req/min
MCP Endpoints100 req/min
ACP Endpoints100 req/min
Webhook Handlers200 req/min