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.

POST/smart-support/external/payments/recover

Body application/json

settingsobjectrequired

AI agent configuration

Show settings properties
contact_detailsobjectrequired

Object with the contact details

Show contact_details properties
channel"PHONE_CALL" | "WHATSAPP_MESSAGE"required

The list of possible contact channels.

initial_template_messageobject

Required if channel = WHATSAPP_MESSAGE. Initial template message configuration for WHATSAPP_MESSAGE.

Show initial_template_message properties
idstring

WHITELABEL template ID

variablesobject

Object with template’s variables

pdf_templateobject

PDF template configuration for WHATSAPP_MESSAGE.

Show pdf_template properties
idstring

WHITELABEL PDF template ID

variablesobject

Object with pdf template’s variables

payment_methodsobject

Available payment methods to offer the customer payer

Show payment_methods properties
availablestring[]required

The list of available payment methods to be offered to the user as alternatives to complete the payment.

additional_informationobject

All relevant information to feed to the AI to improve context.

Show additional_information properties
seller_detailsobject

Object containing the merchant’s contact information to be used if the agent is unable to answer the inquiry.

Show seller_details properties
namestring

The merchant’s name, used by the AI to introduce itself.

fallback_instructionsstring

Instruction to be provided to the user on how to contact customer support in case the AI cannot solve the issue.

redirection_urlstring

URL to redirect the customer for additional support.

paymentobject

Declined payment information

Show payment properties
account_idstring

The unique identifier of the account.

idstring

The unique identifier of the payment.

merchant_order_idstring

Identification of the Order.

countrystring

Country where the payment was processed (ISO 3166-1).

descriptionstring

The description of product or service the user tried to purchase.

created_atstring<date-time>

The timestamp of when the payment was made (ISO 8601).

declined_reasonstring

The declined reason for the payment provided by the payment provider.

payment_methodobject
Show payment_method properties
typestring

The type of payment method selected by the customer.

detailobject
Show detail properties
card_dataobject
Show card_data properties
expiration_monthnumber

Card’s expiration month - MM

expiration_yearnumber

Card’s expiration year - YYYY

iinstring

The Institution identification number (IIN) refers to the first few digits of a payment card number issued by a financial institution.

lfdstring

Last four digits of the card.

issuerstring

Card issuer.

type"CREDIT" | "DEBIT" | "PREPAID"

Card’s issuer type.

amountobject
Show amount properties
valuenumber

The amount of the payment that was declined.

currencystring

The currency of the payment that was declined (ISO 4217).

customer_payerobject
Show customer_payer properties
first_namestring

The customer’s first name.

last_namestring

The customer’s last name.

phoneobject
Show phone properties
country_codestring

Customer payer cell phone area code.

numberstring

Customer payer cell phone number.

Response

Success

idstring
messagestring

Bad Request

messagestring

Internal Server Error

messagestring
Request
curl -X POST "https://api-sandbox.whitelabel.com/v1/smart-support/external/payments/recover" \
  -H "Content-Type: application/json" \
  -H "public-api-key: <public-api-key>" \
  -H "private-secret-key: <private-secret-key>" \
  -d '{
  "settings": {
    "contact_details": {
      "channel": "WHATSAPP_MESSAGE",
      "initial_template_message": {
        "id": "HX8e7ac569f40a064c71a37e5d672bb9123",
        "variables": {
          "name": "Maria",
          "amount": "$10.0000"
        }
      },
      "pdf_template": {
        "id": "string",
        "variables": {
          "seller_name": "RAPPI",
          "merchant_order_id": "MX_Verification_50708779"
        }
      },
      "payment_methods": {
        "available": [
          "MERCADO_PAGO",
          "NEQUI",
          "CREDIT_CARD"
        ]
      }
    }
  },
  "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": "ORDER-12345",
      "country": "US",
      "description": "Online store purchase",
      "created_at": "2022-05-09T20:46:54.786342Z",
      "declined_reason": "insufficient funds",
      "payment_method": {
        "type": "Credit Card",
        "detail": {
          "card_data": {
            "expiration_month": 12,
            "expiration_year": 2030,
            "iin": "411111",
            "lfd": "1234",
            "issuer": "CHASE",
            "type": "CREDIT"
          }
        }
      },
      "amount": {
        "value": 149.99,
        "currency": "USD"
      },
      "customer_payer": {
        "first_name": "John",
        "last_name": "Doe",
        "phone": {
          "country_code": "1",
          "number": "5551234567"
        }
      }
    }
  }
}'
Response
{
  "id": "7c3a9c6e-9bf0-4c2c-9f67-752b16ba5dd5",
  "message": "Communication processed successfully"
}