**版本：202201**

# 取消采购单

**PATCH** `/openapi/2022-01/procurements/:id/cancel`

通过采购单 ID 取消指定采购单。

## 请求

**Path参数**

- `id` string (required)

  Procurement's ID

## 响应

**200 | 400 | 404**

200

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `procurement` object

  - `id` string

    **示例：** `382451985837728044`
  - `procurement_sn` string

    **示例：** `00000002`
  - `supplier_id` string

    **示例：** `382453603865993516`
  - `location_id` string

    **示例：** `190035786870033452`
  - `note` string

    **示例：** `teest note`
  - `state` integer

    **默认值：** `0`

    **示例：** `4`
  - `pending_quantity` integer

    **默认值：** `0`

    **示例：** `0`
  - `received_quantity` integer

    **默认值：** `0`

    **示例：** `0`
  - `rejected_quantity` integer

    **默认值：** `0`

    **示例：** `0`
  - `transfer_quantity` integer

    **默认值：** `0`

    **示例：** `0`
  - `created_by` string

    **示例：**
  - `created_at` string

    **示例：** `2024-05-21T08:47:39Z`
  - `updated_at` string

    **示例：** `2024-05-21T09:59:29Z`

```json
{
  "procurement": {
    "id": "382451985837728044",
    "procurement_sn": "00000002",
    "supplier_id": "382453603865993516",
    "location_id": "190035786870033452",
    "note": "teest note",
    "state": 4,
    "pending_quantity": 0,
    "received_quantity": 0,
    "rejected_quantity": 0,
    "transfer_quantity": 0,
    "created_by": "",
    "created_at": "2024-05-21T08:47:39Z",
    "updated_at": "2024-05-21T09:59:29Z"
  }
}
```

```json
{
    "procurement": {
        "id": "382451985837728044",
        "procurement_sn": "00000002",
        "supplier_id": "382453603865993516",
        "location_id": "190035786870033452",
        "note": "teest note",
        "state": 4,
        "pending_quantity": 0,
        "received_quantity": 0,
        "rejected_quantity": 0,
        "transfer_quantity": 0,
        "created_by": "",
        "created_at": "2024-05-21T08:47:39Z",
        "updated_at": "2024-05-21T09:59:29Z"
    }
}
```

400

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `errors` string[]

```json
{
  "errors": [
    "invalid procurement_id"
  ]
}
```

```json
{
  "errors": [
    "invalid procurement_id"
  ]
}
```

404

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `errors` string[]

```json
{
  "errors": [
    "Procurement not found"
  ]
}
```

```json
{
  "errors": [
    "Procurement not found"
  ]
}
```
