Stripe
Online payments in the app: Checkout, cards, BLIK and subscriptions. The agent can set up products and prices, and the app creates payment sessions.
Connection type: For the app and the agent. Credentials: API key or token, plus the webhook secret (whsec_…).
How it works
The app and the agent never see the credentials. They call the Stripe API through the Bloklo gateway, for example fetch("/gw/<connection id>/customers"). The gateway appends the path to the address https://api.stripe.com/v1, adds an Authorization: Bearer … header with the key from the connection and the headers Stripe-Version: 2026-11-18.endive, Content-Type: application/x-www-form-urlencoded, and passes the service's response back to the app.
- Reads (GET) go through at once. Writes (POST, PUT, PATCH, DELETE) go through at once only when the connection is set to Always allow; otherwise the gateway returns status 202 with an
approval_idand the write waits for approval in the panel (see Agent permissions). - The Test button sends
GET /balanceand checks that the service accepted the credentials.
REST API v1; POST bodies are form-encoded with bracket nesting, responses are JSON. Amounts are in the smallest currency unit. Lists use cursors: limit 1–100 (default 10), starting_after, ending_before and a has_more flag; the Idempotency-Key header makes POST retries safe.
Before you start
- An account with Stripe with permission to create API keys or tokens.
Where to get the credentials
- Sign in to the Stripe Dashboard and switch the account to a sandbox to start with test keys.
- Open the API keys page (dashboard.stripe.com/apikeys, in the Dashboard: Developers → API keys).
- Copy the Secret key (
sk_test_…) or, as Stripe recommends, click Create restricted key and set the permissions: Write for Products, Prices, Checkout Sessions, Customers, Subscriptions and Webhook Endpoints, and Read for Balance (used by the connection test). A restricted key starts withrk_test_…. - To have orders marked as paid: open the Webhooks tab (Workbench), click Create an event destination, select the
checkout.session.completed,checkout.session.async_payment_succeeded,checkout.session.async_payment_failedandcheckout.session.expiredevents, choose Webhook endpoint as the destination and paste the address from the Webhook URL field in the Bloklo form. - On the new endpoint's page, click Reveal secret and paste the
whsec_…value into the Webhook secret field. - After testing, create a second connection with the live key (
sk_live_…orrk_live_…) and a webhook created in live mode. Stripe shows a live key only once, when it is created.
Stripe limits: 100 requests per second in live mode and 25 in a sandbox. Amounts in the API are in the smallest currency unit (for example cents).
Connecting in Bloklo
- Open Connectors in the sidebar and find Stripe.
- Click Connect and enter a connection name in Details.
- In Configure connection, fill in: API key, Webhook secret.
- Click Connect. Bloklo saves the credentials encrypted and sends a test request; the message shows whether the service responded.
- Attach the connection to a project: Attach to a project… on the connection page, or describe the task in the project chat and pick the connection the agent suggests.
Form fields
- API key: the Stripe secret key (
sk_test_…in a sandbox,sk_live_…in live mode) or a restricted key (rk_test_…,rk_live_…), which Stripe recommends. - Webhook secret: the
whsec_…value from a Stripe webhook endpoint. Without it the site does not accept payments, because orders would not be marked as paid. The address to enter in Stripe is shown in the form under Webhook URL.
Never paste credentials into the chat with the agent. Enter them only in the connection form.
Example prompts
Prompts to type in the chat of a project with the connection attached:
- “Add an offer page with a card and BLIK payment button.”
- “Show a dashboard with the latest subscriptions and customer details.”
- “Add a refund button for an order.”
API methods
The most commonly used Stripe API methods. The path goes after /gw/<connection id>; parts in braces, such as {id}, are replaced with values. The gateway treats every request other than GET as a write, including queries sent with POST (such as search or GraphQL), so they need approval unless the connection is set to Always allow. The full list of methods is in the provider's documentation.
| Method | Path | What it does | In the gateway |
|---|---|---|---|
GET | /customers | List customers | read |
POST | /customers | Create a customer | write (approval) |
GET | /products | List products | read |
POST | /products | Create a product | write (approval) |
POST | /prices | Create a price | write (approval) |
POST | /payment_links | Create a payment link | write (approval) |
GET | /checkout/sessions/{id} | Retrieve a Checkout session | read |
GET | /payment_intents/{id} | Retrieve a payment | read |
GET | /subscriptions | List subscriptions | read |
GET | /invoices | List invoices | read |
POST | /refunds | Create a refund | write (approval) |
GET | /balance | Retrieve the account balance | read |
Service limits
Live mode: 100 requests per second, sandbox: 25 per second; a single endpoint is usually limited to 25 per second, search to 20 reads per second. Live concurrency limit: 50 requests. Exceeding it returns 429 (Stripe-Rate-Limited-Reason header); retry with exponential backoff. Idempotency keys are up to 255 characters and kept for at least 24 hours. Read requests also have a monthly allowance: about 500 per transaction, at least 10,000 per month.
Agent actions and permissions
| Action | Type | What the agent uses it for |
|---|---|---|
| Payment provider recommendation | read | Helps choose a payment provider for the country and currency. |
| Create product | write | Creates a product with a price when the app is meant to sell something. |
| Create multiple products | write | Adds a whole price list at once. |
| List products | read | Checks existing products to avoid duplicates. |
| Checkout session | write | Creates a payment session, for example to test a purchase. |
| Customers | write | Reads and creates customers, for example for subscriptions. |
| Subscriptions | write | Checks and changes subscriptions. |
| Webhooks | write | Sets up payment notifications so orders are marked as paid. |
By default, reads run without asking and writes need approval in the chat. Change this on the connector page or in Settings → Agent permissions (see Agent permissions).
Troubleshooting
The connection test shows “Invalid key” (HTTP 401)
The service did not recognise the credentials: the value is wrong, expired, revoked or was copied with a space. Create a new key at the provider and enter it on the connection page under Change API key. Empty fields stay unchanged.
The connection test shows “Invalid key” (HTTP 403)
The credentials are rejected or lack the needed permissions, or the service only accepts requests from selected IP addresses. Check the key, extend its permissions at the provider or add the Bloklo gateway IP address (shown in Settings → Privacy & security) to the allowlist.
The test returns another HTTP code
The Test button sends the service a read request that requires valid credentials. A code other than 401 and 403 usually means a temporary problem at the service or a restriction on the account at the provider; include the error code shown with the result in a problem report.
The payment succeeded but the order is still pending
The Stripe webhook does not exist, or its URL or secret differs from the one in the connection. In Stripe, add an endpoint with the address from the Webhook URL field, select the checkout.session.completed, checkout.session.async_payment_succeeded, checkout.session.async_payment_failed and checkout.session.expired events, and enter its whsec_… secret in the connection (the field is required; without the secret the site does not accept payments). The webhook must be created separately in test mode and live mode.
Where does the payment amount come from?
From the project's price list (src/cennik.json), calculated by Bloklo on the server. The site only sends product identifiers and quantities, so the customer cannot change the price in the browser. An order is marked as paid only when the provider confirms exactly the order amount. Details: Payments on your site.
Limits and security
- One connection can make up to 1,000 requests per minute; the service's own limits also apply.
- Credentials are encrypted and not shown in the browser after saving; only the names of stored fields are visible.
- A published app works for every visitor: protect the data the connection gives access to with sign-in in the app.
Something unclear or out of date? Contact us