---
title: "Get gift card operation records"
description: "Retrieve a list of operation records for a specific gift card."
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/product/gift-card/get-gift-card-operation-records'
  md: 'https://developer.shopline.com/docs/admin-rest-api/product/gift-card/get-gift-card-operation-records.md'
---
# Get gift card operation records

Retrieve a list of operation records for a specific gift card.

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

## Endpoint

```http
GET /gift_cards/:gift_card_id/operation_records.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

* `read_gift_card`

## Request

### Path Parameters

* `gift_card_id`

  string (required)

  Gift Card ID.

### Query Parameters

* `createtime_at_max`

  string (optional)

  Create time before xxx ( format see ISO8601 ), up to 180 days of data can be queried.

* `createtime_at_min`

  string (optional)

  Create time starts with xxx ( format see ISO8601 ), up to 180 days of data can be queried.

* `limit`

  string (optional)

  Limit of query , default 50 , can not exceed 100.

* `operation_type`

  string (optional)

  Gift Card Operation Types, separate multiple values with commas ",".
  If left blank, all types will be returned.
  | Value | Description |
  | --- | --- |
  | OPERATE_ACTION_DEDUCT | Deduction from gift card payment. |
  | OPERATE_ACTION_REFUND | Refund returned to gift card. |
  | OPERATE_ACTION_ADJUST_BALANCE | Balance adjustment by third-party applications. |
  
  

* `page_info`

  string (optional)

  The unique identifier for pagination queries, used to locate a specific page. 
  
  This parameter value is obtained from the `link` value in the response header of this API after you have queried the pagination information. 
  
  For example, if the `link` value you obtained is `<https://{handle}.myshopline.com/admin/openapi/{version}/gift_cards/:gift_card_id/operation_records.json?limit=1&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel="next"` , the value of `page_info` is `eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9` . 
  For more information on how to use pagination, refer to [Paging Mechanism](https://developer.shopline.com/docs/apps/api-instructions-for-use/paging-mechanism.md).

* `sort_order`

  string (optional)

  Sorted by usage time
  | Value | Description |
  | --- | --- |
  | asc | Sorted in ascending order of usage time. |
  | desc | Sorted in ascending order of usage time, is default. |
  
  

### 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.

* `link`

  The URL link that provides the pagination data. You can obtain `page_info` from this parameter for subsequent pagination requests. 
  
  This parameter is returned when the requested page has a previous or next page. 
  
  For more information on how to use pagination, refer to [Paging Mechanism](https://developer.shopline.com/docs/apps/api-instructions-for-use/paging-mechanism.md).

### Response Body

#### 200

* `created_at`

  string

  Gift card creation time.

* `customer_id`

  string

  Client id for customers assigned to present gift card.

* `gift_card_id`

  string

  Gift Card ID.

* `gift_card_records`

  array<object>

  List of gift card operation records.

  * `refund_id`

    string

    Associated refund id.

  * `created_at`

    string

    Gift card record creation time.

  * `cur_balance`

    integer

    Post-change balance.

  * `id`

    string

    Gift Card records ID.

  * `last_balance`

    integer

    Pre-change balance.

  * `operation_type`

    string

    Gift card operation type.
    | Value | Description |
    | --- | --- |
    | OPERATE_ACTION_DEDUCT | Deduction from gift card payment. |
    | OPERATE_ACTION_REFUND | Refund returned to gift card. |
    | OPERATE_ACTION_ADJUST_BALANCE | Balance adjustment by third-party applications. |
    
    

  * `order_id`

    string

    Associated order id.

  * `pay_seq`

    string

    Associated Payment id.

* `status`

  string

  Gift card status , enabled : enabled , disabled : not enabled.

* `count`

  integer

  Total number of records.


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "description": "Retrieve a list of operation records for a specific gift card.",
  "externalDocs": {
    "description": "Permission point used by the interface is `read_gift_card` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": ""
  },
  "operationId": "ZtH7r8BS",
  "parameters": [
    {
      "name": "gift_card_id",
      "in": "path",
      "description": "Gift Card ID.",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "gift_card_id",
        "description": "Gift Card ID.",
        "type": "string",
        "example": "30157043359245339231360282"
      },
      "example": "30157043359245339231360282"
    },
    {
      "name": "createtime_at_max",
      "in": "query",
      "description": "Create time before xxx ( format see ISO8601 ), up to 180 days of data can be queried.",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "createtime_at_max",
        "description": "Create time before xxx ( format see ISO8601 ), up to 180 days of data can be queried.",
        "type": "string",
        "example": "2021-09-04T14:11:54+00:00"
      },
      "example": "2021-09-04T14:11:54+00:00"
    },
    {
      "name": "createtime_at_min",
      "in": "query",
      "description": "Create time starts with xxx ( format see ISO8601 ), up to 180 days of data can be queried.",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "createtime_at_min",
        "description": "Create time starts with xxx ( format see ISO8601 ), up to 180 days of data can be queried.",
        "type": "string",
        "example": "2021-09-02T14:11:54+00:00"
      },
      "example": "2021-09-02T14:11:54+00:00"
    },
    {
      "name": "limit",
      "in": "query",
      "description": "Limit of query , default 50 , can not exceed 100.",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "limit",
        "description": "Limit of query , default 50 , can not exceed 100.",
        "type": "string",
        "example": "100"
      },
      "example": "100"
    },
    {
      "name": "operation_type",
      "in": "query",
      "description": "Gift Card Operation Types, separate multiple values with commas \",\".\nIf left blank, all types will be returned.\n| Value | Description |\n| --- | --- |\n| OPERATE_ACTION_DEDUCT | Deduction from gift card payment. |\n| OPERATE_ACTION_REFUND | Refund returned to gift card. |\n| OPERATE_ACTION_ADJUST_BALANCE | Balance adjustment by third-party applications. |\n\n",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "operation_type",
        "description": "Gift Card Operation Types, separate multiple values with commas \",\".\nIf left blank, all types will be returned.\n| Value | Description |\n| --- | --- |\n| OPERATE_ACTION_DEDUCT | Deduction from gift card payment. |\n| OPERATE_ACTION_REFUND | Refund returned to gift card. |\n| OPERATE_ACTION_ADJUST_BALANCE | Balance adjustment by third-party applications. |\n\n",
        "type": "string",
        "example": "OPERATE_ACTION_DEDUCT,OPERATE_ACTION_REFUND"
      },
      "example": "OPERATE_ACTION_DEDUCT,OPERATE_ACTION_REFUND"
    },
    {
      "name": "page_info",
      "in": "query",
      "description": "The unique identifier for pagination queries, used to locate a specific page. \n\nThis parameter value is obtained from the `link` value in the response header of this API after you have queried the pagination information. \n\nFor example, if the `link` value you obtained is `<https://{handle}.myshopline.com/admin/openapi/{version}/gift_cards/:gift_card_id/operation_records.json?limit=1&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel=\"next\"` , the value of `page_info` is `eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9` . \nFor more information on how to use pagination, refer to [Paging Mechanism](https://developer.shopline.com/docs/apps/api-instructions-for-use/paging-mechanism.md).",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "page_info",
        "description": "The call party does not require use and attention to this field , automatically encapsulated by Shopline.",
        "type": "string",
        "example": "eyJzaW5jZUlkIjoiMzAxNTcwNDMzNTkyNDUzMzkyMzEzNjAyODIiLCJkaXJlY3Rpb24iOiJwcmV2Iiwic3RhdHVzIjoiZW5hYmxl"
      },
      "example": "eyJzaW5jZUlkIjoiMzAxNTcwNDMzNTkyNDUzMzkyMzEzNjAyODIiLCJkaXJlY3Rpb24iOiJwcmV2Iiwic3RhdHVzIjoiZW5hYmxl"
    },
    {
      "name": "sort_order",
      "in": "query",
      "description": "Sorted by usage time\n| Value | Description |\n| --- | --- |\n| asc | Sorted in ascending order of usage time. |\n| desc | Sorted in ascending order of usage time, is default. |\n\n",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "sort_order",
        "description": "Sorted by usage time\n| Value | Description |\n| --- | --- |\n| asc | Sorted in ascending order of usage time. |\n| desc | Sorted in ascending order of usage time, is default. |\n\n",
        "type": "string",
        "example": "desc"
      },
      "example": "desc"
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "style": "string",
      "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. Please 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 put the obtained access token into the API request header in Bearer Token.",
        "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."
        },
        "link": {
          "description": "The URL link that provides the pagination data. You can obtain `page_info` from this parameter for subsequent pagination requests. \n\nThis parameter is returned when the requested page has a previous or next page. \n\nFor more information on how to use pagination, refer to [Paging Mechanism](https://developer.shopline.com/docs/apps/api-instructions-for-use/paging-mechanism.md).",
          "example": "<https://{handle}.myshopline.com/admin/openapi/{version}/gift_cards/:gift_card_id/operation_records.json?limit=20&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel=\"previous\",<https://{handle}.myshopline.com/admin/openapi/{version}/gift_cards/:gift_card_id/operation_records.json?limit=20&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJwcmUiLCJsaW1pdCI6MX0=>; rel=\"next\""
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "created_at": {
                "name": "created_at",
                "description": "Gift card creation time.",
                "type": "string",
                "example": "2023-08-16T23:59:59+08:00"
              },
              "customer_id": {
                "name": "customer_id",
                "description": "Client id for customers assigned to present gift card.",
                "type": "string",
                "example": "4200113946"
              },
              "gift_card_id": {
                "name": "gift_card_id",
                "description": "Gift Card ID.",
                "type": "string",
                "example": "30157043359245339231360282"
              },
              "gift_card_records": {
                "name": "gift_card_records",
                "description": "List of gift card operation records.",
                "type": "array",
                "items": {
                  "name": "gift_card_records",
                  "description": "List of gift card operation records.",
                  "type": "object",
                  "properties": {
                    "refund_id": {
                      "name": "refund_id",
                      "description": "Associated refund id.",
                      "type": "string",
                      "example": "2605514230128707114121"
                    },
                    "created_at": {
                      "name": "created_at",
                      "description": "Gift card record creation time.",
                      "type": "string",
                      "example": "2023-08-16T23:59:59+08:00"
                    },
                    "cur_balance": {
                      "name": "cur_balance",
                      "description": "Post-change balance.",
                      "type": "integer",
                      "example": 100
                    },
                    "id": {
                      "name": "id",
                      "description": "Gift Card records ID.",
                      "type": "string",
                      "example": "5504120995916023830"
                    },
                    "last_balance": {
                      "name": "last_balance",
                      "description": "Pre-change balance.",
                      "type": "integer",
                      "example": 50
                    },
                    "operation_type": {
                      "name": "operation_type",
                      "description": "Gift card operation type.\n| Value | Description |\n| --- | --- |\n| OPERATE_ACTION_DEDUCT | Deduction from gift card payment. |\n| OPERATE_ACTION_REFUND | Refund returned to gift card. |\n| OPERATE_ACTION_ADJUST_BALANCE | Balance adjustment by third-party applications. |\n\n",
                      "type": "string",
                      "example": "OPERATE_ACTION_DEDUCT"
                    },
                    "order_id": {
                      "name": "order_id",
                      "description": "Associated order id.",
                      "type": "string",
                      "example": "21055050822459866501338306"
                    },
                    "pay_seq": {
                      "name": "pay_seq",
                      "description": "Associated Payment id.",
                      "type": "string",
                      "example": "23062186831987862878904657"
                    }
                  },
                  "example": {
                    "order_id": "21055050822459866501338306",
                    "pay_seq": "23062186831987862878904657",
                    "refund_id": "2605514230128707114121",
                    "created_at": "2023-08-16T23:59:59+08:00",
                    "cur_balance": 100,
                    "id": "5504120995916023830",
                    "last_balance": 50,
                    "operation_type": "OPERATE_ACTION_DEDUCT"
                  }
                },
                "example": [
                  {
                    "refund_id": "2605514230128707114121",
                    "created_at": "2023-08-16T23:59:59+08:00",
                    "cur_balance": 100,
                    "id": "5504120995916023830",
                    "last_balance": 50,
                    "operation_type": "OPERATE_ACTION_DEDUCT",
                    "order_id": "21055050822459866501338306",
                    "pay_seq": "23062186831987862878904657"
                  }
                ]
              },
              "status": {
                "name": "status",
                "description": "Gift card status , enabled : enabled , disabled : not enabled.",
                "type": "string",
                "example": "enabled"
              },
              "count": {
                "name": "count",
                "description": "Total number of records.",
                "type": "integer",
                "example": 10
              }
            },
            "example": {
              "status": "enabled",
              "count": 10,
              "created_at": "2023-08-16T23:59:59+08:00",
              "customer_id": "4200113946",
              "gift_card_id": "30157043359245339231360282",
              "gift_card_records": [
                {
                  "order_id": "21055050822459866501338306",
                  "pay_seq": "23062186831987862878904657",
                  "refund_id": "2605514230128707114121",
                  "created_at": "2023-08-16T23:59:59+08:00",
                  "cur_balance": 100,
                  "id": "5504120995916023830",
                  "last_balance": 50,
                  "operation_type": "OPERATE_ACTION_DEDUCT"
                }
              ]
            }
          }
        }
      }
    },
    "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": "get",
  "path": "/gift_cards/:gift_card_id/operation_records.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": "Get gift card operation records",
    "version": "v20270301"
  },
  "authIndexes": [
    "read_gift_card"
  ]
}
```