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, 06 Sep 2026 06:12:24 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: 5df52fcd-f78c-4444-8407-4f84e0b81e2d
Set-Cookie: TS0145d480=01ce483fa5f4df7fac38c14b8361631f50297df3e6ea7bea8b8de4172f4d96281ec1ebea2136ddb18811382ab7ddf6a05c1107d9ec; 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