Managing the Lifecycle of Digital Wallet Tokens

For every token activation request, the card network, the Marqeta platform, and the digital wallet individually assess the legitimacy of the request and reach an approval decision. After this initial determination is made, you can process requests that require further verification. Additionally, you can transition a digital wallet token to any valid state at any time during its lifecycle.

Token approval process

Before you can insert a card into a digital wallet, the card network must provision a token to replace the card's sensitive data. During token provisioning, the digital wallet, the card network, and the Marqeta platform (the issuer/processor) each perform identification and verification (ID&V) steps to individually assess the legitimacy of the token provisioning request. Each participant scores the request by tagging it with one of the following colors:

  • Red – "Do not provision" – If any participant designates DECISION_RED, the token is not provisioned and the card holder is informed that the tokenization request failed.
  • Green – "Provision" – If all participants designate DECISION_GREEN, the token is immediately provisioned.
  • Yellow – “Further verification” - If any participant designates DECISION_YELLOW and none designates DECISION_RED, the token is placed in a pending state and further action is required. DECISION_YELLOW indicates that the participant is unsure of the risk associated with provisioning the token.

After the card network, the Marqeta platform, and the digital wallet reach an approval decision for the token activation request, the Marqeta platform sends an event notification to your webhook endpoint. If the token activation request results in a DECISION_YELLOW, you can perform further verification and transition the token to the appropriate state.

Each participant in the tokenization process uses their own business logic to determine the level of risk associated with creating a new token. A DECISION_YELLOW usually originates at the digital wallet provider and is invoked due to issues such as “Account not in good standing” or “Suspected fraud.”


Processing requests that require further verification

When a token activation request results in a DECISION_YELLOW, you must take additional steps to verify the legitimacy of the request. You must provide at least two methods of verification for your users.

Available methods of verification include the following:

  • Over-the-phone verification – The user calls into your call center or interactive voice response (IVR) system, which verifies the identity of the card holder. You make an API call to transition the digital wallet token based on the verification decision you reach.
  • In-app verification – Your app verifies the card holder’s identity using your own business logic. You make an API call to transition the digital wallet token based on the verification decision you reach.
  • One-time passcode – The Marqeta platform sends a verification passcode to the card holder using email or SMS; the card holder enters the passcode into the digital wallet for identity verification. The Marqeta platform transitions the digital wallet token.

At least one of your verification methods must use over-the-phone verification. Contact your Marqeta Customer Success representative to configure these options.

If you are using over-the-phone or in-app verification, you must assess the legitimacy of the request. Depending on the outcome of your assessment, you can explicitly activate or terminate the token request, effectively overriding the DECISION_YELLOW (regardless of who made that decision).

To process requests that require further verification:

  1. Ensure that your webhook endpoint is configured to receive notifications for token.activation-request type events. These notifications contain the entire token activation request. (See Webhooks Management for information on configuring your webhook endpoint.)
  2. Issue a POST request to the /digitalwallettokentransitions endpoint and set the state based on your decision. For example, if you want to approve the request, set the state field set to ACTIVE.

{
 "token": "my_transition_04",
 "digital_wallet_token": {
  "token": "b98cb680-2fd4-4c14-aa56-8d05091209d5"
  },
 "state": "ACTIVE",
 "reason": "Passed additional identity verification"
}


Determining the status of a token request

If you have properly configured your webhook endpoint, you will receive an event notification of type token.activation-request whenever the Marqeta platform processes a token activation request. This event notification contains the response to the token activation request, which allows you to determine the approval decision and whether the token has been provisioned, rejected, or is pending.

To determine the status of a token activation request, monitor these fields in the token.activation-request notification:

  • digital_wallet_token.state – "ACTIVE" indicates that the token has been provisioned and is active. "REQUESTED" indicates that token provisioning is still pending. “REQUEST_DECLINED” indicates that token provisioning was rejected.
  • digital_wallet_token.fulfillment_status – "DECISION_GREEN" indicates that the token has been provisioned. "DECISION_RED" indicates that token provisioning was rejected. "DECISION_YELLOW" indicates that token provisioning is pending and that further action is required to provision the token.
  • digital_wallet_token.issuer_eligibility_decision – "0000" indicates that the token has been provisioned. "token.activation.verification.required" indicates that token provisioning is pending and that further action is required to provision the token.

The following code sample shows a token.activation-request event notification:

{
    "type": "token.activation-request",
    "state": "CLEARED",
    "token": "23843",
    "user_token": "d5e46927-0c84-4010-af80-5844fce8c154",
    "acting_user_token": "d5e46927-0c84-4010-af80-5844fce8c154",
    "card_token": "348b7e88-f689-4a72-b4ed-20a178d5919a",
    "gpa": {
        "currency_code": "USD",
        "ledger_balance": 10,
        "available_balance": 0,
        "credit_balance": 0,
        "pending_credits": 10,
        "balances": {
            "USD": {
                "currency_code": "USD",
                "ledger_balance": 10,
                "available_balance": 0,
                "credit_balance": 0,
                "pending_credits": 10
            }
        }
    },
    "duration": 50,
    "created_time": "2018-07-16T17:41:41Z",
    "user_transaction_time": "2018-07-16T17:41:41Z",
    "settlement_date": "2018-07-16T00:00:00Z",
    "amount": 0,
    "issuer_interchange_amount": 0,
    "approval_code": "766530",
    "response": {
        "code": "0000",
        "memo": "Approved or completed successfully"
    },
    "network": "VISA",
    "subnetwork": "VISANET",
    "acquirer_fee_amount": 0,
    "acquirer": {
        "institution_country": "840",
        "institution_id_code": "871606746",
        "retrieval_reference_number": "936048123849",
        "system_trace_audit_number": "468607"
    },
    "digital_wallet_token": {
        "token": "d7eed4f0-d61b-441d-879b-e7102acc23f4",
        "card_token": "348b7e88-f689-4a72-b4ed-20a178d5919a",
        "state": "REQUESTED",
        "fulfillment_status": "DECISION_GREEN",
        "issuer_eligibility_decision": "0000",
        "created_time": "2018-07-16T17:41:41Z",
        "last_modified_time": "2018-07-16T17:41:41Z",
        "token_service_provider": {
            "token_reference_id": "408564928506142",
            "pan_reference_id": "41673069",
            "token_requestor_id": "28270789220",
            "token_requestor_name": "UNKNOWN",
            "token_type": "DEVICE_SECURE_ELEMENT",
            "token_expiration": "1120",
            "token_score": "99",
            "token_assurance_level": "00",
            "token_eligibility_decision": "DECISION_GREEN"
        },
        "device": {
            "type": "MOBILE_PHONE",
            "language_code": "ne",
            "device_id": "742968498356601664707181916878546216842668795786",
            "phone_number": "5557994077",
            "name": "ramps",
            "location": "70.558807589/67.436713420",
            "ip_address": "169.10.148.247"
        },
        "wallet_provider_profile": {
            "account": {
                "id": "577804066",
                "email_address": "email@gmail.com",
                "score": "5"
            },
            "risk_assessment": {
                "score": "DECISION_GREEN",
                "version": "10"
            },
            "device_score": "5",
            "pan_source": "KEY_ENTERED",
            "reason_code": "01020304"
        },
        "address_verification": {
            "name": "",
            "street_address": "nil",
            "postal_code": "nil"
        }
    },
    "user": {
        "metadata": {}
    },
    "card": {
        "metadata": {}
    },
    "address_verification": {
        "request": {
            "street_address": "nil",
            "postal_code": "nil"
        },
        "on_file": {
            "street_address": "",
            "postal_code": ""
        },
        "response": {
            "code": "0303",
            "memo": "Not validated"
        }
    },
    "card_security_code_verification": {
        "type": "CVV2",
        "response": {
            "code": "0000",
            "memo": "Card security code match"
        }
    },
    "fraud": {
        "network": {
            "transaction_risk_score": 57,
            "account_risk_score": 8
        }
    },
"card_acceptor": {
        "mid": "000090197809064",
        "mcc": "6411",
        "name": "Marqeta Storefront",
"street_address": "111 Main St",
        "city": "St. Petersbu",
        "country_code": "USA"
    },
    "pos": {
        "pan_entry_mode": "MAG_STRIPE",
        "pin_entry_mode": "TRUE",
        "terminal_id": "TR100000",
        "terminal_attendance": "ATTENDED",
        "card_holder_presence": false,
        "card_presence": false,
        "partial_approval_capable": false,
        "purchase_amount_only": false
    },
    "transaction_metadata": {
        "payment_channel": "OTHER"
    }
}


Transitioning token states

You can transition a token to any valid state by issuing a POST request to the /digitalwallettokentransitions endpoint. The following table describes the available states and transitions.

Value Description
REQUESTED The digital wallet token has been created but not yet provisioned and is non-functional. This is the initial state of a digital wallet token.
REQUEST_DECLINED The digital wallet token is permanently non-functional. This state results from the digital wallet, the card network, or the Marqeta platform designating DECISION_RED.
ACTIVE The digital wallet token is provisioned and functional. A digital wallet token can transition to an ACTIVE state only from a REQUESTED or SUSPENDED state.
SUSPENDED The digital wallet token is temporarily non-functional. A token can transition from ACTIVE to SUSPENDED and back to ACTIVE again. Tokens can be suspended by the fraud system, issuer, customer, or card holder.
TERMINATED The digital wallet token is permanently non-functional and cannot transition to any other state. Tokens can be terminated by the issuer, customer, or card holder.

A webhhook event notification alerts you whenever a token transitions state. See Digital Wallet Token Transition Events for more information about these notifications.

Note: Any number of tokens can be generated for the same card. However, the state of each token is independent from any other token and from the card. For example, terminating token A has no affect on token B even if they both represent the same card. Similarly, terminating the card has no effect on tokens A or B. For more information, see Managing Lost, Stolen, or Damaged Cards.