feat: add card network token credential and instrument types#296
Open
jamesandersen wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
Open
Conversation
Add card_network_token credential and instrument schemas enabling platforms to present pre-provisioned card network tokens (Visa VTS, Mastercard MDES, Amex Token Service) directly at checkout. Separates network tokens from the PCI-scoped card_credential.json, aligning with UCP's stated design intent for opaque credentials.
599e3d7 to
c6e8648
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhancement Proposal: Card Network Token Credential Type
Summary
A new
card_network_tokencredential type for UCP that enables platforms to present card network tokens (Visa VTS, Mastercard MDES, Amex Token Service) directly as payment credentials in checkout sessions — without requiring re-tokenization through a handler or falling back to raw PANs.Motivation
UCP currently supports payment tokenization through handler-specific tokens and a delegated payment model. However, there is no support for card network tokens — tokenized card credentials issued by card networks that replace the primary account number (PAN) with a network-level token.
Card network tokens are an industry-standard payment security mechanism with broad PSP acceptance. Every major processor supports directly processing network tokens with the same core fields (token/DPAN, cryptogram, ECI):
UCP's own specification explicitly identifies network tokens as a mechanism for platforms to avoid PCI-DSS scope:
Yet despite this design intent, UCP currently has no dedicated credential type for network tokens. Platforms that already hold card network tokens cannot use them directly.
Token Provisioning
Platforms can obtain card network tokens through several standard provisioning channels:
Goals
allOfwith base schemas)ucp_response: "omit"Non-Goals
card_credential.jsonschemaRelated Work
card_credential.jsonincludes partial network token support viacard_number_type: "network_token"withcryptogramandeci_valuefields. See "Discussion Points" below for why a separate credential type is proposed.card_payment_instrument.json— defines the card instrument with display properties and theavailable_card_payment_instrumentvariant withconstraints.brands.token_credential.json— base token credential withucp_response: "omit"pattern ontokenfield.available_instrumentswith constraints.Detailed Design
Credential Schema: card_network_token_credential.json
The credential extends
payment_credential.jsonviaallOf:type"card_network_token"tokentoken_expiry_monthtoken_expiry_yearcryptogrameci_valuenametoken_requestor_idInstrument Schema: card_network_token_instrument.json
Network tokens are cards — they share display properties (brand, last digits, expiry, card art) with card instruments. The instrument extends
card_payment_instrument.jsonand includes anavailable_*variant following the established pattern:brand,last_digits,expiry_month,expiry_year,card_art)available_card_network_token_instrumentextendingavailable_card_payment_instrumentto inheritconstraints.brandscard_network_token_credential.jsonvia thecredentialpropertyHow Network Tokens Fit the Handler Model
Network tokens are pre-provisioned credentials that bypass the tokenize/detokenize flow:
available_instrumentsincludingcard_network_token.card_network_tokeninstrument. The business's PSP processes the network token directly.This is analogous to how wallet handlers (e.g., Google Pay, Shop Pay) work: the platform holds a pre-provisioned opaque credential and presents it directly.
Relationship to Existing card_credential.json
The current
card_credential.jsonincludes partial network token support viacard_number_type: "network_token". However, that schema carries PCI restrictions that apply to the entire schema:A separate credential type is proposed because:
card_credential.jsonlackstoken_requestor_idand has no way to distinguish token expiry from card expiry (network tokens have independent expiry dates).card_credentialimplies the platform holds PCI-scoped card data when it does not.Alternative approach: The community could choose to enhance
card_credential.jsonwith the missing fields and relax the PCI restriction whencard_number_typeis"network_token". Either approach achieves the same functional goal. This is an explicit discussion point.Usage Example
A platform presenting a pre-provisioned Visa network token at checkout:
{ "payment": { "instruments": [ { "id": "pi_ntoken_001", "handler_id": "handler_merchant_psp", "type": "card_network_token", "credential": { "type": "card_network_token", "token": "4895370012003478", "token_expiry_month": 12, "token_expiry_year": 2028, "name": "Jane Doe", "cryptogram": "AJkBBkhAAAAA0YFAAAAAAAAAAA==", "eci_value": "05", "token_requestor_id": "40012345678" }, "display": { "brand": "visa", "last_digits": "3478", "expiry_month": 12, "expiry_year": 2028 }, "selected": true } ] } }Design Rationale
payment_credential.jsonviaallOf; instrument extendscard_payment_instrument.jsonto inherit display properties andavailable_*variant pattern.card_payment_instrument.json. Cryptogram and eci_value are optional because they are conditional (CIT vs MIT). Name is optional (only Adyen requires it).ucp_response: omit— prevents leaking sensitive data in API responses, following the pattern fromtoken_credential.json.Risks and Mitigations
card_credential.jsonnetwork token supportcard_credential.jsonand presents this as a discussion point for the TC.ucp_response: "omit"ontokenandcryptogramfields prevents leakage.Test Plan
allOfwithpayment_credential.jsonproduces valid combined schematokenor expiry fields are missingtokenandcryptogramare omitted from API responsesGraduation Criteria
Code Changes
New Files:
source/schemas/shopping/types/card_network_token_credential.json— credential schemasource/schemas/shopping/types/card_network_token_instrument.json— instrument schema withavailable_card_network_token_instrumentvariantdocs/specification/card-network-token.md— documentationModified Files:
mkdocs.yml— Added card network token to nav and llmstxt sections.cspell/custom-words.txt— Added network token-related termsNote: No modifications to existing schemas required. Base
payment_credential.jsonusesadditionalProperties: true;card_payment_instrument.jsonis extended viaallOf, not modified.Discussion Points
card_credential.jsonwith conditional PCI relaxation?available_card_network_token_instrumentextendavailable_card_payment_instrument(inheritingconstraints.brands) or define its own constraints?References
payment_credential.json— base credential schemacard_credential.json— existing card credential with partial network token supportcard_payment_instrument.json— card instrument with display properties andavailable_card_payment_instrumentvariantType of change
Checklist