---
title: "Generate MDES Digitization Data"
method: POST
path: "/sc/v2/sc_generate_MDES_digitization_data/"
tags: ["Card PaySecure WS V2"]
---

# Generate MDES Digitization Data

`POST /sc/v2/sc_generate_MDES_digitization_data/`

<ul>   <li class="docBullet">
    This API allows to generate a Tokenization Authentication Value (TAV) and
 retrieve the encrypted card data to be used during in-app card digitization with MDES.
   </li>
</ul>

## Request body

- GenerateMDESDigitizationDataModel — This will typically be used to generate TAV and encrypted card data for all wallet providers (except Apple) and MC Validation during digitization process in cases where the Client doesn't want to handle PCI sensitive data e.g. PAN and expiry.
  - `client_id` integer, required — Unique identifier for the client which Paymentology will provide at outset
  - `tavDataFields` string, required — Concatenation of field names separated by '|' delimiter. The applicable values are: dataValidUntilTimestamp, accountNumber, accountExpiry
  - `tavFormat` integer, required — Currently 3 is the only supported format.
  - `tavSigned` boolean, required — When false, the TAV signature is not signed.
  - `tavSigningAlgorithm` integer, required — 1 for RSA-SHA256. Currently this is the only supported algorithm.
  - `token` integer, required — Public token for the card.

## Response `200`

Successful Response

- GenerateMDESDigitizationDataResponse — This model contains the response details of generate MDES digitization data api
  - `header` GenerateMDESDigitizationDataHeader
    - `error_id` integer — error id
    - `error_desc` string — error message
  - `body` GenerateMDESDigitizationDataBody
    - `clientId` integer — Client id
    - `token` integer — Public token
    - `tav` string — Base64 encoded TAV. The raw TAV is a JSON structure. Here is one example with an unsigned signature. The signature in this case is a Hex-encoded SHA-256 digest of the original signature: { "version" : "3", "signatureAlgorithm" : "Unsigned", "dataValidUntilTimestamp" : "2022-12-29T22:21:18Z", "includedFieldsInOrder" : "dataValidUntilTimestamp|accountNumber|accountExpiry", "signature" : "10684e9e8a7c570f162e2208357687565c81bb4dddf53e6961df833444d70f77" } Here is another example with a signed signature (The SHA256withRSA algorithm is applied with the client's private key). The signature in this case is Base64-encoded: { "version" : "3", "signatureAlgorithm" : "RSA-SHA256", "dataValidUntilTimestamp" : "2022-12-29T20:38:11Z", "includedFieldsInOrder" : "dataValidUntilTimestamp|accountNumber|accountExpiry", "signature" : "Hj6oQ7hkt1snPbxtfVVGPJ6K7qprE9eYY73ozdw/ENPiGvckzPy23ia6m+X9I+eFPhTG+IVn14cgQ/D+I1N5YOS3p1iZraUpTsaPGpA2FHTrFC9jKlBOROcmeVjwami6lSXZGkX3aruCWIwqGjONCer8qTMfCyLzq+5ZvAqknEzB0HZIlZUlsvkWFqEAmHQI3kJkY8ILKvjtUJTYskX8a4fhKEDDUa6VNOYHmXk8f3RyWAvZ2udSpq3juhiW9QnzuYsGjnhjSQUpbQLNpRP0kp+AMnHBggV2QawchQDnyWVdBimjVQLLEHdbHKNMHOLqkgnommmr5Fp9uNSEtdzb1Q==" }
    - `cardData` string — Base64 encoded card data. The Base64 decoded card data is a JSON structure (corresponding to "cardInfo" for MDES). Here is one example: { "publicKeyFingerprint" : "f06bc288d69728e532148f0e5490fedce9dbc1012e21c38b7377400d8198bb57", "encryptedKey" : "2ffa5e1738f9eeed1aebfed0e96df3570db49d72c249f610b47cfe7354ed72695cbd6811fee64a608020721aa843f58d5f05b7ff17b89817fed1424630346c4f3c9d543edac4c907c34511719f99c33686a4eaa33b3521739fda433711b6995ac9c19c475f9b9b1c8987e71bcb5abe0484ebda69c2f0507e90a622b89637983d80e2a7ae64f38a94484e6065a474a6d89c857768f0dee7bef8ffa3e21d69de9d48c612d461a6e3fc461adfe453fa812e1ed197e48ab1dfe5c80dc9a985f02f7b288fb77bd693f78a1a08b521f1d246b7ddf8f835bf4e048a45058228bfd16c04d5526ab981731f200707c68b2b6e43cde3f041ff6bf72299011f74c9326dc971", "oaepHashingAlgorithm" : "SHA512", "iv" : "6c00d8078023811b10735f7d002861a0", "encryptedData" : "af1cd51ce85aa6f3f24463318ca3a8c065121db8278c19764f3389576e4ba73fb5d278cf0927e93232b895a434f40240481c644984c42f1758902a18aea0a9c27aec478d2a11a4f1b60b2fe3c3a3cdb0f424031656ba3d7ad1e32ca2f5f2f655d4fc4b5e1003cd4cf1b18a2fcd09ca11836b92f51c328284a082c322ab7ffba5c81fa3f6b8ccc1bd203819f374fa2fd0" } The decrypted version of encryptedData is a JSON structure (corresponding to "CardInfoData" for MDES). Here is one example: { "accountNumber" : "5000100020003000", "expiryMonth" : "01", "expiryYear" : "25", "source" : "CARD_ADDED_VIA_APPLICATION", "cardHolderName" : "John Doe", }

## Other responses

- `404` — Webservices does not exist
- `500` — Internal Server error

---

[API](https://skmtc.net/paymentology/apis/payapi-docs.md) · [All operations](https://skmtc.net/paymentology/apis/payapi-docs/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/paymentology/payapi-docs/revisions/a675891b0365/schema)
