One-Click Checkout

One-click Checkout allows consumers to complete a checkout form using saved cards from previous purchases without the need of entering card details.

Cards can be tokenized during the checkout by following our Checkout Tokenization guide.

Steps

1. Create a checkout

Request a checkoutId via API. The checkoutId is valid for the next 30 min.

There are three approaches to determine the set of tokens offered to the customer.

  • Customer tokens: Checkout creation request is sent with field ´customer.customerId´ and the flag ´checkout.useCustomerTokens´ set to true. Only one customerId is permitted. The API will retrieve all the tokens associated with the ´customerId´ specified or empty list if none.

  • Specific tokens: Checkout creation request is sent with the field ´checkout.tokens´ as a list of existing tokens. All existing tokens contained in this list will be returned.

  • Customer tokens and specific tokens: You are allowed to combine customer tokens with specific tokens to offer a superset of tokens to the customer.

POST https://stagconnect.acehubpaymentservices.com/Gateway/v3/Checkouts
{
  "header": {
    "businessId": "{{YOUR_BUSINESS_ID}}"
  },
  "body": {
    "transaction": {
      "amount": 1,
      "currencyCode": "EUR",
      "authorizationMode": "payment",
      "trackingCode": "{{UNIQUE_ID}}"
    },
    "checkout": {
      "brandIds": [1010, 1020, 1030, 3010],
      "returnUrl": "{{REDIRECTION_URL}}",
      "tokenize": "INQUIRE",
      "oneClick":{
        "tokens": ["{{Token_MC}}", "{{Token_Visa}}"]
      }
    }
  }
}
{
  "result": 2,
  "description": "Pending",
  "header": {
    "requestTimestamp": "2019-01-01T08:00:00Z"
  },
  "body": {
    "checkout": {
      "checkoutId": "{{CHECKOUT_ID}}",
      "redirect": {
        "method": "GET",
        "url": "https://stag.checkout-web.dta.payvision.app/checkouts/{{CHECKOUT_ID}}"
      },
      "brandIds": [1010, 1020, 1030, 3010],
      "expirationTime": "2019-01-01T08:30:00Z",
      "tokenize": "INQUIRE",
      "oneClick":{
        "tokens": ["{{Token_MC}}", "{{Token_Visa}}"]
      }
    },
    "transaction": {
      "amount": 1,
      "currencyCode": "EUR",
      "authorizationMode": "PAYMENT",
      "trackingCode": "{{UNIQUE_ID}}"
    }
  }
}
POST https://stagconnect.acehubpaymentservices.com/Gateway/v3/Checkouts
{
  "header": {
    "businessId": "{{YOUR_BUSINESS_ID}}"
  },
  "body": {
    "transaction": {
      "amount": 1,
      "currencyCode": "EUR",
      "authorizationMode": "payment",
      "trackingCode": "{{UNIQUE_ID}}"
    },
    "checkout": {
      "brandIds": [1010, 1020, 1030, 3010],
      "returnUrl": "{{REDIRECTION_URL}}",
      "tokenize": "INQUIRE",
      "oneClick":{
        "useCustomerTokens": true
      }
    },
    "customer": {
      "customerid": "{{CUSTOMER_ID}}"
    }
  }
}
{
  "result": 2,
  "description": "Pending",
  "header": {
    "requestTimestamp": "2019-01-01T08:00:00Z"
  },
  "body": {
    "checkout": {
      "checkoutId": "{{CHECKOUT_ID}}",
      "redirect": {
        "method": "GET",
        "url": "https://stag.checkout-web.dta.payvision.app/checkouts/{{CHECKOUT_ID}}"
      },
      "brandIds": [1010, 1020, 1030, 3010],
      "expirationTime": "2019-01-01T08:30:00Z",
      "tokenize": "INQUIRE",
      "oneClick":{
        "useCustomerTokens": true
      }
    },
    "transaction": {
      "amount": 1,
      "currencyCode": "EUR",
      "authorizationMode": "PAYMENT",
      "trackingCode": "{{UNIQUE_ID}}"
    }
  }
}

2. Create the Checkout form

Please refer to our integrations documentation to learn how to integrate the Checkout form into your website.

Checkout example with tokensCheckout example with tokens

Checkout example with tokens

3. Get the payment status

When the customer completes the payment via the Checkout, our system will redirect the customer to the returnUrl (previously sent on the creation request) and checkoutId will be appended in query parameters. Merchants can get the Checkout status via Checkout API.

GET https://stagconnect.acehubpaymentservices.com/Gateway/v3/Checkouts/{{CHECKOUT_ID}}?businessId={{BUSINESS_ID}}
{
  "result": 0,
  "description": "Completed",
  "header": {
    "requestTimestamp": "2019-01-01T08:02:00Z"
  },
  "body": {
    "payments": [
      {
        "result": 0,
        "description": "Ok",
        "header": {
          "requestTimestamp": "2019-01-01T08:01:00Z",
          "requestCode": "100.379b4d50-5150-4b8b-a51b-0a22e347a18f"
        },
        "body": {
          "card": {
            "approvalCode": "648786",
            "cvvResult": "U",
            "avsResult": "S",
            "expiryMonth": "12",
            "expiryYear": "2030",
            "firstSixDigits": "411111",
            "holderName": "John Doe",
            "lastFourDigits": "1111"
          },
          "transaction": {
            "amount": 1,
            "brandId": 1010,
            "currencyCode": "EUR",
            "action": "payment",
            "id": "{{PAYMENT_ID}}",
            "trackingCode": "{{UNIQUE_ID}}"
          }
        }
      }
    ]
  }
}