Shop API Docs Download .md
v1.0 REST API

Shop API Reference

Comprehensive API reference for integrating ERPs, storefronts, and third-party systems with the WACM Shop Module.

Download as Markdown
Base URL
https://app.wacm.in/api/v1/shop

Authentication

API requests require a Bearer Token. Pass it in the HTTP header:

Authorization: Bearer YOUR_API_TOKEN

There are two types of tokens for the Shop API:

ERP Token

Used for the POST /api/shop/erp/sync endpoint only.

Found in: Shop > Integrations > ERP / Custom API

Sanctum Token

Used for all /api/v1/shop/* endpoints.

Generated via: Settings > API Tokens (create a token with Shop module scope)

Example Request Header
Authorization: Bearer YOUR_API_TOKEN

Quick Start & Integration Flow

To integrate your ERP or external system with WACM Shop:

1

Obtain Your Token

For ERP bulk sync: use the ERP Token from Shop > Integrations. For REST API: generate a Sanctum token from Settings > API Tokens.

2

Push Categories

Make a POST to /api/v1/shop/categories to establish your taxonomy. Save the returned id values.

3

Push Products

For bulk sync: POST an array to /api/shop/erp/sync. For single product: POST to /api/v1/shop/products.

4

Process Orders

Poll GET /api/v1/shop/orders, or register a webhook endpoint to receive real-time events.

5

Update Statuses

Send a PUT to /api/v1/shop/orders/{id}/status with the new status (Pending, Processing, Shipped, Fulfilled, Delivered, Cancelled).

Products

GET /api/v1/shop/products

Returns all products for the authenticated company. Supports eager-loaded category.

POST /api/v1/shop/products

Create a new product.

Parameters

Parameter Description
name Req Product name (max 255 chars).
price Req Selling price (min: 0).
description Full product description.
compare_at_price Original/strikethrough price.
currency 3-letter currency code (e.g., INR, USD).
stock_quantity Available inventory count.
status Active, Draft, Archived. Default: Active.
external_id Your system's product ID.
image Product image URL.
category_id ID of the category to assign.
PUT /api/v1/shop/products/{id}
DEL /api/v1/shop/products/{id}

Update an existing product (same fields as POST, all optional) or delete a product (returns 204 No Content).

Response: GET Products 200 OK
{
  "data": [
    {
      "id": 105,
      "name": "Summer Dress",
      "description": "...",
      "price": "49.99",
      "compare_at_price": null,
      "currency": "INR",
      "stock_quantity": 50,
      "status": "Active",
      "image": "https://...",
      "category_id": 3,
      "external_id": "SKU-001",
      "external_source": "erp",
      "created_at": "2024-01-01T00:00:00Z"
    }
  ]
}

Categories

GET /api/v1/shop/categories

Returns all product categories for the authenticated company.

POST /api/v1/shop/categories

Create a new category.

Parameters

Parameter Description
name Req Category name (max 255 chars).
slug Req URL-friendly identifier (max 255 chars).
description Category description.
image Category image URL.
PUT /api/v1/shop/categories/{id}
DEL /api/v1/shop/categories/{id}

Update an existing category or delete a category (returns 204 No Content).

Orders

GET /api/v1/shop/orders
GET /api/v1/shop/orders/{id}

Returns all orders or a specific order by ID. Each order includes nested contact and line-item data.

PUT /api/v1/shop/orders/{id}/status

Update the status of an order.

Parameters

Parameter Description
status Req One of: Pending, Processing, Shipped, Fulfilled, Delivered, Cancelled, Refunded.
Response: GET Order 200 OK
{
  "data": {
    "id": 42,
    "order_number": "ORD-ABC123",
    "status": "Shipped",
    "total_amount": "99.99",
    "currency": "INR",
    "customer_name": "John Doe",
    "customer_phone": "1234567890",
    "tracking_number": "TRACK001",
    "tracking_url": "https://track.example.com/TRACK001"
  }
}

ERP Bulk Sync

POST https://app.wacm.in/api/shop/erp/sync

Bulk-sync products from your ERP system in a single request. Uses a unique ERP Token (not a Sanctum token).

Token Location

Find your ERP Token in Shop > Integrations > ERP / Custom API tab.

Product Fields

Field Description
external_id Req Unique ID from your ERP system.
name Req Product name.
description Product description.
price Selling price.
compare_at_price Original/strikethrough price.
stock_quantity Available inventory.
status Active, Draft, Archived. Default: Active.
image Product image URL.

Note: Products synced via this endpoint are marked with external_source: "erp". If a product with the same external_id already exists, it will be updated rather than duplicated.

Request: ERP Sync POST Payload
{
  "products": [
    {
      "external_id": "SKU-1001",
      "name": "Summer T-Shirt",
      "description": "100% cotton blue shirt",
      "price": 19.99,
      "compare_at_price": 25.00,
      "stock_quantity": 50,
      "status": "Active",
      "image": "https://example.com/shirt.jpg"
    },
    {
      "external_id": "SKU-1002",
      "name": "Winter Jacket",
      "price": 89.99
    }
  ]
}
Response: ERP Sync 200 OK
{
  "success": true,
  "message": "Successfully synced 2 products."
}

Incoming Webhooks (ERP)

Receive real-time order events from third-party systems (Zapier, Make, custom ERPs) into WACM.

POST https://app.wacm.in/api/shop/webhooks/custom/{token}

The ERP Token is used as the webhook token in the URL.

Event Payload Fields

Field Description
event Req One of: order.placed, order.status_updated.
data.customer_address Combined shipping address (e.g. "123 Main St, New York")
data.status Pending, Processing, Shipped, Fulfilled, Delivered, Cancelled.
data.tracking_url URL to track shipment.
Event: order.placed POST Payload
{
  "event": "order.placed",
  "data": {
    "order_number": "EXT-100",
    "customer_name": "John Doe",
    "customer_phone": "1234567890",
    "customer_email": "john@example.com",
    "total_amount": 45.00,
    "currency": "USD",
    "items": [
      { "name": "Item 1", "quantity": 1, "price": 45.00 }
    ]
  }
}
Event: order.status_updated POST Payload
{
  "event": "order.status_updated",
  "data": {
    "order_number": "EXT-100",
    "status": "Shipped",
    "tracking_url": "https://track.example.com/123",
    "tracking_number": "123"
  }
}

Shopify Integration

WACM integrates with Shopify via the Admin GraphQL API and signed webhooks. Products, orders, and abandoned carts sync for event automation.

Shopify checkout remains authoritative: Shopify-synchronized products are excluded from WACM's separate public catalog and booking-fee checkout.

Setup Instructions

Configure Shopify in Shop > Integrations > Shopify. See the Shopify workspace for the full guide.

Public app installation

WACM.in public app

Start from the Shopify App Store or Shopify Admin. Shopify supplies the store identity and WACM starts OAuth immediately.

  1. Install WACM.in from Shopify
  2. Approve the requested read-only permissions
  3. Sign in to WACM after OAuth and select your company
  4. Verify the connection in the Shopify workspace

Supported Webhooks

Shopify Event WACM Action
products/createCreate/update product
products/updateUpdate product
products/deleteMark product as Draft
orders/createCreate order + Flowmaker event
orders/fulfilledUpdate to "Fulfilled", save tracking
orders/cancelledUpdate to "Cancelled"
checkouts/createTrigger abandoned cart
checkouts/updateTrigger abandoned cart

Product Sync Mapping

Shopify Field WACM Product Field
id (GID)external_id
titlename
descriptionHtmldescription
statusstatus
variants[0].priceprice
variants[0].inventoryQuantitystock_quantity
Webhook Endpoint
https://app.wacm.in/api/shop/webhooks/shopify/{webhook_token}
Data Flow Architecture
Shopify → Webhook (HMAC verified) → WebhookController
    ├── products/* → ShopifySyncService → Shop Products table
    ├── orders/create → Order + Contact created → Flowmaker events dispatched
    ├── orders/fulfilled/cancelled → Order status updated
    └── checkouts/* → Contact created/updated → EVENT_ABANDONED_CART dispatched

© 2026 WACM. All rights reserved. API Version 1.0.