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

# 为虚拟账户创建别名

**适用地区：阿根廷**

此操作允许商家将自定义的、易于理解的别名（CVU 别名）与阿根廷现有的有效虚拟账户关联起来。

别名会将 22 位 CVU 替换为简短易记的文本字符串，从而减少共享付款详情时的错误。

> **信息**
>
> * 别名必须在国家层面保持唯一。这不是平台限制，而是阿根廷银行系统的要求。如果其他 CVU 已使用相同的别名，请求将被拒绝。
> * 如需更新别名，请在所需的 24 小时等待期结束后，使用新值调用同一接口。
> * 别名一经创建或更新，**24 小时内无法再次更改**。更改总次数没有限制。
> * 别名为异步激活。返回 `INPROGRESS` 并不意味着别名已经生效。请使用[获取虚拟账户状态](https://docs.localpayment.com/zh/reference/get-virtual-account-status.md)接口验证激活情况。
> * 如需查看某个虚拟账户上当前有哪些别名处于活动状态，请使用[获取虚拟账户状态](https://docs.localpayment.com/zh/reference/get-virtual-account-status.md)接口。

## 别名格式规则

* 仅允许使用字母（a–z、A–Z）、数字（0–9）和英文句点（`.`）。
* **不允许**使用空格、连字符、下划线、@ 符号（`@`）以及其他特殊字符。
* 长度必须介于 **5 到 20 个字符**之间。
* 有效示例： `alias.example`、`alias.example2026`、`alias.example.test`

## 最佳实践

* 使用有意义、一致的别名来帮助内部核对和支持流程。
* 记录别名创建响应，并将其与内部交易记录关联，以便于审计。
* 定期或在收款前使用状态检查 endpoint 来验证别名是否处于活动状态并已正确映射。


## OpenAPI

````yaml openapi/zh/localpayment.json POST /api/virtual-account/{externalId}/alias
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/virtual-account/{externalId}/alias:
    post:
      summary: 为虚拟账户创建别名
      operationId: create-an-alias-to-a-virtual-account
      parameters:
        - name: Authorization
          in: header
          description: >-
            用于身份验证的 Bearer
            访问令牌。该令牌可从[获取访问令牌](/zh/reference/get-token)或[刷新访问令牌](/zh/reference/refresh-token)endpoint
            获取。
          required: true
          schema:
            type: string
        - name: externalId
          in: path
          description: 要添加别名的虚拟账户的唯一标识符。这必须与您创建虚拟账户时提供的 externalId 值完全一致。
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - C
                  description: 别名类型。对于阿根廷，唯一有效值为： `C` （可自定义——用户自定义文本）。
                value:
                  type: string
                  description: >-
                    所需的别名值。仅允许字母（a–z、A–Z）、数字（0–9）和点（`.`）。长度必须在 5 到 20
                    个字符之间。在整个平台上必须唯一。例如：`alias.example`、`alias.example2026`。
                  minLength: 5
                  maxLength: 20
              required:
                - type
                - value
              x-examples:
                Argentina Example:
                  type: C
                  value: alias.example
            examples:
              Argentina Example:
                value:
                  type: C
                  value: alias.example
      responses:
        '201':
          description: 创建
          content:
            application/json:
              schema:
                type: object
                properties:
                  externalId:
                    type: string
                    description: 虚拟账户的唯一标识符。这与您在请求中提供的 externalId 相同，确认别名已为正确的账户创建。
                  alias:
                    type: object
                    description: 别名信息。
                    properties:
                      type:
                        type: string
                        description: 请求中的别名类型（`C` 表示可定制）。
                      value:
                        type: string
                        description: 请求中的别名值。
                  status:
                    type: object
                    description: 状态信息。
                    properties:
                      code:
                        type: string
                        description: 状态码。
                      description:
                        type: string
                        description: 状态描述。
                      detail:
                        type: string
                        description: 回复的补充信息。
                x-examples: {}
              examples:
                Argentina Example:
                  value:
                    externalId: 94c6faee-0b35-4304-915b-e857981b4c01
                    alias:
                      type: C
                      value: alias.example
                    status:
                      code: '100'
                      description: INPROGRESS
                      detail: Alias creation pending confirmation
        '400':
          description: 错误的请求
          content:
            application/json:
              schema:
                type: object
                properties:
                  externalId:
                    type: string
                    description: 虚拟账户的唯一标识符。这与您在请求中提供的 externalId 相同，确认别名已为正确的账户创建。
                  alias:
                    type: object
                    description: 别名信息。
                    properties:
                      type:
                        type: string
                        description: 请求中的别名类型（`C` 表示可定制）。
                      value:
                        type: string
                        description: 请求中的别名值。
                  status:
                    type: object
                    description: 状态信息。
                    properties:
                      code:
                        type: string
                        description: 状态码。
                      description:
                        type: string
                        description: 状态描述。
                      detail:
                        type: string
                        description: 回复的补充信息。
                x-examples: {}
              examples:
                776 - Alias already in use:
                  value:
                    externalId: 94c6faee-0b35-4304-915b-e857981b4c01
                    alias:
                      type: C
                      value: alias.example
                    status:
                      code: '776'
                      description: REJECTED
                      detail: >-
                        The alias is already in use; please select a different
                        alias.
                777 - Invalid alias:
                  value:
                    externalId: 94c6faee-0b35-4304-915b-e857981b4c01
                    alias:
                      type: C
                      value: alias.example
                    status:
                      code: '777'
                      description: REJECTED
                      detail: The alias is invalid; please enter a valid alias.
                778 - Change period not elapsed:
                  value:
                    externalId: 94c6faee-0b35-4304-915b-e857981b4c01
                    alias:
                      type: C
                      value: alias.example
                    status:
                      code: '778'
                      description: REJECTED
                      detail: >-
                        The alias cannot be changed now; you must wait 24 hours
                        after the last update.
                779 - System error:
                  value:
                    externalId: 94c6faee-0b35-4304-915b-e857981b4c01
                    alias:
                      type: C
                      value: alias.example
                    status:
                      code: '779'
                      description: REJECTED
                      detail: System error to generate alias
                896 - Alias already assigned:
                  value:
                    externalId: 94c6faee-0b35-4304-915b-e857981b4c01
                    alias:
                      type: C
                      value: alias.example
                    status:
                      code: '896'
                      description: REJECTED
                      detail: Alias already assigned to this virtual account
        '401':
          description: 未经授权
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 回复的补充信息。
                  code:
                    type: string
                    description: 状态码。
                  messages:
                    type: array
                    description: 消息列表。
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Token 类。
                        token_type:
                          type: string
                          description: 令牌类型。
                        message:
                          type: string
                          description: 包含补充信息的消息。
                x-examples: {}
              examples:
                401 - Token is invalid or expired:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
        '500':
          description: 内部服务器错误
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: string
                    description: 请求的创建时间。
                  status:
                    type: integer
                    description: 状态码。
                  error:
                    type: string
                    description: 错误描述。
                  message:
                    type: string
                    description: 包含补充信息的消息。
                  path:
                    type: string
                    description: API 路径。
                x-examples: {}
              examples:
                500-Virtual Account doesn't exist:
                  value:
                    timestamp: '2025-05-10T02:14:00.736+00:00'
                    status: 500
                    error: Internal Server Error
                    message: Virtual Account doesn't exist
                    path: /virtual-account/94b6faee-0b875-4304-915b-ei579y1c07/alias
      security:
        - token: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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