WACM.in Logo
Back to API Docs

eCommerce Store API

Shop API Reference

Build and manage your WhatsApp eCommerce store. Sync products, process orders, and integrate with Shopify or WooCommerce seamlessly.

Overview

The Shop API enables you to manage your WhatsApp eCommerce store programmatically. Create and manage products, organize categories, process orders, and integrate with external platforms like Shopify and WooCommerce.

Developer API Base

https://api.wacm.in/api/v1/shop

Public API Base

https://api.wacm.in/shop

The API uses RESTful conventions with JSON request/response bodies. All developer endpoints require authentication via Bearer token.

Authentication

Developer API endpoints (v1) require authentication. Public endpoints for categories and products use company_id for scoping.

Authenticated Request
curl -X GET "https://api.wacm.in/api/v1/shop/products" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

Integration Flow

Follow these steps to integrate your external system with WACM Shop:

1

Get Your Token

Log in to your WACM dashboard, navigate to Settings → API to get your Personal Access Token.

2

Push Categories

Make a POST request to /categories to establish your product taxonomy. Save the returned Category IDs.

3

Push Products

Make a POST request to /products, attaching the newly created shop_category_id to each item.

4

Fulfill Orders

Poll the /orders endpoint to receive new purchases, or use the WACM Webhook engine to listen for real-time events.

5

Update Statuses

Once you ship an item, PUT the new status (e.g., Shipped) back to the /orders/{id}/status endpoint.

Products

GET
/products

List all products

POST
/products

Create a new product

GET
/products/{'{id}'}

Get product details

PUT
/products/{'{id}'}

Update product

DELETE
/products/{'{id}'}

Delete product

List Products

Request
curl -X GET "https://api.wacm.in/api/v1/shop/products" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Create Product

Request
curl -X POST "https://api.wacm.in/api/v1/shop/products" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Premium Wireless Headphones",
    "description": "High-quality wireless headphones with noise cancellation",
    "price": 2999.00,
    "compare_at_price": 4999.00,
    "currency": "INR",
    "stock_quantity": 100,
    "status": "Active",
    "external_id": "SKU-WH-001",
    "shop_category_id": 1
  }'

Request Body

ParameterTypeRequiredDescription
namestringRequiredProduct name
pricenumberRequiredProduct price
descriptionstringOptionalProduct description
compare_at_pricenumberOptionalOriginal price (for showing discounts)
currencystringOptionalCurrency code (default: INR)
stock_quantityintegerOptionalAvailable stock quantity
statusstringOptionalProduct status: Active, Draft, Archived
external_idstringOptionalExternal SKU or product ID
imagestringOptionalProduct image URL
shop_category_idintegerOptionalCategory ID reference

Response

201 Created
{
  "id": 1,
  "name": "Premium Wireless Headphones",
  "description": "High-quality wireless headphones with noise cancellation",
  "price": 2999.00,
  "compare_at_price": 4999.00,
  "currency": "INR",
  "stock_quantity": 100,
  "status": "Active",
  "external_id": "SKU-WH-001",
  "image": null,
  "shop_category_id": 1,
  "created_at": "2025-01-15T10:30:00.000000Z",
  "updated_at": "2025-01-15T10:30:00.000000Z"
}

Categories

GET
/categories

List all categories

POST
/categories

Create a new category

GET
/categories/{'{id}'}

Get category details

PUT
/categories/{'{id}'}

Update category

DELETE
/categories/{'{id}'}

Delete category

Create Category

Request
curl -X POST "https://api.wacm.in/api/v1/shop/categories" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Electronics",
    "description": "Electronic devices and accessories"
  }'

Request Body

ParameterTypeRequiredDescription
namestringRequiredCategory name
descriptionstringOptionalCategory description
parent_idintegerOptionalParent category ID for subcategories

Public Categories Endpoint

No authentication required - uses company_id for scoping.

Request
curl -X GET "https://api.wacm.in/shop/{company_id}/categories"

Orders

GET
/orders

List all orders

GET
/orders/{'{id}'}

Get order details

PUT
/orders/{'{id}'}/status

Update order status

Update Order Status

Request
curl -X PUT "https://api.wacm.in/api/v1/shop/orders/123/status" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "Shipped"
  }'

Request Body

ParameterTypeRequiredDescription
statusstringRequiredNew order status

Valid Order Statuses

PendingProcessingShippedDeliveredCancelledRefunded

ERP Sync

Synchronize your ERP system inventory with WACM Shop.

POST
/erp/syncPublic

Sync products and inventory from ERP

Request
curl -X POST "https://api.wacm.in/shop/erp/sync" \
  -H "Content-Type: application/json" \
  -d '{
    "company_id": 1,
    "products": [
      {
        "external_id": "ERP-001",
        "stock_quantity": 50,
        "price": 1999.00
      }
    ]
  }'

Webhooks

Receive real-time notifications for store events. Webhooks are verified via HMAC-SHA256 signature for security.

POST
/webhooks/shopify/{company_id}No Auth

Shopify webhook receiver

POST
/webhooks/woo/{company_id}No Auth

WooCommerce webhook receiver

POST
/webhooks/custom/{token}Token Auth

Custom webhook receiver

Security

External webhooks (Shopify/WooCommerce) are verified via HMAC-SHA256 signature in the request headers. No additional authentication required.

Shopify Integration

Connect your Shopify store to automatically sync products and receive order notifications.

Webhook Events Supported

  • products/create - New product created
  • products/update - Product updated
  • products/delete - Product deleted
  • orders/create - New order placed
  • orders/updated - Order status changed
Shopify Webhook URL
https://api.wacm.in/shop/webhooks/shopify/{your_company_id}

WooCommerce Integration

Connect your WooCommerce store to sync products and process orders through WhatsApp.

WooCommerce Webhook URL
https://api.wacm.in/shop/webhooks/woo/{your_company_id}

Product Status Reference

StatusDescription
ActiveProduct is visible and purchasable
DraftProduct is hidden from store (work in progress)
ArchivedProduct is no longer available

Order Status Reference

200Pending - Order received, awaiting processing
200Processing - Order is being prepared
200Shipped - Order has been shipped
200Delivered - Order delivered to customer
200Cancelled - Order was cancelled
200Refunded - Payment was refunded

HMAC-SHA256 Security

All external webhooks (Shopify/WooCommerce) are verified using HMAC-SHA256 signatures to ensure request authenticity.

Verification Process
1. Receive webhook request with HMAC signature header
2. Compute HMAC-SHA256 using your shared secret
3. Compare computed signature with received signature
4. Process request only if signatures match

Security Best Practice

Always verify webhook signatures before processing. Never trust unverified webhook payloads.

WhatsApp Business API

Send messages, manage contacts, and run campaigns.

View Docs