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.

StatusReleased, stable. Breaking changes only ever come as a new dated version.
Current version2026-11-01 (initial release)
Productionhttps://api.redpay.pl
Sandboxhttps://api-sand.redpay.pl (separate credentials, no real money)
Machine-readable specGET https://api.redpay.pl/api/openapi/2026-11-01.yaml

Versioning

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.

Default version (request without the header)

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.

Deprecation and removal

  • A version older than the newest one is deprecated: its responses carry RedPay-Api-Version-Deprecated: true and, 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 Sunset date, 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:

HeaderMeaning
RedPay-Api-VersionThe dated version used to build this response
RedPay-Api-Version-SupportedAll versions you may send
RedPay-Api-Version-Deprecated: trueOnly when you use a version older than the newest one
SunsetOnly for a deprecated version: the date it stops being served

Webhook events are always rendered in the API version the payment was created with.

Authentication

Every request is authenticated with the credentials of your virtual point of sale (VPos), sent in two headers:

HeaderValue
Auth-TokenVPos API token
Auth-KeyVPos 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.

Identifiers

ObjectFormatExample
PaymentRP-<random>-TR (max 20 characters)RP-W3YWEWH38PZTQW-TR
RefundRE_<number> (re_<number> is accepted too)RE_42
Eventevt_<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.

Payment flow

  1. Your backend creates a payment with POST /api/payment_intent. The response has status: INITIAL and a redirectUrl.
  2. You send the payer to redirectUrl:
    • type: UNSELECTED - the RedPay payment page, where the payer chooses BLIK, bank transfer or card.
    • type: TRANSFER with preselectedBank - straight to the chosen bank.
    • type: BLIK with blikCode - the BLIK payment is started at once; the payer confirms it in the banking app.
  3. The payer pays. RedPay sends a webhook event (payment_intent.succeeded, payment_intent.failed, ...) to your asyncAckUrl (or the VPos notification URL) and finally redirects the payer to your confirmUrl or failureUrl.
  4. Treat the webhook (or a GET of the payment) as the source of truth, never the browser redirect.

An unpaid payment expires after 3 days (status TIMEOUT, event payment_intent.expired).

Payment statuses

StatusMeaningFinal
INITIALCreated, the payer has not started payingno
STARTEDThe payer started a payment attemptno
VERIFYWaiting for the confirmation of the payment providerno
FAILEDThe last attempt failed; the payer may try again until the payment expires (when retries are enabled for you)no
SUCCESSPaidyes*
PARTLY_PAIDLess than the full amount was receivedyes
PARTLY_REFUNDEDPaid, part of the amount was refundedyes*
REFUNDEDPaid and refunded in fullyes
CANCELED_ACQCanceled by you (merchant) through the APIyes
CANCELED_USERCanceled by the payer on the payment pageyes
TIMEOUTNot paid before the deadlineyes

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

Payment methods and currencies

TypeCurrenciesNotes
UNSELECTEDall acceptedThe payer chooses the method on the payment page
TRANSFERPLN, EUR (SEPA)Pay-by-link bank transfer; pass preselectedBank to skip bank selection
BLIKPLNPass a 6-digit blikCode to start the payment directly
CARDall enabledRequires 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.

Payer language

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

Return URLs

confirmUrl and failureUrl are where the payer lands after paying. Each is taken from the payment, else from the defaults of your VPos, else RedPay's own result pages. All URLs (confirmUrl, failureUrl, asyncAckUrl) must be absolute https URLs of at most 250 characters.

Refunds

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). Poll GET .../refunds/{refundId} or wait for the refund.succeeded / refund.failed event.
  • FAILED - see failureReason (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.

Idempotency

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, 403 and 429 responses are not stored, so you can retry them with the same key.

Rate limits

BucketLimit
Reads (GET) per Auth-Token1200 / minute
Writes (POST) per Auth-Token150 / minute
Requests without credentials, per IP60 / minute

Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. Above the limit you get 429 Too Many Requests with Retry-After (seconds).

Webhooks

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 typeWhendata.object
payment_intent.succeededThe payment was paidPaymentIntent
payment_intent.failedThe payment failed finallyPaymentIntent
payment_intent.canceledCanceled by you or the payerPaymentIntent
payment_intent.expiredNot paid before the deadlinePaymentIntent
refund.succeededA refund was completedRefund
refund.failedA refund failedRefund

Headers of every delivery:

HeaderValue
RedPay-Signaturet=<unix seconds>,v1=<hex signature> (one v1 per active secret)
RedPay-Event-IdThe event id
RedPay-Event-TypeThe event type

Verifying the signature

The signature secret is the VPos webhook secret (whsec_...) shown in the merchant panel; it is not your Auth-Key. To verify a delivery:

  1. Parse t and every v1 from RedPay-Signature.
  2. Compute hex(HMAC-SHA256(secret, t + "." + rawBody)) over the raw request body bytes.
  3. Compare it in constant time with each v1; accept if any matches.
  4. Reject the event if t is 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"}.

Delivery rules

  • Answer any 2xx within 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 id and body - use the id to deduplicate.
  • You can see the delivery state of every event and redeliver it with the Events endpoints.

Errors

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.

CodeMeaning
400Invalid request, unsupported API version, currency or language
401Missing or invalid Auth-Token / Auth-Key
403VPos or merchant not active
404Unknown id, or an object of another merchant
409Idempotency-Key still in progress, or an event delivery is pending
422Business rule: not cancelable, not refundable, method not offered, key reused for another request
429Rate limit exceeded
503A payment provider or exchange rate is temporarily unavailable; retry later
Servers
Production
https://api.redpay.pl
Sandbox
https://api-sand.redpay.pl