MDES API Documentation
MDES API Documentation
Service
Pre-Digitization
Application Programming Interface
Version 2.0.6, BUILD2
12 February 2019
Proprietary Rights
The information contained in this document is proprietary and confidential to Mastercard
International Incorporated, one or more of its affiliated entities (collectively “Mastercard”), or
both.
This material may not be duplicated, published, or disclosed, in whole or in part, without the
prior written permission of Mastercard.
Trademarks
Trademark notices and symbols used in this manual reflect the registration status of
Mastercard trademarks in the United States. Please consult with the Customer Operations
Services team or the Mastercard Law Department for the registration status of particular
product, program, or service names outside the United States.
All third-party product and service names are trademarks or registered trademarks of their
respective owners.
Disclaimer
Access to this document is subject to a separate Non-Disclosure Agreement with Mastercard.
If you are not certain that you are disclosed, or that you should have access to this document,
please stop reading now, and consult the appropriate legal resource within your company
before proceeding.
Mastercard makes no representations or warranties of any kind, express or implied, with
respect to the contents of this document. Without limitation, Mastercard specifically disclaims
all representations and warranties with respect to the document and any intellectual property
rights subsisting therein or any part thereof, including but not limited to any and all implied
warranties of title, non-infringement, or suitability for any purpose (whether or not
Mastercard has been advised, has reason to know, or is otherwise in fact aware of any
information) or achievement of any particular result. Without limitation, Mastercard
specifically disclaims all representations and warranties that any practice or implementation of
the Specification will not infringe any third party patents, copyrights, trade secrets or other
rights.
1 Introduction .......................................................................................................................................... 7
1.1 What is the Mastercard Digital Enablement Service? .................................................................. 7
1.2 Document Scope ........................................................................................................................... 7
1.3 Using This Document .................................................................................................................... 7
2 MDES Pre-Digitization API ..................................................................................................................... 8
2.1 Overview ....................................................................................................................................... 8
2.1.1 Flow Diagram ........................................................................................................................ 8
2.1.2 API Design Principles ............................................................................................................. 9
2.1.3 URL Scheme .......................................................................................................................... 9
2.1.4 Security Overview and Encryption ...................................................................................... 10
2.1.5 API Request / Response Common Elements and Headers ................................................. 13
2.1.6 Retry Strategy ..................................................................................................................... 14
2.2 RequestActivationMethods ........................................................................................................ 18
2.2.1 URL Endpoint....................................................................................................................... 18
2.2.2 HTTP Method ...................................................................................................................... 18
2.2.3 Request Parameters ............................................................................................................ 19
2.2.4 Response Values ................................................................................................................. 21
2.2.5 Example Request Body........................................................................................................ 21
2.2.6 Example Response Body ..................................................................................................... 22
2.3 DeliverActivationCode ................................................................................................................ 22
2.3.1 URL Endpoint....................................................................................................................... 23
2.3.2 HTTP Method ...................................................................................................................... 23
2.3.3 Request Parameters ............................................................................................................ 23
2.3.4 Response Values ................................................................................................................. 24
2.3.5 Example Request Body........................................................................................................ 24
2.3.6 Example Response Body ..................................................................................................... 24
2.4 NotifyServiceActivated................................................................................................................ 24
2.4.1 URL Endpoint....................................................................................................................... 25
2.4.2 HTTP Method ...................................................................................................................... 25
2.4.3 Request Parameters ............................................................................................................ 25
© 2019 Mastercard. Proprietary and Confidential. All rights reserved.
Mastercard Digital Enablement Service - Pre-Digitization API Specification • Version 2.0.6 BUILD2
4
2.4.4 Response Values ................................................................................................................. 30
2.4.5 Example Request Body........................................................................................................ 30
2.4.6 Example Response Body ..................................................................................................... 32
2.5 AuthorizeService ......................................................................................................................... 32
2.5.1 URL Endpoint....................................................................................................................... 32
2.5.2 HTTP Method ...................................................................................................................... 32
2.5.3 Request Parameters ............................................................................................................ 32
2.5.4 Response Values ................................................................................................................. 35
2.5.5 Example Request Body........................................................................................................ 39
2.5.6 Example Response Body ..................................................................................................... 40
2.6 NotifyTokenUpdated................................................................................................................... 41
2.6.1 URL Endpoint....................................................................................................................... 42
2.6.2 HTTP Method ...................................................................................................................... 42
2.6.3 Request Parameters ............................................................................................................ 42
2.6.4 Response Parameters ......................................................................................................... 43
2.6.5 Example Request Body – STATUS_UPDATE ........................................................................ 43
2.6.6 Example Request Body – REDIGITIZATION_COMPLETE ...................................................... 44
2.6.7 Example Request Body – DELETED_FROM_CONSUMER_APP ............................................ 44
2.6.8 Example Response Body ..................................................................................................... 44
2.7 ValidateActivationCode .............................................................................................................. 45
2.7.1 URL Endpoint....................................................................................................................... 45
2.7.2 HTTP Method ...................................................................................................................... 45
2.7.3 Request Parameters ............................................................................................................ 45
2.7.4 Response Values ................................................................................................................. 46
2.7.5 Example Request Body........................................................................................................ 46
2.7.6 Example Response Body ..................................................................................................... 47
2.8 Get Account Information ............................................................................................................ 47
2.8.1 URL Endpoint....................................................................................................................... 47
2.8.2 HTTP Method ...................................................................................................................... 47
2.8.3 Request Parameters ............................................................................................................ 47
2.8.4 Response Values ................................................................................................................. 48
2.8.5 Example Request Body........................................................................................................ 48
© 2019 Mastercard. Proprietary and Confidential. All rights reserved.
Mastercard Digital Enablement Service - Pre-Digitization API Specification • Version 2.0.6 BUILD2
5
2.8.6 Example Response Body ..................................................................................................... 48
A. Appendix A – Request and Response Member Objects ..................................................................... 50
A.1 AccountHolderData..................................................................................................................... 50
A.2 AccountInformationData ............................................................................................................ 51
A.3 AuthorizeServiceResponseData .................................................................................................. 51
A.4 ActivationMethod ....................................................................................................................... 52
A.5 BalanceInformation .................................................................................................................... 53
A.6 BillingAddress .............................................................................................................................. 54
A.7 CardAccountData ........................................................................................................................ 55
A.8 CardAndTokenData - Deprecated ............................................................................................... 56
A.9 CardAndTokenInfo - Deprecated ................................................................................................ 57
A.10 CardholderData - Deprecated ................................................................................................. 59
A.11 CardInfo - Deprecated............................................................................................................. 60
A.12 CardInfoData - Deprecated ..................................................................................................... 62
A.13 DecisioningInfo – MAP<String, Object> .................................................................................. 65
A.14 DeviceInfo – MAP<String, Object> .......................................................................................... 66
A.15 EncryptedPayload ................................................................................................................... 69
A.16 FinancialAccountData ............................................................................................................. 71
A.17 FundingAccountData............................................................................................................... 72
A.18 FundingAccountInfo ................................................................................................................ 74
A.19 Token....................................................................................................................................... 76
A.20 TokenData ............................................................................................................................... 77
B. Appendix B – Error Codes ................................................................................................................... 78
C. Appendix C – Reason Codes ................................................................................................................ 79
C.1 Approved Reason Codes ................................................................................................................... 79
C.2 Require Additional Authentication or Declined Reason Codes ........................................................ 79
2.1 Overview
The MDES Pre-Digitization API provides a set of outbound web requests to inform Issuers of
MDES services being requested by, or on-behalf of, their Account holders. Issuers may provide
information in their responses to guide or inform the Account holder’s experience through the
Wallet Provider.
The second diagram shows a hybrid implementation of the pre-digitization services where:
The Issuer uses the Tokenization Authorization pre-digitization message for
authorizing the creation of a token (digitization).
The Issuer designates a Web Service (e.g. managed by a Service Provider)
implementing the MDES Pre-Digitization API for authentication of the Account holder,
managing both the Activation Methods list and the Activation Code Distribution
Methods.
scheme https
api issuerServices
majorVer The major version of the APIs. This is not related to the version
of this document. This version of the document corresponds to a
major version of:
1
minorVer The minor version of the APIs. This version of the document
corresponds to a minor version of:
0
apiName The URL endpoint as defined in the respective section for the API
operation.
The public key fingerprint publicKeyFingerprint of the receiver Encryption Public Key
used by the encryption scheme for the computation of the digital envelope.
The initialization vector - iv - for the bulk encryption with AES in CBC block cipher
mode.
TR MDES Issuer
Digitize
AS
Watch Dog Timer (WDT) = RAM
5 seconds
AS resp[AML1]]
RAM
resp[AML2]
TR MDES Issuer
Digitize
AS
RAM
Watch Dog Timer (WDT) =
RAM
AS
5 seconds
RAM
resp[AML2]
TR MDES Issuer
Digitize
AS
RAM
5 seconds
WDT =
503 Service
Unavailable with a
retry after header RAM[AML2]
AS[AML1]
AS (2
n
RAM d)
(2n
d)
WDT = 7 seconds
...
b. AS/TA timeout, RAM response received: We still return the 503 and send the AS/TA
with the longer timeout. We retain the RAM response and do not send it again.
Digitize
AS
RAM
5 seconds
WDT =
RAM[AML2]
Store AML2
503 Service AS[AML1]
Unavailable with a
retry after header
AS (2n
d )
WDT = 7 seconds
...
c. RAM timeout, AS/TA response received: MDES uses the decision from AS/TA. In the
case of yellow path MDES uses the Activation Methods List configured in MDES or
returned on the AS/TA. RAM is not resent.
TR MDES Issuer
Digitize
AS
RAM
5 seconds
WDT =
AS[AML1]
3. 2nd timeout: If the AS/TA times out on the 2nd attempt then MDES runs the rules engine
to get a decision. If the RAM times out on the 2nd attempt then MDES uses the AML in the
database.
WDT = 7 seconds
...
RAM[AML2]
2.2 RequestActivationMethods
RequestActivationMethods advises an Issuer that a service activation has been requested and
that an Issuer should provide Activation Methods for the Account holder. The Activation
Methods will be presented to the Account holder so they may select their preferred delivery
channel to receive an Activation Code only when the card eligibility decision is “Require
Authentication.” If there are no methods to return then an empty ActivationMethods array is
returned. If verification of the card data provided in the request fails then an empty
ActivationMethods array should be returned. This includes an unknown PAN or if the
expiration date or the CVC2 do not match. This call is made as part of the service activation
flow and may be subject to strict time constraints based on the service.
If applicable to the service, when no methods are returned or in case of service failure the
MDES system will use the methods returned by the pre-digitization network messages or the
default methods for the account range. The methods returned from this API will be combined
with the activation methods returned from the pre-digitization network messages and any
methods configured as forced.
Value Request
activationMethods
Description: The activation methods to be used for this digitization. Return empty array if no
methods are to be returned.
Data Type: Array[ActivationMethod]
Required: Yes
"responseId" : "123456",
"activationMethods" : [
{
"type" : "TEXT_TO_CARDHOLDER_NUMBER",
"value" : "12X-XXX-XX32"
},
{
"type" : "CARDHOLDER_TO_CALL_AUTOMATED_NUMBER",
"value" : "1-800-BANK-NUMBER"
},
{
"type" : "CARDHOLDER_TO_USE_MOBILE_APP",
"value": "App Name"
}
]
}
2.3 DeliverActivationCode
DeliverActivationCode is used to request an Activation Code be sent to authenticate the
Account holder.
MDES generates an Activation Code and delivers it, along with the chosen Activation Code
Distribution Method, to the Issuer for transmission to the Account holder. Alternately if the
Issuer wishes to generate the Activation Code, MDES will deliver the chosen Activation Code
Distribution Method to the Issuer and the Issuer will generate the Activation code and
transmit it to the account holder. The Account holder will then enter the Activation Code into
the Mobile Payment App.
Once an Activation Code has been generated, it will be valid for a limited activation period,
after which the code will expire. Once a code expires, the Issuer can request a new Activation
Code via the Customer Service Portal/API, or remotely activate the token via the Customer
Service Portal/API.
The Account holder may request the Activation Code again with the same or a different
Activation Code Distribution Method. This will trigger another request as long as the
activation period has not expired. It will not cause the Activation Code to be regenerated nor
extend the validity period of the Activation Code.
tokenUniqueReference
Description: A unique reference assigned following the allocation of a token used to
identify the token for the duration of its lifetime.
Data Type: String
Max Length: 64
Required: Yes
correlationId
Description: Value linking pre-digitization messages generated during provisioning.
Data Type: String
Max Length: 14
Required: Yes
activationCode
Description: The Activation Code to be distributed for the digitization.
Data Type: String
Max Length 32
Required: Conditional - only present if Mastercard generates the activationCode
expirationDateTime
Description: The DateTime when the Activation Code is no longer valid. Expressed in ISO
8601 extended format as one of the following:
YYYY-MM-DDThh:mm:ss[.sss]Z
YYYY-MM-DDThh:mm:ss[.sss]±hh:mm
Where [.sss] is optional and can be 1 to 3 digits.
Data Type: String
Max Length 29
Required: Conditional - only present if Mastercard generates the activationCode
© 2019 Mastercard. Proprietary and Confidential. All rights reserved.
Mastercard Digital Enablement Service - Pre-Digitization API Specification • Version 2.0.6 BUILD2
23
activationMethod
Description: The activation method selected by the Account holder.
Data Type: ActivationMethod
Max Length: NA
Required: Yes
2.4 NotifyServiceActivated
NotifyServiceActivated is used to receive notifications that the provisioning and activation of a
token for a Funding Account has been completed by the digitization service.
services
Description: Array of services that are being requested for the account.
Value Request
2.5 AuthorizeService
AuthorizeService requests an Issuer to authorize a Funding Account for a Mastercard service or
set of services. Information about the service request will be provided to assist with
authorization of the account.
If additional authentication is required the Issuer may return a list of Activation Methods. The
Activation Methods will be presented to the Account holder so they may select their preferred
delivery channel to receive an Activation Code. If there are no methods to return the field may
be omitted. This call is made as part of the service activation flow and may be subject to strict
time constraints based on the service.
Value Request
services
Description: Array of services for the account that the authorization decision applies to.
Must be a subset of the services in the request object. Services that are
not approved for the account will be omitted.
Value Request
Max Length: 64
Required: Yes
activationMethods
Description: The activation methods to be used for this digitization. Return empty array if no
methods are to be returned.
Data Type: Array[ActivationMethod]
Required: No
panSequenceNumber
Description: The pan sequence number for the card. Acceptable values are in the range 000 –
099.
Data Type: String(numeric)
Max Length: 3
Required: No
issuerProductConfigId
Description: The unique Issuer identifier assigned to the product configuration in BPMS. It is
provided for the Digitization service only.
Data Type: String
Max Length: 10
Required: No
Max Length: 32
Required: No
Max Length: 32
Required: No
Required: No
auxTcis
Description: Array of auxiliary terminal capability TCIs.
Data Type: Array[String]
Max Length: NA
Required: No
},
"tokenType" : "CLOUD"
}
2.6 NotifyTokenUpdated
NotifyTokenUpdated is used by MDES to notify the Issuer of significant token updates, such as
when the token is activated, suspended, unsuspended or deleted; or when information about the
token or its product configuration has changed.
It may be triggered as a result of Service Provider update (for example, the provider suspends or
deletes the token), or if MDES changes the state of a token (for example, when Account holder
activates the token using an Activation Code).
The state transition diagram used by MDES is presented in the figure below:
Update Provision
Token Configuration
Update Update
Token Configuration
Update
Inactive
CS PAN SWAP
0302 PAN SWAP
NSA
Update Token Expiry
Activate NTU
Update
(Re-Digitized)
Delete Token Configuration Update
Update
NTU(Status=
CS PAN SWAP Suspend Suspended,
NTU(Status=Suspended
0302 PAN SWAP , SuspendedBy[S1, S2]) SuspendedBy[S1])
Delete
Delete
NTU
(Staus=Deactivated)
NTU(Status=Deactivated)
Deactivated
tokenUniqueReference
Description: A unique reference assigned following the allocation of a token used to
identify the token for the duration of its lifetime.
Data Type: String
Max Length: 64
Required: Yes
correlationId
Description: Value linking pre-digitization messages generated during provisioning.
Data Type: String
Max Length: 14
Required: Yes
Value Request
SUCCESS Activation was successful
A.1 AccountHolderData
accountHolderName
Description: The name of the account holder in the format LASTNAME/FIRSTNAME or
FIRSTNAME LASTNAME.
Data Type: String
Max Length: 27
Required: No
accountHolderAddress
Description: The address for the account holder. Verified as part of reaching the
digitization decision.
Data Type: BillingAddress object
Max Length: N/A
Required: No
sourceIp
Description: The IP of the device initiating the request.
Data Type: String
Max Length: 64
Required: No
deviceLocation
Description: Latitude and longitude where the device the consumer is attempting to
authorize is located. In the format “(sign) latitude/(sign) longitude” with a
precision of 2 decimal places. Ex: "38.63/-90.2" Latitude is between -90 and
90. Longitude between -180 and 180.
Data Type: String
Max Length: 64
Required: No
consumerIdentifier
Description: Consumer Identifier provided by the token requestor.
Data Type: String
Max Length: 88
Required: No – Optionally present in AuthorizeService when provided by the wallet
provider
A.3 AuthorizeServiceResponseData
paymentAccountReference
Description: The payment account reference assigned to the PAN. This should only be
returned if Mastercard is not the BIN controller. It will be ignored if
Mastercard is the BIN controller for the PAN.
Required: No
Max Length: NA
Required: No
alternateAccountIdentifier
Required: No
dataValidUntilTimestamp
Description: The date/time after which this encrypted payload object is considered
invalid. If present, all systems must reject this encrypted object after this
time and treat it as invalid data.
Must be expressed in ISO 8601 extended format as one of the following:
YYYY-MM-DDThh:mm:ss[.sss]Z
YYYY-MM-DDThh:mm:ss[.sss]±hh:mm
Where [.sss] is optional and can be 1 to 3 digits.
Must be a value no more than 30 days in the future. Mastercard
recommends using a value of (Current Time + 30 minutes).
Data Type: String
Max Length: 29
Required: No
A.4 ActivationMethod
Type
Description: Specifies the activation method type.
Must be one of:
Type Meaning Value
Required
TEXT_TO_CARDHOLDER_NUMBER Text message to Account holder's mobile Yes
phone number.
Value will be the Account holder’s
masked mobile phone number.
A.5 BalanceInformation
amount
Description: The amount of the balance. Numeric including the decimal positions.
Data Type: Number
Max Length: 16
Required: Yes
A.6 BillingAddress
line1
Description: First line of the billing address.
Data Type: String
Max Length: 64
Required: No
line2
Description: Second line of the billing address.
Data Type: String
Max Length: 64
Required: No
city
Description: The city of the billing address.
Data Type: String
Max Length: 32
Required: No
A.7 CardAccountData
accountNumber
Description: The Account Primary Account Number of the card to be digitized
Data Type: String (Numeric)
Max Length: 19 (min length 9)
Required: Yes
expiryMonth
Description: The month of the expiration date of the card to be digitized. Note that the
expiry date may not be in the past.
May be omitted if the card does not have an expiry date.
Data Type: String (Numeric)
Max Length: 2 (Exact)
Required: No.
Max Length: NA
Required: Yes
token
Max Length: NA
Required: Yes
paymentAccountReference
Description: The unique account reference assigned to the PAN.
Data Type: String
Max Length: 29(Exact)
Required: No
Required: Yes
tokenUniqueReference
Description: Unique reference to the token to be designated when digitization is complete.
Data Type: String
Max Length: 64
Required: Yes
publicKeyFingerprint
Description: The fingerprint of the public key used to encrypt the ephemeral AES key.
Max Length: 64
Required: Yes
encryptedKey
Description: One-time use AES key encrypted by the Issuer's public key (as identified by
'publicKeyFingerprint') using the OAEP scheme.
Requirement is for a 128-bit key (with 256-bit key supported as an option).
Required: Yes
Value Meaning
Max Length: 6
Required: No
iv
Description: The initialization vector used when encrypting data using the one-time use
AES key. Must be exactly 16 bytes (32 character hex string) to match the
block size.
If not present, an IV of zero is assumed.
Required: No
}
Data Type: String. Hex-encoded data (case-insensitive).
Max Length: 256K
Required: Yes
sourceIp
Description: The IP of the device initiating the request.
Data Type: String
Max Length: 64
Max Length: 64
Required: No
publicKeyFingerprint
Description: The fingerprint of the public key used to encrypt the ephemeral AES key.
Max Length: 64
Required: Yes
Description: One-time use AES key encrypted by the Issuer's public key (as identified by
'publicKeyFingerprint') using the OAEP scheme.
Requirement is for a 128-bit key (with 256-bit key supported as an option).
Required: Yes
oaepHashingAlgorithm
Value Meaning
Max Length: 6
Required: No
iv
Description: The initialization vector used when encrypting data using the one-time use
AES key. Must be exactly 16 bytes (32 character hex string) to match the
block size.
If not present, an IV of zero is assumed.
Required: No
Description: The Account PAN of the card associated with the service or the token PAN.
Required: Yes
expiryMonth
Description: The month of the expiration date of the card to be digitized. Note that the
expiry date may not be in the past.
May be omitted if the card does not have an expiry date.
Required: No
Description: The year of the expiration date of the card to be digitized. Note that the
expiry date may not be in the past.
May be omitted if the card does not have an expiry date.
Required: No
source
Value Meaning
Max Length: 32
cardholderName
Max Length: 27
Description: The CVC2 for the card to be digitized, as entered by the Cardholder.
Verified as part of reaching the digitization decision.
Required: No
dataValidUntilTimestamp
Max Length: 29
Required: No
billingAddress
Required: No
cardholderData
Required: No
A.15 EncryptedPayload
publicKeyFingerprint
Description: The fingerprint of the public key used to encrypt the ephemeral AES key.
Data Type: String. Hex-encoded data (case-insensitive).
Max Length: 64
Required: Yes
A.16 FinancialAccountData
financialAccountId
Description: The identifier of the financial account being tokenized. This could be a bank
account number or other types of financial accounts.
Data Type: String(Spaces not allowed)
Max Length: 64 (min length 9)
Required: Yes
interbankCardAssociationId
Description: The id assigned by Mastercard to the financial institution.
Data Type: Number
Max Length: 11 (min length 3)
Required: Yes
countryCode
Description: The country of the financial account. Expressed as a 3-letter (alpha-3)
country code as defined in ISO 3166-1.
Data Type: String
Max Length: 3 (Exact)
Required: Yes
tokenData
Max Length: NA
"accountHolderData" : {
"accountHolderName" : "John Doe",
"sourceIp" : "127.0.0.1",
"deviceLocation" : "38.63/-90.2",
"accountHolderAddress" : {
"line1" : "100 1st Street",
"line2" : "Apt. 4B",
"city" : "St. Louis",
"countrySubdivision" : "MO",
"postalCode" : "61000",
"country" : "USA"
}
},
"tokenData" : {
"token" : "5345678901234521",
"expiryMonth" : "10",
"expiryYear" : "17",
"sequenceNumber" : "01
},
"source" : "ACCOUNT_ON_FILE",
"paymentAccountReference":"512381d9f8e0629211e3949a08002"
}
Data Type: EncryptedPayload object containing a FundingAccountData object.
Max Length: N/A
Required: Yes.
A.20 TokenData
token
Description: The token issued for this service request.
Data Type: String (Numeric)
Max Length: 19 (min length 12)
Required: Yes
expiryMonth
Description: The month of the expiration date.
Data Type: String (Numeric)
Max Length: 2 (Exact)
Required: Yes
expiryYear
Description: The year of the expiration date.
Data Type: String (Numeric)
Max Length: 2 (Exact)
Required: Yes
sequenceNumber
Description: Sequence number of the Token
Data Type: String (Numeric)
Max Length: 2 (Exact)
Required: Conditional – required in AuthorizeServiceResponseData. Optional
otherwise.
LONG_ACCOUNT_TENURE Account has existed for an extended period of not less than one year.
A Payment App Provider may determine a longer account tenure to
qualify for this reason.
GOOD_ACTIVITY_HISTORY There has been financial activity linked to the account for at least and
within a period of not less than six months; no suspicious activity is linked
to the account within a period of at least one year.
CARDHOLDER_UNAVAILABLE The cardholder is not actively participating in the request to tokenize the
PAN.
AUTHENTICATION_NOT_SUPPORTED The Token Requestor does not support account holder authentication.
ADDITIONAL_DEVICE The digitization is for an additional device for the same Account PAN and
consumer account. There must be a currently active (not suspended)
Token that was previously digitized and activated on an existing device for
the same Account PAN and consumer account.