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

# Declined Payment Calls

This endpoint allows you to initiate large-scale processing of calls and WhatsApp messages related to declined payments. To use the endpoint, you have to provide an object containing detailed information about the declined payment.


## OpenAPI

````yaml openapi/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: Production server
security:
  - public_api_key: []
    private_secret_key: []
tags:
  - name: AI Caller
    description: Operations related to user accounts
paths:
  /smart-support/external/payments/recover:
    post:
      tags:
        - AI Caller
      summary: Copy of Declined Payment Calls
      operationId: declined-payment-calls-1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - settings
              properties:
                settings:
                  type: object
                  description: AI agent configuration
                  required:
                    - contact_details
                  properties:
                    contact_details:
                      type: object
                      description: Object with the contact details
                      required:
                        - channel
                      properties:
                        channel:
                          type: string
                          enum:
                            - PHONE_CALL
                            - WHATSAPP_MESSAGE
                          description: |+
                            The list of possible contact channels.

                          example: WHATSAPP_MESSAGE
                        initial_template_message:
                          type: object
                          description: >-
                            Required if `channel = WHATSAPP_MESSAGE`. Initial
                            template message configuration for
                            `WHATSAPP_MESSAGE`.
                          properties:
                            id:
                              type: string
                              description: Yuno template ID
                              example: HX8e7ac569f40a064c71a37e5d672bb9123
                            variables:
                              type: object
                              description: Object with template's variables
                              example:
                                name: Maria
                                amount: $10.0000
                        pdf_template:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Yuno PDF template ID
                            variables:
                              type: object
                              description: Object with pdf template's variables
                              example:
                                seller_name: RAPPI
                                merchant_order_id: MX_Verification_50708779
                          description: PDF template configuration for WHATSAPP_MESSAGE.
                        payment_methods:
                          type: object
                          description: >-
                            Available payment methods to offer the customer
                            payer
                          properties:
                            available:
                              type: array
                              description: >-
                                The list of available payment methods to be
                                offered to the user as alternatives to complete
                                the payment.
                              items:
                                type: string
                              example:
                                - MERCADO_PAGO
                                - NEQUI
                                - CREDIT_CARD
                          required:
                            - available
                additional_information:
                  type: object
                  description: >-
                    All relevant information to feed to the AI to improve
                    context.
                  properties:
                    seller_details:
                      type: object
                      description: >-
                        Object containing the merchant's contact information to
                        be used if the agent is unable to answer the inquiry.
                      properties:
                        name:
                          type: string
                          description: >-
                            The merchant's name, used by the AI to introduce
                            itself.
                          minLength: 3
                          maxLength: 255
                          example: RAPPI
                        fallback_instructions:
                          type: string
                          description: >-
                            Instruction to be provided to the user on how to
                            contact customer support in case the AI cannot solve
                            the issue.
                          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 to redirect the customer for additional support.
                          example: www.test.com/purchase
                    payment:
                      type: object
                      description: Declined payment information
                      properties:
                        account_id:
                          type: string
                          description: The unique identifier of the account.
                          minLength: 36
                          maxLength: 64
                          example: e4c03f29-b0f6-403a-8814-9aee1a88d60e
                        id:
                          type: string
                          description: The unique identifier of the payment.
                          minLength: 3
                          maxLength: 64
                          example: f1fbad16-93c1-4335-b735-2b01ec94ea9e
                        merchant_order_id:
                          type: string
                          description: Identification of the Order.
                          minLength: 3
                          maxLength: 255
                          example: ORDER-12345
                        country:
                          type: string
                          description: >-
                            Country where the payment was processed (ISO
                            3166-1).
                          minLength: 2
                          maxLength: 2
                          example: US
                        description:
                          type: string
                          description: >-
                            The description of product or service the user tried
                            to purchase.
                          minLength: 3
                          maxLength: 1000
                          example: Online store purchase
                        created_at:
                          type: string
                          format: date-time
                          description: >-
                            The timestamp of when the payment was made (ISO
                            8601).
                          minLength: 27
                          maxLength: 27
                          example: '2022-05-09T20:46:54.786342Z'
                        declined_reason:
                          type: string
                          description: >-
                            The declined reason for the payment provided by the
                            payment provider.
                          minLength: 3
                          maxLength: 255
                          example: insufficient funds
                        payment_method:
                          type: object
                          properties:
                            type:
                              type: string
                              description: >-
                                The type of payment method selected by the
                                customer.
                              minLength: 3
                              maxLength: 255
                              example: Credit Card
                            detail:
                              type: object
                              properties:
                                card_data:
                                  type: object
                                  properties:
                                    expiration_month:
                                      type: number
                                      description: Card's expiration month - MM
                                      minimum: 1
                                      maximum: 12
                                      example: 12
                                    expiration_year:
                                      type: number
                                      description: Card's expiration year - YYYY
                                      minimum: 2024
                                      maximum: 9999
                                      example: 2030
                                    iin:
                                      type: string
                                      description: >-
                                        The Institution identification number
                                        (IIN) refers to the first few digits of
                                        a payment card number issued by a
                                        financial institution.
                                      minLength: 6
                                      maxLength: 8
                                      example: '411111'
                                    lfd:
                                      type: string
                                      description: Last four digits of the card.
                                      minLength: 4
                                      maxLength: 4
                                      example: '1234'
                                    issuer:
                                      type: string
                                      description: Card issuer.
                                      minLength: 3
                                      maxLength: 255
                                      example: CHASE
                                    type:
                                      type: string
                                      description: Card's issuer type.
                                      enum:
                                        - CREDIT
                                        - DEBIT
                                        - PREPAID
                                      minLength: 3
                                      maxLength: 255
                                      example: CREDIT
                        amount:
                          type: object
                          properties:
                            value:
                              type: number
                              description: The amount of the payment that was declined.
                              example: 149.99
                            currency:
                              type: string
                              description: >-
                                The currency of the payment that was declined
                                (ISO 4217).
                              minLength: 3
                              maxLength: 3
                              example: USD
                        customer_payer:
                          type: object
                          properties:
                            first_name:
                              type: string
                              description: The customer's first name.
                              minLength: 3
                              maxLength: 255
                              example: John
                            last_name:
                              type: string
                              description: The customer's last name.
                              minLength: 3
                              maxLength: 255
                              example: Doe
                            phone:
                              type: object
                              properties:
                                country_code:
                                  type: string
                                  description: Customer payer cell phone area code.
                                  minLength: 2
                                  maxLength: 3
                                  example: '1'
                                number:
                                  type: string
                                  description: Customer payer cell phone number.
                                  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: '3132450765'
      responses:
        '200':
          description: Success
          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: |
        Example: `<Your public-api-key>`
    private_secret_key:
      type: apiKey
      in: header
      name: private-secret-key
      description: |
        Example: `<Your private-secret-key>`      

````