Orders API

Manage customer orders in your CRM workspace. Use these endpoints to list, create, retrieve, update, and delete orders, including all associated customer and product line item details.

Base URL

All URLs referenced in the documentation use the following base:

Base URL
https://api.meetandrock.com/v1/dev

Order Management

Endpoints for listing, creating, retrieving, updating, and deleting orders. Orders include customer details, shipping and billing addresses, notes, and an array of product line items.

GET/crm/orders

List orders

Retrieve orders for the current project with pagination and rich search and filtering options.

  • Search: Search across notes, billing_address and shipping_address (case-insensitive partial match).
  • Filtering: Use status, customer_id and product_id to narrow results.
  • Order items: Each order can contain multiple items. The orderItems array contains products, quantities, and pricing details.
GEThttps://api.meetandrock.com/v1/dev/crm/orders?page=1&limit=10&search=notes&status=pending&customer_id=uuid&product_id=uuid
List orders

List orders for the project with pagination, search, and filters.

curl -X GET "https://api.meetandrock.com/v1/dev/crm/orders?page=1&limit=10&search=notes&status=pending&customer_id=uuid&product_id=uuid" \
-H "Authorization: Bearer YOUR_API_KEY"
POST/crm/orders

Create order

Create a new order. The total amount and line item pricing are automatically calculated from the product prices and quantities.

Required fields

  • customer_id
  • items (array with at least one item)

Items array

Each item must include product_id (UUID) and quantity (integer, min 1). You can include multiple products in a single order.

Optional fields

  • status (pending, processing, shipped, delivered, cancelled)
  • order_date
  • shipping_address
  • billing_address
  • notes

Note: If order_date is not provided, it defaults to the current date.

POSThttps://api.meetandrock.com/v1/dev/crm/orders
Create order

Create a new order with one or more product line items.

curl -X POST "https://api.meetandrock.com/v1/dev/crm/orders" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "uuid",
"items": [
{
"product_id": "uuid",
"quantity": 2
},
{
"product_id": "uuid",
"quantity": 1
}
],
"status": "pending",
"order_date": "2024-01-20T10:00:00.000Z",
"shipping_address": "123 Main St, City, State 12345",
"billing_address": "123 Main St, City, State 12345",
"notes": "Please handle with care"
}'
GET/crm/orders/:orderId

Get order

Retrieve a specific order by its ID, including customer details and full line item breakdown.

GEThttps://api.meetandrock.com/v1/dev/crm/orders/:orderId
Get order

Retrieve a single order by its unique identifier.

curl -X GET "https://api.meetandrock.com/v1/dev/crm/orders/:orderId" \
-H "Authorization: Bearer YOUR_API_KEY"
PUT/crm/orders/:orderId

Update order

Update an existing order. If you send items, all existing items are replaced and totals are recalculated.

You can also update other fields like status, shipping_address or notes without changing the items.

PUThttps://api.meetandrock.com/v1/dev/crm/orders/:orderId
Update order

Replace items and update status and addresses for an existing order.

curl -X PUT "https://api.meetandrock.com/v1/dev/crm/orders/:orderId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"product_id": "uuid",
"quantity": 3
}
],
"status": "processing",
"shipping_address": "456 Oak Ave, City, State 67890",
"notes": "Updated notes"
}'
DELETE/crm/orders/:orderId

Delete order

Permanently delete an order and its associated items.

DELETEhttps://api.meetandrock.com/v1/dev/crm/orders/:orderId
Delete order

Delete an order by its unique identifier.

curl -X DELETE "https://api.meetandrock.com/v1/dev/crm/orders/:orderId" \
-H "Authorization: Bearer YOUR_API_KEY"

Error responses

Standard error responses for the Orders API.

400 Bad Request

The request body or query parameters are invalid.

{
  "message": "Invalid request parameters"
}

400 Bad Request (validation)

Required fields like customer_id or items are missing or invalid.

{
  "message": "customer_id is required"
}
{
  "message": "items must contain at least 1 item"
}

401 Unauthorized

The API key is missing, expired, or invalid.

{
  "message": "Invalid or missing API key"
}

404 Not Found

The requested order, product, or customer does not exist.

{
  "message": "Order not found"
}
{
  "message": "Product with id {uuid} not found"
}
{
  "message": "Customer not found"
}

500 Internal Server Error

An unexpected error occurred on our side.

{
  "message": "Something went wrong"
}

Contents