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

# How it works

> Charge with any compatible PSP from Brain Studio—without waiting for a dedicated integration.

If the payment gateway you need for your project **isn't** among Jelou's [native payment integrations](https://docs.jelou.ai/en/guides/integrations/payments/providers.md), you can set it up yourself as a **custom gateway**.

You'll need your **PSP's technical documentation** and its **API keys or tokens** (same as BYOK, but you define which keys your provider requires). With that, you describe the integration once in **Payments** and charge from the **Payment** node in Brain Studio, using the [embedded WebView](https://docs.jelou.ai/en/guides/integrations/payments/experiences/checkout-webview.md) experience.

## Integration summary

> [tab] What it is
>
> * Configured from **Payments → Integrations** with the **Add gateway** button
>
> * Available in Brain Studio's **Payment** node once it's active
>
> * No backend code required for each new provider
>
> > [!NOTE]
> >
> > You configure the gateway in **Payments**. Then you select it in the **Payment** node in Brain Studio to charge inside the flow.

> [tab] Experience
>
> * **Embedded WebView:** Yes
>
> * **Native in chat:** No
>
> * **External confirmation:** No
>
> > [!NOTE]
> >
> > The user completes the payment inside the PSP checkout in WebView.
> > Capture and processing of sensitive data happen on the provider's infrastructure.

> [tab] Requirements
>
> Your PSP must be able to:
>
> * Create a charge with a **single HTTP call** (GET, POST, PUT, or PATCH)
> * Expose an endpoint on a **public URL**
> * Respond in **JSON** with a **transaction id** and a **checkout URL (paylink)**
> * Authenticate with **static headers** (Bearer, API key, Basic, etc.)
>
> If it also reports the outcome via **webhook** or allows a **status check**, Jelou can confirm the payment automatically. Without either, you can still send the paylink, but confirmation is limited.
>
> > [!WARNING]
> >
> > It does not support recurring payments, cancelling the order from Jelou, card tokenization, or embedded checkout with the PSP's SDK.

## Compatibility assistant

Before you set up the wizard, use this **prompt with your LLM** (ChatGPT, Claude, Cursor, or another). Copy it from the docs, paste it as instructions, and **add your PSP's technical documentation** (URL, PDF, or text). The model tells you if it's compatible and what to fill in each setup step.

**1. Copy the prompt**

> [card] [View and copy the prompt](https://docs.jelou.ai/en/guides/integrations/payments/custom/compatibility-prompt.md)
>
> Open it in the docs and copy it with the code block button.

**2. Paste it into your LLM**

Use it as the assistant's instructions (system prompt or first message).

**3. Attach the PSP documentation**

Share the **URL**, **PDF**, or **text** of your provider's API docs. Without that, the assistant can't evaluate compatibility.

**4. Ask for the verdict**

Request the verdict and field-by-field wizard mapping. Use it as the base when you [create the gateway](https://docs.jelou.ai/en/guides/integrations/payments/custom/create-gateway.md).

> [!NOTE]
>
> If your PSP fails the checklist (for example OAuth with refresh, SOAP/XML, or a mandatory multi-step flow), email [marketplace@jelou.ai](mailto:marketplace@jelou.ai) to explore a dedicated integration or other options.

## When to use it

* Your PSP **isn't** in the [native integrations](https://docs.jelou.ai/en/guides/integrations/payments/providers.md) and you can't (or don't want to) wait for a dedicated integration.
* You want to charge in conversation with [embedded WebView](https://docs.jelou.ai/en/guides/integrations/payments/experiences/checkout-webview.md) using that provider's checkout.
* Your technical team can describe the PSP's API (charge creation + keys) and you configure it in the wizard.

## How it works

![Integrations screen under Payments, with the Add gateway button highlighted in the top-right corner](https://mintcdn.com/jelouai/R4qL5d7Hj6fxJl87/assets/images/integraciones/pagos/personalizadas/agregar-pasarela.png?fit=max\&auto=format\&n=R4qL5d7Hj6fxJl87\&q=85\&s=084e1a0af66f85adf212ef2919cbc27a)

From Payments → Integrations, the "Add gateway" button opens the setup wizard.

**1. Describe the integration**

From **Payments**, an admin completes the wizard: credentials, request, webhook, and return.

**2. Jelou stores the configuration**

The gateway is tied to your company and ready to test or edit from Integrations.

**3. Use it in Brain Studio**

When the gateway is **active**, select it in the **Payment** node to charge inside the conversation.

## Jelou payment page

Some PSPs don't send the customer back to the conversation once they finish paying: the checkout stays open and the customer doesn't know how to return. That's why Jelou shows its own **payment page** before the PSP checkout. The message button opens that page instead of the PSP link, and Jelou takes care of the way back and of how long the link stays valid.

> [tab] Your PSP redirects the customer
>
> If your gateway's request uses `{{returnUrl}}`, the page takes the customer straight to the PSP checkout, with no extra steps. When they finish, the PSP sends them back as usual.

> [tab] Your PSP doesn't redirect
>
> The page shows the amount and the **Empezar el pago** button, which opens the PSP checkout in a new window. While the customer pays, the page follows the order status. Once the webhook confirms the payment, it closes the PSP window and takes the customer back to WhatsApp.

The link stays valid for the **Timeout** set in the **Payment** node, up to 30 minutes, regardless of how long the PSP keeps it valid. After that, the page shows that the link expired. If the payment was already confirmed, it shows the result or takes the customer back to the conversation.

> [!NOTE]
>
> In WhatsApp for Android, the PSP checkout opens in a window the page can't close. There, the page tells the customer to close the payment window to get back to the conversation. The payment result still reaches the flow through the webhook.

## Before you start

Get this ready before you open the wizard:

* Your **PSP's technical documentation** (charge-creation endpoint, authentication, request/response shape, webhook if any).
* The PSP's **API keys or tokens**: **test / sandbox** keys first, then **production** keys.
* Start by creating the gateway in **Sandbox**, connect it with test keys, and [validate the checkout](https://docs.jelou.ai/en/guides/integrations/payments/custom/test-gateway.md). Only then move to **Production** with real keys.

> [!NOTE]
>
> Same BYOK model as the catalog: the keys are yours. Here you also define *which* keys the wizard declares and *where* they are used (almost always in request headers, for example `Authorization: Bearer {{apiKey}}`).

## Next steps

**1. Create the gateway**

Walk through the 6-step wizard to set up your PSP.

> [card] [Create a custom gateway](https://docs.jelou.ai/en/guides/integrations/payments/custom/create-gateway.md)
>
> Configure credentials, request, webhook, and return.

**2. Review variables**

Check the placeholders you can inject into the request to the PSP.

> [card] [Variables and placeholders](https://docs.jelou.ai/en/guides/integrations/payments/custom/variables-and-placeholders.md)
>
> Reference for amount, customer, order, return, and more.

**3. Test before publishing**

Validate the full flow against the PSP's sandbox.

> [card] [Test the gateway](https://docs.jelou.ai/en/guides/integrations/payments/custom/test-gateway.md)
>
> Generate a test paylink and review the production checklist.

**4. Use it in Brain Studio**

Configure the Payment node to charge with your active gateway.

> [card] [Use in Brain Studio](https://docs.jelou.ai/en/guides/integrations/payments/custom/use-in-brain-studio.md)
>
> Node fields, outputs, and use cases.


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