These docs are for v1.0.1. Click to read the latest docs for v2.1.0.

Payment Link

The Payment Link 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 a Payment Link.

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://api.datatrans.com/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