Reference Information
Encrypt and Decrypt Data
- Send a POST request to token cryptogram resource at/tms/v2/tokens/instrumentIdentifierTokenId/payment-credentials. The response is BASE 64 encoded text. For example:
ADDITIONAL INFORMATION
JraWQiOiI5OWY5YmVjOTlmMzQ1MDJmMDE2NWIyYmJhYWYyODAxNDNhOTI0OWNjIiwiY3R5IjoianNvbiIsInR5cCI6IkpXVCIsImVuYyI6IkEyNTZHQ00iLCJhbGciOiJSU0EtT0FFUC0yNTYifQ.uYCE2zysWJB8E562FGJl4YyotZEHw4Az-2fvhjaUWubuAZ2tmZm44oKUdsfsBLYWInxpMDUsiENTTHG_UJJ25Snhcft6eZGj79gW_S55ZAGAi1eYIJA08gr01U7P-1QIzQ5t6dlkTRZElYDiNjypSaVfQPQPODaGNfB04Li7Pt88i-PIspGafq9P7TgacPyKoIkvM5CwLWbwSZYN_jdFq8hEu4Dy7gqDpf0z-rCdtWggWpFbGwdurDrKCbLBoQ4dY7OckJoe2OOWH-O1h_7uZymDDUjnqWFRcHgjxY7bmWJz94i_r4QUaoTQiaaqgyP6A2H3Gmt6Dy4VpIzO2XgLQA._cLex9BPstYqqnfe.RMbdjAqWR6HaVZ7USbp6j-KWPC1jGc3Wzk4M_CwJ58X2NNZ5ekUpAvU28_MbqQ2W6MLhJ7ulgfU5mk9_Y5nvAW6Yh68Ctye2yOhgu_V_33aLmz3iZP5AEGi7HeJVng0hy4EaQHNb92XYXUV1mvFHJokA4cRaj3eKwh6v-1lRhB4uIgXU62ZanVGGu5c7UkVkf6JiigZarGJiY2DKCRjYnbQYkj4JNFY94JlS50wTnGrk3MiAJN9DYIU-6US98zWGJ8VhBwhMuXk1juqVBfifjJMFa_-vnJjGpq1ri2buZ7hMJG-x0PIYoHUGSFeqNrcLUjJxI0o8lnXfhj7DtfYvNc0e4g5U39xtk-T2TDnQfdekRVxgdxcVR4mZdEqUHBxYUWTSW4AbgV-fjuCGDCkUoPIgkZ95y4RJhSPZzjZHdulf2Fk3L7e-nto2PB25zUTt_aXeNBSH8zjmaI2ve6D3VN0ScduRMl_9PXv1876opHEGqgkKLSTXcTUasXKlzMEiUzLl3p5pN30KnVbryAzuU3hhmIMyyPpEQkp9h3WlD4sc5oH1E8YtihLlSTtTUNwX5dJuR6iVwpKqFxECqYPtDWlzXQDTedFqdTA4isE3MCs.th9qWPzsevuDYp--06oPOw - Decode the BASE 64 encoded response. The response is a decoded JWE response with an encrypted payload. For example:
ADDITIONAL INFORMATION
{ "kid": "99f9bec99f34502f0165b2bbaaf280143a9249", "cty": "json", "typ": "JWT", "enc": "A256GCM", "alg": "RSA-OAEP-256" } <Encrypted payload> - Decrypt the JWE encrypted payload. The response is the decrypted payload. For example:
ADDITIONAL INFORMATION
{ "_links": { "self": { "href": "/tms/v2/tokens/A560EECDED74936DE0533F36CF0ACEBC/payment-credentials" } }, "tokenizedCard": { "state": "ACTIVE", "number": "4X24XX7118382281", "expirationMonth": "11", "expirationYear": "2022", "type": "visa", "cryptogram": "AF1ajnoLKKj8AAKhssPUGgADFA\u003d\u003d", "requestorId": "ABCD", "card": { "suffix": "2382", "expirationMonth": "12", "expirationYear": "2018" } }, "card": { "number": "402400XXXXXX2382" }, "issuer": { "paymentAccountReference": "V0000000000005109162731718000" } }
HTTP Status Codes
A request response returns one of the following HTTP status codes:
- 200: The standard response for a successful HTTP request. In aGETrequest, the response will contain an empty entity corresponding to the requested resource. In aPOSTrequest, the response will contain an entity describing or containing the result of the action.
- 201: The request was fulfilled and resulted in a new resource being created. If you get this HTTP status code for an unsuccessful transaction,Cybersourceor the merchant's processor probably marked this transaction as under review, declined, or failed.
- 204: The server fulfilled the request but does not need to return a body.
- 403: Forbidden Response: The profile might not have permission to perform the operation.
- 404: Token Not Found. The token ID may not exist or was entered incorrectly.
- 409: Conflict. The token is linked to a Payment Instrument.
- 410: Token not available The token has been deleted.
- 424: Failed Dependency: The profile represented by the profile ID may not exist or the profile ID was entered incorrectly.
- 500: Unexpected error.
- 502: Bad gateway. There was a token deletion error from the Visa Token Service (VTS).