Payment Process

Review the sections below to discover the possible payment flows with Datatrans. We divided our payment flows into three categories: Customer-Initiated Payments explaining registrations and payments via your customers, Merchant-Initiated Payments elaborating on payments via you as a merchant, including subscription and recurring payments, and finally After The Payment which contains all actions you can perform after a transaction has been initiated.


API Communication Only via Server!

Please note that all API communication should occur directly via server to server, and not via client (eg. the user's browser). This is to ensure maximum security for your payments.

Customer initiated payments

Customer-initiated payments are payments that are initiated by your customers. This is the classic checkout experience you see when purchasing goods online. To proceed with customer-initiated transactions, you will need to follow a few steps.

  • You send the required parameters to initialize a transactionId or mobileToken.
  • You let the customer proceed with the payment by redirecting them to the correct link - or showing them your payment form. They proceed with entering their payment information and finally hit the confirm button.
  • We check the payment information with your acquirers. The acquirers check the payment information with the issuing parties. For card payments, the customer proceeds with 3D Secure whenever required.
  • After the payment, we return all relevant information to you, including the status of the transaction and if available the payment information tokenized.

Merchant initiated payments

Merchant-initiated payments give you the option to debit the payment information from your customers after they initially processed a customer-initiated payment or registration. Some payment methods allow you to save the payment information, while others don't. Once you have the payment information on your server, you can proceed with the following flow.

  • You send the required parameters to our authorize endpoint and we return a transactionId, together with the result of the authorization.

After the payment

Once you are done with authorizing a transaction you have several options as to what to do with a transaction. After the payment you can leave the transaction as it is or you proceed with a refund. Below is a list of the possible operations.

  • Settle a transaction: To finalize your payments, you need to have your transactions settled. Without a settlement, the payments from your customers will not be paid out to you. Unsettled transactions usually expire within a month, so we encourage you to proceed with the settlement as fast as possible.
  • Cancel / Refund a transaction: If you wish to cancel an unsettled transaction or refund a transaction, you can call our cancel endpoint.
  • Ask for the status: Check what happened with the transaction at any time. Call our status endpoint to check all details of a specific payment.
  • Reconcile your transactions: Match your online payment transactions with acquirers’ payouts and manage discrepancies as well as chargebacks.

Important information

Regardless of which integration you wish to use, you will often require to work with the following critical information.

merchantIdThis is your merchant account identifier which is assigned when creating an account at Datatrans. The merchantId is also your username for basicAuth.

Integer, 10 characters
Example: 1100001337
basicAuthPasswordThis would be your password required for basicAuth.
transactionIdOur unique identifier for each transaction. This is the value you require for post-transaction operations.

Integer, 64bit
Example: 200909172048627413
mobileTokenOur unique identifier to initialize our Mobile SDKs.

String, 48 characters
Example: 1bf1d06fdbac3a31e7cf3e166303c92802ead023c9679a06
currencyThe currency code for the transaction.

String, 3 letters
based on the ISO-4217 character code.
Example: CHF or USD
amountThe amount of the transaction in the currency’s smallest unit. For example use 1000 for CHF 10.00.

Integer, 64bit
Example: 1000
refnoYour unique reference for a transaction. We recommend it to be unique for each transaction.

String, 20 characters
Example: Payment-001