Orders API

Create, retrieve, and manage customer orders with full lifecycle tracking.

GET /admin/orders

List orders with status filtering and pagination

Query Parameters

?status=pending&limit=50&offset=0&customer_id=cust_123

Response

{
  "success": true,
  "data": [
    {
      "id": "order_789",
      "customer_id": "cust_123",
      "status": "pending",
      "total": 149.99,
      "items_count": 3,
      "created_at": "2026-03-20T12:00:00Z"
    }
  ]
}
Bearer Token Required
POST /admin/orders

Create a new order

Request Body

{
  "customer_id": "cust_123",
  "items": [
    {"product_id": "prod_123", "quantity": 2}
  ],
  "shipping_address": {
    "name": "Jane Doe",
    "street": "123 Main St",
    "city": "Springfield",
    "state": "IL",
    "zip": "62701"
  }
}

Response

{
  "success": true,
  "data": {
    "id": "order_999",
    "status": "pending",
    "total": 59.98,
    "created_at": "2026-03-20T15:00:00Z"
  }
}
Bearer Token Required
GET/admin/orders/{order_id}

Get full details of a specific order including items, customer, and timeline

Bearer Token Required
PUT /admin/orders/{order_id}/status

Update order status (pending, processing, shipped, delivered, cancelled)

Request Body

{
  "status": "shipped",
  "tracking_number": "TRK123456789",
  "notify_customer": true
}

Response

{
  "success": true,
  "data": {
    "id": "order_999",
    "status": "shipped",
    "updated_at": "2026-03-20T16:00:00Z"
  }
}
Bearer Token Required
POST/admin/orders/{order_id}/cancel

Cancel an order and optionally trigger refund

Bearer Token Required
GET/admin/orders/counts

Get order counts grouped by status (for dashboard badges)

Bearer Token Required

My Orders API (User Portal)

Customer-facing endpoints for viewing and placing orders.

GET/orders

List the authenticated user's own orders

Bearer Token Required
POST/orders

Place a new order as the authenticated customer

Bearer Token Required
GET/orders/{order_id}

Get details of a specific order belonging to the current user

Bearer Token Required

Order Attachments API

Upload and manage file attachments on orders (design proofs, receipts, etc.).

GET/admin/orders/{order_id}/attachments

List all attachments on an order

Bearer Token Required
POST/admin/orders/{order_id}/attachments

Upload a new attachment to an order

Bearer Token Required
GET/admin/orders/{order_id}/attachments/{attachment_id}

Get a specific attachment's details

Bearer Token Required
PUT/admin/orders/{order_id}/attachments/{attachment_id}

Update attachment metadata

Bearer Token Required
DEL/admin/orders/{order_id}/attachments/{attachment_id}

Delete an attachment from an order

Bearer Token Required

Order Notes & Timeline API

Add internal notes, view timeline events, and manage attachments on orders.

GET/admin/orders/{order_id}/notes

List all notes for an order

Response

{
  "success": true,
  "data": [
    { "id": "note_01", "content": "Customer called about shipping ETA", "author": "marc@example.com", "created_at": "2026-03-22T09:00:00Z" }
  ]
}
Bearer Token Required
POST/admin/orders/{order_id}/notes

Add a note to an order

Request Body

{ "content": "Expedited shipping approved per manager" }
Bearer Token Required
GET/admin/orders/{order_id}/timeline

Get the full event timeline for an order (status changes, notes, payments, shipments)

Response

{
  "success": true,
  "data": [
    {"type": "status_change", "status": "pending"},
    {"type": "note", "content": "Order received"}
  ]
}
Bearer Token Required

Order Tracking API

Public endpoint for customers to track their order status without authentication.

GET/api/track-order

Track an order by order ID and email (no auth required)

Query Parameters

?order_id=order_789&email=jane@example.com

Response

{
  "success": true,
  "data": {
    "order_id": "order_789",
    "status": "shipped",
    "tracking_number": "1Z999AA10123456784",
    "carrier": "UPS",
    "estimated_delivery": "2026-03-25",
    "items": [{ "name": "Custom Jersey", "quantity": 2, "status": "shipped" }]
  }
}
No Auth Required
GET/orders/{order_id}/qr

Generate a QR code image for quick order lookup

Response

{
  "success": true,
  "data": {
    "qr_code_url": "https://...",
    "order_id": "order_789"
  }
}
Bearer Token Required

Fulfillment API

Ship orders and dispatch in bulk with carrier integration.

POST/admin/fulfillment/ship

Mark an order as shipped with tracking information

Request Body

{
  "order_id": "order_789",
  "tracking_number": "1Z999AA10123456784",
  "carrier": "UPS",
  "notify_customer": true
}
Bearer Token Required
POST/admin/fulfillment/bulk-dispatch

Dispatch multiple orders at once with batch tracking updates

Request Body

{
  "orders": [
    { "order_id": "order_100", "tracking_number": "1Z...", "carrier": "UPS" },
    { "order_id": "order_101", "tracking_number": "9400...", "carrier": "USPS" }
  ]
}
Bearer Token Required

Packing API

Generate packing slips, invoices, pick lists, and batch packing documents.

GET /admin/packing/slip/{order_id}

Generate packing slip HTML for an order

Response

{
  "success": true,
  "data": {
    "order_id": "order_999",
    "html_content": "<html>...</html>",
    "download_url": "https://api.marcsinventory.com/files/slip_order_999.pdf"
  }
}
Bearer Token Required
GET /admin/packing/invoice/{order_id}

Generate invoice HTML for an order

Response

{
  "success": true,
  "data": {
    "order_id": "order_999",
    "html_content": "<html>...</html>",
    "download_url": "https://api.marcsinventory.com/files/invoice_order_999.pdf"
  }
}
Bearer Token Required
GET /admin/packing/pick-list

Generate batch pick list for multiple orders

Query Parameters

?order_ids=order_123,order_456,order_789&format=pdf

Response

{
  "success": true,
  "data": {
    "pick_list_id": "picklist_001",
    "order_count": 3,
    "item_count": 12,
    "download_url": "https://api.marcsinventory.com/files/picklist_001.pdf"
  }
}
Bearer Token Required

Backorders API

Manage and allocate inventory to backordered items when stock arrives.

GET/admin/backorders

List all pending backorders

Response

{
  "success": true,
  "data": [
    {"id": "bo_01", "product_id": "prod_123", "quantity": 10}
  ]
}
Bearer Token Required
POST/admin/backorders/{item_id}/allocate

Allocate available stock to a specific backordered item

Response

{
  "success": true,
  "data": {"allocation_id": "alloc_01", "quantity_allocated": 10}
}
Bearer Token Required
POST/admin/backorders/auto-allocate

Automatically allocate stock across all eligible backorders (FIFO)

Response

{
  "success": true,
  "data": {"allocations_created": 5, "total_allocated": 45}
}
Bearer Token Required

Pre-Orders API

Accept orders before stock arrives, track expected dates, and auto-fulfill when inventory lands.

GET/admin/preorders

List all pre-orders with allocation status

Response

{
  "success": true,
  "data": [
    { "id": "bo_01", "order_id": "order_100", "product_id": "prod_123", "quantity": 5, "status": "waiting", "expected_date": "2026-04-01" }
  ]
}
Bearer Token Required
POST/admin/preorders/allocate

Allocate available inventory to a pre-order

Request Body

{ "backorder_id": "bo_01", "quantity": 5 }
Bearer Token Required

Cart API

Customer shopping cart with item management, coupon application, and checkout.

GET/cart

Get the current user's shopping cart

Response

{
  "success": true,
  "data": {
    "items": [{ "product_id": "prod_123", "name": "Custom T-Shirt", "quantity": 2, "unit_price": 29.99, "subtotal": 59.98 }],
    "subtotal": 59.98, "discount": 0, "total": 59.98
  }
}
Bearer Token Required
POST/cart/items

Add an item to the cart

Request Body

{ "product_id": "prod_123", "quantity": 2 }
Bearer Token Required
POST/cart/checkout

Proceed to checkout and create an order from the current cart

Response

{
  "success": true,
  "data": {
    "order_id": "order_789",
    "status": "pending_payment",
    "total": 59.98
  }
}
Bearer Token Required

Bulk Operations API

Perform batch updates and exports on products, inventory, and orders.

POST/admin/bulk/products/update

Bulk update product fields (price, status, category) across multiple products

Request Body

{
  "product_ids": ["prod_123", "prod_456", "prod_789"],
  "updates": { "status": "active", "category": "cat_02" }
}
Bearer Token Required
POST/admin/bulk/products/export

Export all products as CSV or JSON

Response

{
  "success": true,
  "data": {"export_id": "exp_01", "format": "csv", "url": "https://..."}
}
Bearer Token Required
POST/admin/inventory-history/bulk-adjust

Bulk adjust stock levels for multiple products at once

Request Body

{
  "adjustments": [
    { "product_id": "prod_123", "quantity_change": 50, "reason": "restock" },
    { "product_id": "prod_456", "quantity_change": -5, "reason": "damaged" }
  ]
}
Bearer Token Required