> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Gift Card

> Query gift card details by card number or redemption code. When both parameters are provided, key takes priority.

## Overview

This page documents the `POST /payment/open/institution/v1/pay/gift/query` endpoint. The full schema, parameters, and examples are rendered from the linked OpenAPI definition above.

## Notes

* Authentication uses the standard GatePay signed headers.
* This page documents the standard merchant endpoint.
* For shared signing rules, see [/api-reference/version/100/en/common/securityAndSignature](/api-reference/version/100/en/common/securityAndSignature).


## OpenAPI

````yaml /api-reference/version/100/en/openapi/institution/gift-card-openapi.json POST /payment/open/institution/v1/pay/gift/query
openapi: 3.1.0
info:
  title: GatePay API
  description: >-
    The gift card API solution provided by Gate Pay is designed to facilitate
    the instant creation and value checking of gift cards.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /payment/open/institution/v1/pay/gift/query:
    post:
      summary: Query Gift Card
      description: >-
        Query gift card details by card number or redemption code. When both
        parameters are provided, key takes priority.
      parameters:
        - $ref: '#/components/parameters/X-GatePay-Certificate-ClientId'
        - $ref: '#/components/parameters/X-GatePay-Signature'
        - $ref: '#/components/parameters/X-GatePay-Timestamp'
        - $ref: '#/components/parameters/X-GatePay-Nonce'
        - $ref: '#/components/parameters/X-GatePay-On-Behalf-Of'
      requestBody:
        description: >-
          Query gift card request parameters (card_number and key, one of two
          required)
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GiftCardQueryRequest'
            examples:
              basicExample:
                summary: Query by card number
                value:
                  card_number: '5202710871862281'
                  key: ''
        required: true
      responses:
        '200':
          description: Query successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GiftCardQueryResponse'
              examples:
                successResponse:
                  summary: Success Response
                  value:
                    status: SUCCESS
                    code: '000000'
                    errorMessage: ''
                    data:
                      card_num: '6712561472330044'
                      key: r81T4rg3FKjt2+BYUgIn0CFqwtxp9CUSHGBFYDDJ608=
                      title: ''
                      creator_name: GateUser-8118f6f8
                      amount: '0.99'
                      status: 2
                      currency: USDT
                      create_time: 1737971259259
                      exchange_uid: 0
                      exchange_time: 1737971259259
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: Merchant client ID
      schema:
        type: string
        example: mZ96D37oKk-HrWJc
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: Signature
      schema:
        type: string
        example: >-
          b8c4705ff4c1357f2a27925dd180c1e1f4a244148f312a2dee5afbcc6f4b150e9ffceee455c5a298f895d43a64ee829eebdfd262539d45c41f7aee4336fd8c8c
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: Timestamp (milliseconds)
      schema:
        type: string
        example: '1738934053475'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: Nonce
      schema:
        type: string
        example: '5417061546'
    X-GatePay-On-Behalf-Of:
      name: X-GatePay-On-Behalf-Of
      in: header
      required: true
      schema:
        type: string
      description: >-
        Required delegated-subject header. Provide the initiating account ID for
        this request. For institution merchant APIs, this is typically the
        target sub-account ID; for institution charge and transfer APIs, it can
        be either an institution account ID or a sub-account ID.
  schemas:
    GiftCardQueryRequest:
      type: object
      properties:
        card_number:
          type: string
          description: Gift card number (one of two with key)
          example: '5202710871862281'
        key:
          type: string
          description: >-
            Redemption code (one of two with card_number, key takes priority
            when both provided)
          example: ''
    GiftCardQueryResponse:
      type: object
      properties:
        status:
          type: string
          description: Response status
          example: SUCCESS
        code:
          type: string
          description: Response code
          example: '000000'
        errorMessage:
          type: string
          description: Error message
          example: ''
        data:
          $ref: '#/components/schemas/GiftCardQueryData'
    GiftCardQueryData:
      type: object
      properties:
        card_num:
          type: string
          description: Gift card number
          example: '6712561472330044'
        key:
          type: string
          description: Redemption code
          example: r81T4rg3FKjt2+BYUgIn0CFqwtxp9CUSHGBFYDDJ608=
        title:
          type: string
          description: Title
          example: ''
        creator_name:
          type: string
          description: Gift card creator's name
          example: GateUser-8118f6f8
        amount:
          type: string
          description: Gift card amount
          example: '0.99'
        status:
          type: integer
          description: >-
            Gift card status: 0=Unknown, 1=Pending Payment, 2=Not Redeemed,
            3=Redeemed, 4=Frozen, 5=Payment Failed, 6=Manual Review, 7=Review
            Rejected, 8=Review Payment Failed
          enum:
            - 0
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8
          example: 2
        currency:
          type: string
          description: Gift card currency
          example: USDT
        card_temp_id:
          type: string
          description: Gift card cover ID
          example: '255267012439183360'
        create_time:
          type: integer
          format: int64
          description: Create time (millisecond timestamp)
          example: 1737971259259
        exchange_uid:
          type: integer
          description: Redeemer
          example: 0
        exchange_time:
          type: integer
          format: int64
          description: Exchange time in standard timestamp format, measured in milliseconds
          example: 1737971259259

````