One-Click Payments

One-Click Payments utilize a previously generated payment token to prefill payment details for credit card or invoice payments pages - which means that the payer don't need to enter these details for every purchase. 


The main purchase flow and implementation is exactly the same as described in the Redirect and Hosted View scenarios for card and financing invoice payments, the difference being the use of a paymentToken. The details in this section describe explicitly the parameters that must be set to enable one-click purchases.

API requests to generate paymentToken

When making the initial purchase request, you need to generate a paymentToken. You can do this either by by setting generatePaymentToken to true when doing a card purchase, or set the initial operation to Verify.

Credit cardPurchase or VerifyIf Purchase, generatePaymentToken must be set to true. A verification payment generates a paymentToken automatically.
generatePaymentToken property
"generatePaymentToken": "true"

When the purchase is followed through a paymentToken will linked to the payment.  You can return the value by making a GETrequest payment resource (expanding either the authorizations or verifications sub-resource), after the consumer successfully has completed the purchase.

GET$expand=[authorizations|verifications] HTTP/1.1
"paymentToken": "5adc265f-f87f-4313-577e-08d3dca1a26c",

You need to store the paymentToken in your system and keep track of the corresponding consumer-ID in your system.

Returning purchases

When a known consumer (where you have attained a consumer-ID or similar) returns to your system, you can use the payment token, using already stored payment data, to initiate enable one-click payments. You will need to make a standard redirect purchase, following the sequence as specified in the Redirect scenarios for  credit-card and financing invoice. When making the first POSTrequest you insert the paymentToken attribute. This must be the  paymentToken you received in the initial purchase, where you specified the generatePaymentToken to true.

See the technical reference, for how to create a card and invoice payment.


POST /psp/creditcard/payments HTTP/1.1
Authorization: Bearer <MerchantToken>
Content-Type: application/json

"payment": {
"operation": "Purchase",
"intent": "Authorization",
"paymentToken": "5adc265f-f87f-4313-577e-08d3dca1a26c",
"currency": "SEK",
"prices": [
"type": "CreditCard",
"amount": 1500,
"vatAmount": 0
"description": "Test Purchase",
"payerReference": "AB1234",
"generateRecurrenceToken": "true",
"userAgent": "Mozilla/5.0...",
"language": "sv-SE",
"urls": {
"hostUrls": [
"completeUrl": "",
"cancelUrl": "",
"callbackUrl": "",
"logoUrl": "",
"termsOfServiceUrl": ""
"payeeInfo": {
"payeeId": "22222222-2222-2222-2222-222222222222",
"payeeReference": "AB1234",
"payeeName": "Merchant1",
"productCategory": "A123",
"orderReference": "or123",
"subsite": "MySubsite"
"metadata": {
"key1": "value1",
"key2": 2,
"key3": 3.1,
"key4": false
"cardholder": {
"firstName": "firstname/companyname",
"lastName": "lastname",
"email": "string",
"msisdn": "",
"homePhoneNumber": "",
"workPhoneNumber": ""
"accountInfo": {
"accountAgeIndicator": "01",
"accountChangeIndicator": "01",
"accountPwdChangeIndicator": "01",
"shippingAddressUsageIndicator": "01",
"shippingNameIndicator": "01",
"suspiciousAccountActivity": "01",
"addressMatchIndicator": "false"
"creditCard": {
"rejectCreditCards": false,
"rejectDebitCards": false,
"rejectConsumerCards": false,
"rejectCorporateCards": false

When redirecting to PayEx (as specified in the Redirect scenario) the payment page will be prefilled with the payer's card details.



Delete payment token

Please see Delete payment token

Created by Fredrik Köhler on 2018/10/03 14:56