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

# 修改静态码扩展信息

> 仅替换 extension。此操作不能修改支付方式、币种、金额模式或金额。不要求幂等键，也不会按幂等键回放先前的更新。



## OpenAPI

````yaml /zh/global-acquiring/v1.6/payment.yaml post /v2/payment/static_qrs/{code_no}
openapi: 3.0.2
info:
  title: Payment API
  version: 0.0.1
  x-source-en-commit: 8d93105
  x-source-en-path: global-acquiring/v1.6/payment.yaml
  description: >
    UQPAY Payment API 让你接受付款、管理交易，并处理退款与出款。


    ## 功能概览

    - 使用卡、数字钱包和本地支付方式创建并确认 PaymentIntent

    - 处理全额和部分退款

    - 创建出款与银行账户记录

    - 查询 PaymentAttempt、余额与交易历史


    ## 身份认证

    所有请求都需要携带有效的鉴权 Token，Token 通过 [Access
    Token](/zh/account-center/v1.6/api-reference/access-token) 接口获取。请在
    `x-auth-token` 请求头中携带该 Token。


    ## 幂等性

    POST 请求支持 `x-idempotency-key` 请求头，可在不重复创建资源的前提下安全重试。
  contact:
    name: UQPAY Support Team
    url: https://www.uqpay.com/support
    email: support@uqpay.com
  license:
    name: Proprietary
    url: https://www.uqpay.com/legal/api-terms
  termsOfService: https://www.uqpay.com/legal/terms
servers:
  - url: https://api-sandbox.uqpaytech.com/api
    description: 沙盒环境基础 URL。
  - url: https://api.uqpay.com/api
    description: 生产环境基础 URL。
security:
  - XAuthToken: []
tags:
  - name: Payment Intents
    description: >-
      PaymentIntent 引导你完成向客户收款的整个流程。建议你的系统中每个订单或客户会话只创建一个 PaymentIntent。之后可以引用该
      PaymentIntent，查看某次会话的 PaymentAttempt 历史。
  - name: Payment Attempts
    description: >-
      每当客户使用所选 PaymentMethod 付款时，都会创建一个 PaymentAttempt 对象。通过该 API
      可以了解客户是如何为订单付款的。
  - name: Payment Refunds
    description: >
      你可以创建多笔部分退款，直至累计达到原交易金额。每笔退款都会生成唯一记录，并自动校验可用余额。

      PaymentIntent 引导你完成向客户收款的整个流程。建议你的系统中每个订单或客户会话只创建一个 PaymentIntent。之后可以引用该
      PaymentIntent，查看某次会话的 PaymentAttempt 历史。
  - name: Payment Balances
    description: |
      支付余额管理让你查询不同币种的账户余额。你可以查询单个币种的余额，也可以分页查询所有币种的余额。
  - name: Payment Payouts
    description: |
      出款管理让你创建和管理用于资金划转的出款单。你可以创建出款、查询单笔出款，也可以分页并按条件筛选列出所有出款。
  - name: Terminal Management
    description: 用于 POS 设备注册和密钥管理的终端管理 API。
  - name: Bank Accounts
    description: |
      用于结算账户的银行账户管理 API。可创建、更新、查询和列出用于接收结算款项的银行账户。
  - name: Static QR Codes
    description: 创建、查询和管理可重复使用的收款二维码。
paths:
  /v2/payment/static_qrs/{code_no}:
    post:
      tags:
        - Static QR Codes
      summary: 修改静态码扩展信息
      description: 仅替换 extension。此操作不能修改支付方式、币种、金额模式或金额。不要求幂等键，也不会按幂等键回放先前的更新。
      operationId: update-static-qr-code-extension
      parameters:
        - $ref: '#/components/parameters/XClientID'
        - $ref: '#/components/parameters/StaticQRTarget'
        - $ref: '#/components/parameters/StaticQRCodeNumber'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StaticQRExtensionRequest'
            examples:
              sandbox:
                summary: 修改静态码扩展信息
                value:
                  extension: without key
      responses:
        '200':
          description: 请求已处理，资源状态需单独判断。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StaticQRCode'
              examples:
                sandbox:
                  summary: 修改静态码扩展信息
                  value:
                    code_no: D5610f5e1
                    status: SUCCEEDED
                    payment_methods:
                      - ALIPAY
                    currency: SGD
                    amount_mode: DYNAMIC
                    amount: null
                    store_name: Docs Test
                    city: Singapore
                    extension: without key
                    create_time: '2026-10-28T10:18:45+08:00'
                    updated_time: '2026-10-28T10:18:52+08:00'
        '400':
          description: 字段无效或静态码配置要求未满足。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StaticQRError'
        '404':
          description: 目标账户内没有可用的码。码仍在创建时，详情也可能暂不可用。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StaticQRError'
              examples:
                sandbox:
                  summary: 未找到码
                  value:
                    code: STATIC_QR_NOT_FOUND
                    message: >-
                      The requested static QR resource or endpoint was not
                      found.
                    type: static_qr_error
        default:
          description: 其他错误（包括鉴权失败）可能使用通用 API 错误响应。
components:
  parameters:
    XClientID:
      in: header
      name: x-client-id
      schema:
        type: string
      required: true
      description: UQPAY 生成的 API 客户端 ID
      example: Up1HIsjiETgON9PMGPXLy7
    StaticQRTarget:
      name: x-on-behalf-of
      in: header
      required: false
      description: 要操作的已授权关联子账户。省略或传空值时使用凭证账户。同一码的所有操作应使用相同目标账户。不要将凭证账户 ID 显式作为子账户传入。
      schema:
        type: string
        format: uuid
    StaticQRCodeNumber:
      name: code_no
      in: path
      required: true
      description: 区分大小写的码牌号，须保留前导零。历史码牌号可能超过新建码的长度限制。
      schema:
        type: string
        minLength: 1
        maxLength: 64
        pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$
  schemas:
    StaticQRExtensionRequest:
      type: object
      required:
        - extension
      properties:
        extension:
          type: string
          description: >-
            用于替换当前值的关联信息。空字符串可清空，不接受 null。 静态码付款通知中的对应字段为
            `data.payment_method.<method>.static_qrcode_extension`；它不是
            `data.metadata` 或商户订单号。见
            [付款通知字段映射](/zh/global-acquiring/v1.6/guide/static-qr-codes#接收付款通知与对账)。
          maxLength: 512
    StaticQRCode:
      type: object
      required:
        - code_no
        - status
        - payment_methods
        - currency
        - amount_mode
        - amount
        - store_name
        - city
        - extension
        - create_time
        - updated_time
      properties:
        code_no:
          type: string
          description: >-
            码牌号，保留大小写和前导零。 静态码付款通知通过
            `data.payment_method.<method>.static_qrcode_number_plate`
            关联此码；同一码可用于多笔付款。见
            [付款通知字段映射](/zh/global-acquiring/v1.6/guide/static-qr-codes#接收付款通知与对账)。
        status:
          type: string
          description: 码的创建状态，不是付款状态。INITIATED 表示已开始创建，SUCCEEDED 表示码已创建。
        payment_methods:
          type: array
          description: >-
            此码关联的支付方式。 付款通知的 `data.payment_method.type`
            表示本次交易实际使用的单一支付方式，不回传此数组。
          items:
            type: string
            enum:
              - ALIPAY
              - WECHAT
              - PAYNOW
              - UNIONPAY
        currency:
          type: string
          description: 此码收款使用的币种。 付款通知的 `data.currency` 表示单笔交易的币种。
        amount_mode:
          type: string
          enum:
            - FIXED
            - DYNAMIC
          description: FIXED 使用指定金额；DYNAMIC 由付款人输入金额。
        amount:
          type: string
          description: >-
            以主货币单位表示的固定付款金额；DYNAMIC 模式下为 null。响应的小数位数可能与创建请求不同。
            对账时读取付款通知中的单笔交易金额 `data.amount`，不要使用 DYNAMIC 静态码的 null 金额。
          nullable: true
        store_name:
          type: string
          description: 此码关联的门店名称。
        city:
          type: string
          description: 此码关联的城市。
        extension:
          type: string
          description: >-
            你的关联信息，不会编码到二维码支付参数中。 静态码付款通知中的对应字段为
            `data.payment_method.<method>.static_qrcode_extension`；它不是
            `data.metadata` 或商户订单号。见
            [付款通知字段映射](/zh/global-acquiring/v1.6/guide/static-qr-codes#接收付款通知与对账)。
        create_time:
          type: string
          description: 带时区偏移的创建时间。
          format: date-time
        updated_time:
          type: string
          description: 最近更新时间；无更新时间时为 null。
          format: date-time
          nullable: true
    StaticQRError:
      type: object
      required:
        - code
        - message
        - type
      properties:
        code:
          type: string
          description: 供程序识别的错误码。
        message:
          type: string
          description: 失败原因，以及可用时的修正方法。
        type:
          type: string
          enum:
            - static_qr_error
  securitySchemes:
    XAuthToken:
      type: apiKey
      in: header
      name: x-auth-token
      description: UQPAY 提供的登录 API Token。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.