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 PAN of an alias from your vault.

Please refer to the API Reference 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.

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": "[email protected]"
    }
}'
{
    "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.


Removing PANs

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

📘

Removing PANs is only available for accounts enabled for Network Tokenization for a given card number.

A removed PAN can not be restored.

curl --request PATCH \
  --url 'https://api.sandbox.datatrans.com/v1/aliases/7LHXscqwAAEAAAGQl2DPXQbbUOZ4ADnU' \
  --header 'Authorization: Basic {{basicAuth}}' \
  --data '{
	    "removePlain": true
}'
{
    "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 API if you are not sure whether the PAN exists or not.