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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# 创建独立转账

> 创建方向不可变更的独立转账

独立于支付创建转账。`direction` 字段决定由哪个账户发送资金。

> [!WARNING]
>
> 收款方到平台的转账尚未全面开放。请仅在 Yuno 确认账户已启用且服务提供商支持后使用此方向。

| 方向 | 资金流向 |
| - | - |
| `PLATFORM_TO_RECIPIENT` | 从平台余额转给收款方。当省略 `direction` 或其值为 `null` 时，这是默认方向。 |
| `RECIPIENT_TO_PLATFORM` | 从收款方余额转给平台，例如单独收取的争议费用。需要已启用的账户以及 `STRIPE` 服务提供商支持。收款方的 onboarding 连接用于识别服务提供商账户。 |

方向在创建时保存，并在响应、[GET](https://docs.y.uno/zh-hans/reference/transfers/get-standalone-transfer.md) 和转账通知中返回。创建后无法更改。使用相同的账户和幂等键但方向不同的请求会被拒绝；省略方向与显式指定 `PLATFORM_TO_RECIPIENT` 表示同一个方向。

无效字符串（包括空值或大小写不正确的值）、对象、数组、数字和布尔值会返回 `400 INVALID_PARAMETERS`。服务提供商不是 `STRIPE` 的收款方到平台请求，会在启用检查之前返回 `400 INVALID_PARAMETERS`。对于没有访问权限的账户，有效的收款方到平台请求会在幂等方向检查之前返回 `400 DIRECTION_NOT_ENABLED`。

收款方到平台的转账无法[撤回](https://docs.y.uno/zh-hans/reference/transfers/reverse-standalone-transfer.md)。如需退还单独收取的费用，请创建一笔新的平台到收款方的转账。


## OpenAPI

````yaml openapi/zh-hans/transfers/create-standalone-transfer.json POST /split-marketplace/transfers
openapi: 3.1.0
info:
  title: Transfer Flow API
  version: 1.0.0
  description: >-
    API for managing standalone forward and reverse transfers within the
    Marketplace.
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - public_api_key: []
    private_secret_key: []
paths:
  /split-marketplace/transfers:
    post:
      tags:
        - Transfers
      summary: 创建独立转账
      description: >-
        创建独立转账。方向不可变；省略或为 null 的方向默认为
        PLATFORM_TO_RECIPIENT。RECIPIENT_TO_PLATFORM 尚未全面开放。请在 Yuno
        确认账户已启用并支持该服务提供商之后再使用。对于 STRIPE 以外的服务提供商使用
        RECIPIENT_TO_PLATFORM，会在启用检查之前返回
        INVALID_PARAMETERS。使用相同的账户和幂等键但规范化后的方向不同，当所请求的方向已启用时会返回
        INVALID_PARAMETERS；否则可用性检查会先返回 DIRECTION_NOT_ENABLED。
      operationId: create-standalone-transfer
      parameters:
        - name: X-Account-Code
          in: header
          required: true
          schema:
            type: string
            format: uuid
          description: 在 Yuno Dashboard 中找到的 account_id。API 从此标头读取账户。
        - name: X-Idempotency-Key
          in: header
          required: true
          schema:
            type: string
          description: 请求幂等的唯一键。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - recipient_id
                - provider_id
                - amount
              properties:
                account_id:
                  type: string
                  deprecated: true
                  description: 未使用。API 从 `X-Account-Code` 标头获取账户，因此可以省略此字段。
                recipient_id:
                  type: string
                  format: uuid
                  description: >-
                    目标收款方标识符。该收款方必须在 `provider_id` 上有一个状态为 PENDING 或 SUCCEEDED 的
                    onboarding。
                provider_id:
                  type: string
                  description: 要使用的支付服务提供商代码（例如 adyen、stripe）。
                amount:
                  $ref: '#/components/schemas/Amount'
                description:
                  type: string
                  description: 转账的描述，便于阅读（3-255 个字符）。会发送给服务提供商。
                merchant_reference:
                  type: string
                  description: 商户用于幂等和跟踪的唯一标识符。
                metadata:
                  $ref: '#/components/schemas/Metadata'
                direction:
                  type:
                    - string
                    - 'null'
                  enum:
                    - PLATFORM_TO_RECIPIENT
                    - RECIPIENT_TO_PLATFORM
                    - null
                  default: PLATFORM_TO_RECIPIENT
                  description: >-
                    转账方向。省略或为 null 时默认为
                    PLATFORM_TO_RECIPIENT。RECIPIENT_TO_PLATFORM 仅支持符合条件的 STRIPE
                    账户。RECIPIENT_TO_PLATFORM 尚未全面开放。请在 Yuno
                    确认账户已启用并支持该服务提供商之后再使用。
            examples:
              Platform to recipient:
                value:
                  recipient_id: 5a37f0c0-7689-4065-8348-4b5ff5bf9cc7
                  provider_id: STRIPE
                  amount:
                    value: 150
                    currency: USD
                  description: Marketplace payout
                  merchant_reference: MR-TRANSFER-001
                  direction: PLATFORM_TO_RECIPIENT
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transfer'
              examples:
                Success:
                  value:
                    id: 94036ceb-5cca-4384-b144-e2a5a908af77
                    recipient_id: e56c3329-f3d9-48e5-a677-284b147abf95
                    amount:
                      currency: USD
                      value: 100
                    status: SUCCEEDED
                    description: test transfer
                    merchant_reference: c19e858a-ffd6-4635-8a31-4f60c5becf4d
                    metadata: []
                    provider: null
                    transactions:
                      - code: 7ac2c5f3-7c79-4e99-b45e-aa5952620188
                        type: SPLIT_TRANSFER
                        status: SUCCEEDED
                        provider_transfer_id: tr_1T9eKVIiMnPsFcbbRTb8ObsZ
                        provider_response_message: null
                        provider_raw_response: |-
                          {
                            "id": "tr_1T9eKVIiMnPsFcbbRTb8ObsZ",
                            "object": "transfer",
                            "amount": 10000,
                            "amount_reversed": 0,
                            "balance_transaction": "txn_1T9eKVIiMnPsFcbbOPnvz3xM",
                            "created": 1773203107,
                            "currency": "usd",
                            "description": "test transfer",
                            "destination": "acct_1T9PSQIZEg1WWTvj",
                            "destination_payment": "py_1T9eKVIZEg1WWTvjbVjmnzFK",
                            "livemode": false,
                            "metadata": {},
                            "reversals": {
                              "object": "list",
                              "data": [],
                              "has_more": false,
                              "total_count": 0,
                              "url": "/v1/transfers/tr_1T9eKVIiMnPsFcbbRTb8ObsZ/reversals"
                            },
                            "reversed": false,
                            "source_transaction": null,
                            "source_type": "card",
                            "transfer_group": null
                          }
                        created_at: '2026-03-11T04:25:06.229027Z'
                        updated_at: '2026-03-11T04:25:07.917364Z'
                    created_at: '2026-03-11T04:25:06.208761Z'
                    updated_at: '2026-03-11T04:25:07.928000342Z'
                    completed_at: '2026-03-11T04:25:07.927971142Z'
                    direction: PLATFORM_TO_RECIPIENT
                Error:
                  value:
                    id: 9778f631-504d-448f-b2c1-f7b903781df7
                    recipient_id: 82b12c8c-7d3d-4a21-a3c6-165cc04ca741
                    amount:
                      currency: USD
                      value: 50000
                    status: ERROR
                    description: test transfer
                    merchant_reference: cb18df20-21ae-4fed-8da9-fb81cfd56797
                    metadata: []
                    provider: null
                    transactions:
                      - code: 9eee65d1-6c3a-4076-9ef9-fa4bff73d597
                        type: SPLIT_TRANSFER
                        status: ERROR
                        provider_transfer_id: tr_1T9PTLIiMnPsFcbbFKyh1Nds
                        provider_response_message: |-
                          {
                            "id": "tr_1T9PTLIiMnPsFcbbFKyh1Nds",
                            "object": "transfer",
                            "amount": 10000,
                            "amount_reversed": 0,
                            "balance_transaction": "txn_1T9PTMIiMnPsFcbbxRKvaZ3G",
                            "created": 1773145996,
                            "currency": "usd",
                            "description": "test transfer"
                          }
                        provider_raw_response: '{.... }'
                        created_at: '2026-03-10T13:39:19.342902Z'
                        updated_at: '2026-03-10T13:39:19.342914Z'
                    created_at: '2026-03-10T13:39:19.241990247Z'
                    updated_at: '2026-03-10T13:39:19.242012664Z'
                    direction: PLATFORM_TO_RECIPIENT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              examples:
                PROVIDER_NOT_FOUND:
                  summary: Provider not found
                  value:
                    code: PROVIDER_NOT_FOUND
                    messages:
                      - The specified provider was not found.
                ONBOARDING_NOT_VALID:
                  summary: Onboarding not valid
                  value:
                    code: ONBOARDING_NOT_VALID
                    messages:
                      - >-
                        The recipient onboarding is not valid for this
                        operation.
                CURRENCY_NOT_SUPPORTED:
                  summary: Currency not supported
                  value:
                    code: CURRENCY_NOT_SUPPORTED
                    messages:
                      - The specified currency is not supported.
                INVALID_AMOUNT:
                  summary: Invalid amount
                  value:
                    code: INVALID_AMOUNT
                    messages:
                      - The transfer amount is invalid.
                INSUFFICIENT_BALANCE:
                  summary: Insufficient balance
                  value:
                    code: INSUFFICIENT_BALANCE
                    messages:
                      - Insufficient balance to complete the transfer.
                INVALID_DIRECTION_VALUE:
                  summary: Invalid direction value
                  description: >-
                    An empty, unknown or incorrectly cased string returns
                    INVALID_PARAMETERS. Null uses the default direction.
                  value:
                    code: INVALID_PARAMETERS
                    messages:
                      - The field 'direction' has an invalid value.
                INVALID_DIRECTION_TYPE:
                  summary: Direction is not a string
                  description: >-
                    A JSON object, array, number or boolean in direction is
                    rejected while decoding the body, before any other
                    validation.
                  value:
                    code: INVALID_PARAMETERS
                    messages:
                      - The field 'direction' must be a string.
                DIRECTION_UNSUPPORTED_PROVIDER:
                  summary: Recipient-to-platform with a provider other than STRIPE
                  description: >-
                    Rejected before the account enablement check. Match on code;
                    the message text can differ between releases.
                  value:
                    code: INVALID_PARAMETERS
                    messages:
                      - Invalid transfer parameters
                DIRECTION_NOT_ENABLED:
                  summary: Direction not enabled for this account
                  value:
                    code: DIRECTION_NOT_ENABLED
                    messages:
                      - Transfer direction is not enabled for this account
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              examples:
                RECIPIENT_NOT_FOUND:
                  summary: Recipient not found
                  value:
                    code: RECIPIENT_NOT_FOUND
                    messages:
                      - The specified recipient was not found.
        '502':
          description: 网关错误
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              examples:
                PROVIDER_INTERNAL_ERROR:
                  summary: Provider internal error
                  value:
                    code: PROVIDER_INTERNAL_ERROR
                    messages:
                      - The payment provider encountered an internal error.
components:
  schemas:
    Amount:
      type: object
      required:
        - value
        - currency
      properties:
        value:
          type: number
          example: 150
        currency:
          type: string
          example: USD
    Metadata:
      type: array
      items:
        type: object
        properties:
          key:
            type: string
          value:
            type: string
    Transfer:
      type: object
      properties:
        id:
          type: string
          example: TRF_7kB2mQ9xPnL4vR
        direction:
          type: string
          enum:
            - PLATFORM_TO_RECIPIENT
            - RECIPIENT_TO_PLATFORM
          description: 转账创建时保存的不可变方向。现有转账返回 PLATFORM_TO_RECIPIENT。创建后无法更改。
          example: PLATFORM_TO_RECIPIENT
        recipient_id:
          type: string
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        amount:
          $ref: '#/components/schemas/Amount'
        status:
          type: string
          example: SUCCEEDED
        reason:
          type: string
          example: ORDER_CANCELLED
        description:
          type: string
          example: Weekly marketplace earnings
        merchant_reference:
          type: string
          example: TRANSFER-2026-02-15-001
        metadata:
          $ref: '#/components/schemas/Metadata'
        provider_data:
          $ref: '#/components/schemas/ProviderData'
        created_at:
          type: string
          format: date-time
          example: '2026-02-16T10:30:00Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-02-16T10:30:15Z'
        completed_at:
          type: string
          format: date-time
          example: '2026-02-16T10:30:15Z'
        provider:
          type:
            - string
            - 'null'
          example: null
        transactions:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                example: 9eee65d1-6c3a-4076-9ef9-fa4bff73d597
              type:
                type: string
                example: SPLIT_TRANSFER
              status:
                type: string
                example: ERROR
              provider_transfer_id:
                type: string
                example: tr_1T9PTLIiMnPsFcbbFKyh1Nds
              provider_response_message:
                type: string
                example: ...
              provider_raw_response:
                type: string
                example: '{.... }'
              parent_transaction_code:
                type: string
                description: SPLIT_TRANSFER_REVERSE 交易所撤回的原始交易的代码。在原始交易上不存在。
                example: cb5fd244-90fd-49b0-a160-a9d9f764eb9e
              reason:
                type: string
                description: 撤回请求中给出的原因。出现在 SPLIT_TRANSFER_REVERSE 交易上。
                example: ORDER_CANCELLED
              created_at:
                type: string
                format: date-time
                example: '2026-03-10T13:39:19.342902Z'
              updated_at:
                type: string
                format: date-time
                example: '2026-03-10T13:39:19.342914Z'
    ProviderData:
      type: object
      properties:
        id:
          type: string
          example: adyen
        recipient_id:
          type: string
          example: SE322KT223222B5CM82WL9TB
        transfer_id:
          type: string
          example: TRF_8535296827453920
        response_code:
          type: string
          example: '000'
        response_message:
          type: string
          example: Transfer completed
  securitySchemes:
    public_api_key:
      type: apiKey
      in: header
      name: PUBLIC-API-KEY
    private_secret_key:
      type: apiKey
      in: header
      name: PRIVATE-SECRET-KEY

````

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