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!

Pay by E-Mail

The Pay by E-Mail API creates a unique link to the Payment Page which then can be sent to customers.

Integration

Check out the API Usage for the URL Path to generate Pay by E-Mail links.

Sample Request

curl https://api.sandbox.datatrans.com/upp/jsp/XML_PayByEmail \
  -H "Content-Type: application/xml" \
  -d "@request.xml"

Where the payload (request.xml) could have the following content.

<?xml version="1.0" encoding="UTF-8"?>
<payByEmailService version="1">
  <body merchantId="1000011011">
    <language>en</language>
    <currency>CHF</currency>
    <amount>400</amount>
    <refno>1337</refno>
    <duedate>20181231</duedate>
  </body>
</payByEmailService>

Note: The duedate parameter should have the 'yyyymmdd' format.

Sample Response

<?xml version="1.0" encoding="UTF-8"?>
<payByEmailService version="1">
    <body merchantId="1000011011">
      <payByEmailURL>
        https://pay.sandbox.datatrans.com/upp/jsp/upStartFromTemplate
          ?paymentTemplateId=023983c5-7bc3-a3a8-0000-015341ed7da8
      </payByEmailURL>
    </body>
</payByEmailService>

XSD schema

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
  <xs:include schemaLocation="https://payment.datatrans.biz/upp/schema/base.xsd"/>
  <xs:element name="payByEmailService">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="body" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="language" type="xs:string" minOccurs="0" maxOccurs="1"/>
              <xs:element name="currency" type="currency" minOccurs="0" maxOccurs="1"/>
              <xs:element name="amount" type="amountCents" minOccurs="0" maxOccurs="1">
                <xs:annotation>
                  <xs:documentation>
                    Transaction amount in cents (the smallest unit of the currency) (e.g. 123.50 = 12350) Must not exceed the authorized amount!
                  </xs:documentation>
                </xs:annotation>
              </xs:element>
              <xs:element name="refno" type="xs:string" minOccurs="0" maxOccurs="1"/>
              <xs:element name="duedate" type="dateYYYYMMDD" minOccurs="0" maxOccurs="1"/>
              <xs:element name="payByEmailURL" type="xs:string" minOccurs="0" maxOccurs="1"/>
            </xs:sequence>
            <xs:attribute name="merchantId" type="merchantIdType" use="required">
              <xs:annotation>
                <xs:documentation>
                  Unique Merchant Identifier (allocated by Datatrans at merchant registration process)
                </xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="status" type="status" use="optional">
              <xs:annotation>
                <xs:documentation>Returned in response</xs:documentation>
              </xs:annotation>
            </xs:attribute>
          </xs:complexType>
        </xs:element>
        <xs:element name="error" type="error" minOccurs="0">
          <xs:annotation>
            <xs:documentation>
              Returned in response when the XML request is invalid
            </xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
      <xs:attribute type="xs:string" name="version" use="required"/>
    </xs:complexType>
  </xs:element>
</xs:schema>

What's Next

API Usage