CODRocket API Documentation
The CODRocket REST API allows you to programmatically interact with your CODRocket account. Build custom integrations, automate workflows, connect with platforms we do not natively support, or build your own tools on top of CODRocket. This guide provides an overview of the API and how to get started.
API Overview
The CODRocket API is a RESTful API that uses standard HTTP methods and returns JSON responses. All API endpoints require authentication via API keys.
Authentication
To authenticate API requests:
- Go to Settings > API Keys in your CODRocket dashboard
- Click "Generate New Key"
- Give the key a descriptive name (e.g., "Custom Integration", "Webhook Handler")
- Copy the generated API key
- Include the key in all API requests as a Bearer token in the Authorization header
Base URL
All API requests are made to: https://api.codrocket.com/v1/
Available Endpoints
Orders
| Method | Endpoint | Description |
|---|---|---|
| GET | /orders | List all orders with pagination and filters |
| GET | /orders/{id} | Get a specific order by ID |
| POST | /orders | Create a new order |
| PUT | /orders/{id} | Update an existing order |
| PATCH | /orders/{id}/status | Update order status |
| DELETE | /orders/{id} | Delete/cancel an order |
Products
| Method | Endpoint | Description |
|---|---|---|
| GET | /products | List all products |
| GET | /products/{id} | Get a specific product |
| POST | /products | Create a new product |
| PUT | /products/{id} | Update a product |
| PATCH | /products/{id}/stock | Update stock levels |
Delivery
| Method | Endpoint | Description |
|---|---|---|
| GET | /deliveries | List all deliveries |
| POST | /deliveries/assign | Assign orders to a driver |
| PATCH | /deliveries/{id}/status | Update delivery status |
| GET | /drivers | List all drivers |
Analytics
| Method | Endpoint | Description |
|---|---|---|
| GET | /analytics/sales | Sales summary with date range filter |
| GET | /analytics/delivery | Delivery performance metrics |
| GET | /analytics/products | Product performance data |
Webhooks
CODRocket can send webhook notifications to your server when events occur:
- order.created: Fired when a new order is created
- order.updated: Fired when order details change
- order.status_changed: Fired when an order status transitions
- delivery.completed: Fired when a delivery is successfully completed
- delivery.failed: Fired when a delivery attempt fails
- inventory.low_stock: Fired when a product hits low stock threshold
Rate Limits
- Standard plans: 100 requests per minute
- Professional plans: 500 requests per minute
- Enterprise plans: 2,000 requests per minute
Rate limit information is included in response headers: X-RateLimit-Remaining and X-RateLimit-Reset.
Error Handling
The API uses standard HTTP status codes. Error responses include a JSON body with an error code and human-readable message. Common status codes: 200 (Success), 201 (Created), 400 (Bad Request), 401 (Unauthorized), 404 (Not Found), 422 (Validation Error), 429 (Rate Limited), 500 (Server Error).
For native platform integrations, see our guides for WooCommerce, Shopify, and YouCan.