Skip to main content
The SDK allows the merchant to create payments within the main product. Each payment carries an amount, an external identifier (externalId), a return URL after payment (returnUrl) and optional customer data. After creating a payment, the SDK returns a redirectUrl to the checkout page where the customer can complete the payment.
Before integrating via SDK, make sure you have configured your product and webhook. Go to Configuration to complete the required steps.
Call the SDK server-side only. The API key must never reach frontend code, and a browser call would be rejected by CORS anyway.

1. Installation

Do not pin a version - install the latest.

2. Example call

Configuration parameters

createPayment parameters

All parameters are passed flat, on a single level - the SDK assembles the details object sent to the API from them. Any extra fields are passed through along with the rest.
amount must be an integer. The SDK only checks that the value is a number greater than zero, so 49.99 passes validation and the API then silently truncates it to 49 grosze. Convert złoty amounts with Math.round(amount * 100).

Starting a payment method automatically

With triggerPayment you preselect a payment method in the checkout, so the customer does not have to find it in the list. Any other value throws a PaymoveValidationError (field triggerPayment). Omitting the field or passing null means the standard checkout with method selection.
Auto-start - opening the payment as if the customer pressed Pay - applies to Google Pay and Apple Pay only. For the other five methods the tile is merely preselected.
Even for the wallets, auto-start only works when the checkout knows the customer email - pass it in email. It also does not run inside the embedded widget modal, or when the method is not available for your product.
The auto-start applies to the first display of the checkout only. Once the customer picks a method themselves, it does not run again - until the page is reloaded.
Google Pay and Apple Pay open a native browser sheet that normally requires a customer gesture - the automatic start may be blocked by the browser. The customer then sees the standard payment screen and pays manually.

QR code step

With qrStepEnabled the checkout opens on an extra screen on desktop: instead of the payment form the customer sees a QR code, scans it with their phone and finishes the payment there. Useful for BLIK and for wallets that only exist on mobile. The step is opt-in - omit the field or pass false and the checkout goes straight to the payment form.
The QR code appears on desktop only. On mobile, and whenever triggerPayment is set, the checkout skips the step regardless of this field.
qrStepEnabled reached the SDK types after 0.2.0 was published. On the older version the field still works (the SDK forwards unknown keys), but TypeScript will not suggest it - update the package to the latest version.

Automatic return to the store

After a successful payment the checkout shows a confirmation screen with a “Back to store” button. The autoclose field (in milliseconds) makes that return happen on its own: the remaining seconds are shown inside the button (Back to store (10s)) and the customer lands on returnUrl once the countdown ends. Inside the widget the modal closes instead and onComplete fires. Any interaction from the customer - a click, a tap, a key press - cancels the countdown for good, so nobody is pulled away mid-action, for example while downloading the confirmation PDF. Omit the field and the confirmation stays on screen until the customer leaves it themselves.
autoclose reached the SDK types in release 0.3.0. On older versions the field still works (the SDK forwards unknown keys), but TypeScript will not suggest it.

Response

3. Redirect the customer

Once the payment completes, the checkout shows a confirmation screen with a “back to shop” button that takes the customer to the address provided in returnUrl. The entire payment process is fully managed by Paymove - checkout and processing - while you fulfil the order after a verified webhook, not after the customer returns.
Instead of redirecting, you can open the same URL in a modal on your own page — see the Browser widget, which also ships a ready-made button and a payment-methods bar.