Skip to content
BlokloDocumentation

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_id and the write waits for approval in the panel (see Agent permissions).
  • The Test button sends GET /balance and 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

  1. Sign in to the Stripe Dashboard and switch the account to a sandbox to start with test keys.
  2. Open the API keys page (dashboard.stripe.com/apikeys, in the Dashboard: Developers → API keys).
  3. 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 with rk_test_….
  4. 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_failed and checkout.session.expired events, choose Webhook endpoint as the destination and paste the address from the Webhook URL field in the Bloklo form.
  5. On the new endpoint's page, click Reveal secret and paste the whsec_… value into the Webhook secret field.
  6. After testing, create a second connection with the live key (sk_live_… or rk_live_…) and a webhook created in live mode. Stripe shows a live key only once, when it is created.
Note

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).

Stripe documentation

Connecting in Bloklo

  1. Open Connectors in the sidebar and find Stripe.
  2. Click Connect and enter a connection name in Details.
  3. In Configure connection, fill in: API key, Webhook secret.
  4. Click Connect. Bloklo saves the credentials encrypted and sends a test request; the message shows whether the service responded.
  5. 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.
Important

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.

MethodPathWhat it doesIn the gateway
GET/customersList customersread
POST/customersCreate a customerwrite (approval)
GET/productsList productsread
POST/productsCreate a productwrite (approval)
POST/pricesCreate a pricewrite (approval)
POST/payment_linksCreate a payment linkwrite (approval)
GET/checkout/sessions/{id}Retrieve a Checkout sessionread
GET/payment_intents/{id}Retrieve a paymentread
GET/subscriptionsList subscriptionsread
GET/invoicesList invoicesread
POST/refundsCreate a refundwrite (approval)
GET/balanceRetrieve the account balanceread

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.

Stripe API reference

Agent actions and permissions

ActionTypeWhat the agent uses it for
Payment provider recommendationreadHelps choose a payment provider for the country and currency.
Create productwriteCreates a product with a price when the app is meant to sell something.
Create multiple productswriteAdds a whole price list at once.
List productsreadChecks existing products to avoid duplicates.
Checkout sessionwriteCreates a payment session, for example to test a purchase.
CustomerswriteReads and creates customers, for example for subscriptions.
SubscriptionswriteChecks and changes subscriptions.
WebhookswriteSets up payment notifications so orders are marked as paid.
Tip

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