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

# Connect your app to Kustom

> Connect your app to Kustom to accept payments with your merchant account, test checkout in Playground, manage captures and refunds, and review payouts.

[Kustom](https://www.kustom.co/) is a checkout service for accepting payments with cards, invoices, and local payment methods. The Kustom connector lets your Lovable app take payments through your own Kustom merchant account. It's designed for apps that already have orders and need checkout and payment management.

Kustom is available as an [app + chat connector](https://docs.lovable.dev/integrations/app-connectors.md): one shared connection that works in [Chats](https://docs.lovable.dev/features/chats.md), in the project chat while you build, and in your published apps.

With Kustom, your app can:

* Send customers to a hosted payment page to pay for an order
* Capture authorized payments, meaning collect the amount approved at checkout
* Issue refunds after capture and cancel orders before capture
* Read payouts for a finance dashboard
* Show payment methods and express checkout buttons with **Kustom Elements**

## Common use cases and example apps

These examples show what you can build with Kustom, each with a prompt to start from.

| Example app | Example prompt | Description |
| :- | :- | :- |
| Order checkout | *Use Kustom and build a checkout for the orders in my app, with a confirmation page after payment.* | **Accept payments for existing orders.** The app sends customers to Kustom's hosted payment page and checks the order status before confirming payment. |
| Fulfillment dashboard | *Use Kustom and build an admin page where my team can capture payment when an order is ready to ship.* | **Collect authorized payments when you fulfill an order.** The app captures the payment for the selected order and records the result. |
| Returns dashboard | *Use Kustom and build a returns page where my support team can issue a full or partial refund for an order.* | **Manage refunds from your support workflow.** The app submits the refund and records the refunded amount against the order. |
| Payout dashboard | *Use Kustom and build a finance dashboard that lists our payouts.* | **Review payouts alongside your app's sales data.** The app reads payouts from your Kustom merchant account. |
| Payment method display | *Use Kustom and build a payment method display on my existing product pages.* | **Show payment options before checkout.** The app uses **Kustom Elements** to display the methods configured for your merchant account and market. |

## How to connect Kustom

Who can create Kustom connections depends on your plan and workspace settings. App + chat connectors are available by default. On Business and Enterprise plans, [Who can create connections and clients](https://docs.lovable.dev/integrations/admin-controls.md#who-can-create-connections-and-clients) starts at **Admins**. Some Enterprise workspaces start at **No one**, which disables the connector. An admin or owner changes it in **Connectors → Admin settings → App + chat connectors**.

You can create multiple Kustom connections using different merchant credentials, including separate connections for testing and real payments.

When the connection is created, you can [link it to the projects](https://docs.lovable.dev/integrations/app-connectors.md#link-a-connection-to-a-project) where you want to use it. Anyone building in a project can ask Lovable in the project chat to link their project to it. Linking follows the connection's access rules.

### Prerequisites

Before connecting Kustom, make sure you have:

* A Kustom account for the environment you want to connect, with access to API credentials in the Kustom Portal
* Permission to **create connections** in your Lovable workspace (see [Who can create connections and clients](https://docs.lovable.dev/integrations/admin-controls.md#who-can-create-connections-and-clients))

> [!NOTE]
>
> Payment processing fees are billed directly by Kustom, not Lovable, under your [merchant agreement](https://www.kustom.co/legal/general-terms-and-conditions).

### Step 1: Get your Kustom API credentials

Kustom uses an API username and password for your merchant account. Your Kustom Portal login and your Merchant ID are different from these credentials.

**1. Open the Kustom Portal for your environment**

Sign in to the portal for the environment you want to connect:

* [Playground Portal](https://portal.playground.kustom.co/): test checkout without charging real money.
* [Production Portal](https://portal.kustom.co/): take real payments. Lovable labels this environment **Live**.

Each environment has separate accounts and credentials. If you need a test account, follow [Kustom's Playground setup guide](https://docs.kustom.co/api/authentication/).

**2. Generate credentials**

Open **Developers → API** and check that the selected merchant account is the one you want your app to use. Click **Generate new**.

If you cannot access the API settings, ask your Kustom account admin to provide credentials or update your access.

**3. Save the username and password**

Copy **Key ID** as your API username and **Password** as your API password. Kustom shows the password only when you generate it, so save both values securely before leaving the page.

The password starts with `kco_test_api_` for Playground or `kco_live_api_` for Live. You now have the credential pair for the next step.

> [!WARNING]
>
> Keep your API password private. Enter it in the connection form, not in the project chat or your app's public code.

For more information, see [Kustom's authentication guide](https://docs.kustom.co/api/authentication/).

### Step 2: Connect Kustom to Lovable

Create the connection with the credential pair from Step 1.

**1. Open Kustom in Connectors**

Open [Connectors](https://lovable.dev/dashboard?connectors) and select **Kustom**. For the other places to open the catalog from, see [Where to find connectors](https://docs.lovable.dev/integrations/introduction#where-to-find-connectors).

**2. Add a connection**

Click **Connect** on the connector page. The form is split into collapsible sections, **Details**, **Configure connection**, and **Sharing**.

**3. Name the connection**

Under **Details**, Lovable fills in a name for the connection, which you can change. The name is only used inside Lovable to identify the connection.

**4. Configure the connection**

Under **Configure connection**, complete these required fields:

1. **Environment**: choose **Playground**, the default, for test payments, or **Live** for real payments.
2. **API username**: paste the **Key ID** from the matching Kustom Portal.
3. **API password**: paste the password generated with that Key ID.

The credentials must belong to the selected environment. You cannot change a connection's environment after creation. Create another connection to use a different environment.

**5. Choose who can use this connection**

Under **Sharing**, the connection is private to you by default and shows a **Private** label. To share it, click **Share with others**. Then add workspace members by email, or click **Invite entire workspace** to make the connection available to everyone in your Lovable workspace.

See [Who can use connections and clients](https://docs.lovable.dev/integrations/admin-controls.md#who-can-use-connections-and-clients) for more information.

**6. Connect**

Click **Connect** at the bottom of the form. Lovable checks the credentials with Kustom and confirms when the connection is created.

If Kustom rejects the credentials, the form shows an error under **Configure connection**. Check that both credentials match the selected environment and try again.

When connected, anyone building in a project can ask Lovable in the project chat to link their project to Kustom. Linking follows the connection's access rules. Your Lovable apps can then take payments and manage orders through your merchant account.

## Test checkout and accept real payments

Kustom separates test payments in **Playground** from real payments in **Live**. Link at most one Playground connection and one Live connection to each project, because your app uses only one connection per environment.

> [!WARNING]
>
> With only a Live connection linked, checkout takes real payments in both the preview and the published app. With only Playground linked, both use test payments.

**1. Build and test with Playground**

Create a **Playground** connection using the setup steps above and link it to your project. Ask Lovable to add Kustom checkout to your existing order flow.

Complete a test checkout using [Kustom's test data](https://docs.kustom.co/basics/test-data/). Check that your app confirms the order and that the order appears in the Playground Portal.

**2. Add a Live connection**

Repeat the setup with credentials from the Production Portal and select **Live**. Ask Lovable in the project chat to link the Live connection to the same project.

Keep the Playground connection linked for testing. With both connections linked, the preview uses Playground and the published app uses Live.

Tell Lovable when your app should capture payments, such as immediately after checkout or when an order ships. An authorized order is not paid out until the payment is captured.

Capture before the authorization expires, by default after about 28 days. If fulfillment takes longer, contact Kustom about your account's configured authorization period. See [Kustom's order management guide](https://docs.kustom.co/order-management/) for details.

## Add payment displays and express buttons

**Kustom Elements** adds payment method displays and express checkout buttons to existing product or cart pages.

If you have never opened **Elements** in the Kustom Portal for your environment, open it once before you ask Lovable. See [Kustom's Elements setup guide](https://docs.kustom.co/checkout/surfaces/elements/) for more information.

Ask Lovable to add the elements you need. Lovable registers the addresses where your app runs with Kustom, including previews and custom domains.

For example:

```text wrap theme={null}
Use Kustom and add a payment method display to my existing product pages. Configure it for my app's preview and published addresses.
```

Express buttons also require **Shipping Assistant** on your merchant account. See [Kustom's express button setup](https://docs.kustom.co/checkout/surfaces/express-buttons/) for the requirements.

Apple Pay and Google Pay buttons may not appear in the preview inside the editor. To test them, open the preview in its own tab, in a browser that supports the wallet.

## Limitations

The Kustom connector cannot let each app user connect a separate Kustom merchant account. Your app takes payments through the merchant account on its linked connection.

## Manage your Kustom connection

Connections are managed from [**Connectors**](https://lovable.dev/dashboard?connectors): select **Kustom**, then open the connection.

* **Unlink projects** to remove Kustom access from specific projects while keeping the connection available for others. See [Unlink projects from a connection](https://docs.lovable.dev/integrations/app-connectors.md#unlink-projects-from-a-connection) for the steps.
* **Delete the connection** to remove it from the workspace entirely. Deleting is permanent. It removes the credentials from all linked projects, and app features that use Kustom stop working until a new connection is added. See [Delete a connection](https://docs.lovable.dev/integrations/app-connectors.md#delete-a-connection) for the steps and who can delete.
