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

# 已拒绝支付挽回呼叫

> 批量发起 AI 呼叫和 WhatsApp 消息，挽回支付被拒绝的客户

此 endpoint 用于大规模发起与已拒绝支付相关的呼叫和 WhatsApp 消息处理。要使用此 endpoint，您必须提供一个包含已拒绝支付详细信息的对象。

每个请求都发送一个唯一的 `X-Idempotency-Key` 标头，以确保重试的请求只被处理一次。


## OpenAPI

````yaml openapi/zh-hans/ai-caller/declined-payment-calls.json POST /smart-support/external/payments/recover
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/recover:
    post:
      tags:
        - AI Caller
      summary: 已拒绝支付挽回呼叫
      operationId: declined-payment-calls
      parameters:
        - name: X-Idempotency-Key
          in: header
          description: 在 HTTP 标头中使用的唯一标识符，用于确保请求只被处理一次，即使因网络问题或超时而重试。
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - settings
              properties:
                settings:
                  type: object
                  description: AI 代理配置
                  required:
                    - contact_details
                  properties:
                    contact_details:
                      type: object
                      description: 包含联系方式的对象
                      required:
                        - channel
                      properties:
                        channel:
                          type: string
                          enum:
                            - PHONE_CALL
                            - WHATSAPP_MESSAGE
                          description: |+
                            可用联系渠道的列表。

                          example: WHATSAPP_MESSAGE
                        initial_template_message:
                          type: object
                          description: >-
                            当 `channel = WHATSAPP_MESSAGE`
                            时必填。`WHATSAPP_MESSAGE` 的初始模板消息配置。
                          properties:
                            id:
                              type: string
                              description: Yuno 模板 ID
                              example: HX8e7ac569f40a064c71a37e5d672bb9123
                            variables:
                              type: object
                              description: 包含模板变量的对象
                              example:
                                name: Maria
                                amount: $10.0000
                        pdf_template:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Yuno PDF 模板 ID
                            variables:
                              type: object
                              description: 包含 PDF 模板变量的对象
                              example:
                                seller_name: RAPPI
                                merchant_order_id: MX_Verification_50708779
                          description: WHATSAPP_MESSAGE 的 PDF 模板配置。
                        payment_methods:
                          type: object
                          description: 可向付款客户提供的支付方式
                          properties:
                            available:
                              type: array
                              description: 可作为替代方案提供给用户以完成支付的可用支付方式列表。
                              items:
                                type: string
                              example:
                                - MERCADO_PAGO
                                - NEQUI
                                - CREDIT_CARD
                          required:
                            - available
                additional_information:
                  type: object
                  description: 提供给 AI 以改善上下文的所有相关信息。
                  properties:
                    seller_details:
                      type: object
                      description: 包含商户联系信息的对象，在代理无法回答咨询时使用。
                      properties:
                        name:
                          type: string
                          description: 商户名称，AI 用它进行自我介绍。
                          minLength: 3
                          maxLength: 255
                          example: RAPPI
                        fallback_instructions:
                          type: string
                          description: 当 AI 无法解决问题时，向用户说明如何联系客户支持的指引。
                          minLength: 3
                          maxLength: 255
                          example: >-
                            Go to the application and click on the top right
                            corner to contact a customer support agent.
                        redirection_url:
                          type: string
                          description: 将客户重定向以获取更多支持的 URL。
                          example: www.test.com/purchase
                    payment:
                      type: object
                      description: 已拒绝支付的信息
                      properties:
                        account_id:
                          type: string
                          description: 账户的唯一标识符。
                          minLength: 36
                          maxLength: 64
                          example: e4c03f29-b0f6-403a-8814-9aee1a88d60e
                        id:
                          type: string
                          description: 支付的唯一标识符。
                          minLength: 3
                          maxLength: 64
                          example: f1fbad16-93c1-4335-b735-2b01ec94ea9e
                        merchant_order_id:
                          type: string
                          description: 订单标识。
                          minLength: 3
                          maxLength: 255
                          example: ORDER-12345
                        country:
                          type: string
                          description: 处理该支付的国家/地区（ISO 3166-1）。
                          minLength: 2
                          maxLength: 2
                          example: US
                        description:
                          type: string
                          description: 用户尝试购买的产品或服务的描述。
                          minLength: 3
                          maxLength: 1000
                          example: Online store purchase
                        created_at:
                          type: string
                          format: date-time
                          description: 支付发生时的时间戳（ISO 8601）。
                          minLength: 27
                          maxLength: 27
                          example: '2022-05-09T20:46:54.786342Z'
                        declined_reason:
                          type: string
                          description: 支付服务提供商给出的该支付的拒绝原因。
                          minLength: 3
                          maxLength: 255
                          example: insufficient funds
                        payment_method:
                          type: object
                          properties:
                            type:
                              type: string
                              description: 客户所选支付方式的类型。
                              minLength: 3
                              maxLength: 255
                              example: Credit Card
                            detail:
                              type: object
                              properties:
                                card_data:
                                  type: object
                                  properties:
                                    expiration_month:
                                      type: number
                                      description: 卡有效期月份，格式 MM
                                      minimum: 1
                                      maximum: 12
                                      example: 12
                                    expiration_year:
                                      type: number
                                      description: 卡有效期年份，格式 YYYY
                                      minimum: 2024
                                      maximum: 9999
                                      example: 2030
                                    iin:
                                      type: string
                                      description: 发卡机构标识号（IIN）是指金融机构发行的支付卡卡号的前几位数字。
                                      minLength: 6
                                      maxLength: 8
                                      example: '411111'
                                    lfd:
                                      type: string
                                      description: 卡号后四位。
                                      minLength: 4
                                      maxLength: 4
                                      example: '1234'
                                    issuer:
                                      type: string
                                      description: 发卡机构。
                                      minLength: 3
                                      maxLength: 255
                                      example: CHASE
                                    type:
                                      type: string
                                      description: 卡的发卡机构类型。
                                      enum:
                                        - CREDIT
                                        - DEBIT
                                        - PREPAID
                                      minLength: 3
                                      maxLength: 255
                                      example: CREDIT
                        amount:
                          type: object
                          properties:
                            value:
                              type: number
                              description: 被拒绝的支付金额。
                              example: 149.99
                            currency:
                              type: string
                              description: 被拒绝的支付的币种（ISO 4217）。
                              minLength: 3
                              maxLength: 3
                              example: USD
                        customer_payer:
                          type: object
                          properties:
                            first_name:
                              type: string
                              description: 客户的名。
                              minLength: 3
                              maxLength: 255
                              example: John
                            last_name:
                              type: string
                              description: 客户的姓。
                              minLength: 3
                              maxLength: 255
                              example: Doe
                            phone:
                              type: object
                              properties:
                                country_code:
                                  type: string
                                  description: 付款客户的手机区号。
                                  minLength: 2
                                  maxLength: 3
                                  example: '1'
                                number:
                                  type: string
                                  description: 付款客户的手机号码。
                                  minLength: 1
                                  maxLength: 32
                                  example: '5551234567'
            examples:
              Request Example:
                summary: Request Example
                value:
                  settings:
                    contact_details:
                      channel: PHONE_CALL
                      initial_template_message:
                        id: HX8e7ac569f40a064c71a37e5d672bb9123
                        variables:
                          name: Maria
                          amount: $10.0000
                      pdf_template:
                        id: ede0d2da-138d-441b-8101-85e2d21af8b9
                        variables:
                          seller_name: RAPPI
                          merchant_order_id: MX_Verification_50708779
                      payment_methods:
                        available:
                          - MERCADO_PAGO
                          - NEQUI
                  additional_information:
                    seller_details:
                      name: RAPPI
                      fallback_instructions: >-
                        Go to the application and click on the top right corner
                        to contact a customer support agent.
                      redirection_url: www.test.com/purchase
                    payment:
                      account_id: e4c03f29-b0f6-403a-8814-9aee1a88d60e
                      id: f1fbad16-93c1-4335-b735-2b01ec94ea9e
                      merchant_order_id: MX_Verification_50708779
                      country: CO
                      description: Purchase in McDonalds
                      created_at: '2022-05-09T20:46:54.786342Z'
                      declined_reason: insufficient funds
                      payment_method:
                        type: Credit Card
                        detail:
                          card_data:
                            iin: '636318'
                            lfd: '2671'
                            type: CREDIT
                            issuer: SCOTIABANK
                            expiration_year: 2030
                            expiration_month: 12
                      amount:
                        currency: COP
                        value: 27000
                      customer_payer:
                        first_name: Pepito
                        last_name: Perez
                        phone:
                          country_code: '57'
                          number: '3000000000'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: 7c3a9c6e-9bf0-4c2c-9f67-752b16ba5dd5
                  message:
                    type: string
                    example: Communication processed successfully
              examples:
                Success:
                  value:
                    id: 7c3a9c6e-9bf0-4c2c-9f67-752b16ba5dd5
                    message: Communication processed successfully
                  summary: Success
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Missing customer_payer.first_name required field
              examples:
                Bad Request:
                  value:
                    message: Missing customer_payer.first_name required field
                  summary: Bad Request
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Internal error
              examples:
                Internal Error:
                  value:
                    message: Internal error
                  summary: Internal Error
components:
  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.