> ## Documentation Index
> Fetch the complete documentation index at: https://docs-restapi.wplimit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Order

> Create a new order.

## Required Parameters

| Parameter     | Type    | Description        |
| ------------- | ------- | ------------------ |
| `customer_id` | integer | Customer ID        |
| `total`       | number  | Order total amount |
| `subtotal`    | number  | Order subtotal     |

## Optional Parameters

| Parameter           | Type   | Description                                               |
| ------------------- | ------ | --------------------------------------------------------- |
| `tax_total`         | number | Tax amount                                                |
| `discount_total`    | number | Discount amount                                           |
| `coupon_code`       | string | Applied coupon code                                       |
| `status`            | string | Order status                                              |
| `payment_method`    | string | Payment method used                                       |
| `notes`             | string | Order notes                                               |
| `coupon_discount`   | number | Discount amount from coupon                               |
| `ip_address`        | string | IP address of the customer                                |
| `source_id`         | string | Source identifier for tracking                            |
| `source_url`        | string | Source URL for tracking                                   |
| `confirmation_code` | string | Custom confirmation code (auto-generated if not provided) |

## Example Request

```bash theme={null}
POST /wp-json/latepoint-api/v1/orders
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "customer_id": 8,
  "total": 50.00,
  "subtotal": 45.00,
  "tax_total": 5.00,
  "status": "open",
  "payment_status": "not_paid",
  "fulfillment_status": "not_fulfilled",
  "customer_comment": "Test order creation"
}
```

## Example Response

```json theme={null}
{
  "id": 39,
  "confirmation_code": "LP39CONF",
  "subtotal": "45.00",
  "total": "50.00",
  "status": "open",
  "fulfillment_status": "not_fulfilled",
  "payment_status": "not_paid",
  "customer_id": 8,
  "coupon_code": null,
  "tax_total": "5.00",
  "customer_comment": "Test order creation",
  "created_at": "2024-12-21 18:15:45",
  "updated_at": "2024-12-21 18:15:45"
}
```
