--- title: "Authorise a recurring payment" url: "https://docs.adyen.com/online-payments/classic-integrations/classic-api-integration/tokenization/authorise-a-recurring-payment" source_url: "https://docs.adyen.com/online-payments/classic-integrations/classic-api-integration/tokenization/authorise-a-recurring-payment.md" canonical: "https://docs.adyen.com/online-payments/classic-integrations/classic-api-integration/tokenization/authorise-a-recurring-payment" last_modified: "2020-01-24T16:44:00+01:00" language: "en" --- # Authorise a recurring payment [View source](/online-payments/classic-integrations/classic-api-integration/tokenization/authorise-a-recurring-payment.md) **Adyen is no longer developing the Classic API integration** This page is for the Classic API (`/authorise`) integration, which we no longer accept new integrations with. We strongly recommend migrating to the newer [Tokenization](/online-payments/tokenization) integration. To use this newer integration, you must also [migrate to the Checkout API](/online-payments/upgrade-your-integration/migrate-to-checkout-api). After you successfully [stored payment details](/online-payments/classic-integrations/classic-api-integration/tokenization/store-payment-details) during the first `/authorise` call, you can refer to these details in subsequent calls every time a recurring payment should take place. ## One-click payments For subsequent [one-click payments](/online-payments/classic-integrations/classic-api-integration/tokenization), include in your [/authorise](https://docs.adyen.com/api-explorer/#/Payment/authorise) request: * `card.cvc`: the card CVC that you collected from the shopper. * `recurring.contract`: **ONECLICK** * `recurringProcessingModel`: **CardOnFile** * `shopperReference`: The `shopperReference` that you specified when storing the payment details. * `shopperInteraction`: **ContAuth** * `selectedRecurringDetailReference`: Either the `recurringDetailReference` returned from the list of all stored details based on the `shopperReference`, or **LATEST** to use the most recent recurring detail. The following code examples show the request of a one-click payment. #### JSON ```json { "amount":{ "value":2000, "currency":"EUR" }, "card":{ "cvc":"737" }, "reference":"Your Reference Here", "merchantAccount":"TestMerchant", "shopperEmail":"s.hopper@test.com", "shopperIP":"61.294.12.12", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j", "selectedRecurringDetailReference":"LATEST", "recurring":{ "contract":"ONECLICK" }, "recurringProcessingModel": "CardOnFile", "shopperInteraction":"ContAuth" } ``` #### Soap ```xml EUR 2000 737 TestMerchant Your Reference Here s.hopper@test.com 61.294.12.12 YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j LATEST ONECLICK CardOnFile ContAuth ``` #### Form ```html merchantAccount=TestMerchant&amount.value=2000&amount.currency=EUR&card.cvc=737&reference=Your+Reference+Here&shopperReference=YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j&shopperEmail=s.hopper%40test.com&shopperIP=61.294.12.12&recurring.contract=ONECLICK&recurringProcessingModel=CardOnFile&selectedRecurringDetailReference=LATEST&shopperInteraction=ContAuth ``` If you are [hosting the CSE library](/online-payments/classic-integrations/classic-api-integration/client-side-encryption/hosting-the-cse-library), include the encrypted card CVC in `additionalData`: ```json { "amount":{ "value":2000, "currency":"EUR" }, "additionalData":{ "card.encrypted.json":"adyenjs_0_1_18$*******" }, "reference":"Your Reference Here", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "shopperEmail":"s.hopper@test.com", "shopperIP":"61.294.12.12", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j", "selectedRecurringDetailReference":"LATEST", "recurring":{ "contract":"ONECLICK" }, "recurringProcessingModel":"CardOnFile", "shopperInteraction":"ContAuth" } ``` ## Recurring payments For subsequent [recurring payments](/online-payments/classic-integrations/classic-api-integration/tokenization), include in your [/authorise](https://docs.adyen.com/api-explorer/#/Payment/authorise) request: * `recurring.contract`: **RECURRING** * `recurringProcessingModel`: **Subscription** * `shopperReference`: The `shopperReference` that you specified when storing the payment details. * `shopperInteraction`: **ContAuth** * `selectedRecurringDetailReference`: Either the `recurringDetailReference` returned from the list of all stored details based on the `shopperReference`, or **LATEST** to use the most recent recurring detail. The following code examples show the request of a recurring payment. #### JSON ```json { "amount":{ "value":2000, "currency":"EUR" }, "reference":"Your Reference Here", "merchantAccount":"TestMerchant", "shopperEmail":"s.hopper@test.com", "shopperIP":"61.294.12.12", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j", "selectedRecurringDetailReference":"LATEST", "recurring":{ "contract":"RECURRING" }, "recurringProcessingModel": "Subscription", "shopperInteraction":"ContAuth" } ``` #### Soap ```xml EUR 2000 TestMerchant Your Reference Here s.hopper@test.com 61.294.12.12 YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j LATEST RECURRING Subscription ContAuth ``` #### curl ```bash curl https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount": { "value": 2000, "currency": "EUR" }, "reference": "Your Reference Here", "merchantAccount": "TestMerchant", "shopperEmail": "s.hopper@test.com", "shopperIP": "61.294.12.12", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j", "selectedRecurringDetailReference": "LATEST", "recurring": { "contract": "RECURRING" }, "recurringProcessingModel": "Subscription", "shopperInteraction": "ContAuth" }' ``` #### Java ```java // Adyen Java API Library v39.3.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.payment.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.service.*; Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(2000L); Recurring recurring = new Recurring() .contract(Recurring.ContractEnum.RECURRING); PaymentRequest paymentRequest = new PaymentRequest() .reference("Your Reference Here") .amount(amount) .merchantAccount("TestMerchant") .recurring(recurring) .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.SUBSCRIPTION) .selectedRecurringDetailReference("LATEST") .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH) .shopperEmail("s.hopper@test.com") .shopperIP("61.294.12.12") .shopperReference("YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j"); // Send the request paymentApi service = new paymentApi(client); PaymentResult response = service.authorise(paymentRequest, null); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(2000); $recurring = new Recurring(); $recurring ->setContract("RECURRING"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("Your Reference Here") ->setAmount($amount) ->setMerchantAccount("TestMerchant") ->setRecurring($recurring) ->setRecurringProcessingModel("Subscription") ->setSelectedRecurringDetailReference("LATEST") ->setShopperInteraction("ContAuth") ->setShopperEmail("s.hopper@test.com") ->setShopperIP("61.294.12.12") ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j"); // Send the request $service = new PaymentsApi($client); $response = $service->authorise($paymentRequest); ``` #### C\# ```cs // Adyen .net API Library v32.1.1 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Payment; using Adyen.Service; var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) Amount amount = new Amount { Currency = "EUR", Value = 2000 }; Recurring recurring = new Recurring { Contract = Recurring.ContractEnum.RECURRING }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "Your Reference Here", Amount = amount, MerchantAccount = "TestMerchant", Recurring = recurring, RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.Subscription, SelectedRecurringDetailReference = "LATEST", ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth, ShopperEmail = "s.hopper@test.com", ShopperIP = "61.294.12.12", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j" }; // Send the request var service = new PaymentService(client); var response = service.Authorise(paymentRequest); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v29.0.0 const { Client, PaymentAPI } = require('@adyen/api-library'); const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentRequest = { amount: { value: 2000, currency: "EUR" }, reference: "Your Reference Here", merchantAccount: "TestMerchant", shopperEmail: "s.hopper@test.com", shopperIP: "61.294.12.12", shopperReference: "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j", selectedRecurringDetailReference: "LATEST", recurring: { contract: "RECURRING" }, recurringProcessingModel: "Subscription", shopperInteraction: "ContAuth" } // Send the request const paymentAPI = new PaymentAPI(client); const response = paymentAPI.authorise(paymentRequest); ``` #### Go ```go // Adyen Go API Library v21.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/src/payments" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := payments.Amount{ Currency: "EUR", Value: 2000, } recurring := payments.Recurring{ Contract: common.PtrString("RECURRING"), } paymentRequest := payments.PaymentRequest{ Reference: "Your Reference Here", Amount: amount, MerchantAccount: "TestMerchant", Recurring: &recurring, RecurringProcessingModel: common.PtrString("Subscription"), SelectedRecurringDetailReference: common.PtrString("LATEST"), ShopperInteraction: common.PtrString("ContAuth"), ShopperEmail: common.PtrString("s.hopper@test.com"), ShopperIP: common.PtrString("61.294.12.12"), ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j"), } // Send the request service := client.Payments() req := service.PaymentsApi.AuthoriseInput().PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Authorise(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v13.6.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "amount": { "value": 2000, "currency": "EUR" }, "reference": "Your Reference Here", "merchantAccount": "TestMerchant", "shopperEmail": "s.hopper@test.com", "shopperIP": "61.294.12.12", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j", "selectedRecurringDetailReference": "LATEST", "recurring": { "contract": "RECURRING" }, "recurringProcessingModel": "Subscription", "shopperInteraction": "ContAuth" } # Send the request result = adyen.payment.payments_api.authorise(request=json_request) ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :amount => { :value => 2000, :currency => 'EUR' }, :reference => 'Your Reference Here', :merchantAccount => 'TestMerchant', :shopperEmail => 's.hopper@test.com', :shopperIP => '61.294.12.12', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j', :selectedRecurringDetailReference => 'LATEST', :recurring => { :contract => 'RECURRING' }, :recurringProcessingModel => 'Subscription', :shopperInteraction => 'ContAuth' } # Send the request result = adyen.payment.payments_api.authorise(request_body) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.0.0 import { Client, PaymentAPI, Types } from "@adyen/api-library"; const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.payment.Amount = { currency: "EUR", value: 2000 }; const recurring: Types.payment.Recurring = { contract: Types.payment.Recurring.ContractEnum.RECURRING }; const paymentRequest: Types.payment.PaymentRequest = { reference: "Your Reference Here", amount: amount, merchantAccount: "TestMerchant", recurring: recurring, recurringProcessingModel: Types.payment.PaymentRequest.RecurringProcessingModelEnum.Subscription, selectedRecurringDetailReference: "LATEST", shopperInteraction: Types.payment.PaymentRequest.ShopperInteractionEnum.ContAuth, shopperEmail: "s.hopper@test.com", shopperIP: "61.294.12.12", shopperReference: "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j" }; // Send the request const paymentAPI = new PaymentAPI(client); const response = paymentAPI.authorise(paymentRequest); ``` ## Next steps * [Capture a recurring payment](/online-payments/classic-integrations/classic-api-integration/tokenization/capture-a-recurring-payment) * [Retrieve stored details](/online-payments/classic-integrations/classic-api-integration/tokenization/retrieve-stored-details) * [Update stored details](/online-payments/classic-integrations/classic-api-integration/tokenization/update-stored-details)