---
title: "Disable a gift card"
description: "Disable a gift card in the store."
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/product/gift-card/disable-gift-card'
  md: 'https://developer.shopline.com/docs/admin-rest-api/product/gift-card/disable-gift-card.md'
---
# Disable a gift card

Disable a gift card in the store.

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_gift_card`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
POST /gift_cards/:gift_card_id/disable.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Required Permissions

* `write_gift_card`

## Request

### Path Parameters

* `gift_card_id`

  string (required)

  The unique identifier for the gift card.<br/>
  Maximum length：64 

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `gift_card`

  object

  Gift card information.

  * `id`

    string

    The unique identifier for the gift card .

  * `note`

    string

    The note content of the gift card. 

  * `user_id`

    string

    The ID of the SHOPLINE Admin user who disabled the gift card.

  * `recipient_attributes`

    object

    The recipient information for the gift card.

    * `nickname`

      string

      Recipient nickname for the gift card.

    * `send_around`

      string

      The scheduled delivery date and time of the gift card. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

    * `email`

      string

      Recipient email address for the gift card.

    * `message`

      string

      Message for the gift card.

  * `api_client_id`

    string

    The unique identifier for the calling API client.

  * `created_at`

    string

    The date and time when the gift card was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

  * `disabled_at`

    string

    The date and time when the gift card was disabled. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

  * `last_characters`

    string

    The last four characters of the gift card code. 

  * `line_item_id`

    string

    The associated order line item ID.

  * `order_id`

    string

    The associated order ID.

  * `balance`

    string

    The current balance of the gift card. The value is rounded to two decimal places. The currency unit is the base unit of the store's current settlement currency.

  * `currency`

    string

    A three-letter currency code that follows the  [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html)  standard.

  * `customer_id`

    string

    The ID of the customer who owns the gift card. 

  * `expires_on`

    string

    The current expiration date and time of the gift card. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). Returns `null` if the card never expires.

  * `initial_value`

    string

    The initial amount of the gift card. The value is rounded to two decimal places. The currency unit is the base unit of the store's current settlement currency.

  * `updated_at`

    string

    The date and time when the gift card was last updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "tags": [
    "Disable a gift card"
  ],
  "description": "Disable a gift card in the store.",
  "externalDocs": {
    "description": "Permission point used by the interface is `write_gift_card` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": "| Error Code | HTTP Status Code | Error Description |\n|------------|------------------|-------------------|\n| DATA_NOT_EXIST | 404 | The requested data does not exist. |\n| SUBSCRIPTION_UNSUPPORTED | 401 | The subscription is not supported. |\n| INVALID_PARAMETER | 400 | The provided parameter is invalid. |\n| SUCCESS | 200 | request success |\n| SYSTEM_ERROR | 500 | system error |\n"
  },
  "operationId": "UsypNcgu",
  "parameters": [
    {
      "name": "gift_card_id",
      "in": "path",
      "description": "The unique identifier for the gift card.<br/>\nMaximum length：64 ",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "gift_card_id",
        "description": "The unique identifier for the gift card.<br/>\nMaximum length：64 ",
        "type": "string",
        "example": "30171274557691301804060045"
      },
      "example": "30171274557691301804060045",
      "examples": {
        "Disable a gift card": {
          "value": "30175685282753764489900045"
        }
      }
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "name": "body",
            "type": "object",
            "properties": {
              "gift_card": {
                "name": "gift_card",
                "description": "Gift card information.",
                "type": "object",
                "properties": {
                  "id": {
                    "name": "id",
                    "description": "The unique identifier for the gift card .",
                    "type": "string",
                    "example": "30171274557691301804060045"
                  },
                  "note": {
                    "name": "note",
                    "description": "The note content of the gift card. ",
                    "type": "string",
                    "example": "This is a note"
                  },
                  "user_id": {
                    "name": "user_id",
                    "description": "The ID of the SHOPLINE Admin user who disabled the gift card.",
                    "type": "string",
                    "example": "4214250478"
                  },
                  "recipient_attributes": {
                    "name": "recipient_attributes",
                    "description": "The recipient information for the gift card.",
                    "type": "object",
                    "properties": {
                      "nickname": {
                        "name": "nickname",
                        "description": "Recipient nickname for the gift card.",
                        "type": "string",
                        "example": "nickname"
                      },
                      "send_around": {
                        "name": "send_around",
                        "description": "The scheduled delivery date and time of the gift card. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                        "type": "string",
                        "example": "2025-06-28T23:59:59+08:00"
                      },
                      "email": {
                        "name": "email",
                        "description": "Recipient email address for the gift card.",
                        "type": "string",
                        "example": "recipient@example.com"
                      },
                      "message": {
                        "name": "message",
                        "description": "Message for the gift card.",
                        "type": "string",
                        "example": "This is a message"
                      }
                    },
                    "example": {
                      "email": "recipient@example.com",
                      "message": "This is a message",
                      "nickname": "nickname",
                      "send_around": "2025-06-28T23:59:59+08:00"
                    }
                  },
                  "api_client_id": {
                    "name": "api_client_id",
                    "description": "The unique identifier for the calling API client.",
                    "type": "string",
                    "example": "36d2bc4e97af056677b61c529d9e3a3f7396040d"
                  },
                  "created_at": {
                    "name": "created_at",
                    "description": "The date and time when the gift card was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                    "type": "string",
                    "example": "2023-08-16T23:59:59+08:00"
                  },
                  "disabled_at": {
                    "name": "disabled_at",
                    "description": "The date and time when the gift card was disabled. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                    "type": "string",
                    "example": "2023-08-16T23:59:59+08:00"
                  },
                  "last_characters": {
                    "name": "last_characters",
                    "description": "The last four characters of the gift card code. ",
                    "type": "string",
                    "example": "d246"
                  },
                  "line_item_id": {
                    "name": "line_item_id",
                    "description": "The associated order line item ID.",
                    "type": "string",
                    "example": "18060183094426803997483534"
                  },
                  "order_id": {
                    "name": "order_id",
                    "description": "The associated order ID.",
                    "type": "string",
                    "example": "24060486231247568944830202"
                  },
                  "balance": {
                    "name": "balance",
                    "description": "The current balance of the gift card. The value is rounded to two decimal places. The currency unit is the base unit of the store's current settlement currency.",
                    "type": "string",
                    "example": "299.99"
                  },
                  "currency": {
                    "name": "currency",
                    "description": "A three-letter currency code that follows the  [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html)  standard.",
                    "type": "string",
                    "example": "USD"
                  },
                  "customer_id": {
                    "name": "customer_id",
                    "description": "The ID of the customer who owns the gift card. ",
                    "type": "string",
                    "example": "4200113946"
                  },
                  "expires_on": {
                    "name": "expires_on",
                    "description": "The current expiration date and time of the gift card. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). Returns `null` if the card never expires.",
                    "type": "string",
                    "example": "2023-08-16T23:59:59+08:00"
                  },
                  "initial_value": {
                    "name": "initial_value",
                    "description": "The initial amount of the gift card. The value is rounded to two decimal places. The currency unit is the base unit of the store's current settlement currency.",
                    "type": "string",
                    "example": "299.99"
                  },
                  "updated_at": {
                    "name": "updated_at",
                    "description": "The date and time when the gift card was last updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                    "type": "string",
                    "example": "2025-06-28T23:59:59+08:00"
                  }
                },
                "example": {
                  "id": "30171274557691301804060045",
                  "order_id": "24060486231247568944830202",
                  "user_id": "4214250478",
                  "disabled_at": "2023-08-16T23:59:59+08:00",
                  "last_characters": "d246",
                  "line_item_id": "18060183094426803997483534",
                  "updated_at": "2025-06-28T23:59:59+08:00",
                  "api_client_id": "36d2bc4e97af056677b61c529d9e3a3f7396040d",
                  "customer_id": "4200113946",
                  "expires_on": "2023-08-16T23:59:59+08:00",
                  "initial_value": "299.99",
                  "note": "This is a note",
                  "balance": "299.99",
                  "created_at": "2023-08-16T23:59:59+08:00",
                  "currency": "USD",
                  "recipient_attributes": {
                    "email": "recipient@example.com",
                    "message": "This is a message",
                    "nickname": "nickname",
                    "send_around": "2025-06-28T23:59:59+08:00"
                  }
                }
              }
            },
            "example": {
              "gift_card": {
                "balance": "299.99",
                "currency": "USD",
                "user_id": "4214250478",
                "customer_id": "4200113946",
                "updated_at": "2025-06-28T23:59:59+08:00",
                "note": "This is a note",
                "order_id": "24060486231247568944830202",
                "recipient_attributes": {
                  "send_around": "2025-06-28T23:59:59+08:00",
                  "email": "recipient@example.com",
                  "message": "This is a message",
                  "nickname": "nickname"
                },
                "api_client_id": "36d2bc4e97af056677b61c529d9e3a3f7396040d",
                "created_at": "2023-08-16T23:59:59+08:00",
                "disabled_at": "2023-08-16T23:59:59+08:00",
                "id": "30171274557691301804060045",
                "initial_value": "299.99",
                "expires_on": "2023-08-16T23:59:59+08:00",
                "last_characters": "d246",
                "line_item_id": "18060183094426803997483534"
              }
            }
          },
          "examples": {
            "Disable a gift card": {
              "description": "Disable a gift card.",
              "value": {
                "gift_card": {
                  "updated_at": "2026-06-14T03:51:36-11:00",
                  "user_id": null,
                  "currency": "USD",
                  "customer_id": "2605118091",
                  "id": "30175685282753764489900045",
                  "initial_value": "200.00",
                  "recipient_attributes": {
                    "email": "giftcarttest@shopline.com",
                    "message": "This is a message",
                    "nickname": "giftcarttest",
                    "send_around": "2026-06-28T04:59:59-11:00"
                  },
                  "api_client_id": "1133d7c99428f83aa3c8d155e0efbb6f71e198c9",
                  "created_at": "2026-06-14T03:32:28-11:00",
                  "expires_on": "2026-08-16T23:59:59-11:00",
                  "line_item_id": null,
                  "order_id": null,
                  "balance": "200.00",
                  "last_characters": "0611",
                  "disabled_at": "2026-06-14T03:51:36-11:00",
                  "note": "This is a note"
                }
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/gift_cards/:gift_card_id/disable.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Disable a gift card",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_gift_card"
  ]
}
```