Use with Lovable

Add Swish to the website you are building.

Building with Lovable, Bolt or a similar AI tool? Give it our prompt and API documentation to help it set up BjornTech Swish. You will still need Swish Handel from your bank and a secure, tested integration.

  1. 01Copy the prompt below into your AI builder
  2. 02Include the API documentation so it has the full setup instructions
  3. 03Let it check the requirements, then review and test before going live

The prompt tells your builder to keep payment credentials private and check that payments have completed. Never paste real credentials into the builder’s chat.

Technical requirements for your builder

Before you build

Five prerequisites. No frontend workaround.

If one is missing, enable it before adding Swish.

Trusted backend

Secret storage

Persistent database

Authentication

Access control

Browser-only projects are not acceptable. HMAC credentials, merchant configuration, provider identifiers, payment logic and refund logic must never be shipped to the browser.

Safe boundary

The browser knows less.

It calls only your authenticated backend and receives sanitized application-level state. Amount, currency and payee are calculated authoritatively on the server.

01Persist the order and one stable instruction ID
02Treat create as acknowledgement—not payment success
03Verify status with authenticated GET
04Make callbacks and fulfillment idempotent
05Restrict refunds to authorized operators
06Use fakes or controlled non-live tests while building

Builder prompt

Copy this prompt into your AI builder.

Attach the BjornTech API documentation to your AI builder together with this prompt.
bjorntech-swish-integration-prompt.txt
Build a secure website order and Swish payment flow using the BjornTech Swish Platform API Documentation as the source of truth.

Before coding, verify the project has: (1) trusted backend/server functions, (2) server-only secret storage, (3) persistent database, (4) authentication, (5) enforced ownership/access control. If any prerequisite is missing, stop the Swish integration and state exactly what needs enabling. Do not create a frontend workaround.

All BjornTech API requests, HMAC signing, payment/refund logic, merchant configuration, provider identifiers and secrets stay backend-only. Never ask me to paste credentials into chat, source, frontend environment variables, browser storage, logs, screenshots or test data. Configure them directly in backend secret storage.

The browser calls only my authenticated application backend and receives sanitized application-level state. Follow the BjornTech documentation exactly and do not invent routes, statuses, SDKs, launch URLs or behavior.

Calculate authoritative amount/currency/payee server-side. Persist the order and one stable instruction ID. Treat create response as acknowledgement only and verify status via authenticated GET. Make retries/idempotency safe. After an uncertain create outcome reuse the same instruction ID and exact payload with fresh nonce/timestamp/signature. Respect Retry-After on 429. Fulfillment must be idempotent.

Include QR checkout for customers scanning from another device. After creating the payment, use its non-empty paymentRequestToken as token in a backend-signed POST /v1/swish/qr-codes, following the documented request example. It is not the instructionId or paymentReference. Display the returned QR image through my authenticated, ownership-checked application backend; handle HTTP status and Content-Type instead of assuming JSON or an image URL. If the token is empty or QR generation fails, show a clear unavailable/error state without inventing a token or launch URL. Generating or scanning the QR does not confirm payment: verify PAID with authenticated payment GET using the original instructionId before fulfillment.

Callbacks are notifications only; verify via authenticated GET before marking paid. Refunds are backend-only and restricted to authorized operators. Do not perform live payments/refunds while building; use fakes/non-live controlled tests. Cover QR image display, missing tokens, non-image/error responses and no fulfillment before authenticated PAID in those tests.

At the end report backend components, secret configuration mechanism, database/access controls, browser/backend boundary, retry/idempotency behavior, QR behavior/error handling, tests, and anything blocked or omitted.