# Place several orders

> Places up to 100 orders (configurable) in one call.

Source: https://docs.stxapp.io/api/rest/orders/place-several-orders/

Places up to 100 orders (configurable) in one call. `orders` is a list, each entry shaped exactly like the single `POST /api/v1/orders` body. `batched` is a literal path segment. One geo check covers the batch; each leg is placed independently, so a rejected leg does not fail the others; the `results` array has one entry per order, in request order, each either `{order}` on success or `{errors}` on rejection. A malformed body (a bad field in any leg, empty, over the limit, or `orders` missing/not a list) is a 400 and places nothing. Requires a `read_write` key.

```http
POST /api/v1/orders/batched
```

Send it with your own demo key: [Try it](/quick-start/?op=orders_batched_post#try-it).

## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `geo_location` | string,null | no | Location code from the STX geolocation check, covering the whole batch, checked once for the request, not per leg. Read only in environments that enforce geo-fencing, and ignored elsewhere. Where it is read, omitting it is a 422 (`Placing Order(s) from this IP address … is disallowed.`) unless that environment accepts the network location the request arrives from in its place, which it can refuse for an address identified as a VPN, proxy or hosting provider. Do not rely on omitting it: send the code whenever you have one. A code that is sent is always checked, so a bad one is a 422 even where omitting it would have been accepted. |
| `orders` | NewOrder[] | **yes** | The orders to place, each shaped exactly like the single `POST /api/v1/orders` body (a `NewOrder`). At most 100 (configurable) per request. |

## Responses

| Status | Description | Schema |
|---|---|---|
| `200` | Success | object |
| `400` | A parameter was missing or invalid. | Error |
| `401` | Missing, malformed or unrecognized signature, or a timestamp outside the 30-second window. Body: &#123;"error":"Missing or invalid API key credentials"&#125; | Error |
| `403` | This API key does not have write access. The account behind this key is not active, for example it is pending approval or suspended. Body: &#123;"error":"Your account is suspended. Contact support."&#125;, the message naming the account's status. | Error |
| `422` | The batch was refused as a whole, for example by the location check, and nothing was placed. A leg refused on its own is reported in `results`, not as a 422. | Error |

## Example

Request:

```bash
curl --request POST \
  --url 'https://demo.stxapp.io/api/v1/orders/batched' \
  --header 'X-STX-ACCESS-KEY: <key-id>' \
  --header 'X-STX-ACCESS-TIMESTAMP: <unix-ms>' \
  --header 'X-STX-ACCESS-SIGNATURE: <base64-ed25519>' \
  --header 'Content-Type: application/json' \
  --data '{
  "geo_location": null,
  "orders": [
    {
      "action": "buy",
      "cancel_on_disconnect": null,
      "client_order_id": null,
      "device_id": null,
      "expiration": null,
      "expiration_time": null,
      "geo_location": null,
      "market_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
      "order_type": "limit",
      "price": "0.42",
      "quantity": "10"
    }
  ]
}'
```

Response `200`:

```json
{
  "results": [
    "string"
  ]
}
```

### Response fields

| Field | Type | Description |
|---|---|---|
| `results` | array | One entry per requested order, in request order. |
