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

# 针对放弃的用户流程发起挽回联系

> 通知 Yuno 的挽回代理联系在完成支付前放弃 checkout 的客户

> [!WARNING]
>
> 此 endpoint 尚未通过公共 API 提供。`POST /smart-support/external/payments` 目前返回 404。要针对已拒绝的支付发起挽回联系，请使用 [已拒绝支付挽回呼叫](https://docs.y.uno/zh-hans/reference/ai-caller/declined-payment-calls.md)。

此 endpoint 允许商户在用户完成支付前放弃购买流程时（例如在选择商品期间或发起 checkout 之后）通知 Yuno 的挽回代理（Recovery Agent）。提交的数据使 Yuno 能够通过电话或 WhatsApp 跟进该用户，促使其完成交易。

## 安全与合规

* **身份验证**：访问 API 需要在请求标头中提供有效的 API 密钥。

* **数据保护**：所有数据都必须通过 HTTPS 传输。Yuno 遵守相关的数据保护法规，包括 **GDPR** 和 **LGPD**。

* **数据使用**：提交的数据仅用于客户互动，存储时间不会超过必要的期限。

> [!NOTE]
>
> **用例示例**
>
> 一位名为 Jane Doe 的用户在某商户网站上将一副无线耳机加入购物车，但放弃了 checkout 流程。商户系统检测到这一情况，并将相关 payload 发送到 Yuno 的 Recovery Agent API。随后，Yuno 向 Jane 发送一条 WhatsApp 消息，提醒她购物车中留下的商品，并提供帮助以完成购买。


## OpenAPI

````yaml openapi/zh-hans/ai-caller/initiate-recovery-outreach-for-abandoned-user-flows.json POST /smart-support/external/payments
openapi: 3.0.0
info:
  title: AI Caller
  description: >-
    API for initiating large-scale processing of calls and WhatsApp messages
    related to declined payments and abandoned user flows.
  version: 1.0.0
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: []
tags:
  - name: AI Caller
    description: 与用户账户相关的操作
paths:
  /smart-support/external/payments:
    post:
      tags:
        - AI Caller
      summary: 针对放弃的用户流程发起挽回联系
      operationId: initiate-recovery-outreach-for-abandoned-user-flows
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecoveryOutreachRequest'
            examples:
              recoveryOutreachExample:
                summary: Example Recovery Outreach Request (USA)
                value:
                  customer:
                    full_name: Robert Johnson
                    phone_number: '+12125550103'
                    email: robert.johnson@example.com
                    country_code: US
                    language: en
                  session:
                    abandonment_timestamp: '2025-05-13T22:45:00Z'
                    flow_stage: cart_review
                    platform: ios
                    session_id: sess_def456uvw
                  cart:
                    total_value: 29.99
                    currency: USD
                    items:
                      - name: Bluetooth Speaker
                        sku: BSPEAKER-PRO
                        quantity: 1
                        price: 29.99
                  engagement:
                    preferred_channel: whatsapp
                    reason: user_abandoned_cart
                    metadata:
                      utm_campaign: summer_promo
                      last_clicked_button: Continue Shopping
      responses:
        '200':
          description: 已成功发起挽回联系。
        '400':
          description: 请求 payload 无效或验证错误。
        '401':
          description: 未授权：缺少 API 密钥或 API 密钥无效。
        '500':
          description: 内部服务器错误。
components:
  schemas:
    RecoveryOutreachRequest:
      type: object
      required:
        - customer
        - session
      properties:
        customer:
          $ref: '#/components/schemas/Customer'
        session:
          $ref: '#/components/schemas/Session'
        cart:
          $ref: '#/components/schemas/Cart'
        engagement:
          $ref: '#/components/schemas/Engagement'
    Customer:
      type: object
      required:
        - full_name
        - phone_number
        - country_code
      properties:
        full_name:
          type: string
          description: 客户的全名。
          example: Jane Doe
        phone_number:
          type: string
          description: 客户的手机号码，E.164 格式。
          example: '+573001234567'
        email:
          type: string
          format: email
          description: 客户的电子邮件地址。
          example: jane.doe@example.com
        country_code:
          type: string
          description: ISO 3166-1 alpha-2 国家/地区代码（例如 "CO"）。
          example: CO
        language:
          type: string
          description: 首选沟通语言（例如 "es"、"en"）。
          example: es
    Session:
      type: object
      required:
        - abandonment_timestamp
        - flow_stage
        - platform
      properties:
        abandonment_timestamp:
          type: string
          format: date-time
          description: 用户放弃流程时的时间戳。
          example: '2025-05-13T22:45:00Z'
        flow_stage:
          type: string
          description: 用户中途退出的阶段。
          enum:
            - product_selection
            - cart_review
            - checkout
            - payment
          example: checkout
        platform:
          type: string
          description: 用户的平台。
          enum:
            - web
            - ios
            - android
          example: web
        session_id:
          type: string
          description: 用户会话的唯一标识符。
          example: sess_abc123xyz
    Cart:
      type: object
      properties:
        total_value:
          type: number
          format: float
          description: 购物车的总金额。
          example: 149.99
        currency:
          type: string
          description: 币种代码（例如 "COP"）。
          example: COP
        items:
          type: array
          description: 购物车中的商品列表。
          items:
            $ref: '#/components/schemas/CartItem'
    Engagement:
      type: object
      properties:
        preferred_channel:
          type: string
          description: 首选沟通渠道。
          enum:
            - call
            - whatsapp
            - auto
          default: auto
          example: auto
        reason:
          type: string
          description: 放弃原因（如已知）。
          example: user_abandoned_checkout
        metadata:
          type: object
          description: 其他上下文信息（例如 UTM 参数、用户最近的操作）。
          example:
            utm_campaign: spring_sale
            last_clicked_button: Proceed to Payment
    CartItem:
      type: object
      properties:
        name:
          type: string
          description: 商品名称。
          example: Wireless Headphones
        sku:
          type: string
          description: 库存单位（SKU）标识符。
          example: WH-1000XM5
        quantity:
          type: integer
          description: 数量。
          example: 1
        price:
          type: number
          format: float
          description: 单价。
          example: 149.99
  securitySchemes:
    public_api_key:
      type: apiKey
      in: header
      name: public-api-key
      description: |
        示例：`<Your public-api-key>`
    private_secret_key:
      type: apiKey
      in: header
      name: private-secret-key
      description: |
        示例：`<Your private-secret-key>`      

````

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