Direct API integration

Introduction

This guide describes how to integrate AfterPay in your shop, using a direct connection to our webservices.

Complete technical requirements and specifications can be found in the API documentation. References to the API documentation can be found in this guide when relevant.

Payment Methods

Currently, AfterPay supports these payment methods:

Method Description
B2C invoice NL AfterPay for Dutch consumers
B2C invoice BE AfterPay for Belgium consumers
B2B invoice NL AfterPay for Dutch companies
B2C direct debit NL AfterPay for Dutch consumers (Direct Debit)

From order to invoice

Technically, AfterPay is similar to the creditcard payment model.
This is how an AfterPay payment is processed:

1. Authorization
After placing the order, an authorization request is sent to AfterPay, using the data from the checkout. The AfterPay webservice checks if the data sent is correctly formatted and complete. If so, then it does a risk check using that data. If the payment request is accepted, the total amount of the order is reserved and can be invoiced.

The API documentation has an overview of all possible responses and how to process them.

2. Capture
After the order has been shipped, the reserved amount can be captured fully or partially. The captured amount is then set to be invoiced.

3. Invoicing
Within a few days, AfterPay sends an invoice by e-mail for the captured amount.

 

Add fields to your checkout

Each AfterPay payment method requires personal- and address information (to do a risk check). Please make sure you ask for this information in your checkout. Add fields where needed. You can choose to only ask for certain info (like date of birth or gender) when choosing AfterPay.

If  fields are already available for gender, DOB etc. then do not ask for that information again. (you can have them as optional for example, in that case check if there is a value. If not then ask for them when choosing AfterPay)

The required fields are listed in the API documentation.

Create XML messages for authorization

Each AfterPay payment method has a specific XML structure. You can find an example of an authorization request per payment method in the API documentation.

First, set-up the basic XML structure for each payment method you use in your shop. Then, send in some testrequests, using the testdata below.

In every request, you need to send authentication information using the , and  fields. The test credentials for each payment method will be provided by AfterPay.

Submit testorders

ResultId 0 – accepted payment

To check the submission of successful orders, place an testorder for each payment method with:

  • multiple products
  • discount (if possible)
  • shipping fee (if possible)
  • service fee (if allowed)
  • alternate delivery address

Below you will find the testdata that can be used.

Field Value
Gender M
First name Test
Last name Acceptatie
E-mail [your e-mailadres]
Telephone 0513744112
Zip code 8443ER
Housenumber 1
Streetname Teststraat
City Testplaats
Country Nederland
Date of birth January 1st 1990
Field Value
Gender M
First name Test
Last name Acceptatie
E-mail [your e-mailadres]
Telephone 0513744112
Zip code 8443ER
Housenumber 1
Streetname Teststraat
City Testplaats
Country Nederland
Date of birth January 1st 1990
Bankaccount NL93RABO0170100200
Field Value
First name T
Last name Acceptatie
E-mail [your e-mailadres]
Telephone 0513744112
Zip code 8443ER
Housenumber 1
Streetname Teststraat
City Testplaats
Country Nederland
Company Testbedrijf
COC number 56583052
VAT number NL001234567B01

ResultId 1 – technical error

To verify and process a technical error, place a regular order, but trigger a technical error, for example using:

  • 0 as merchantID
  • Incorrect password

ResultId 2 – validation error

To verify and process a validation error, place a regular order, but use invalid data, for example:

  • a telephone number consisting of 9 digits, i.e.: 051322334
  • a postal code using only letters, i.e.: ABCD
  • a name with number in it, i.e.: John Doe 123

ResultId 3 – rejected payment

To verify and process a rejected payment, place a regular order, but use the e-mailaddress: rejection@afterpay.nl.

Show validation errors to end-users

In case of a validation error, AfterPay sends a specific response containing the error type and a user friendly message in the field . This message should be visible to the end-user, with the option to change the data and try again.

Of multiple errors occur, all should be listed as provided in the response.

The API documentation has an example of a validation error.

Show rejection message

In case of a rejection, a generic rejection message should be shown, plus the reason of rejection. The latter is sent in the response of the AfterPay webservice in the field . The API documentation has an example of a rejection response.

Below you will find the text to be used, for both Dutch and Belgium payment methods.

Dutch payment methods (B2C invoice NL, B2B invoice NL, B2C direct debit NL):
Het spijt ons u te moeten mededelen dat uw aanvraag om uw bestelling achteraf te betalen op dit moment niet door AfterPay wordt geaccepteerd. De reden hiervoor is: . Voor vragen over uw afwijzing kunt u contact opnemen met de Klantenservice van AfterPay. Wij adviseren u voor een andere betaalmethode te kiezen om alsnog de betaling van uw bestelling af te ronden.

Belgium payment methods (B2C invoice BE):
Het spijt ons u te moeten mededelen dat uw aanvraag om uw bestelling achteraf te betalen op dit moment niet door AfterPay wordt geaccepteerd. De reden hiervoor is: . Voor vragen over uw afwijzing kunt u contact opnemen met de Klantenservice van AfterPay. Wij adviseren u voor een andere betaalmethode te kiezen om alsnog de betaling van uw bestelling af te ronden.

 

Note: please link to the contact pages, using the links in the text.

AfterPay conditions

In order to pay with AfterPay, a user has to agree to the AfterPay terms & conditions. Please create a checkbox with the link to the conditions.

Method URL
B2C invoice NL https://www.afterpay.nl/nl/algemeen/betalen-met-afterpay/betalingsvoorwaarden
B2C invoice BE https://www.afterpay.be/be/footer/betalen-met-afterpay/betalingsvoorwaarden
B2B invoice NL https://www.afterpay.nl/nl/algemeen/zakelijke-partners/betalingsvoorwaarden-zakelijk
B2C direct debit NL https://www.afterpay.nl/nl/algemeen/betalen-met-afterpay/betalingsvoorwaarden

Name in checkout

Please use these names in your checkout:

Method Name in checkout
B2C invoice NL AfterPay – veilig achteraf betalen
B2C invoice BE AfterPay – veilig achteraf betalen
B2B invoice NL AfterPay – veilig achteraf betalen voor bedrijven
B2C direct debit NL AfterPay – veilig achteraf betalen (eenmalige machtiging)

Hide AfterPay payment methods

Total order amount

In order to prevent rejections based on the total order amount, please hide the AfterPay payment based on these conditions:

  • if total order amount < EUR 5
  • if total order amount > Max amount (please check the contract or AfterPay email)

The exception to this is the B2C invoice Belgium method. For AfterPay Belgium, the max total order amount is variable, so it should only be hidden if below the minimum amount.

Country

In order to prevent unsuccessful payments due to choosing unsupported countries, please only show the NL AfterPay payment methods if the chosen country is The Netherlands and show the BE payment methods only if the chosen country is Belgium.

 

AFTERPAY LOGO & BANNER

Below you will find the AfterPay logo and banner.

Looking for a different size? Simply click on the logo or banner and see all sizes available.

Please add the AfterPay logo on all places where payment method logo’s are shown
No logo’s of payment methods? Then you can skip this part.

The banner is a great way of showing AfterPay is now a payment option in your shop!

 

*All log’s have transparency, the white logo can be used in places where the background color is dark.

Logo AfterPay M M: 113 x 22
download PNG
M: 113 x 22
download PNG

 

*The banners are as is, no transparency, white is actually the color white.

Logo AfterPay M

AfterPay information

For each payment method, please place the explanation somewhere on your webshop. Usually, this is the page where you sum up the available payment methods.

Below you will find the text, that you can copy and paste into your webshop.

Replace the variables where needed:
– [webshop url] = the URL of your webshop

AfterPay – Achteraf betalen voor consumenten (NL/BE)

AfterPay voert voor [webshop url] het volledige achteraf betaalproces uit. Wanneer je je bestelling afrondt via AfterPay ontvang je van hen een digitaal betaaloverzicht en betaal je het orderbedrag aan AfterPay. Ter goedkeuring van je verzoek om achteraf te betalen voert AfterPay een gegevenscontrole uit. AfterPay hanteert een strikt privacybeleid zoals omschreven in het privacy statement. Mocht onverhoopt jouw verzoek tot betaling met AfterPay niet geautoriseerd worden, dan kun je jouw bestelling natuurlijk betalen met een andere betaalmethode. Wil je meer informatie over achteraf betalen met AfterPay? Ga dan naar de website van AfterPay.

AfterPay – Achteraf betalen voor bedrijven

Bij [webshop url] kun je achteraf betalen met AfterPay als zakelijke klant. Wanneer je je bestelling afrondt via AfterPay ontvang je van hen een digitaal betaaloverzicht en betaal je het orderbedrag aan AfterPay. Ter goedkeuring van je verzoek om achteraf te betalen voert AfterPay een gegevenscontrole uit. AfterPay hanteert een strikt privacybeleid zoals omschreven in het privacy statement. Mocht onverhoopt jouw verzoek tot betaling met AfterPay niet geautoriseerd worden, dan kun je jouw bestelling natuurlijk betalen met een andere betaalmethode. Wil je meer informatie over achteraf betalen met AfterPay? Ga dan naar de website van AfterPay.

Order maintenance operations

Usually, an invoice for each order is created automatically by AfterPay and any changes, like refunds, are done using the AfterPay backoffice. This way, you only need to send (authorize) the payment requests.

Optionally, you can also use the order maintenance operations to automate the complete payment processing. For example, a cancel can be used if the the complete order is cancelled before capture/invoicing. AfterPay will not send an invoice.

In case of a full or partial return, a full or partial refund can be used. AfterPay will send an update by e-mail, stating the remaining amount to be paid.

The API documentation has a complete description of all order maintenance operations. It also provides an overview of use-cases, which describes how to use the operations in specific scenario’s.

Request final check

Suggest Edit