---
updatedAt: 2025-11-11T01:48:35.000Z
agentTools:
  projectIndex: https://docs.pci-proxy.com/llms.txt
---

# Patch tokens

Update existing aliases and provision Network Tokens

This Patch endpoint allows you to update an existing alias. You can:

* provision a Network Token for an existing alias
* update and map the expiry date (year and month) and cardholder data of a card
* remove the underlying <Glossary>PAN</Glossary> of an alias from your vault.

Please refer to the [API Reference](https://docs.pci-proxy.com/reference/aliasespatch) to get a detailed view of all required and optional fields.

## Provision a Network Token for an existing alias

Call the PATCH alias endpoint to provision a Network Token for an existing alias stored in your PCI Proxy vault.

```java Request
curl -L -X PATCH 'https://api.sandbox.datatrans.com/v1/aliases/7LHXscqwAAEAAAGQl2DPXQbbUOZ4ADnU' \
-H 'Content-Type: application/json; charset=UTF-8' \
-H 'Authorization: Basic {{basicAuth}}' \
--data-raw '{
    "createNetworkToken": true,
    "expiryMonth": "02",    
    "expiryYear": "25",
    "cardholder": {
        "ipAddress": "127.0.0.2",
        "phoneNumber": "+11234567899",
        "emailAddress": "test1@test.com"
    }
}'
```
```javascript Response
{
    "alias": "7LHXscqwAAEAAAGQl2DPXQbbUOZ4ADnU",
    "fingerprint": "F-cg_iu0Xulk1UNMtL57hZW3",
    "type": "CARD",
    "masked": "22228502xxxx7008",
    "dateCreated": "2023-07-09T12:03:42Z",
    "card": {
        "usage": "REGISTRATION",
        "panRemoved": false,
        "bin": "22228502",
        "last4": "7008",
        "expiryMonth": "12",
        "expiryYear": "30",
        "cardInfo": {
            "brand": "MASTERCARD",
            "type": "credit",
            "usage": "consumer",
            "country": "US",
            "issuer": ""
        },
        "networkToken": {
            "expiryMonth": "08",
            "expiryYear": "27",
            "status": "ACTIVE",
            "paymentAccountReference": "5001CKVAXG3BF45LG87F63JVX3AQ0",
            "tokenRequestorId": "50179002095",
            "token": "2222850249926011"
            }
        }
    }
}
```

> 🚧 Mandatory data for Network Token provisioning
>
> Adding the expiry date is required when you want to provision a Network Token (VTS, MDES, AETS).
>
> Additionally for AMEX the `ipAddress` and either `phoneNumber` or `emailAddress`  is required to successfully provision an AMEX token.

<br />

## Removing <Glossary>PAN</Glossary>s

Removing a <Glossary>PAN</Glossary> from storage is helpful if you need to comply certain regulation which doesn't allow storage of plain card details on payment ecosystems.

> 📘 Removing <Glossary>PAN</Glossary>s is only available for accounts enabled for [Network Tokenization](https://docs.pci-proxy.com/docs/network-tokenization) for a given card number.
>
> A removed <Glossary>PAN</Glossary> can not be restored.

```curl Request
curl --request PATCH \
  --url 'https://api.sandbox.datatrans.com/v1/aliases/7LHXscqwAAEAAAGQl2DPXQbbUOZ4ADnU' \
  --header 'Authorization: Basic {{basicAuth}}' \
  --data '{
	    "removePlain": true
}'
```
```json Response
{
    "alias": "7LHXscqwAAEAAAGQl2DPXQbbUOZ4ADnU",
    "fingerprint": "F-cg_iu0Xulk1UNMtL57hZW3",
    "type": "CARD",
    "masked": "22228502xxxx7008",
    "dateCreated": "2023-07-09T12:03:42Z",
    "card": {
        "panRemoved": true,
        "bin": "22228502",
        "last4": "7008",
        "expiryMonth": "12",
        "expiryYear": "30",
        "cardInfo": {
            "brand": "MASTERCARD",
            "type": "credit",
            "usage": "consumer",
            "country": "US",
            "issuer": ""
        },
        "networkToken": {
            "expiryMonth": "08",
            "expiryYear": "27",
            "status": "ACTIVE",
            "paymentAccountReference": "5001CKVAXG3BF45LG87F63JVX3AQ0",
            "tokenRequestorId": "50179002095",
            "token": "2222850249926011"
        }
    }
}
```

The response property `panRemoved` indicates if the PAN has been removed from storage for a given alias. You can also call the [Token Status](https://docs.pci-proxy.com/docs/token-status) API if you are not sure whether the <Glossary>PAN</Glossary> exists or not.