Trustly recommends using Trustly Pay for all new integrations, including one-time payments. It offers better risk optimization and a better user experience.
Set the technical paymentType to 'Deferred' for Trustly Pay (modern, high-conversion flow).
paymentType 'Instant' if your logic specifically requires a legacy, single-phase capture rail.Trustly Instant Payments is a legacy workflow for processing one-time transfers. Unlike our modern flows, this one authorizes and captures funds in a single synchronous step without generating a reusable credential token. The “Instant” designation applies to the single-phase authorization workflow; it doesn’t guarantee immediate settlement through the Real-Time Payments (RTP) network.
Before implementing the Instant Payments workflow, consider the following limitations:
accessId and accessKey. Contact Trustly Support if you do not have them.The following diagram illustrates the single-phase lifecycle of an Instant Payment. The user authorizes the transfer, and the funds are authorized and captured immediately.
The following table details each step of the instant payment workflow, corresponding to the lettered annotations in the diagram.
Important: Although Instant Payments authorize and capture funds in a single step, settlement confirmation is still asynchronous. Always wait for the webhook before fulfilling irreversible actions, such as shipping goods.
Modify the integrated SDK Trustly.establish() method in your frontend application to include the following parameters for a one-time payment:
paymentType: Must be set to 'Instant'. If you copied the example from the Integrate the client-side SDK topic, you’ll need to change this value from 'Deferred' to 'Instant' to capture funds immediately.amount: The exact amount to charge the customer. For example, '100.00'.merchantReference: Your unique order ID or session reference.requestSignature: You must generate a signature on your backend to secure the payload. Do not generate this on the frontend or you will expose your Access Key. Pass the generated string to your frontend for this call. See Generate request signatures.To configure TrustlyOptions, see Integrate the Client-Side SDK.
Once the customer completes the payment at their bank, Trustly closes the Lightbox and redirects the customer to your returnUrl.
Trustly appends the transaction result to the URL parameters. You must parse these parameters to verify the outcome.
Example Return URL: https://merchant.com/checkout/success?transactionId=1002633191&status=2
Check the status parameter immediately to show the correct page to your customer. The following are the status codes that are returned:
2 (Authorized): Success. The customer approved the payment. You can display your thank you page and rely on the webhook for final confirmation.7 (Canceled or Declined): The customer cancelled the transaction, or the bank declined the transaction. Redirect them back to the checkout page to try again.Trustly relies on webhooks to confirm the final status of a payment. You must configure a webhook listener to receive these updates. This ensures your database remains synchronized with the Trustly system, even if a customer closes their browser before the redirect completes.
Use the webhook payload to confirm the final transaction status. Look for the following statuses:
COMPLETED: Confirms the funds have been successfully collected.FAILED: Confirms the payment was declined or reversed.See Handle webhooks.
To refund a completed Instant Payment, use the Refund API. See Refund transaction.
Refunds are processed asynchronously. You must wait for the webhook to confirm completion.
Once you’ve implemented the payment flow, you must verify that your application handles success and error states correctly.