Menu

Card Number token type

Worldpay STS tokens (Direct) examples are shown below for the Card Number token type. Each example includes a request and a response.

Note: eCheck is not supported for Worldpay STS (WPG) tokens.


Token types

Merchants can be onboarded to use either Card or Card Number token types. The token type is configured on the STS system.

If you were onboarded using the Card Number token type, refer to the Worldpay STS token (Direct) examples shown below.

Headers

Include theTMS-specific headersin all of your requests.

Tokenize card - shopper tokens

Tokenize card - shopper tokens request and response examples are shown below.

  • token.payloadType must be card.
  • outputTokenProviderProfileIds contains your assigned profileId(s) that you want to tokenize against.
  • cardDetails.cardNumber and shopper.id are required.

Request

Copied!
{
    "token": {
        "payloadType": "Card"
    },
    "cardDetails": {
        "cardNumber": "4111111111111111"
    },
    "shopper": {
        "id": "123"
    },
    "outputTokenProviderProfileIds": [
        "Your_STSCardNumber_Profile"
    ]
}

Response

Ignore tokens.isNewlyCreated as it does not apply to STS tokens.

Copied!
{
    "tokens": [
        {
            "statusCode": "100",
            "tokenProvider": "STS WPG Token Provider",
            "profileId": "Your_STSCardNumber_Profile",
            "value": "99560584550225161072",
            "payloadType": "Card",
            "tokenProviderRefId": "f4c97bd4df0141be85f9eccdb60e1273",
            "isNewlyCreated": false,
            "expirationDate": "2021-12-11 17:32:35Z"
        }
    ],
    "statusCode": "100",
    "requestId": "lUzMQoAx70yi7OuQeEcarQ"
}

Detokenize card - shopper tokens

Detokenize card - shopper tokens request and response examples are shown below.

Request

GET https://dev-tesua-vip.pmdev.local/api/tokens/99560584550225161072?profileId=Your_STSCardNumber_Profile&payloadType=Card&shopperId=123

Response

Copied!
{
    "cardDetails": {
        "cardNumber": "4111111111111111"
    },
    "statusCode": "100",
    "requestId": "RV57wnE3k0O7Fb5NVpSZcA"
}

Tokenize card - Merchant tokens

Tokenize card - Merchant tokens request and response examples are shown below.

  • token.payloadType must be card
  • outputTokenProviderProfileIds contains your assigned profileId(s)
  • cardDetails.cardNumber is required

Request

Copied!
{
    "token": {
        "payloadType": "Card"
    },
    "cardDetails": {
        "cardNumber": "4111111111111111"
    },
    "outputTokenProviderProfileIds": [
        "Your_STSCardNumber_Profile"
    ]
}

Response

Ignore tokens.isNewlyCreated as it does not apply to STS tokens.

Copied!
{
    "tokens": [
        {
            "statusCode": "100",
            "tokenProvider": "STS WPG Token Provider",
            "profileId": "Your_STSCardNumber_Profile",
            "value": "99631436642424548271",
            "payloadType": "Card",
            "tokenProviderRefId": "958ca59f5689491e9003e8a594f1903b",
            "isNewlyCreated": false,
            "expirationDate": "2021-12-08 02:49:54Z"
        }
    ],
    "statusCode": "100",
    "requestId": "0x6tH3xy0kSOzVaMc2dfqA"
}

Detokenize card - Merchant tokens

Detokenize card - Merchant tokens request and response examples are shown below.

Request

GEThttps://dev-tesua-vip.pmdev.local/api/tokens/99631436642424548271?profileId=Your_STSCardNumber_Profile&payloadType=Card

Response

Copied!
{
    "cardDetails": {
        "cardNumber": "4111111111111111"
    },
    "statusCode": "100",
    "requestId": "1z8ErhKzB0iszYHMoUDow"
}