**版本：202201**

# 更新礼品卡

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

通过礼品卡 ID 更新现有礼品卡的详细信息。

## 请求

**Path参数**

- `id` string (required)

  礼品卡 ID。

**application/json**

**请求体 | 示例**

**请求体**

- `gift_card` object

  Gift card informations to update

  - `expires_on` string

    The date when the gift card expires. e.g. `2022-11-01T00:00:00Z`
  - `note` string

    An optional note that a merchant can attach to the gift card that isn't visible to customers.
  - `template_suffix` string

    The suffix of the Liquid template that's used to render the gift card online.

```json
{
  "gift_card": {
    "expires_on": "string",
    "note": "string",
    "template_suffix": "string"
  }
}
```

## 响应

**200**

200

**application/json**

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

**数据结构**

- `gift_card` object

  - `id` string

    **示例：** `377006280092433706`
  - `last_characters` string

    **示例：** `ghjg`
  - `balance` string

    **示例：** `100.00`
  - `initial_value` string

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

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

    **示例：** `2025-11-01T00:00:00Z`
  - `disabled_at`
  - `enabled` boolean

    **默认值：** `true`

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

    **示例：** `2024-05-06T10:06:04Z`
  - `updated_at` string

    **示例：** `2024-05-07T02:37:20Z`
  - `status` string

    **示例：** `enable`
  - `currency` string

    **示例：** `USD`
  - `line_item_id`
  - `order_id`
  - `user_id`
  - `template_suffix`
  - `customer_id` string

    **示例：** `8b91ccbd-37d0-4897-aac6-5082e64ca374`

```json
{
  "gift_card": {
    "id": "377006280092433706",
    "last_characters": "ghjg",
    "balance": "100.00",
    "initial_value": "100.00",
    "note": "note",
    "expires_on": "2025-11-01T00:00:00Z",
    "disabled_at": {},
    "enabled": true,
    "created_at": "2024-05-06T10:06:04Z",
    "updated_at": "2024-05-07T02:37:20Z",
    "status": "enable",
    "currency": "USD",
    "line_item_id": {},
    "order_id": {},
    "user_id": {},
    "template_suffix": {},
    "customer_id": "8b91ccbd-37d0-4897-aac6-5082e64ca374"
  }
}
```

```json
{
  "gift_card": {
    "id": "377006280092433706",
    "last_characters": "ghjg",
    "balance": "100.00",
    "initial_value": "100.00",
    "note": "note",
    "expires_on": "2025-11-01T00:00:00Z",
    "disabled_at": null,
    "enabled": true,
    "created_at": "2024-05-06T10:06:04Z",
    "updated_at": "2024-05-07T02:37:20Z",
    "status": "enable",
    "currency": "USD",
    "line_item_id": null,
    "order_id": null,
    "user_id": null,
    "template_suffix": null,
    "customer_id": "8b91ccbd-37d0-4897-aac6-5082e64ca374"
  }
}
```
