> ## Documentation Index
> Fetch the complete documentation index at: https://developers.pcibooking.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Card Expiration Date

> Update the expiration date on a stored token. Only the expiration date is changed; all other card data remains unchanged.

<Card title="Update Card Data Guide" icon="book" href="/manage-tokens/update-card-data">
  Modify expiration dates and creator references on tokens
</Card>

Updates the expiration date on a stored token without affecting any other card data. Use this when a cardholder's card has been renewed with a new expiration date and you need to keep the token current.

## Error Responses

| Code  | HTTP Status | Condition                            |
| ----- | ----------- | ------------------------------------ |
| -125  | 400         | Year or Month value is not numeric   |
| -125  | 400         | Expiration date is in the past       |
| -1003 | 401         | User is not the owner of this token  |
| -160  | 404         | Card not found for the given token   |
| -150  | 500         | Update transaction failed (rollback) |

## Parameter Constraints

| Parameter | Type   | Required | Constraints                                                           |
| --------- | ------ | -------- | --------------------------------------------------------------------- |
| Month     | string | Yes      | Numeric string, valid range 1 to 12                                   |
| Year      | string | Yes      | Numeric string, must be greater than or equal to the current UTC year |

<Note>This endpoint is rate limited.</Note>

## Parameters

### Headers

<ParamField header="Authorization" type="string" required>
  Your API key prefixed with `APIKEY`. Example: `APIKEY your-api-key`. See the [Authentication guide](/getting-started/authentication).
</ParamField>

### Path Parameters

<ParamField path="cardToken" type="string" required>
  The token ID as returned by one of the tokenization methods. For example, `2821a46d80e14d1b96a7f18f1b81926d`.
</ParamField>

### Request Body

<ParamField body="Year" type="integer" required>
  New expiration year. Format **YYYY**.
</ParamField>

<ParamField body="Month" type="integer" required>
  New expiration month. Format **MM**.
</ParamField>

<RequestExample>
  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://service.pcibooking.net/api/payments/paycard/2821a46d80e14d1b96a7f18f1b81926d/UpdateExpiration',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'APIKEY your-api-key',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        Year: 2027,
        Month: 12
      })
    }
  );

  console.log(response.status);
  ```

  ```python Python theme={null}
  import requests

  response = requests.put(
      'https://service.pcibooking.net/api/payments/paycard/2821a46d80e14d1b96a7f18f1b81926d/UpdateExpiration',
      headers={
          'Authorization': 'APIKEY your-api-key',
          'Content-Type': 'application/json'
      },
      json={
          'Year': 2027,
          'Month': 12
      }
  )

  print(response.status_code)
  ```
</RequestExample>

## Response

**200** - Expiration updated successfully. Empty response body.

<ResponseExample>
  ```text 200 theme={null}
  Expiration date updated successfully. No content returned.
  ```

  ```json 400 theme={null}
  {
      "code": -125,
      "message": "Bad input data",
      "moreInfo": "Expiration year/month error",
      "errorList": null
  }
  ```

  ```json 401 theme={null}
  {
      "code": -1003,
      "message": "Not authorized to access this resource",
      "moreInfo": "Bad or missing authorization data, expected APIKEY",
      "errorList": null
  }
  ```
</ResponseExample>
