TWINT for Payment Setup API
Last updated: April 30, 2026
To accept TWINT payments, you must:
- Create a payment setup.
- Confirm the payment.
- Redirect the customer to TWINT.
Call the Create a payment setup endpoint.
Information
Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see API endpoints.
post
https://{prefix}.api.checkout.com/payments/setups
1{2"amount": 6540,3"currency": "CHF",4"reference": "ORD-5023-4E89",5"settings": {6"success_url": "https://example.com/payments/success",7"failure_url": "https://example.com/payments/failure"8}9}
In the request body, provide the following:
| Field | Description |
|---|---|
number | The payment amount, in the minor currency unit. |
string | Three-letter ISO 4217 currency code. |
string | A unique reference for the payment. |
string | The URL to redirect the customer to if the payment fails. |
string | The URL to redirect the customer to if the payment is successful. |
string | A description of the payment. |
1{2"id": "set_rcmepwrchqab2wsergcafvijfy",3"processing_channel_id": "pc_wzjki6hw5puepb5fnvqlizj2e4",4"amount": 6540,5"currency": "CHF",6"payment_type": "Regular",7"reference": "ORD-5023-4E89",8"description": "TWINT payment",9"payment_methods": {10"twint": {11"status": "ready",12"flags": []13}14},15"available_payment_methods": [16"twint"17],18"settings": {19"success_url": "https://example.com/payments/success",20"failure_url": "https://example.com/payments/failure"21}22}
The response returns a payment_methods object, which contains the payment methods enabled on your account.
When all required fields are present, the payment_methods.twint object shows a ready status.
Confirm the payment by calling the Confirm a payment setup endpoint and provide:
- The payment setup
idas the{id}path parameter. twintas the payment method name.
post
https://{prefix}.api.checkout.com/payments/setups/{id}/confirm/twint
1{2"id": "pay_zsoov3umgscetdq66zkrxfijpu",3"status": "Pending",4"reference": "ORD-5023-4E89",5"payment_type": "Regular",6"_links": {7"self": {8"href": "https://{prefix}.api.checkout.com/payments/pay_zsoov3umgscetdq66zkrxfijpu"9},10"redirect": {11"href": "https://pay.twint.ch/static-page/?orderUUID=712f8d2d-3e54-4ed9-bd0e-52a4b7941e79&type=PAYMENT"12}13}14}
Redirect the customer to the redirect.href URL from the response. The customer completes the payment on the TWINT page and is then redirected back to your settings.success_url or settings.failure_url.
The redirection step varies depending on whether you redirect the customer from a desktop or mobile browser.
- Ensure that the TWINT app is installed on your customer's phone.
- Redirect your customer to the
_links.redirect.hrefURL provided in the response. The URL displays a QR code. - Your customer scans the code using their TWINT app and confirms the payment on their device.
- After confirming the payment, they are redirected to either your success or failure URL.
Information
The QR code becomes invalid after five minutes. The payment expires if the customer does not confirm the payment within this time.
- Ensure that the TWINT app is installed on your customer's phone.
- Redirect your customer to the
_links.redirect.hrefURL provided in the response. The URL displays the available TWINT apps. - The chosen TWINT app opens on the customer's device for them to authorize the payment.
- After authorizing the payment, they are redirected to either your success or failure URL.