---
name: circuspay-integration
description: "Integrate CircusPay with your coding assistant."
---

# CircusPay integration

Use this skill for requested CircusPay integrations. Preserve existing structure and integrations. Test locally or in sandbox. This skill authorizes no live payment, deployment, account change or webhook sent to a third party: those actions must be covered by the user request. Do not invent endpoints or parameters. Do not change the CircusPay engine to make an example work.

https://circus-pay.com/docs/en/

## Targeted references

- [Create a checkout](references/create-payment.md)
- [Payment methods](references/payment-methods.md)
- [Checkout Studio & themes](references/themes.md)
- [Webhooks](references/webhooks.md)
- [Transactions & statuses](references/transactions.md)
- [Test mode](references/testing.md)

## Keep in mind

- Create a test key in your merchant portal. Store it on your server in `CIRCUSPAY_SECRET_KEY`. Never embed your secret key in a web page or mobile application.

- Amounts use minor units: `2499` means **EUR 24.99**. Use a unique `orderId` for each new order.

- Read `url` from the JSON response and redirect the browser to that exact URL. The domain may vary with your account configuration: do not reconstruct it.

- Configure a [signed webhook](https://circus-pay.com/docs/en/webhooks/) and verify the order, amount, currency and status. A visit to your return URL is not proof of payment.

- Restricts offered methods. Does not enable a method unavailable to your account.

- This list restricts authorized methods; it does not enable them. An empty list or one containing only unknown values does not disable all payments: creation ignores that restriction.

- The account must allow BLIK and the selected flow must support PLN. To add cards, use `["blik", "card"]`.

- Create and activate your theme in Checkout Studio. Copy its identifier and send it as `theme_id` when creating the checkout.

- The API checks that the theme is active and belongs to your account. Its configuration is stored with the link. Branding enforced for your account may take precedence.

- Without `theme_id`, your integration retains its usual behavior. The legacy `template` parameter keeps its compatibility handling; prefer `theme_id` for a saved theme.

- For a non-reusable link and an existing reference, the API may return `reused: true` and `alreadyPaid`. Check these fields and the status before restarting payment. This is not a general idempotency guarantee across all endpoints.

- `X-ONIPAY-Signature` contains the hexadecimal HMAC-SHA256 of the raw HTTP body, computed with the webhook secret. Verify the exact received body before re-encoding JSON.

- This snippet only verifies the signature. Add durable storage, deduplication and order logic before returning 2xx. The HTTP delivery timeout is 10 seconds.

- Payment events use an envelope with `type`, `created` and `data`. The contents of `data` depend on the flow. Do not assume every event shares the same schema; reconcile references with your transactions.

- A test key forces this mode. The response contains `test: true`, `mode: "test"` and a sandbox URL. Check these values before continuing.

- Test mode does not collect through a real provider. It does not prove that a method or currency is enabled in production. Test webhooks can reach your configured destinations: isolate test processing.

- The recommended base is `https://circus-pay.com/api`. Existing integration paths remain unchanged. This documentation introduces no mandatory migration.

