**版本：202201**

# 更新供应商

**PUT** `/openapi/2022-01/suppliers/:id`

通过供应商 ID 更新现有供应商的详细信息。

## 请求

**Path参数**

- `id` string (required)

  待更新的供应商 ID。

**application/json**

**请求体 | 示例**

**请求体**

- `supplier` object

  - `url` string (required)

```json
{
  "supplier": {
    "url": "string"
  }
}
```

## 响应

**200 | 400 | 404**

200

**application/json**

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

**数据结构**

- `supplier` object

  - `id` string

    **示例：** `382454149549138220`
  - `title` string

    **示例：** `example suppliers`
  - `url` string

    **示例：** `https://shoplazza.com`
  - `created_at` string

    **示例：** `2024-05-21T08:56:15Z`
  - `updated_at` string

    **示例：** `2024-05-21T08:56:15Z`

```json
{
  "supplier": {
    "id": "382454149549138220",
    "title": "example suppliers",
    "url": "https://shoplazza.com",
    "created_at": "2024-05-21T08:56:15Z",
    "updated_at": "2024-05-21T08:56:15Z"
  }
}
```

```json
{
    "supplier": {
        "id": "382454149549138220",
        "title": "example suppliers",
        "url": "https://shoplazza.com",
        "created_at": "2024-05-21T08:56:15Z",
        "updated_at": "2024-05-21T08:56:15Z"
    }
}
```

400

**application/json**

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

**数据结构**

- `errors` string[]

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

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

404

**application/json**

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

**数据结构**

- `errors` string[]

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

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