RedPay Gate API (2026-11-01)
The RedPay Gate API is the official, released server-to-server API for merchants and partners who build their own integration with the RedPay payment gateway. With it your backend creates payments, sends the payer to the RedPay payment page (or to the bank / BLIK flow directly), follows the result through webhook events, cancels unpaid payments and refunds paid ones.
| Status | Released, stable. Breaking changes only ever come as a new dated version. |
| Current version | 2026-11-01 (initial release) |
| Production | https://api.redpay.pl |
| Sandbox | https://api-sand.redpay.pl (separate credentials, no real money) |
| Machine-readable spec | GET https://api.redpay.pl/api/openapi/2026-11-01.yaml |
The API is versioned by date in the RedPay-Api-Version request header, not in the URL. Send RedPay-Api-Version: 2026-11-01 with every request. An unsupported version is rejected with 400 listing the supported ones.
A request without RedPay-Api-Version uses the default version of your point of sale (VPos). It is shown as defaultApiVersion in GET /api/vpos.
- Today every VPos defaults to
2026-11-01, the only released version. - The default is fixed when the VPos is created: it is the newest version released at that time. A VPos created after a newer version is released defaults to that newer version; existing VPos keep theirs.
- The default never moves to a newer version on its own. Releasing a new version changes nothing for requests without the header. Your default changes only when you ask for it, after you have tested your integration with the new version (send the new version in the header first).
- The default is not "latest" on purpose: a new dated version is released only for breaking changes, so following "latest" would change your integration's behaviour without warning. Pinned default versions follow the established practice of payment APIs: a payment integration must never change behaviour without the integrator's decision.
- A version older than the newest one is deprecated: its responses carry
RedPay-Api-Version-Deprecated: trueand, once a removal date is set,Sunset. This applies to requests without the header too, when your default version is deprecated. - A version is removed only after its
Sunsetdate, announced in advance in the changelog and by e-mail to the merchants whose VPos still default to it or still send it. - A removed version is never replaced silently by another one. Requests that send a removed version are rejected with
400. A VPos whose default is removed is moved to the next version only after that announcement, never by the release of a newer version.
Recommendation: always send the header. Then neither a new release nor a change of your default affects you.
Every response carries:
| Header | Meaning |
|---|---|
RedPay-Api-Version | The dated version used to build this response |
RedPay-Api-Version-Supported | All versions you may send |
RedPay-Api-Version-Deprecated: true | Only when you use a version older than the newest one |
Sunset | Only for a deprecated version: the date it stops being served |
Webhook events are always rendered in the API version the payment was created with.
Every request is authenticated with the credentials of your virtual point of sale (VPos), sent in two headers:
| Header | Value |
|---|---|
Auth-Token | VPos API token |
Auth-Key | VPos API key (secret) |
You find both in the merchant panel (https://app.redpay.pl) under your point of sale. Credentials are checked before the request body is read; credentials put in the body are ignored by this API.
- Missing or wrong credentials →
401 Unauthorized. - Valid credentials of a VPos or merchant that is not active →
403 Forbidden.
Keep Auth-Key on your server only. Never send it to a browser or a mobile app.
| Object | Format | Example |
|---|---|---|
| Payment | RP-<random>-TR (max 20 characters) | RP-W3YWEWH38PZTQW-TR |
| Refund | RE_<number> (re_<number> is accepted too) | RE_42 |
| Event | evt_<hex> | evt_9f1c2b |
A payment is always addressed by its public id. A payment that belongs to another merchant is answered with 404, exactly like a payment that does not exist.
- Your backend creates a payment with
POST /api/payment_intent. The response hasstatus: INITIALand aredirectUrl. - You send the payer to
redirectUrl:type: UNSELECTED- the RedPay payment page, where the payer chooses BLIK, bank transfer or card.type: TRANSFERwithpreselectedBank- straight to the chosen bank.type: BLIKwithblikCode- the BLIK payment is started at once; the payer confirms it in the banking app.
- The payer pays. RedPay sends a webhook event (
payment_intent.succeeded,payment_intent.failed, ...) to yourasyncAckUrl(or the VPos notification URL) and finally redirects the payer to yourconfirmUrlorfailureUrl. - Treat the webhook (or a
GETof the payment) as the source of truth, never the browser redirect.
An unpaid payment expires after 3 days (status TIMEOUT, event payment_intent.expired).
| Status | Meaning | Final |
|---|---|---|
INITIAL | Created, the payer has not started paying | no |
STARTED | The payer started a payment attempt | no |
VERIFY | Waiting for the confirmation of the payment provider | no |
FAILED | The last attempt failed; the payer may try again until the payment expires (when retries are enabled for you) | no |
SUCCESS | Paid | yes* |
PARTLY_PAID | Less than the full amount was received | yes |
PARTLY_REFUNDED | Paid, part of the amount was refunded | yes* |
REFUNDED | Paid and refunded in full | yes |
CANCELED_ACQ | Canceled by you (merchant) through the API | yes |
CANCELED_USER | Canceled by the payer on the payment page | yes |
TIMEOUT | Not paid before the deadline | yes |
* SUCCESS and PARTLY_REFUNDED change only through refunds.
A payment is cancelable in INITIAL, STARTED and (with retries enabled) FAILED, and refundable in SUCCESS and PARTLY_REFUNDED while amountRefunded < amount. Every payment resource tells you both in the cancelable and refundable fields - use them instead of re-implementing these rules.
| Type | Currencies | Notes |
|---|---|---|
UNSELECTED | all accepted | The payer chooses the method on the payment page |
TRANSFER | PLN, EUR (SEPA) | Pay-by-link bank transfer; pass preselectedBank to skip bank selection |
BLIK | PLN | Pass a 6-digit blikCode to start the payment directly |
CARD | all enabled | Requires cardTokenId. Card refunds are not supported yet (422) |
The methods actually available for your point of sale depend on its currencies, your price plan and the current availability of providers. Ask GET /api/payment_channels?currency= before you offer a method. Your point of sale accepts the currencies listed in GET /api/vpos. An unsupported currency is rejected with 400.
language (two-letter code, any case) sets the language of the payment page and of the payer's confirmation e-mail: pl, en, de, bg, cs, da, el, es, et, fi, fr, ga, hr, hu, it, lt, lv, mt, nl, pt, ro, sk, sl, sv. Without it the VPos default language is used, else Polish. Payment page links carry it as lang (e.g. ?lang=en-GB).
POST /api/payment_intent/{id}/refund refunds a paid payment in full or in part; several partial refunds are allowed until the paid amount is used up. The response is a Refund resource:
SUCCEEDED- done. Bank transfer refunds are paid out with the next bank payment run.PENDING- the provider confirms asynchronously (e.g. BLIK). PollGET .../refunds/{refundId}or wait for therefund.succeeded/refund.failedevent.FAILED- seefailureReason(PROVIDER_ERROR,PROVIDER_TIMEOUT,INSUFFICIENT_FUNDS).
A refund above the remaining refundable amount (amount - amountRefunded) is rejected with 400; a refund of a payment that is not paid is 422. Always send an Idempotency-Key with refunds.
Send an Idempotency-Key header (1-64 characters A-Z a-z 0-9 _ -, e.g. a UUID) with POST requests to make retries safe:
- A repeat with the same key and the same request returns the stored response, with
Idempotent-Replayed: true, for 24 hours, without executing the request again. - The same key with a different request →
422. - The same key while the first request is still running →
409; retry a moment later. 5xx,401,403and429responses are not stored, so you can retry them with the same key.
| Bucket | Limit |
|---|---|
Reads (GET) per Auth-Token | 1200 / minute |
Writes (POST) per Auth-Token | 150 / minute |
| Requests without credentials, per IP | 60 / minute |
Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. Above the limit you get 429 Too Many Requests with Retry-After (seconds).
RedPay POSTs an event to the payment's asyncAckUrl (or, without it, to the notification URL of the VPos) whenever a payment or refund reaches a result:
| Event type | When | data.object |
|---|---|---|
payment_intent.succeeded | The payment was paid | PaymentIntent |
payment_intent.failed | The payment failed finally | PaymentIntent |
payment_intent.canceled | Canceled by you or the payer | PaymentIntent |
payment_intent.expired | Not paid before the deadline | PaymentIntent |
refund.succeeded | A refund was completed | Refund |
refund.failed | A refund failed | Refund |
Headers of every delivery:
| Header | Value |
|---|---|
RedPay-Signature | t=<unix seconds>,v1=<hex signature> (one v1 per active secret) |
RedPay-Event-Id | The event id |
RedPay-Event-Type | The event type |
The signature secret is the VPos webhook secret (whsec_...) shown in the merchant panel; it is not your Auth-Key. To verify a delivery:
- Parse
tand everyv1fromRedPay-Signature. - Compute
hex(HMAC-SHA256(secret, t + "." + rawBody))over the raw request body bytes. - Compare it in constant time with each
v1; accept if any matches. - Reject the event if
tis older than 5 minutes.
After a secret rotation both the old and the new secret sign events for 24 hours (two v1 values).
Test vector: secret whsec_test, t=1700000000, body {"id":"evt_1"} → the signed string is 1700000000.{"id":"evt_1"}.
- Answer any
2xxwithin 15 seconds; do the heavy work afterwards. - Failed deliveries are retried after 1 min, 5 min, 15 min, 1 h, 3 h, 6 h, 12 h and 24 h.
- Redirects (
3xx) are not followed and count as failures. - Only public internet addresses on ports 80 / 443 are called.
- Retries and redeliveries carry the same event
idand body - use theidto deduplicate. - You can see the delivery state of every event and redeliver it with the Events endpoints.
Errors are JSON objects (Error) with the HTTP code, a message and, for validation errors, a field → message map in errors. 404 responses for unknown or foreign payments have no body.
| Code | Meaning |
|---|---|
400 | Invalid request, unsupported API version, currency or language |
401 | Missing or invalid Auth-Token / Auth-Key |
403 | VPos or merchant not active |
404 | Unknown id, or an object of another merchant |
409 | Idempotency-Key still in progress, or an event delivery is pending |
422 | Business rule: not cancelable, not refundable, method not offered, key reused for another request |
429 | Rate limit exceeded |
503 | A payment provider or exchange rate is temporarily unavailable; retry later |
