/v1/transactions

Initialize a transaction

Changed on

Securely send all the needed parameters to the transaction initialization API. The result of this API call is a HTTP 201 status code with a transactionId in the response body and the Location header set. This call is required to proceed with our Redirect and Lightbox integration

post/v1/transactions

Request

  • Base URL
    https://api.sandbox.datatrans.com
  • URL
    https://api.sandbox.datatrans.com/v1/transactions
  • Auth
    HTTP basic

Request body

amountinteger

The amount of the transaction in the currency’s smallest unit. For example use 1000 for CHF 10.00. Can be omitted for use cases where only a registration should take place (if the payment method supports registrations)

currencystring required

3 letter <a href='https://en.wikipedia.org/wiki/ISO_4217' target='_blank'>ISO-4217</a> character code. For example CHF or USD

refnostring required

The merchant's reference number. It should be unique for each transaction.

refno2string

Optional customer's reference number. Supported by some payment methods or acquirers.

autoSettleboolean

Whether to automatically settle the transaction after an authorization or not. If not present with the init request, the settings defined in the dashboard ('Authorisation / Settlement' or 'Direct Debit') will be used. Those settings will only be used for web transactions and not for server to server API calls.

language'en' | 'de' | 'fr' | 'it' | 'es' | 'el' | 'fi' | 'hu' | 'ko' | 'nl' | 'no' | 'da' | 'pl' | 'pt' | 'ru' | 'ja' | 'sk' | 'sl' | 'sv' | 'tr' | 'zh'

This parameter specifies the language (language code) in which the payment page should be presented to the cardholder. The <a href='https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes' target='_blank'>ISO-639-1</a> two letter language codes listed above are supported

paymentMethodsstring[]

An array of payment method shortnames. For example ["VIS", "PFC"]. If omitted, all available payment methods will be displayed on the payment page. If the Mobile SDKs are used (returnMobileToken), this array is mandatory.

DVIDeltaVistaData

DVI has no specific request parameters but we need an empty object here to handle it as a DVI request.

accertifyAccertify

Accertify decision (Accepted, Review, Declined

Example request

{
  "card": {
    "number": "4242424242424242"
  },
  "BON": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "DMO": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "ELV": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "ESY": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "INT": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "MDP": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "MFX": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "MPX": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "PAP": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "PFC": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "PFP": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "PLU": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "REK": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "SWP": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  },
  "TWI": {
    "alias": "AAABeCBPbiHssdexyrAAAYkaznYWAPYt"
  }
}

Response

Transaction successfully initialized

transactionIdstring

The transactionId to be used when using Redirect- or Lightbox Mode. If no further action happens with the transactionId after initialization, it will be invalidated after 30 minutes.

mobileTokenstring

Mobile token which is needed to initialize the Mobile SDKs.

TWITwintResponse

Twint specific response parameters

Example response

{
  "resources": [
    {
      "uri": "https://pay.datatrans.com/upp/payment/js/secure-fields-2.0.0.js",
      "integrity": "sha384-Base64EncodedHashValue"
    }
  ]
}

Changes

    • warning

      removed the request property

    • warning

      removed the request property //////

    • warning

      removed the request property //////

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      added the new CONCURRENT_LIMIT_REACHED enum value to the / response property for the response status

    • warning

      added the new NOT_FOUND enum value to the / response property for the response status

    • warning

      added the new ROUTING_LOOKUP_FAILED enum value to the / response property for the response status

    • warning

      added the new ROUTING_NOT_CONFIGURED enum value to the / response property for the response status

    • warning

      added the new ROUTING_NOT_FOUND enum value to the / response property for the response status

    • info

      added the new optional request property

    • info

      added the new optional request property /

    • info

      added the new optional request property //////

    • info

      added the new optional request property //////

    • info

      added the new optional request property /

    • info

      added the new 80 enum value to the request property ///////

    • info

      added the new 80 enum value to the request property ///////

    • info

      added the new 81 enum value to the request property ///////

    • info

      added the new 81 enum value to the request property ///////

    • info

      added the new 82 enum value to the request property ///////

    • info

      added the new 82 enum value to the request property ///////

    • info

      added the new 83 enum value to the request property ///////

    • info

      added the new 83 enum value to the request property ///////

    • info

      added the new 84 enum value to the request property ///////

    • info

      added the new 84 enum value to the request property ///////

    • info

      added the new 85 enum value to the request property ///////

    • info

      added the new 85 enum value to the request property ///////

    • info

      added the new 86 enum value to the request property ///////

    • info

      added the new 86 enum value to the request property ///////

    • info

      added the new 87 enum value to the request property ///////

    • info

      added the new 87 enum value to the request property ///////

    • info

      added the new 88 enum value to the request property ///////

    • info

      added the new 88 enum value to the request property ///////

    • info

      added the new 89 enum value to the request property ///////

    • info

      added the new 89 enum value to the request property ///////

    • info

      added the new 90 enum value to the request property ///////

    • info

      added the new 90 enum value to the request property ///////

    • info

      added the new 91 enum value to the request property ///////

    • info

      added the new 91 enum value to the request property ///////

    • info

      added the new 92 enum value to the request property ///////

    • info

      added the new 92 enum value to the request property ///////

    • info

      added the new 93 enum value to the request property ///////

    • info

      added the new 93 enum value to the request property ///////

    • info

      added the new 94 enum value to the request property ///////

    • info

      added the new 94 enum value to the request property ///////

    • info

      added the new 95 enum value to the request property ///////

    • info

      added the new 95 enum value to the request property ///////

    • info

      added the new 96 enum value to the request property ///////

    • info

      added the new 96 enum value to the request property ///////

    • info

      added the new 97 enum value to the request property ///////

    • info

      added the new 97 enum value to the request property ///////

    • info

      added the new 98 enum value to the request property ///////

    • info

      added the new 98 enum value to the request property ///////

    • info

      added the new 99 enum value to the request property ///////

    • info

      added the new 99 enum value to the request property ///////

    • info

      added the new DMO enum value to the request property /

    • info

      added the optional property to the response with the status