Orders are the core of any e-commerce platform. The Orders API allows you to manage customer orders within your Venddor store, including creating, retrieving, updating, and deleting orders.
Orders typically follow this workflow within the Venddor system:
Retrieves a list of all orders in the system, with optional filtering.
Parameter | Type | Required | Description |
---|---|---|---|
status | string | No | Filter orders by status (e.g., "open", "processed", "completed") |
user_id | integer | No | Filter orders by customer ID |
date_from | string | No | Filter orders created after specified date (format: YYYY-MM-DD) |
date_to | string | No | Filter orders created before specified date (format: YYYY-MM-DD) |
items_per_page | integer | No | Number of orders to return per page (default: 10, max: 100) |
page | integer | No | Page number for pagination (default: 1) |
Retrieves detailed information about a specific order.
Parameter | Type | Required | Description |
---|---|---|---|
order_id* | integer | Yes | The unique identifier of the order to retrieve |
{ "order_id": "12345", "status": "P", "user_id": "42", "timestamp": "1618500452", "payment": { "payment_id": "PM12345", "payment_method": "credit_card", "status": "paid" }, "products": [ { "item_id": "456", "product_id": "101", "product_code": "TSH-BLK-L", "product_name": "Black T-shirt", "price": "19.99", "amount": "2" }, { "item_id": "457", "product_id": "204", "product_code": "CAP-RED", "product_name": "Red Cap", "price": "12.50", "amount": "1" } ], "shipping_address": { "address": "123 Main Street", "city": "Anytown", "state": "CA", "country": "US", "zipcode": "12345" }, "shipping_method": "standard", "total": "52.48" }
Creates a new order in the system.
Parameter | Type | Required | Description |
---|---|---|---|
user_id* | integer | Yes | ID of the customer placing the order |
products* | array | Yes | Array of products being ordered |
shipping_address* | object | Yes | Shipping address details |
shipping_method* | string | Yes | Selected shipping method |
payment_method* | string | Yes | Selected payment method |
Updates an existing order in the system.
Parameter | Type | Required | Description |
---|---|---|---|
order_id* | integer | Yes | The unique identifier of the order to update |
You can update any of the order properties. Only include the fields you want to update.
Deletes an order from the system.
Parameter | Type | Required | Description |
---|---|---|---|
order_id* | integer | Yes | The unique identifier of the order to delete |
The following status codes are used throughout the Orders API:
Code | Status | Description |
---|---|---|
O |
Open | Order has been created but not yet processed |
P |
Processing | Order is being processed |
C |
Complete | Order has been fulfilled and completed |
F |
Failed | Order processing failed (e.g., payment declined) |
D |
Declined | Order was declined by the administrator |
B |
Backordered | Order contains products that are currently backordered |
X |
Cancelled | Order was cancelled by the customer or administrator |