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

# Komerza

> Accept Rust-skin payments on a Komerza store using your own Cloudflare Worker and Skinloop checkout.

The bridge runs in **your Cloudflare account**. Komerza fulfills an order
only after Skinloop confirms payment. Your Komerza and Cloudflare credentials
stay in your accounts; Skinloop does not receive or store them.

## Before you start

You'll need a **Cloudflare account**, a **GitHub account**, and a Komerza store
that supports **custom payment methods**.

## 1. Deploy the bridge

Click the button below, connect GitHub to Cloudflare, and enter these settings
when prompted:

| Setting | Where to find it | Store as |
| - | - | - |
| `SKINLOOP_API_KEY` | Skinloop **API Keys & Webhooks**; allow `checkout:create` and `checkout:read`, restricted to Rust | Cloudflare secret |
| `KOMERZA_API_KEY` | Komerza **Developers → API Keys**; use a key for your store | Cloudflare secret |
| `KOMERZA_STORE_ID` | Komerza **Settings → General → Store ID** | Cloudflare variable |
| `SHOP_URL` | Your customer-facing Komerza shop URL | Cloudflare variable |

Keep API keys in **Cloudflare secrets**, not GitHub or normal variables. Choose
**Create private Git repository** if Cloudflare asks. Leave the generated
project and resource names unchanged; their bindings are already configured.

[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/Skin-loop/skinloop-komerza-cloudflare)

## 2. Copy the Worker URL and approve it

In **Cloudflare → Workers & Pages → your Worker → Domains & Routes**, turn on
the **Production** `workers.dev` URL and copy it. Example:

```text theme={null}
https://komerza-skinloop-rust.your-account.workers.dev
```

![Turn on the production Worker URL in Cloudflare Domains & Routes](https://mintcdn.com/skinloop/3rTaXbBL9L3DJPrN/public/integrations/komerza/worker-production-domain.png?fit=max\&auto=format\&n=3rTaXbBL9L3DJPrN\&q=85\&s=051980e5a0fabea7b292a68e53447887)

In **Skinloop → Settings → Checkout Settings → Checkout Redirect Origins**, add
your Worker URL **without any path**. Use your own URL, not the example above.
Your Komerza shop can have a different domain.

![Approve the Worker URL in Skinloop Checkout Redirect Origins](https://mintcdn.com/skinloop/ItuLtQCZs1_eDEpE/public/integrations/komerza/checkout-redirect-origins.png?fit=max\&auto=format\&n=ItuLtQCZs1_eDEpE\&q=85\&s=a42c8f11a2dd8d76fe97c1f00ef35210)

Do not add `/pay`, `/return`, `/cancel`, or `/webhook/skinloop` to the
redirect origin.

## 3. Connect Skinloop's webhook

1. Open your Worker URL and copy its `webhookEndpoint`.
2. In **Skinloop → API Keys & Webhooks → Webhooks**, add that endpoint and
   subscribe to `payment.pending`, `payment.completed`, and
   `payment.reverted`.
3. Copy the signing secret Skinloop shows **once**. In **Cloudflare → Workers &
   Pages → your Worker → Settings → Variables and Secrets**, add it as a
   **Production Secret** named `SKINLOOP_WEBHOOK_SECRET_CURRENT`, then deploy.

![Add the Skinloop webhook signing secret in Cloudflare](https://mintcdn.com/skinloop/3rTaXbBL9L3DJPrN/public/integrations/komerza/webhook-secret-variable.png?fit=max\&auto=format\&n=3rTaXbBL9L3DJPrN\&q=85\&s=058b0dabe1d96632ce109d561e807c1c)

Never put the webhook signing secret in source code, a normal variable, or
Komerza settings. The Worker cannot process payments until it is added.

## 4. Add the Komerza payment method

In **Komerza → Settings → Payment Methods → Custom Payment Methods**, add a
**Redirect** method. Use your Worker URL followed by `/pay?ref={id}`.
Example (replace the domain with yours):

```text theme={null}
https://komerza-skinloop-rust.your-account.workers.dev/pay?ref={id}
```

Keep `{id}` exactly as written; Komerza fills in the unpaid order ID.

![Komerza custom payment method with the Worker redirect URL](https://mintcdn.com/skinloop/3rTaXbBL9L3DJPrN/public/integrations/komerza/custom-payment-redirect.png?fit=max\&auto=format\&n=3rTaXbBL9L3DJPrN\&q=85\&s=cada2d6bfce86959e7090b9c9d9cd34d)

[Download the Skinloop payment-method icon](https://docs.skinloop.io/public/integrations/komerza/payment-method-icon.png)

## 5. Test before enabling it for buyers

Create a low-value unpaid Rust order and select the new payment method.
Check that the customer reaches Skinloop checkout with the correct amount,
a cancelled checkout does not fulfill the order, and a completed payment
fulfills it **once**. Enable the method for buyers only after this test
succeeds.

### If checkout does not open

In **Cloudflare → Workers & Pages → your Worker → Observability → Logs**, find
the failed `/pay` request by its time. Send
[Skinloop support](mailto:support@skinloop.io) the time (including time zone),
HTTP status, and error shown to the buyer. If Cloudflare shows a **Ray ID**,
include it as a support reference. Hide order IDs, buyer details, and secrets
in any screenshot or log you share. Never send API keys or signing secrets.

If no logs appear, turn on Workers Logs in Cloudflare's **Observability**
settings. Do not retry an order if a payment may already be in progress;
contact support instead.

> [!WARNING]
>
> **Rust only.** A return page does not prove payment. The order and amount
> must match a payment confirmed by Skinloop.


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