# Take card, Apple Pay and Google Pay in Telegram bots and Discord stores

Source: https://caravelpay.app/guides/telegram-bot-and-discord-store-card-payments/ · Caravel Pay guides · By the Caravel Pay team · Published 2026-11-26 · Updated 2026-11-26

Accept Visa, Mastercard, Apple Pay and Google Pay inside Telegram shop bots, Discord communities and digital storefronts using Payment Links and POST /v1/checkouts.

You can accept Visa, Mastercard, Apple Pay and Google Pay inside a Telegram shop bot, a Discord paid-role server or an automated digital storefront and receive native USDC on Polygon in your own wallet — without a merchant account, bank underwriting or Stripe/PayPal freezes. For manual sales in DMs and pinned channels, generate a shareable [Caravel Pay payment link](https://caravelpay.app/link/) in seconds with nothing to install. For instant automated delivery — unlocking Discord roles, sending license keys or granting private Telegram group invites — create per-order checkouts with `POST /v1/checkouts` and fulfil orders from verified HMAC-SHA256 webhooks.

This guide covers all three bot and community integration patterns as of 26 November 2026, includes working Node.js code for Telegram and Discord fulfillment, and spells out the real small-ticket fee maths and buyer UX trade-offs.

## Three ways to take cards in Telegram and Discord

Pick the lightest pattern that matches how you deliver access or digital goods:

| Pattern | Best for | Setup effort | Automated delivery? | How you confirm payment |
|---|---|---|---|---|
| 1. No-key Payment Links ([/link/](https://caravelpay.app/link/)) | Manual DM sales, custom quotes, pinned tip jars, small channels | 30 seconds; no server, no website, no API keys | No (manual role/file delivery) | Watch USDC payouts arrive in your Polygon wallet |
| 2. Signed Payment Links (`POST /v1/payment-links`) | Fixed-price digital products or single-use ticket links you want to track or deactivate | 1 HTTPS endpoint + `POST /v1/connect` | Yes, via signed `callback_url` webhooks (checkout `order_id` starts with the link id) | HMAC-SHA256 webhook + `GET /v1/payment-links/{id}` |
| 3. Per-Order Checkouts (`POST /v1/checkouts`) | Telegram shop bots, automated Discord role bots, key dispensers and license portals | 1 HTTPS server + `POST /v1/connect` | **Yes — exact per-user binding** via your own unique `order_id` | Verified HMAC-SHA256 `checkout.paid` webhook + re-read `GET /v1/checkouts/{id}` |

All three patterns charge the same flat **2% Caravel fee** (covering Polygon payout gas, with no monthly or setup fee), support US dollars and 26 other currencies (EUR, GBP, CAD, AUD, NZD, SEK, NOK, DKK, CHF, PLN, CZK, HUF, RON, HKD, SGD, MXN, BRL, ZAR, ILS, INR, THB, MYR, PHP, TRY, JPY and KRW), and never require your buyers to install a crypto wallet.

## Pattern 1: Automated Telegram shop bot (Node.js)

Telegram's native payment buttons only support a fixed list of traditional processors, and Telegram Stars carry platform revenue shares and payout delays. Instead, your bot creates a Caravel Pay checkout on your server when a user taps **Buy**, sends an inline URL button pointing to `checkout_url`, and delivers the product automatically when the signed webhook confirms `paid`.

1. **Connect your bot's HTTPS domain once** with [`POST /v1/connect`](https://caravelpay.app/docs/connect) (sending `site_url` such as `https://bot.example`, your Polygon `payout_address`, and `"platform": "api"`). Store the returned `merchant_id` and `secret` in your server environment. Remember that `return_url`, `cancel_url` and `callback_url` must be HTTPS URLs on that `site_url`.
2. **Create a checkout when the user picks an item.** Save a pending row in your database mapping a unique `order_id` (for example `tg_849201_pro_1795561200`) to the user's Telegram `chat_id` and SKU, then reply with an inline keyboard button linking to `checkout.checkout_url`.
3. **Deliver only on verified `paid`.** When Caravel Pay posts `checkout.paid` to your webhook, verify `Caravel-Signature` against the raw bytes, deduplicate on `event.id`, re-read `GET /v1/checkouts/{id}` to confirm `status === "paid"`, and call Telegram's `sendMessage` or `createChatInviteLink` (with `member_limit: 1` for private channels).

*Telegram bot checkout + webhook fulfillment (Node.js 18+)*

```js
import crypto from "node:crypto";
import express from "express";

const app = express();
const MERCHANT = process.env.CARAVEL_MERCHANT;
const SECRET = process.env.CARAVEL_SECRET;
const TG_TOKEN = process.env.TELEGRAM_BOT_TOKEN;
const SITE = "https://bot.example";

function sign(ts, method, path, rawBody = "") {
  return crypto
    .createHmac("sha256", SECRET)
    .update(`${ts}\n${method}\n${path}\n${rawBody}`)
    .digest("hex");
}

async function caravel(method, path, payload) {
  const rawBody = payload ? JSON.stringify(payload) : "";
  const ts = String(Math.floor(Date.now() / 1000));
  const res = await fetch(`https://api.caravelpay.app${path}`, {
    method,
    headers: {
      ...(payload ? { "Content-Type": "application/json" } : {}),
      "Caravel-Merchant": MERCHANT,
      "Caravel-Timestamp": ts,
      "Caravel-Signature": sign(ts, method, path, rawBody),
    },
    ...(payload ? { body: rawBody } : {}),
  });
  const data = await res.json();
  if (!res.ok) throw new Error(`${data.error?.code || res.status}: ${data.error?.message || ""}`);
  return data;
}

// 1. Call this inside your Telegram /buy handler
export async function startTelegramOrder(chatId, sku, priceUsd) {
  const orderId = `tg_${chatId}_${sku}_${Date.now()}`;
  const checkout = await caravel("POST", "/v1/checkouts", {
    order_id: orderId,
    amount: priceUsd, // e.g. "49.00"
    currency: "USD",
    return_url: `${SITE}/paid`,
    cancel_url: `${SITE}/cancelled`,
    callback_url: `${SITE}/webhooks/caravel`,
  });
  await db.orders.insert({ orderId, checkoutId: checkout.id, chatId, sku, status: "pending" });
  return checkout.checkout_url; // Send in reply_markup.inline_keyboard URL button
}

// 2. Signed webhook endpoint: deliver key or single-use invite link on confirmed paid
app.post("/webhooks/caravel", express.raw({ type: "application/json" }), async (req, res) => {
  const ts = req.get("Caravel-Timestamp") ?? "";
  const sig = req.get("Caravel-Signature") ?? "";
  const expected = sign(ts, "POST", req.originalUrl, req.body.toString("utf8"));
  const fresh = /^\d+$/.test(ts) && Math.abs(Date.now() / 1000 - Number(ts)) <= 300;
  const valid = sig.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
  if (!fresh || !valid) return res.sendStatus(401);

  const event = JSON.parse(req.body.toString("utf8"));
  if (await db.events.has(event.id)) return res.sendStatus(200);

  const live = await caravel("GET", `/v1/checkouts/${event.data.id}`);
  const order = await db.orders.findByCheckoutId(live.id);
  if (order && live.status === "paid" && order.status !== "fulfilled") {
    const licenseKey = await db.keys.claimNext(order.sku, order.orderId);
    await db.orders.markFulfilled(order.orderId, live.payout.tx_hash);
    await fetch(`https://api.telegram.org/bot${TG_TOKEN}/sendMessage`, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        chat_id: order.chatId,
        text: `Payment confirmed. Your key: ${licenseKey}`,
      }),
    });
  } else if (order && (live.status === "underpaid" || live.status === "review")) {
    await db.orders.markHold(order.orderId, live.status, live.paid_amount);
  }
  await db.events.add(event.id);
  res.sendStatus(200);
});
```

You can also skip hand-rolling the HMAC code by using the zero-dependency [Caravel Pay Node.js SDK](https://caravelpay.app/docs/node-sdk) or [PHP SDK](https://caravelpay.app/docs/php-sdk).

## Pattern 2: Discord paid roles and automated ticket shops

Discord communities selling VIP access, private signals, game-server perks or downloadable tools follow the exact same server-side loop — replacing the Telegram delivery call with Discord's REST API:

1. **Member runs a slash command** (such as `/buy-pass`) or clicks a Discord Button inside a shop channel. Respond with an **ephemeral message** (visible only to that member) containing a Link Button pointing to `checkout.checkout_url`.
2. **Store `guild_id`, `user_id`, `role_id` and `expires_at`** alongside `order_id` and `checkout.id` in your database before sending the button.
3. **Grant the role from the webhook.** When `checkout.paid` arrives and `GET /v1/checkouts/{id}` confirms `paid`, send an authenticated Discord bot request to assign the role (and log the payout tx hash in a private staff audit channel):

*Assign a Discord role after verified checkout.paid*

```js
const roleRes = await fetch(
  `https://discord.com/api/v10/guilds/${order.guildId}/members/${order.discordUserId}/roles/${order.roleId}`,
  {
    method: "PUT",
    headers: {
      Authorization: `Bot ${process.env.DISCORD_BOT_TOKEN}`,
      "X-Audit-Log-Reason": `Caravel Pay ${live.id}`,
    },
  }
);
if (!roleRes.ok) throw new Error(`Discord role grant failed: ${roleRes.status}`);
```

**Handling timed memberships without stored cards:** Caravel Pay does not store cards or pull automatic monthly renewals. For 30-day, 90-day or 12-month Discord roles, store a `role_expires_at` timestamp in your database, have a daily cron job DM members 3 days before expiry with a fresh `POST /v1/checkouts` renewal button, and remove the role once the grace window passes. Selling quarterly or annual passes also lowers card-provider minimum fees dramatically.

## Pattern 3: Fast no-code Payment Links in DMs and pinned posts

If you sell custom artwork, coaching, private setups or occasional digital drops without running a bot server, you do not need any code or API keys:

- Open [caravelpay.app/link/](https://caravelpay.app/link/), paste your Polygon wallet (`0x…`), set a fixed price (in USD or any of 26 other currencies) or choose *Let the buyer choose* ($1.00–$2,500.00 USD), add an optional note up to 80 plain-text characters (no links or HTML), and share the `https://pay.caravelpay.app/l/lnk_…` URL in Telegram or Discord.
- **Single-use vs reusable:** keep *Reusable link* ticked for a pinned channel item or tip link; untick it for a one-off invoice so the link closes automatically after one paid checkout. Remember that unsigned links cannot be deactivated later — if you need to revoke links on demand or receive webhooks, create signed links through [`POST /v1/payment-links`](https://caravelpay.app/docs/payment-links).
- **Matching manual payments:** because unsigned links send no webhooks, ask the buyer to screenshot the confirmation screen or paste their checkout reference in your ticket channel, and match the USDC payout timestamp and amount in your Polygon wallet before unlocking access.

## Fees, small-ticket maths and buyer expectations

Caravel Pay charges one flat fee: the **2% Caravel fee** on the order total, covering Polygon payout gas, with $0 monthly fee and $0 setup fee. On a $100.00 order in default mode, your buyer pays $100.00 and most independent card providers keep their fee and exchange-rate spread before USDC arrives — about 3% is typical of recent card orders through Caravel Pay, leaving 97.00 USDC arriving and **95.00 USDC** in your Polygon wallet after the 2.00 USDC Caravel fee. Read 3% as an estimate, not a guarantee: it varies by card provider, payment method, buyer's country and order size (about 1 in 4 recent card orders arrived in full because the provider charged its fee on top, while a few routes keep up to about 8% to 10%).

> **Watch $5–$15 roles and keys.** Caravel Pay's minimum checkout is $1.00, but independent card providers often charge fixed minimum fees (published tariffs list up to $3.99 or €3.99 on some routes; see [on-ramp fees explained](https://caravelpay.app/guides/on-ramp-fees/)). On a $5.00 Discord role, a $3.00 provider minimum plus the 2% Caravel fee leaves too little margin — and if less than 85% of the checkout amount arrives, the checkout is marked `underpaid` rather than `paid`. For card checkout, price bundles, quarterly/annual passes or wallet credit packs at $25+ and keep direct Polygon USDC or crypto open for $5 micro-orders.

- **Fee modes:** pass `"fee_mode": "split"` (buyer covers card provider cut; you pay the 2% Caravel fee, receiving 98.00 USDC on $100) or `"fee_mode": "buyer"` (100.00 USDC on $100) only where local surcharge laws allow — the EU and UK restrict surcharges on most consumer cards ([fee modes](https://caravelpay.app/docs/payouts#fee-modes)).
- **Buyer UX inside in-app browsers:** Telegram and Discord mobile apps open links inside an in-app WebView where Apple Pay or card autofill can occasionally behave differently from Safari or Chrome. Add a short hint above your button ("Open in Safari/Chrome if Apple Pay doesn't appear") and note that an independent card provider handles card payments and may ask first-time buyers for email or quick ID verification (and first-time UK buyers face a [24-hour FCA cooling-off wait](https://caravelpay.app/guides/uk-buyers-24-hour-cooling-off-card-to-crypto/)).
- **Chargebacks, refunds and acceptable use:** payouts settle on-chain straight to your Polygon wallet with no merchant card-chargeback clawbacks from Caravel Pay — closing the common "buy a digital key, redeem it, file a PayPal dispute" loophole. Refunds are manual from your wallet ([USDC refunds guide](https://caravelpay.app/guides/refunds-when-paid-in-usdc/)). Everything sold through your bot or server must be strictly lawful and comply with the [acceptable use policy](https://caravelpay.app/acceptable-use/) (no stolen accounts, stolen data, malware, hacking services or scams).

## Frequently asked questions

### Can I take Apple Pay and Google Pay inside a Telegram bot without Stripe?

Yes. Your bot calls `POST /v1/checkouts` and sends the buyer an inline URL button to Caravel Pay's hosted checkout, where buyers pay by Visa, Mastercard, Apple Pay, Google Pay or direct Polygon crypto. You receive USDC on Polygon and fulfil the order from the verified HMAC-SHA256 webhook.

### Do I need a website to accept card payments in Discord or Telegram?

Not for manual sales: create no-key payment links at [caravelpay.app/link/](https://caravelpay.app/link/) with just a Polygon wallet address. For automated bot fulfillment with `POST /v1/checkouts` and webhooks, you need an HTTPS domain for your bot's webhook endpoint (registered as `site_url` in `POST /v1/connect`).

### How does my Discord bot know which member paid a checkout?

When your bot creates a checkout with `POST /v1/checkouts`, store your unique `order_id` and the returned `checkout.id` alongside the member's Discord `user_id`, `guild_id` and `role_id` in your database. When the signed `checkout.paid` webhook arrives, look up the order by `event.data.id`, re-read `GET /v1/checkouts/{id}`, and assign the role.

### Why should I avoid $5 card checkouts for Discord roles or keys?

Independent card providers frequently apply fixed minimum fees (up to $3.99 or €3.99 on some routes). On very small tickets, that minimum eats your margin and can push the arrived amount below Caravel Pay's 85% `paid` threshold. Bundle $25+ quarterly passes or credit packs for cards, and offer direct crypto for tiny tickets.

### Can a buyer charge back a digital key or Discord role after redeeming it?

Payouts settle as final on-chain transfers in Polygon USDC to a wallet only you control, with no merchant card-chargeback clawbacks from Caravel Pay. Any card dispute stays between the buyer, their bank and the independent card provider. Caravel Pay can still pause merchants suspected of fraud.

### Does Caravel Pay support automatic monthly renewals for Discord memberships?

No. Caravel Pay never stores card numbers or pulls automatic recurring charges. Track membership expiry in your bot database and DM members a fresh renewal checkout button before their role expires.

## Sources

1. Caravel Pay docs: [Get your API keys](https://caravelpay.app/docs/connect), [Checkouts](https://caravelpay.app/docs/checkouts), [Webhooks](https://caravelpay.app/docs/webhooks), [Payment links](https://caravelpay.app/docs/payment-links), [Checkout statuses](https://caravelpay.app/docs/statuses), checked 2026-11-26.
2. Caravel Pay: [Create a payment link](https://caravelpay.app/link/), [Pricing](https://caravelpay.app/pricing/), [Acceptable use policy](https://caravelpay.app/acceptable-use/), checked 2026-11-26.
3. [Telegram Bot API documentation](https://core.telegram.org/bots/api) (inline keyboard URL buttons, invite links) and [Discord API: Add Guild Member Role](https://discord.com/developers/docs/resources/guild#add-guild-member-role), checked 2026-11-26.
