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

# 创建礼品卡

> 创建一张新的礼品卡，指定标题、封面、币种和金额。

## 概述

本页说明 `POST /payment/open/institution/v1/pay/gift/create` 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 本页展示同一接口的机构路径版本。
* 除创建子账户、查询子账户详情、分页查询子账户外，机构侧请求需携带 `X-GatePay-On-Behalf-Of`。
* 通用签名规则请参见 [/api-reference/version/100/cn/common/securityAndSignature](/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml api-reference/version/100/cn/openapi/institution/gift-card-openapi.json POST /payment/open/institution/v1/pay/gift/create
openapi: 3.1.0
info:
  title: GatePay 机构礼品卡 API
  description: Gate Pay 礼品卡 API 解决方案，用于礼品卡的即时创建和价值检查。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /payment/open/institution/v1/pay/gift/create:
    post:
      summary: 创建礼品卡
      description: 创建一张新的礼品卡，指定标题、封面、币种和金额。
      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: 创建礼品卡请求参数
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GiftCardCreateRequest'
            examples:
              basicExample:
                summary: 基础示例
                value:
                  title: 创建礼品卡示例
                  templateId: '255267012439183360'
                  currency: USDT
                  amount: '0.99'
        required: true
      responses:
        '200':
          description: 创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GiftCardCreateResponse'
              examples:
                successResponse:
                  summary: 成功响应
                  value:
                    status: SUCCESS
                    code: '000000'
                    errorMessage: ''
                    data:
                      card_num: '2002356433468640'
                      card_key: yJgkiqAVCwS0tC8W5D+t9iFqwtxp9CUSHGBFYDDJ608=
                      amount: '0.99'
                      currency: USDT
                      status: 1
                      card_temp_id: '255267012439183360'
                      creator: 10002
                      creator_name: GateUser-8118f6f8
                      exchange_uid: 0
                      owner: 10002
                      give_count: 0
                      last_give_time: 0
                      create_time: 1737942105582
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: 商户客户端ID
      schema:
        type: string
        example: mZ96D37oKk-HrWJc
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: 签名
      schema:
        type: string
        example: >-
          b8c4705ff4c1357f2a27925dd180c1e1f4a244148f312a2dee5afbcc6f4b150e9ffceee455c5a298f895d43a64ee829eebdfd262539d45c41f7aee4336fd8c8c
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: 时间戳（毫秒）
      schema:
        type: string
        example: '1738934053475'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: 随机数
      schema:
        type: string
        example: '5417061546'
    X-GatePay-On-Behalf-Of:
      name: X-GatePay-On-Behalf-Of
      in: header
      required: true
      schema:
        type: string
      description: >-
        必填代理归属请求头。请填写本次请求的发起方账户 ID；在机构代理商户 API 中通常填写目标子账户 ID，在机构代扣与划转接口中可填写机构账户
        ID 或子账户 ID。
  schemas:
    GiftCardCreateRequest:
      type: object
      required:
        - title
        - templateId
        - currency
        - amount
      properties:
        title:
          type: string
          description: 礼品卡的标题
          example: 创建礼品卡示例
        templateId:
          type: string
          description: 礼品卡封面的ID
          example: '255267012439183360'
        currency:
          type: string
          description: 礼品卡的币种
          example: USDT
        amount:
          type: string
          description: 礼品卡的金额
          example: '0.99'
    GiftCardCreateResponse:
      type: object
      properties:
        status:
          type: string
          description: 响应状态
          example: SUCCESS
        code:
          type: string
          description: 响应码，000000表示成功
          example: '000000'
        errorMessage:
          type: string
          description: 错误信息，成功时为空
          example: ''
        data:
          $ref: '#/components/schemas/GiftCardCreateData'
    GiftCardCreateData:
      type: object
      properties:
        card_num:
          type: string
          description: 礼品卡卡号
          example: '2002356433468640'
        card_key:
          type: string
          description: 礼品卡兑换码
          example: yJgkiqAVCwS0tC8W5D+t9iFqwtxp9CUSHGBFYDDJ608=
        amount:
          type: string
          description: 礼品卡金额
          example: '0.99'
        currency:
          type: string
          description: 礼品卡币种
          example: USDT
        status:
          type: integer
          description: 礼品卡状态：0=未知状态，1=待支付，2=未兑换，3=已兑换，4=冻结，5=支付失败，6=人工审核，7=审核驳回，8=审核支付失败
          enum:
            - 0
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8
          example: 1
        card_temp_id:
          type: string
          description: 礼品卡封面ID
          example: '255267012439183360'
        creator:
          type: integer
          description: 创建人ID
          example: 10002
        creator_name:
          type: string
          description: 礼品卡创建人名字
          example: GateUser-8118f6f8
        exchange_uid:
          type: integer
          description: 兑换人ID
          example: 0
        owner:
          type: integer
          description: 持有人ID
          example: 10002
        give_count:
          type: integer
          description: 赠送次数
          example: 0
        last_give_time:
          type: integer
          description: 最后赠送时间
          example: 0
        create_time:
          type: integer
          format: int64
          description: 创建时间（毫秒时间戳）
          example: 1737942105582

````