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:
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.
List orders
Retrieve orders for the current project with pagination and rich search and filtering options.
- Search: Search across
notes,billing_addressandshipping_address(case-insensitive partial match). - Filtering: Use
status,customer_idandproduct_idto narrow results. - Order items: Each order can contain multiple items. The
orderItemsarray contains products, quantities, and pricing details.
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"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_iditems(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_dateshipping_addressbilling_addressnotes
Note: If order_date is not provided, it defaults to the current date.
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 order
Retrieve a specific order by its ID, including customer details and full line item breakdown.
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"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.
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 order
Permanently delete an order and its associated items.
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"Pagination & search
Query parameters for filtering and paginating orders.
page (optional)
Page number for pagination. Default: 1.
limit (optional)
Number of items per page. Default: 10.
search (optional)
Search term that filters orders by notes, billing_address, or shipping_address (case-insensitive partial match).
status (optional)
Filter by order status. Values: pending, processing, shipped, delivered, cancelled.
customer_id (optional)
Filter by customer ID (UUID).
product_id (optional)
Filter by product ID (UUID). Returns orders that contain this product in their orderItems.
Get the first page of orders with the default limit.
curl -X GET "https://api.meetandrock.com/v1/dev/crm/orders?page=1&limit=10" \ -H "Authorization: Bearer YOUR_API_KEY"Combine search with status filter and pagination.
curl -X GET "https://api.meetandrock.com/v1/dev/crm/orders?search=main%20street&status=processing&page=1&limit=20" \ -H "Authorization: Bearer YOUR_API_KEY"Pagination metadata
All list endpoints return a pagination object with total, page and limit.
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"
}