Datatrans QR Code Test - creating QR code from redirect link
JSON request:
{
"currency": "CHF",
"refno": "1672871",
"amount": 650,
"language": "en",
"redirect": {
"method": "POST",
"successUrl": "https://pay.sandbox.datatrans.com/upp/merchant/successPage.jsp?a=b",
"cancelUrl": "https://pay.sandbox.datatrans.com/upp/merchant/cancelPage.jsp?a=b",
"errorUrl": "https://pay.sandbox.datatrans.com/upp/merchant/errorPage.jsp?a=b"
},
"webhook": {
"url": "https://www.webhook.com/test/webhook.php?sessionId=7f3d3864-d260-44fd-853c-6310fdf77d2b"
}
}
Response:
HTTP/1.1 401
Date: Sun, 12 Jul 2026 03:25:36 GMT
Content-Type: application/json
Content-Length: 91
Connection: keep-alive
Strict-Transport-Security: max-age=31536000; includeSubdomains
P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
X-XSS-Protection: 1; mode=block
Correlation-Id: 297c0473-d780-401d-92ce-82cd24506c82
Set-Cookie: TS0145d480=01ce483fa5ae5221158cc28474ce4f65d04020a23e15123b246cd7f930947d0fbf942e34237e2ff15229ae4b8b0840fcf149b2bfec; Path=/; Domain=.api.sandbox.datatrans.com
{
"error" : {
"code" : "UNAUTHORIZED",
"message" : "Invalid authentication"
}
}
Redirect link:
/var/www/html/qr-test.php on line 93
Deprecated: urlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/qr-test.php on line 93
" target="_blank">
Warning: Undefined array key "Location" in /var/www/html/qr-test.php on line 93
(click for QR Code)"
Test cards: https://docs.datatrans.ch/docs/testing-credentials#section-credit-debit-cards