# Order several services

`POST /v1/order` · scope `orders:write`

Create an order and invoice for several items at once (service plans, domains, certificates), paid with `pay_method`. Per-item errors come back as HTTP 200 with `error` = `["item_error", {code, message, item}]` (`item`: position in `items`); hosting plans need a `domain`. Requires both `orders:write` and `billing:write`: missing either returns 403 `insufficient_scope`.

## HTTP request

| Item | Value |
| --- | --- |
| URL | `https://api.tino.vn/v1/order` |
| Method | `POST` |
| Scope | `orders:write` |
| Header | `Authorization: Bearer <token>` |
| Content-Type | `application/json` |
| Tokens that can call it | app tokens (`tinoat_`), personal API tokens (`tinopat_`) |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pay_method` | body | integer | no | Payment method ID |
| `ignore_errors` | body | boolean | no | Process order even if some of the items were rejected due to errors |
| `items` | body | array | no | list with order items |
| `aff_id` | body | integer | no | Affiliate ID |

## Example request

```bash
curl -X POST "https://api.tino.vn/v1/order" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "pay_method": 1,
  "ignore_errors": "No error",
  "items": [
    {
      "type": "certificate",
      "product_id": 840,
      "csr": "-----BEGIN CERTIFICATE REQUEST----- (...)",
      "years": 1,
      "approver_email": "admin@example.com"
    }
  ],
  "aff_id": 55
}'
```

`$TINO_TOKEN` is a token with the scope `orders:write`.

SDK ([SDK & examples](/en/docs/sdk)): Python `client.cart.order(pay_method=...)`, Node.js `await client.cart.order({ pay_method: ... });`, PHP `$client->cart->order(['pay_method' => ...]);`.

## Example response

No live sample: the route changes real data or the test account has no data for it. The answer is a JSON object; errors follow the common shape in [Calling the Tino API](/en/docs/api#errors).
