Add Crypto Payments to a Site Built with Lovable, Cursor, v0 or Bolt
If an AI tool built your site, an AI tool can add the payment flow too, provided you give it precise instructions. This article shows the prompt approach, what a good prompt contains and the five things to verify before you accept the first real payment.
Why a prompt beats hand-coding here
AI tools are good at wiring a known API into an existing project when the specification is complete and unambiguous. A payment integration is exactly that: two endpoints, one webhook, a handful of security rules. The failure mode is a vague request ("add crypto payments") that leaves the model guessing at endpoints and skipping signature checks. A precise prompt removes the guessing.
Getting the prompt from the dashboard
Sign in to the KriptoGo dashboard and open Setup prompt. Choose your stack (Next.js, Express, PHP, WordPress, Django/Flask, Telegram bot or "not sure"), enter your site URL and what you sell, and pick the language. The page generates a complete instruction. By default it references your key as an environment variable; you can optionally embed the real key, but keep that prompt private if you do.
What the prompt contains
- The task in one sentence and the context (site, product, provider).
- The full API definition: create-invoice request and response, status endpoint, webhook headers and body, error codes.
- A numbered to-do list: environment variables, payment button, server-side start-payment endpoint, webhook endpoint, idempotency, return page, error messages.
- Mandatory rules: key stays server-side, amount decided on the server, signature verified over the raw body with a constant-time comparison, respond within 10 seconds, no custom checkout screen.
- Expected deliverables: working code, an .env.example, a short setup note and test steps.
Lovable and v0
Paste the prompt into the chat of your project. These tools usually run on Next.js or Vite plus a serverless backend, so make sure the generated create-invoice call lives in a server route or edge function, never in a client component. When the tool asks where to put secrets, use the project's environment settings, not a file in the repo.
Cursor, Bolt and IDE agents
Open the project, paste the prompt into the agent chat and let it read the codebase first. Review the diff before accepting: look for the webhook route reading the raw body, and for the secret being read from process.env or the equivalent. Run the app locally and hit the start-payment endpoint with curl.
ChatGPT and Claude
Without repository access these tools generate files for you to place manually. Tell them your framework version and file layout so paths match. Ask for the webhook handler and the start-payment handler as separate files, then add them to the project yourself.
Five things to verify
- The API key is not in client code. Search the built bundle for "kriptogo.com/api/create-invoice"; it must only appear in server files.
- The amount comes from the server. The client should send a product or order id, not a price.
- The signature is verified over the raw body with
timingSafeEqual,hash_equalsorcompare_digest. - Duplicates are ignored. A second webhook for the same invoice id must not deliver twice.
- Errors are user-friendly. A 403 from the API means your account is not approved yet; the site should say so instead of crashing.
Environment variables
Two variables: KRIPTOGO_API_KEY and KRIPTOGO_SECRET_KEY. Never prefix them with NEXT_PUBLIC_, VITE_ or REACT_APP_; those prefixes ship the value to the browser. Add .env to .gitignore and commit only .env.example.
Testing
Create a small invoice through your own site, pay it, and confirm the order flips to paid. Send a fake webhook with a wrong signature and confirm a 401. Replay the real webhook and confirm nothing changes. Only then switch the button on for customers.
Summary
A precise prompt turns a payment integration into a fifteen-minute task for an AI tool. The prompt generator in the dashboard writes that prompt for you; your job is the five-point review before going live.
Frequently asked questions
Does the prompt work with any framework?
Yes. It describes the HTTP API and the rules; the stack selector only tunes file names and idioms. Pick 'not sure' and the tool detects the framework itself.
Should I embed my real API key in the prompt?
It is safer not to. Leave the default (environment variable name) and add the key in your hosting settings. If you embed it, paste the prompt only into a private tool you control.
What if the tool builds its own checkout screen?
Ask it to remove it and redirect to checkout_url instead. The hosted page handles QR codes, countdowns and live status for you.
Accept crypto payments in 30 minutes with KriptoGo
No setup fee, no monthly fee. Just 1% on successful payments.
