<!-- canonical: https://docs.costplus.io/api-reference/orders/captureByOrderLine -->

> Capture specific order lines from an authorized transaction.
# Capture by order line

Capture specific order lines from an authorized transaction.

## Endpoint

```
POST /orders/{id}/transactions/{transaction_id}/captures/orderlines
```

## Authentication

HTTP Basic — use your API key as the username with an empty password.

```bash
curl -u YOUR_API_KEY: https://api.costplus.online/v1/orders/{id}/transactions/{transaction_id}/captures/orderlines/
```

## Parameters

| In | Name | Type | Required | Description |
|---|---|---|---|---|
| path | `id` | string | yes | Order identifier |
| path | `transaction_id` | string | yes | Transaction identifier |
| header | `if-match` | string | no | ETag for optimistic locking. Only process if the order version matches. |

## Request body

Content-Type: `application/json` (required)

Fields:

- `description` — string. Capture description
- `order_line` — object

## Responses

### 200 — The updated order

### 401 — Invalid or missing API key

### 403 — No authorization for the requested resource

### 412 — ETag version mismatch — the order was modified since last fetched

## cURL

```bash
curl -u YOUR_API_KEY: \
  -X POST 'https://api.costplus.online/v1/orders/{id}/transactions/{transaction_id}/captures/orderlines/' \
  -H 'Content-Type: application/json' \
  -H 'If-Match: <etag-from-GET-order>' \
  -d '{ "order_lines": [ { "id": "line-1", "quantity": 1 } ] }'
```
