> ## Documentation Index
> Fetch the complete documentation index at: https://adyen-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Stored Details

> This page is for the Classic API ( /authorise ) integration, which we no longer accept new integrations with.

**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 [Manage tokens](https://adyen-preview.mintlify.site/online-payments/tokenization/managing-tokens.md#update-stored-details) integration. To use this newer integration, you must also [migrate to the Checkout API](https://adyen-preview.mintlify.site/online-payments/upgrade-your-integration/migrate-to-checkout-api).

For credit cards, you can update the [previously stored payment details](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/tokenization/store-payment-details.md). This may be required, for example, when the card expiry date or the billing/delivery address changes.

## Request

You can update stored payment details when you initiate a new recurring payment. For this, pass new payment details along with an `/authorise` call and specify the `selectedRecurringDetailReference` value of the details that you want to update.

The details will only update if the `/authorise` request is successful.

For information on all available fields, see [PaymentRequest](https://docs.adyen.com/api-explorer/Payment/latest/authorise).

The following example demonstrates how to update the expiry month and year for the previously stored card details with an `/authorise` call:

#### JSON

```json theme={null}
{
   "amount":{
      "value":"100",
      "currency":"EUR"
   },
   "card":{
      "expiryMonth":"11",
      "expiryYear":"2018"
   },
   "merchantAccount":"TestMerchant",
   "recurring":{
      "contract":"RECURRING"
   },
   "recurringProcessingModel": "Subscription",
   "reference":"RecurringPayment-0001",
   "shopperEmail":"gras.shopper77@somewhere.org",
   "shopperIP":"1.1.1.1",
   "shopperInteraction":"ContAuth",
   "shopperReference":"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
   "selectedRecurringDetailReference":"RecurringDetailReference1"
}
```

#### Soap

```xml theme={null}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
     <ns1:authorise xmlns:ns1="http://payment.services.adyen.com">
       <ns1:paymentRequest>
         <amount xmlns="http://payment.services.adyen.com">
           <currency xmlns="http://common.services.adyen.com">EUR</currency>
           <value xmlns="http://common.services.adyen.com">100</value>
         </amount>
         <ns1:card>
           <ns1:expiryMonth>11</ns1:expiryMonth>
           <ns1:expiryYear>2018</ns1:expiryYear>
         </ns1:card>
         <ns1:merchantAccount>TestMerchant</ns1:merchantAccount>
         <ns1:recurring>
           <ns1:contract>RECURRING</ns1:contract>
         </ns1:recurring>
         <ns1:recurringProcessingModel>Subscription</ns1:recurringProcessingModel>
         <ns1:reference>RecurringPayment-0001</ns1:reference>
         <ns1:shopperEmail>gras.shopper77@somewhere.org</ns1:shopperEmail>
         <ns1:shopperIP>1.1.1.1</ns1:shopperIP>
         <ns1:shopperInteraction>ContAuth</ns1:shopperInteraction>
         <ns1:shopperReference>YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j</ns1:shopperReference>
         <ns1:selectedRecurringDetailReference>RecurringDetailReference1</ns1:selectedRecurringDetailReference>
       </ns1:paymentRequest>
     </ns1:authorise>
   </soap:Body> 
</soap:Envelope>
```

```bash curl theme={null}
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": 10,
   "currency": "EUR"
 },
 "card": {
   "expiryMonth": 11,
   "expiryYear": 2018
 },
 "merchantAccount": "TestMerchant",
 "recurring": {
   "contract": "RECURRING"
 },
 "recurringProcessingModel": "Subscription",
 "reference": "RecurringPayment-0001",
 "shopperEmail": "gras.shopper77@somewhere.org",
 "shopperIP": "1.1.1.1",
 "shopperInteraction": "ContAuth",
 "shopperReference": "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
 "selectedRecurringDetailReference": "RecurringDetailReference1"
}'
```

```java Java theme={null}
// Adyen Java API Library v25.0.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(10L);

Recurring recurring = new Recurring()
  .contract(Recurring.ContractEnum.RECURRING);

Card card = new Card()
  .expiryMonth("11")
  .expiryYear("2018");

PaymentRequest paymentRequest = new PaymentRequest()
  .reference("RecurringPayment-0001")
  .amount(amount)
  .merchantAccount("TestMerchant")
  .recurring(recurring)
  .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.SUBSCRIPTION)
  .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH)
  .selectedRecurringDetailReference("RecurringDetailReference1")
  .shopperEmail("gras.shopper77@somewhere.org")
  .shopperIP("1.1.1.1")
  .card(card)
  .shopperReference("YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j");

// Make the API call
paymentApi service = new paymentApi(client);
PaymentResult response = service.authorise(paymentRequest, null);
```

```php PHP theme={null}
// Adyen PHP API Library v17.4.0
use Adyen\Client;
use Adyen\Environment;
use Adyen\Model\Payments\Amount;
use Adyen\Model\Payments\Recurring;
use Adyen\Model\Payments\Card;
use Adyen\Model\Payments\PaymentRequest;
use Adyen\Service\Payments\PaymentsApi;

$client = new Client();
$client->setXApiKey("ADYEN_API_KEY");
$client->setEnvironment(Environment::TEST);


// Create the request object(s)
$amount = new Amount();
$amount
  ->setCurrency("EUR")
  ->setValue(10);

$recurring = new Recurring();
$recurring
  ->setContract("RECURRING");

$card = new Card();
$card
  ->setExpiryMonth("11")
  ->setExpiryYear("2018");

$paymentRequest = new PaymentRequest();
$paymentRequest
  ->setReference("RecurringPayment-0001")
  ->setAmount($amount)
  ->setMerchantAccount("TestMerchant")
  ->setRecurring($recurring)
  ->setRecurringProcessingModel("Subscription")
  ->setShopperInteraction("ContAuth")
  ->setSelectedRecurringDetailReference("RecurringDetailReference1")
  ->setShopperEmail("gras.shopper77@somewhere.org")
  ->setShopperIP("1.1.1.1")
  ->setCard($card)
  ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j");

// Make the API call
$service = new PaymentsApi($client);
$response = $service->authorise($paymentRequest);
```

```cs C# theme={null}
// Adyen .net API Library v14.4.0
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 = 10
};

Recurring recurring = new Recurring
{
  Contract = Recurring.ContractEnum.RECURRING
};

Card card = new Card
{
  ExpiryMonth = "11",
  ExpiryYear = "2018"
};

PaymentRequest paymentRequest = new PaymentRequest
{
  Reference = "RecurringPayment-0001",
  Amount = amount,
  MerchantAccount = "TestMerchant",
  Recurring = recurring,
  RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.Subscription,
  ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth,
  SelectedRecurringDetailReference = "RecurringDetailReference1",
  ShopperEmail = "gras.shopper77@somewhere.org",
  ShopperIP = "1.1.1.1",
  Card = card,
  ShopperReference = "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j"
};

// Make the API call
var service = new PaymentService(client);
var response = service.Authorise(paymentRequest);
```

```js NodeJS (JavaScript) theme={null}
// Adyen Node API Library v16.2.0
// Require the parts of the module you want to use
const { Client, PaymentAPI } = require('@adyen/api-library');
// Initialize the client object
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object(s)
const paymentRequest = {
  amount: {
    value: 10,
    currency: "EUR"
  },
  card: {
    expiryMonth: 11,
    expiryYear: 2018
  },
  merchantAccount: "TestMerchant",
  recurring: {
    contract: "RECURRING"
  },
  recurringProcessingModel: "Subscription",
  reference: "RecurringPayment-0001",
  shopperEmail: "gras.shopper77@somewhere.org",
  shopperIP: "1.1.1.1",
  shopperInteraction: "ContAuth",
  shopperReference: "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
  selectedRecurringDetailReference: "RecurringDetailReference1"
}

// Make the API call
const paymentAPI = new PaymentAPI(client);
const response = paymentAPI.authorise(paymentRequest);
```

```go Go theme={null}
// Adyen Go API Library v9.3.0
import (
  "context"
  "github.com/adyen/adyen-go-api-library/v9/src/common"
  "github.com/adyen/adyen-go-api-library/v9/src/adyen"
  "github.com/adyen/adyen-go-api-library/v9/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: 10,
}

recurring := payments.Recurring{
  Contract: common.PtrString("RECURRING"),
}

card := payments.Card{
  ExpiryMonth: common.PtrString("11"),
  ExpiryYear: common.PtrString("2018"),
}

paymentRequest := payments.PaymentRequest{
  Reference: "RecurringPayment-0001",
  Amount: amount,
  MerchantAccount: "TestMerchant",
  Recurring: &recurring,
  RecurringProcessingModel: common.PtrString("Subscription"),
  ShopperInteraction: common.PtrString("ContAuth"),
  SelectedRecurringDetailReference: common.PtrString("RecurringDetailReference1"),
  ShopperEmail: common.PtrString("gras.shopper77@somewhere.org"),
  ShopperIP: common.PtrString("1.1.1.1"),
  Card: &card,
  ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j"),
}

// Make the API call
service := client.Payments()
req := service.PaymentsApi.AuthoriseInput().PaymentRequest(paymentRequest)
res, httpRes, err := service.PaymentsApi.Authorise(context.Background(), req)
```

```py Python theme={null}
# Adyen Python API Library v12.2.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": 10,
    "currency": "EUR"
  },
  "card": {
    "expiryMonth": 11,
    "expiryYear": 2018
  },
  "merchantAccount": "TestMerchant",
  "recurring": {
    "contract": "RECURRING"
  },
  "recurringProcessingModel": "Subscription",
  "reference": "RecurringPayment-0001",
  "shopperEmail": "gras.shopper77@somewhere.org",
  "shopperIP": "1.1.1.1",
  "shopperInteraction": "ContAuth",
  "shopperReference": "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
  "selectedRecurringDetailReference": "RecurringDetailReference1"
}

# Make the API call
result = adyen.payment.payments_api.authorise(request=json_request)
```

```rb Ruby theme={null}
# Adyen Ruby API Library v9.3.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 => 10,
    :currency => 'EUR'
  },
  :card => {
    :expiryMonth => 11,
    :expiryYear => 2018
  },
  :merchantAccount => 'TestMerchant',
  :recurring => {
    :contract => 'RECURRING'
  },
  :recurringProcessingModel => 'Subscription',
  :reference => 'RecurringPayment-0001',
  :shopperEmail => 'gras.shopper77@somewhere.org',
  :shopperIP => '1.1.1.1',
  :shopperInteraction => 'ContAuth',
  :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j',
  :selectedRecurringDetailReference => 'RecurringDetailReference1'
}

# Make the API call
result = adyen.payment.payments_api.authorise(request_body)
```

```ts NodeJS (TypeScript) theme={null}
// Adyen Node API Library v16.2.0
// Require the parts of the module you want to use
import { Client, PaymentAPI, Types } from "@adyen/api-library";
// Initialize the client object
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object(s)
const amount: Types.payment.Amount = {
  currency: "EUR",
  value: 10
};

const recurring: Types.payment.Recurring = {
  contract: Types.payment.Recurring.ContractEnum.RECURRING
};

const card: Types.payment.Card = {
  expiryMonth: "11",
  expiryYear: "2018"
};

const paymentRequest: Types.payment.PaymentRequest = {
  reference: "RecurringPayment-0001",
  amount: amount,
  merchantAccount: "TestMerchant",
  recurring: recurring,
  recurringProcessingModel: Types.payment.PaymentRequest.RecurringProcessingModelEnum.Subscription,
  shopperInteraction: Types.payment.PaymentRequest.ShopperInteractionEnum.ContAuth,
  selectedRecurringDetailReference: "RecurringDetailReference1",
  shopperEmail: "gras.shopper77@somewhere.org",
  shopperIP: "1.1.1.1",
  card: card,
  shopperReference: "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j"
};

// Make the API call
const paymentAPI = new PaymentAPI(client);
const response = paymentAPI.authorise(paymentRequest);
```

## Response

If a recurring payment is successfully authorised, payment details are also updated during this call. In this case, the old `recurringDetailReference` becomes invalid, and a new reference is created.

A new `recurringDetailReference` value isn't returned in the `/authorisation` response. To learn how to obtain a new `recurringDetailReference` value, refer to [this document](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/tokenization/retrieve-stored-details.md).

For information on all available fields, refer to the [PaymentResult](https://docs.adyen.com/api-explorer/Payment/latest/authorise) topic.

The following example shows the response in case of successful authorisation:

#### JSON

```json theme={null}
{
   "pspReference":"8535034809517607",
   "resultCode":"Authorised",
   "authCode":"32486"
}
```

#### Soap

```xml theme={null}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
               xmlns:ns1="http://payment.services.adyen.com" 
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <ns1:authoriseResponse>
         <ns1:paymentResult>
            <ns1:pspReference>9914713344211235</ns1:pspReference>
            <ns1:resultCode>Authorised</ns1:resultCode>
            <ns1:authCode>32486</ns1:authCode>
         </ns1:paymentResult>
      </ns1:authoriseResponse>
   </soap:Body>
</soap:Envelope>
```

## Next steps

* [Disable stored details](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/tokenization/disable-stored-details.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.