> For the complete documentation index, see [llms.txt](https://docs.outpoll.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.outpoll.com/api/rest-api/private-endpoints/orders/place-market-order.md).

# Place Market Order

Execute an order at the best available price

`POST`

### Overview

Executes an order immediately at the best available price.

Use `am` for `BUY` orders and `q` for `SELL` orders.

### Authentication

HMAC-SHA256 authentication required.

| Header                  | Description                             |
| ----------------------- | --------------------------------------- |
| `OUTPOLL-API-KEY`       | Your API key                            |
| `OUTPOLL-API-SIGNATURE` | Base64URL-encoded HMAC-SHA256 signature |
| `OUTPOLL-API-TIMESTAMP` | Current Unix timestamp in seconds       |

Generate the signature from `timestamp + method + path + body`.

Timestamps must be within `30` seconds of server time.

### Common errors

| Code | Description                                           |
| ---- | ----------------------------------------------------- |
| 200  | OK — Request succeeded                                |
| 201  | Created — Resource created successfully               |
| 202  | Accepted — Request accepted for async processing      |
| 204  | No Content — Success with no response body            |
| 400  | Bad Request — Invalid parameters                      |
| 401  | Unauthorized — Missing or invalid API key / signature |
| 403  | Forbidden — API key permanently blocked               |
| 404  | Not Found — Resource does not exist                   |
| 429  | Too Many Requests — Rate limit exceeded               |
| 500  | Internal Server Error                                 |

### Request

* Method: `POST`
* Path: `/orders/market`

#### Request body

| Field | Type   | Required    | Description                                     |
| ----- | ------ | ----------- | ----------------------------------------------- |
| e     | string | Yes         | Event ID                                        |
| o     | string | Yes         | Outcome ID                                      |
| ba    | string | Yes         | Betting asset ID                                |
| qa    | string | Yes         | Quote asset ID                                  |
| s     | string | Yes         | Side: `BUY` or `SELL`                           |
| am    | number | Conditional | Amount in USDC to spend. Required for `BUY`     |
| q     | number | Conditional | Quantity in shares to sell. Required for `SELL` |

### Response

**Response** `200 OK` or `202 Accepted`

```json
{
  "i": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

| Field | Type   | Description |
| ----- | ------ | ----------- |
| i     | string | Order ID    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.outpoll.com/api/rest-api/private-endpoints/orders/place-market-order.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
