The developer.datatrans.com Developer Hub

Welcome to the developer.datatrans.com developer hub. You'll find comprehensive guides and documentation to help you start working with developer.datatrans.com as quickly as possible, as well as support if you get stuck. Let's jump right in!

paymentmethod=TWI

paymentmethod=TWI

Payment Process
Integration

Authorization

:heavy-check-mark+:

Payment Page

:heavy-check-mark+:

Deferred Settlement

:heavy-check-mark+:

Split Mode

:heavy-check-mark+:

Refund

:heavy-check-mark+:

Mobile SDK

:heavy-check-mark+:

Cancel

:heavy-check-mark+:

Alias
(Mobile SDKs only)

:heavy-check-mark+:

Try it

Don't worry you will not be charged.

Pay CHF 10.00

Description

With TWINT, app users can make cashless payments at cash registers, online and at vending machines. It is also possible for money to be transferred between private individuals and for payment requests to be made.

Datatrans provides you with the opportunity to integrate TWINT in your web shop and in your app as a payment method.

TWINT AG was founded on 1 October 2016 following the merger of TWINT and Paymit.
Payment Method provider website :link+:

Web payment flow

 1 
[Not supported by viewer]
Customer clicks Pay
Customer clicks Pay
Merchant Website
Merchant Website
Merchant Server
Merchant Server
Payment Page loaded from Datatrans
Payment Page loaded from Datatrans
Twint
Twint
 3 
[Not supported by viewer]
Customer selects Twint
[Not supported by viewer]
 2 
[Not supported by viewer]
 4 
[Not supported by viewer]
Request for Token and QR Code
Request for Token and QR Code
Validates and creates Transaction; returns QR Code and Token
[Not supported by viewer]
Displays QR Token / Waiting Page
Displays QR Token / Waiting Page
Monitors transaction status
Monitors transaction status
9.1
[Not supported by viewer]
 10 
[Not supported by viewer]
Receives Result and Invokes merchant's
POST URL (Webook)
[Not supported by viewer]
Receives Result 
Receives Result 
 11 
[Not supported by viewer]
Redirects customer back to merchant
Redirects customer back to merchant
Customer gets redirected to merchant page
Customer gets redirected to merchant page
Returns Status of transaction
Returns Status of transaction
User's Device
User's Device
 7 
[Not supported by viewer]
Confirms Transaction
Confirms Transaction
 8 
[Not supported by viewer]
 9 
[Not supported by viewer]
 5 
[Not supported by viewer]
 6 
[Not supported by viewer]

Server to Server API calls

After a transactionId or alias was received by completing the payment flow on the web, the following server to server API calls can be used to do other actions.

Authorization

Is only possible through the web interface.

Settlement

Request

curl -v -X POST https://api.sandbox.datatrans.com/upp/jsp/XML_processor.jsp \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d @- << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<paymentService version="1">
  <body merchantId="1100016230">
    <transaction refno="1234987abc">
      <request>
        <amount>1</amount>
        <currency>CHF</currency>
        <uppTransactionId>180816161546585482</uppTransactionId>
      </request>
    </transaction>
  </body>
</paymentService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='1'>
    <body merchantId='1100016230' status='accepted'>
        <transaction refno='1234987abc' trxStatus='response'>
            <request>
                <amount>850</amount>
                <currency>CHF</currency>
                <uppTransactionId>180816161546585482</uppTransactionId>
            </request>
            <response>
                <responseCode>01</responseCode>
                <responseMessage>settlement succeeded</responseMessage>
            </response>
        </transaction>
    </body>
</paymentService>

Cancel

Request

curl -v -X POST https://api.sandbox.datatrans.com/upp/jsp/XML_processor.jsp \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d @- << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<paymentService version="1">
  <body merchantId="1100016230">
    <transaction refno="91827364">
      <request>
        <amount>850</amount>
        <currency>CHF</currency>
        <uppTransactionId>180816162031057241</uppTransactionId>
        <reqtype>DOA</reqtype>
      </request>
    </transaction>
  </body>
</paymentService>

EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='1'>
    <body merchantId='1100016230' status='accepted'>
        <transaction refno='91827364' trxStatus='response'>
            <request>
                <amount>850</amount>
                <currency>CHF</currency>
                <uppTransactionId>180816162031057241</uppTransactionId>
                <reqtype>DOA</reqtype>
                <transtype>05</transtype>
            </request>
            <response>
                <responseCode>01</responseCode>
                <responseMessage>cancellation succeeded</responseMessage>
            </response>
        </transaction>
    </body>
</paymentService>
EOF

Status

Request

curl -v -X POST https://api.sandbox.datatrans.com/upp/jsp/XML_status.jsp \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d @- << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<statusService version="3">
  <body merchantId="1100016230">
    <transaction>
      <request>
        <uppTransactionId>180816162031057241</uppTransactionId>
        <reqtype>STX</reqtype>
      </request>
    </transaction>
  </body>
</statusService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<statusService version='3'>
    <body merchantId='1100016230' status='accepted'>
        <transaction trxStatus='response'>
            <request>
                <uppTransactionId>180816162031057241</uppTransactionId>
                <reqtype>STX</reqtype>
            </request>
            <response itemNr='1'>
                <responseCode>7</responseCode>
                <responseMessage>MOA Cancel</responseMessage>
                <refno>91827364</refno>
                <amount>850</amount>
                <currency>CHF</currency>
                <authorizationCode>945407288</authorizationCode>
                <pmethod>TWI</pmethod>
                <uppTransactionId>180816162031057241</uppTransactionId>
                <maskedCC></maskedCC>
                <aliasCC></aliasCC>
                <expm></expm>
                <expy></expy>
                <trxDate>20180816</trxDate>
                <trxTime>162031</trxTime>
                <trtype>05</trtype>
            </response>
        </transaction>
    </body>
</statusService>

Twint


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.