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

# Payments with AI Agent

> Add a payment gateway's tools to the AI Agent node so the agent creates the payment link and checks its status during the conversation.

The **AI Agent** node can charge customers with the payment gateways you have installed: it creates the payment link inside the conversation and checks whether the customer has paid, without leaving the agent.

Unlike the payment node, where you build the charge in the flow, here the agent creates the order from what it discussed with the customer. You decide which values stay fixed and which ones the agent fills in.

![AI Agent node with the Tools tab open, the Stripe, Payphone and Wompi gateways added, and the settings of the Wompi payment link tool with the amount set to Static](https://mintcdn.com/jelouai/COkfMM80RSibEN2U/assets/images/integraciones/pagos/ai-agent-herramientas-pasarela.png?fit=max\&auto=format\&n=COkfMM80RSibEN2U\&q=85\&s=b790344a554454d34941e7d47fb8c197)

Wompi tools in the AI Agent node, with a fixed amount

***

## Before you start

The gateway must be **installed and connected**, with its VAT configured, either from the Marketplace or through assisted setup by the Jelou team. Check how your [provider](https://docs.jelou.ai/en/guides/integraciones/pagos/proveedores.md) is installed.

The agent uses the credentials of that installation. It never sees them, and you don't enter them again in the node.

Available gateways: **Wompi**, **Kushki**, **Nuvei**, **Mercado Pago**, **Payphone**, **DeUna**, **PayPal**, **Datafast**, **Stripe** and **Conekta**. Placetopay, Niubiz, Culqi and Jelou Pay don't have tools for the agent: to charge with them, use the payment node.

> [!WARNING]
>
> Stripe and Conekta only work with the merchant's own keys. If the installation uses Stripe Connect or Conekta Connect, charges from the AI Agent are rejected.

***

## Available tools

Each gateway comes with two tools. Their names include the gateway, so you can add several gateways to the same agent without mixing them up.

| Tool | What it does |
| - | - |
| **Create payment link `<gateway>`** | Creates the order and sends the customer the payment method: a link or a code, depending on the gateway. It returns the order number and the total to the agent. |
| **Check payment status `<gateway>`** | Checks whether an order was paid, is pending or failed, using the order number. |

> [!NOTE]
>
> The payment method doesn't go through the agent: the system sends it straight to the customer. The agent only receives the order number to use as a reference.

***

## Add the tools to the agent

**1. Open the node's tools**

In Canvas, open the **AI Agent** node and go to the **Tools** tab.

**2. Add the gateway**

Click **Add tool**, filter by **Marketplace** and pick the gateway. It shows up in the agent's tool list.

**3. Configure the charge tool**

Click the gateway's settings icon and open **Create payment link**. There you set how each parameter is filled in and the behavior after it runs.

To charge, use **Continue**: the agent gets the order number and keeps the conversation going to share it with the customer.

**4. Test the charge**

Test the conversation in the tester before publishing. Every charge creates a real order in the gateway, so use an installation in [test mode](https://docs.jelou.ai/en/guides/integrations/payments/test-mode.md) or with test credentials. Test mode allows up to 10 tests per configuration, and DeUna doesn't have it.

***

## Fix the amount and other values

Each parameter of **Create payment link** can be filled in two ways:

* **AI**: the agent takes it from the conversation.
* **Static**: the value is fixed. The agent doesn't ask for it and can't change it, even if the customer mentions a different amount in the chat.

Fix the amount and the concept when the price doesn't depend on the conversation, such as a fee or a flat-rate service.

| Parameter | What it is |
| - | - |
| `amount` | Amount before taxes, in the gateway's currency. |
| `concept` | What the customer is paying for. It appears on the order. |
| `tax_percentage` | VAT percentage (0 to 30). If you leave it empty or set it to 0, the installation's VAT is used. |
| `without_tax` | When `true`, the amount is the total and no VAT is added. |

> [!WARNING]
>
> `amount` is charged **plus VAT**. If you fix a price that already includes VAT, turn on `without_tax`; otherwise the customer pays the tax twice. To charge without VAT use `without_tax: true`: a `tax_percentage` of 0 doesn't remove the tax, because it falls back to the installation's VAT.

> [!TIP]
>
> Set `tax_percentage` and `without_tax` as **Static**. The customer shouldn't decide the tax on the charge.

The customer pays the amount plus VAT, unless `without_tax` is on. The agent gets that total in the tool's response.

***

## Customer data by gateway

Besides the amount and the concept, each gateway requires some payer data. The agent only asks for the data the gateway requires and it doesn't have yet. It sends the optional fields if the customer already shared them.

| Gateway | Required data | Optional data |
| - | - | - |
| **Wompi** | — | Email, first name, last name |
| **Kushki** | — | Email, first name, last name |
| **PayPal** | — | Email, first name, last name |
| **Stripe** | — | Email |
| **DeUna** | — | Email |
| **Mercado Pago** | Email | — |
| **Nuvei** | Email, first name, last name | — |
| **Payphone** | Email, first name, last name, phone | — |
| **Conekta** | Email, phone | — |
| **Datafast** | Email, first name, last name, ID number, phone | — |

> [!NOTE]
>
> On WhatsApp the phone number comes from the conversation, so the agent doesn't ask for it.

***

## What the customer sees

When the agent creates the charge, the customer gets the same payment message the payment node sends, with the **Proceed to payment** button. With a verified WhatsApp Business account, the [checkout](https://docs.jelou.ai/en/guides/integrations/payments/experiences/checkout-webview.md) opens as a WebView without leaving WhatsApp; if the account isn't verified, it opens in the device's browser.

Afterwards they can ask the agent whether their payment went through, and the agent checks it with **Check payment status**.

![Tester conversation where the customer receives the payment message with the Proceed to payment button, the agent shares the total and the order number, and then confirms the payment was successful](https://mintcdn.com/jelouai/COkfMM80RSibEN2U/assets/images/integraciones/pagos/ai-agent-cobro-chat.png?fit=max\&auto=format\&n=COkfMM80RSibEN2U\&q=85\&s=ef7dd3419965ea680a2d05625db29984)

Charge and payment confirmation, tested from the tester

> [!NOTE]
>
> The agent only checks orders created for the same contact, even from another conversation. That way the customer can come back another day to ask about their payment, but can't look up other contacts' orders.

***

## Current limits

* **Link expiration.** In Mercado Pago, Stripe, Conekta and DeUna the link expires after 30 minutes. In Kushki, the payment session lasts 15 minutes from when the link is opened. The other gateways have no common expiration; until the customer pays, the order stays pending.
* **Each charge is a new order.** If the agent creates another charge, a new order is created, even if there's a pending one.
* **There's no maximum amount.** If `amount` is in **AI** mode, the conversation sets the amount. When the price is known, keep it **Static**.

***

## Prompt recommendations

* **Confirm before charging.** Every call creates a real order. Tell the agent to show the concept and the amount and wait for the customer to confirm.
* **Check for a pending order.** Before creating another charge, the agent should check the status of the previous order.
* **Don't ask for what's fixed.** If the amount or the concept is static, avoid instructions like "confirm the amount with the customer": the agent can't change it.
* **Don't paste the link.** The customer already gets the payment message. The agent should only mention the order number.

***

## Troubleshooting

> [accordion] The agent asks for a value I already fixed
>
> Check that the parameter is set to **Static** in the tool and that the prompt doesn't ask the agent to confirm it with the customer.

> [accordion] The charge is rejected for the minimum amount
>
> Each gateway has a minimum amount per currency. If the total falls below it, the tool returns a message like "`<gateway>` no acepta cobros menores a `<minimum>` `<currency>`". Raise the amount or check the VAT applied.

> [accordion] Charges with Stripe or Conekta are rejected
>
> The installation uses Stripe Connect or Conekta Connect. Connect the gateway with the merchant's own keys.

> [accordion] The gateway rejects the customer's data
>
> Some gateways require email, first name, last name or phone. Check the [customer data by gateway](#customer-data-by-gateway) table and make sure the agent doesn't send empty values.

> [accordion] The agent says it couldn't create the charge
>
> Check the run in the debugger to see the actual message the tool returned.

***

## Next steps

> [card] [Payment providers](https://docs.jelou.ai/en/guides/integraciones/pagos/proveedores.md)
>
> How to install and connect each gateway.

> [card] [Test mode](https://docs.jelou.ai/en/guides/integrations/payments/test-mode.md)
>
> Try a gateway without your own credentials.

> [card] [Payment experiences](https://docs.jelou.ai/en/guides/integrations/payments/experiences/experience-types.md)
>
> Differences between checkout, native payment and external confirmation.

> [card] [Fees and costs](https://docs.jelou.ai/en/guides/integrations/payments/fees-and-costs.md)
>
> What each gateway charges per transaction.


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