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

# Create Order

> Place a new order through the Reseller API

This action creates a new order through the API.

## Method / Endpoint

```text theme={null}
POST {{API_URL}}/buy
```

For Hostrox, the full URL is:

```text theme={null}
POST https://client.hostrox.net/api/reseller/buy
```

## Request parameters

| Name              | Required | Description                                                                                                       |
| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------- |
| `key`             | Yes      | API Key                                                                                                           |
| `type`            | Yes      | Product type. Possible values: `hosting`, `server`, `software`, `special`, `sms`                                  |
| `id`              | Yes      | Product ID number                                                                                                 |
| `period_type`     | Yes      | Billing period type. Possible values: `none`, `year`, `month`, `week`, `day`, `hour`                              |
| `period_duration` | Yes      | Length of the billing period                                                                                      |
| `options`         | Optional | Array of additional values (e.g. `domain`, `hostname`, `nameserver`, `password`, `IP`) if the order requires them |

## Example cURL request

```bash theme={null}
curl --location 'https://client.hostrox.net/api/reseller/buy' \
  --header 'Content-Type: application/json' \
  --data '{
    "key": "UzZBSlBWeWk0UEcrVWxlU0RjS1B1dz09",
    "type": "hosting",
    "id": 33,
    "period_type": "month",
    "period_duration": 1,
    "options": {
      "domain": "example123.com"
    }
  }'
```

## Example JSON response

```json theme={null}
{
  "status": "successful",
  "invoice_id": 3,
  "order_id": 3,
  "fee": "14.0000",
  "fee_formatted": "$14"
}
```

## Response fields

<Note>
  The fee is deducted from your reseller balance. Use [Check Balance](/reseller-api/actions/check-balance) to make sure you have enough credit before placing the order.
</Note>
