# Shop Developer API Documentation v1.0

Modern, RESTful, and highly performant API designed for seamless E-commerce integrations.
Base URL: /api/v1/shop/

## Authentication
API requests require a Bearer Token. This can be passed in two ways:
1. HTTP Header (Recommended): `Authorization: Bearer YOUR_API_TOKEN`
2. Query Parameter: Append `?token=YOUR_API_TOKEN` to the URL.

## Quick Start / Integration Flow
To seamlessly 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
**GET /products**
Returns a list of all products for your company.

### Create Product
**POST /products**
Required JSON fields: `name`, `price`. Optional: `description`, `compare_at_price`, `currency`, `stock_quantity`, `status` (Active, Draft, Archived), `external_id`, `image`, `shop_category_id`.

## Categories
### Get Categories
**GET /categories**
Returns a list of all product categories.

## Orders
### Get Orders
**GET /orders**
Returns a list of all orders.

### Update Order Status
**PUT /orders/{id}/status**
Update an order status. Expected JSON payload: `{"status": "Shipped"}`. Valid statuses: Pending, Processing, Shipped, Delivered, Cancelled, Refunded.