- METHOD TYPEBNPL
- PAYMENTS
- PAYOUTS
- REFUNDS
- RECURRING
Introduction
Afterpay (known as Clearpay in the EU) is an Australian financial technology company. It provides merchants with a “buy now, pay later” service that does not require customers to enter a traditional loan or pay upfront fees or interest. Consumers pay for their purchases in 4 easy payments over a total of 6 weeks, with zero interest when paid on time.
With Afterpay, users gain access to a large and growing segment of consumers who are increasingly using buy now, pay later options as a flexible alternative to credit cards. Best of all, you’re immediately paid in full for each purchase, and are protected against fraud and consumer payment risk.
Supported Countries
- Australia
- Canada
- New Zealand
- United States of America
Supported Currencies
- AUD
- CAD
- NZD
- USD
Payment (Deposit) Flow
Follow these steps to perform a payment using Nuvei REST API integration:
1. Generate a sessionToken
Press here for details.
2. Send a /payment
Request
Perform the payment by sending a /payment
request with its mandatory parameters including:
userTokenId
amount
currency
paymentOption.alternativePaymentMethod
class containing:paymentMethod
: “apmgw_Afterpay“
deviceDetails
class containing:ipAddress
billingAddress
class containing:firstName
,lastName
,country
,email
,address
,city
,state
,zip
userDetails
class containing:firstName
,lastName
,country
,email
,address
,city
,state
,zip
Example /payment
Request
{ "sessionToken":"<sessionToken from /getSessionToken>", "merchantId":"<your merchantId>", "merchantSiteId":"<your merchantSiteId>", "clientRequestId":"<unique request ID in merchant system>", "amount":"200", "currency":"USD", "userTokenId":"<unique customer identifier in merchant system>", "clientUniqueId":"<unique transaction ID in merchant system>", "paymentOption":{ "alternativePaymentMethod":{ "paymentMethod":"apmgw_Afterpay" } }, "deviceDetails":{ "ipAddress":"<customer's IP address>" }, "billingAddress": { "firstName": "John", "lastName": "Smith", "address": "22 Main Street", "city": "Boston", "zip": "02460", "state": "MA", "country": "US", "email": "[email protected]" }, "userDetails":{ "firstName": "John", "lastName": "Smith", "address": "22 Main Street", "city": "Boston", "zip": "02460", "state": "MA", "country": "US", "email": "[email protected]" }, "timeStamp":"<YYYYMMDDHHmmss>", "checksum":"<calculated checksum>" }
The response generates and returns a redirect URL (redirectUrl
) to redirect the customer to the payment page, as well as a UPO (userPaymentOptionId
) for use in future transactions.
Example /payment
Response
{ "orderId":"341413598", "userTokenId":"Usertoken01", "paymentOption":{ "redirectUrl":"https://apitest.nuvei.com/Home?PaymentToken=F355F191C8B97D1D3B8453B283258C66.13560826", "userPaymentOptionId":"83246818", }, "transactionStatus":"REDIRECT", "sessionToken":"f43d774a-a180-4935-bbc1-1315bb4dc203", "internalRequestId":549917488, "status":"SUCCESS", "errCode":0, "reason":"", "merchantId":"2439523627382132721", "merchantSiteId":"224428", "version":"1.0", "clientRequestId":"20221104131500" }
After the transaction is processed, Nuvei sends a Direct Merchant Notification (DMN) that includes the result of the transaction to the urlDetails.notificationUrl
, which Nuvei recommends including in the /payment
request.
Example Payment DMN – status
=APPROVED
...'ppp_status=OK&Status=APPROVED&ExErrCode=0&ErrCode=0&errApmCode=0&errApmDescription=&errScCode=0&errScDescription=&Reason=&ReasonCode=0&PPP_TransactionID=346641898&userid=UT_1007&merchant_unique_id=&customData=&productId=&first_name=Alberta&last_name=Bobbethcharleson&email=accountholder0%40example.com¤cy=USD&customField1=&customField2=&customField3=&customField4=&customField5=&customField6=&customField7=&customField8=&customField9=&customField10=&customField11=&customField12=&customField13=&customField14=&customField15=&invoice_id=&address1=433+3rd+Ave&address2=&country=United+States&state=NEW+YORK&city=Brooklyn&zip=11215&phone1=2014177692&phone2=&phone3=&client_ip=104.162.79.210&nameOnCard=&cardNumber=&bin=&noCVV=&acquirerId=&acquirerBank=Nuvei-PI&expMonth=&expYear=&Token=&tokenId=&AuthCode=&AvsCode=&Cvv2Reply=&shippingCountry=&shippingState=&shippingCity=&shippingAddress=&shippingZip=&shippingFirstName=&shippingLastName=&shippingPhone=&shippingCell=&shippingMail=&total_discount=0.00&total_handling=0.00&total_shipping=0.00&total_tax=0.00&buyButtonProductBundleId=&merchant_site_id=224428&merchant_status=&action=&requestVersion=&message=APPROVED&merchantLocale=&unknownParameters=&payment_method=apmgw_Afterpay&ID=&merchant_id=2439523627382132721&responseTimeStamp=2022-12-13.14%3A50%3A35&buyButtonProductId=&webMasterId=&appliedPromotions=&uniqueCC=&transactionType=Sale&externalEmail=&cardCompany=&eci=&user_token_id=UT_1007&userPaymentOptionId=84776198&TransactionID=811000000000312769&externalTransactionId=14599399&APMReferenceID=AC3C5B7D70792D56AB6A6A01078331C0&orderTransactionId=1171199358&totalAmount=207.00&dynamicDescriptor=test&item_name_1=NA&item_number_1=&item_amount_1=207.00&item_quantity_1=1&item_discount_1=0.00&item_handling_1=0.00&item_shipping_1=0.00&feeAmount=&amountWithoutFee=&houseNumber=&customCurrency=&upoRegistrationDate=20221208&type=DEPOSIT&clientRequestId=20221213094850&relatedTransactionId=&sessionId=bf545930e4edb9dab11f9fd307d3&responsechecksum=dc7043f724a5207b9b3f7db5d5a984a479f130a85428ca1add15d3fc6fb2d42f&advanceResponseChecksum=f267dc5bf3d5b2ad8cd506ecb39283ee1f3f482406376c00b5ffb48e190425d8',
User Experience
Registered User
- The user is redirected to the Afterpay website.
- The user enters their password and clicks Continue.
- The user enters their password and clicks Continue.
- The user confirms the order.
A confirmation message is displayed.
New User
- The user is redirected to the Afterpay website.
- The user enters their mobile number (valid for that country) and clicks Continue.
- The user enters their details:
- Date of Birth
- Address (valid for that country)
- The user enters the verification code received:
- The user enters their card payment information and clicks Continue.
- Card Number
- Card expiry MM/YY
- CVV Code
- The user enters their payment schedules and confirms the order.
A confirmation message is displayed.
Testing
[email protected]
Webmaster501#
Also, you can create your testing accounts, same as above, by using a new email with a unique phone number.
- Required verification PIN is: 111111
- Test cards:
4111 1111 1111 1111 , 01/22 , CVV 000 for capture approved.
4111 1111 1111 1111 , 01/22 , CVV 051, capture declined.
Multi-store Marketplace Addendum
A Marketplace merchant can submit /payment
requests that include an addendums.marketplace
class with multiple stores (submerchants).
Example addendum.marketplace
Class with Multiple Stores
{ "addendums": { "marketplace": { "description": "new market place", "sellerInfo": [ { "uniqueAccountIdentifierSeller": { "phone": "12121231242", "email": "[email protected]", "other": "passthrough data" }, "subMerchantId": "1234567890qwertyuiopasdfg", "subMerchantName": "Marketbrick Ltd.", "subMerchantPostalCode": "11010", "productCategory": "Computers", "productName": "Acer 5400", "sellerRating": "4.5", "accountRregistrationDate": "2020-06-10T12:02:21Z", "numberOfTrades": "34", "volumeOfTrades": "4500", "uniqueAccountIdentifier": { "email": "[email protected]", "personalNumber": "6175553333", "other": "passthrough data" }, "accountLastModified": { "password": "2020-06-10T12:02:21Z", "email": "2020-06-10T12:02:21Z", "listing": "2020-06-10T12:02:21Z", "login": "2020-06-10T12:02:21Z", "address": "2020-06-10T12:02:21Z" } }, { "subMerchantId": "9876543210sjuwytcndflpss", "subMerchantName": "Marketstore Ltd.", "subMerchantPostalCode": "54321", "productCategory": "Pet Food", "productName": "Purina Puppy Chow", "sellerRating": 3.4, "accountRregistrationDate": "2020-06-10T12:02:21Z", "numberOfTrades": 3, "volumeOfTrades": 2, "uniqueAccountIdentifier": { "email": "[email protected]", "personalNumber": "6175551414", "other": "passthrough data" }, "accountLastModified": { "password": "2020-06-10T12:02:21Z", "email": "2020-06-10T12:02:21Z", "listing": "2020-06-10T12:02:21Z", "login": "2020-06-10T12:02:21Z", "address": "2020-06-10T12:02:21Z" } } ], "marketplaceConsumerInfo": [ { "accountRegistrationDate": "2020-06-10T12:02:21Z", "numberOfTrades": 2, "volumeOfTrades": 12, "uniqueAccountIdentifier": { "email": "[email protected]", "personalNumber": "+33623232323", "other": "passthrough data" }, "accountLastModified": { "password": "2020-06-10T12:02:21Z", "email": "2020-06-10T12:02:21Z", "listing": "2020-06-10T12:02:21Z", "login": "2020-06-10T12:02:21Z", "address": "2020-06-10T12:02:21Z" } } ] } } }