Who it’s for

Payments for AI services

A user tops up their balance by an amount they choose and carries on working at once. Your server is notified by webhook and credits exactly the amount the invoice was issued for.

  • No company required
  • 3% fee
  • Payouts in USDT
Theme Quiet All forms

How it works

From the “Pay” button to the delivered purchase — with no manual checking of transfers.

  1. 1

    The user enters an amount

    Your service creates an invoice for that amount, with the user id in metadata.

  2. 2

    Payment via SBP

    On the payment page or in a Telegram mini app: a QR code on desktop, one tap to the bank app on a phone.

  3. 3

    The invoice.paid webhook

    The event carries amount: the amount you asked for, without the buyer’s fee.

  4. 4

    The balance is topped up

    Your server credits the user, who returns to the service via return_url.

What your server receives

An invoice is created with one API request, and your server is notified by webhook. The sample is in Node.js.

  • order_id and metadata from the request come back in event.data — use them to deliver the order. The buyer never sees metadata.
  • The signature is checked by verify(token, header, body) — the docs have it in four languages. Test events are signed with the test key, live ones with the live key.
  • "test": true means a test-mode payment: no money moved, deliver nothing.
  • The same event may arrive twice — deduplicate by ExpressOplata-Event-Id. Respond with 2xx within 10 seconds, or the delivery is retried.
  • Credit amount, not amount_to_pay: if the buyer pays the fee, it is already added to the latter.
Webhooks in the docs
Request · POST /v1/invoices
{
  "amount": "1500.00",
  "order_id": "top-3307-12",
  "description": "Balance top-up",
  "return_url": "https://ai.example/billing",
  "metadata": {
    "user": "u3307"
  }
}
Webhook handler · Node.js
Webhook handler · Node.js
import express from "express";
import { verify } from "./verify.js"; // the function from /en/docs/#signature
import { db, credits } from "./app.js"; // your code

const app = express();
app.post("/hooks/expressoplata", express.raw({ type: "application/json" }), async (req, res) => {
  const event = JSON.parse(req.body); // req.body is the raw bytes the signature covers
  const token = event.test ? process.env.EO_TEST_TOKEN : process.env.EO_TOKEN;
  if (!verify(token, req.get("ExpressOplata-Signature") ?? "", req.body)) return res.sendStatus(401);
  if (event.type !== "invoice.paid") return res.sendStatus(200);
  const eventId = req.get("ExpressOplata-Event-Id");
  if (await db.isDone(eventId)) return res.sendStatus(200); // a repeat of the same event
  const { order_id, metadata } = event.data;
  if (event.test) {
    console.log("a test payment: the path works, deliver nothing", order_id);
  } else {
    await credits.topUp(metadata.user, event.data.amount); // amount excludes the buyer’s fee
  }
  await db.markDone(eventId);
  res.sendStatus(200);
});
app.listen(8080);

Common questions

All questions
Does the user choose the amount?

Yes: your server sets the invoice amount, so it can be whatever the user entered, within the project’s limits. A project sees its limits in the GET /v1/me response.

How do I sell an AI subscription?

With an invoice for each period — there are no automatic charges. At the end of the term your service issues a new invoice and extends access on the webhook once it is paid.

What do I credit if the user pays the fee?

The amount field — the amount you asked for. The buyer pays amount_to_pay, which already includes the 3% fee.

Where does the money go?

To the project balance in USDT, at the rate fixed when the invoice was created. Payouts are requested in the bot to your wallet; more in the rules.

Connect your project

Submit a request on the site or in the bot. The test key works right away, before the project is reviewed.