Skip to main content

Payment flow with 1-Click Purchase

Payment flow with 1-Click Purchase

Last updated: 06-Mar-2023
Rate this article:

Overview

2Checkout supports 1-click purchases for returning customers who paid for their previous orders with credit cards (including UnionPay) or PayPal, iDeal, and Alipay.

Availability

Available for all 2Checkout accounts.

Requirements

In order to use the 1-click purchase payment method, you need to have this setting enabled on your 2Checkout account. Please contact the Merchant Support team in order to enable this.

How 1-click purchase works

In order to place an order with a previous order reference (1-click purchase), you need to validate that a previous order reference is valid for use. 

This can be done via the 2Checkout API by calling the isValidOrderReference method (SOAP and JSON-RPC) and GET/paymentmethods​/PREVIOUS_ORDER​/refno​/{OrderReference}​/ (on REST). This API method will return 'True' (for order references that can be used), or 'False' (if not).

2Checkout will charge returning customers using their payment-on-file information, either a card or their PayPal account. 

Payment method Object structure

Field name Type Required/Optional Description

RecurringEnabled

Boolean

Optional

True – shopper checks the auto-renewal checkbox and 2Checkout charges subscription renewals using a recurring billing process.

False – shopper doesn’t check the auto-renewal checkbox.

RefNo

String

Required

Order reference to a previous purchase.

You can use an order for which customers paid with credit/debit cards or with PayPal.

The status of the order should be AUTHRECEIVED or COMPLETE

Check the validity of references with the isValidOrderReference method. The 2Checkout system blocks you from using references for fraudulent or potentially fraudulent orders.

Request example

The full JSON used to place an order with credit cards would look like:

{   
   "Language":"en",
   "Country":"US",
   "CustomerIP":"10.10.10.10",
   "Source":"Website",
   "ExternalCustomerReference":"externalCustomerId",
   "Currency":"USD",
   "MachineId":"123456789"
   "Items":[
      {
         "Code":"5DCB30C6B0",
         "Quantity":1
      }
   ],
   "BillingDetails":{
      "Email":"example@email.com",
      "FirstName":"Customer First Name",
      "LastName":"Customer Last Name",
      "CountryCode":"US",
      "State":"California",
      "City":"San Francisco",
      "Address1":"Example Street",
      "Zip":"90210"
   },
   "PaymentDetails":{
      "Type":"PREVIOUS_ORDER",
      "Currency":"GBP",
      "CustomerIP":"159.8.170.22",
      "PaymentMethod":{
         "RecurringEnabled":false,
         "RefNo":"224497479"
      }
   },
}

The API will respond with the full order object (for orders placed successfully) or an error message.

Notes on using the 1-click purchase payment method

  • Use only references to previous orders with one of the following statuses AUTHRECEIVED or COMPLETE.
  • The email address of the BillingDetails object is mandatory and it needs to match the email address used as a part of the billing details of the initial order whose reference you're now using to place a new order. 2Checkout checks whether the email addresses are identical and throws an error if they're not, blocking the order placement process. 
    • You need to provide only the email address of the shopper and can ignore the rest of the required customer billing information. If you enter any billing details in addition to the email address, you'll have to provide all information required in the BillingDetails object.

Integration test cases

  1. Build a request with all the relevant information in order to place a new order. Make sure that when the order is sent in the API the response contains an order object (order was placed successfully).
  2. Make sure that you validate the order so that it can be used for a 1-click purchase before placing the order.
  3. If you have any additional webhook integrations, make sure that the webhooks are correctly configured and that the notifications are received and processed successfully.
Rate this article:

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo