# JPMC-PDP Documentation from https://developer.payments.jpmorgan.com # Testing The test environment generates results based on the transaction and details supplied in the request. In this guide, you will learn how to: - Use card test data - Test tokens - Test token cryptograms - Test token lifecycle - Test bulk tokenization ## Before you begin You need the test client credentials you received from the implementations team to conduct a test transaction. For more about getting your test client credentials, see [Getting started](/docs/commerce/optimization-protection/getting-started). ## Test card data Using the following data in the request will provide a pre-determined outcome, helping you to integrate with the APIs more efficiently, as well as plan for** SUCCESS** and **ERROR** scenarios: **Test card data** | Card brand | Test card number | | --- | --- | | Mastercard (MC) | 2223000890000000 5204740000001002 | | Visa | 4761220000000237 4012001037141112 | | American Express (AMEX) | 373953192351004 341111599241000 | ## Token provisioning test cases The following tables break down test cases and predetermined responses driven by test data: **HTTP method**: `POST` **Endpoint**: `/tokens` **Token provisioning test cases** | Test case | Test data | responseStatus | responseCode | | --- | --- | --- | --- | | Successful token provisioning | Valid test card number | SUCCESS | APPROVED | | Missing or invalid data in the request | Set accountholderReference: 302e20dc-bcbc3f5a9001 | ERROR | VALIDATION_ERROR | | Server error | Set accountholderReference: 302e20dc-bcbc3f5a9003 | ERROR | HOST_ERROR | | Server timeout | Set accountholderReference: 302e20dc-bcbc3f5a9004 | ERROR | TIMEOUT | | Token cannot be found | Set accountholderReference: 302e20dc-bcbc3f5a9006 | ERROR | NOT_FOUND | | 2-second delay — successful provisioning | Set accountholderReference: 302e20dc-bcbc3f5a8123 | SUCCESS | APPROVED | | 5-second delay — timeout error | Set accountholderReference: 302e20dc-bcbc3f5a8124 | ERROR | TIMEOUT | | Tokenization request declined | Set the following request fields: cardNumber: 4761340000000019 cardExpiry.Month: 12 cardExpiry.Year: 26 cardVerificationNumber: 946 | ERROR | DENIED | ## Token details The following tables break down test cases and predetermined responses driven by test data: **HTTP method**: `GET` **Endpoint**: `/tokens/{tokenReferenceId}/details` **Token details test cases** | Test case | Test data | responseStatus | responseCode | | --- | --- | --- | --- | | Get card metadata update | Set token-reference-id: b2b92b5b-403d-4bd8-a756-6e415b86b291 | SUCCESS | APPROVED | | Missing or invalid data provided in request | Set token-reference-id: b2b92b5b-403d-4bd8-a756-6e415b86b299 | ERROR | VALIDATION_ERROR | | Server cannot handle request | Set token-reference-id: b2b92b5b-403d-4bd8-a756-6e415b86b293 | ERROR | HOST_ERROR | | 2-second delay — successful provisioning | Set token-reference-id: fe112322-b04d-49e3-9cde-bcbc3f5a8125 | SUCCESS | APPROVED | | 5-second delay — timeout error | Set token-reference-id: fe112322-b04d-49e3-9cde-bcbc3f5a8124 | ERROR | TIMEOUT | ## Token asset information The following tables break down test cases and predetermined responses driven by test data. **HTTP method**: `GET` **Endpoint**: `/tokens/{tokenReferenceId}/assets/{asset-ref}` **Token asset information test cases** | Test case | Test data | responseStatus | responseCode | | --- | --- | --- | --- | | Get card metadata update | Set token-reference-id: b2b92b5b-403d-4bd8-a756-6e415b86b291 | SUCCESS | APPROVED | | Provided value of the data field is invalid | Set token-reference-id: 302e20dc-c3ac-4a82-8504-bcbc3f5a9002 | ERROR | BAD_REQUEST | | Request timeout | Set token-reference-id: 302e20dc-c3ac-4a82-8504-bcbc3f5a9004 | ERROR | TIMEOUT | ## Token cryptogram request test cases The following tables break down test cases and predetermined responses driven by test data. **HTTP method**: `POST` **Endpoint**: `/cryptograms` **Token cryptogram request test cases** | Test case | Test data | responseStatus | responseCode | | --- | --- | --- | --- | | Successful token cryptogram request | Use tokenReferenceIdentifier from token provisioning | SUCCESS | ACCEPTED | | Missing or invalid data in request | Set tokenReferenceIdentifier: 302e20dc-c3ac-4a82-8504-bcbc3f5a9001 | ERROR | VALIDATION_ERROR | | Server error | Set tokenReferenceIdentifier: 302e20dc-c3ac-4a82-8504-bcbc3f5a9003 | ERROR | HOST_ERROR | | Token cannot be found | Set tokenReferenceIdentifier: 302e20dc-c3ac-4a82-8504-bcbc3f5a9006 | ERROR | NOT_FOUND | | Token state is invalid for attempted action | Set tokenReferenceIdentifier: 1. 302e20dc-c3ac-4a82-8504-bcbc3f5a9104 2. a3d451d3-3b60-4a7e-b3fc-fabb12f439ef 3. ba0d1ae4-73af-493d-8a4f-851c0abc71d6 | ERROR | ACCEPTED | | 2-second delay — successful provisioning | Set tokenReferenceIdentifier: fe112322-b04d-49e3-9cde-bcbc3f5a8124 | SUCCESS | SERVER_ERROR | | 5-second delay — timeout error | Set tokenReferenceIdentifier: fe112322-b04d-49e3-9cde-bcbc3f5a8125 | ERROR | SERVER_ERROR | ## Token lifecycle state test cases The following tables break down test cases and predetermined responses driven by test data. **HTTP method**: `PATCH` **Endpoint**: `/tokens/{token-reference-id}/lifecycle-states` **Token lifecycle state test cases** | Test case | Test data | responseStatus | responseMessage | | --- | --- | --- | --- | | Set token state — SUSPEND | Any valid test card number. set stateChangeReason: SUSPEND | SUCCESS | ACCEPTED | | Set token state — DELETE | Any valid test card number. set stateChangeReason: DELETE | SUCCESS | ACCEPTED | | Set token state — RESUME | Any valid test card number. set stateChangeReason: RESUME | SUCCESS | ACCEPTED | | Missing or invalid data in request | Set token-reference-id: 302e20dc-c3ac-4a82-8504-bcbc3f5a9002 | ERROR | VALIDATION_ERROR | | Server cannot handle request | Set token-reference-id: 302e20dc-c3ac-4a82-8504-bcbc3f5a9004 | ERROR | HOST_ERROR | ## Token card metadata test cases The following tables break down test cases and predetermined responses driven by test data. **HTTP method**: `GET` **Endpoint**: `/tokens/{token-reference-id}/lifecycle-states` **Token card metadata test cases** | Test case | Test data | responseStatus | responseCode | | --- | --- | --- | --- | | Get token status inquiry | Set token-reference-id: b2b92b5b-403d-4bd8-a756-6e415b86b291 | SUCCESS | APPROVED | | Missing or invalid data provided in request | Set token-reference-id: 302e20dc-c3ac-4a82-8504-bcbc3f5a9001 | ERROR | VALIDATION_ERROR | | Provided value of data field is invalid | Set token-reference-id: 302e20dc-c3ac-4a82-8504-bcbc3f5a9002 | ERROR | INVALID_VALUE | | Server cannot handle request | Set token-reference-id: 302e20dc-c3ac-4a82-8504-bcbc3f5a9003 | ERROR | HOST_ERROR | | Request timeout | Set token-reference-id: 302e20dc-c3ac-4a82-8504-bcbc3f5a9004 | ERROR | TIMEOUT | ## Bulk tokenization **HTTP method**: `POST` **Endpoint**: `/bulk-tokens` Replace the Token requestor ID (TRID) value with the TRID received during onboarding. For more information about file formats, see [Bulk tokenization](/docs/commerce/optimization-protection/capabilities/tokenization/bulk-tokenization). **Bulk token test cases** | File processing | Test card (numbers/comments) | File header (S - summary/D - detail) | File data | File trailer | | --- | --- | --- | --- | --- | | Successful Visa | PAN XXXXXXXXXXXX0237 XXXXXXXXXXXX1112 | 0,(Merchant Id),20220124,S,PAN2NWT | 1,XXXXXXXXXXXX0237,1222,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) | 9,1 | | Successful Mastercard | PAN XXXXXXXXXXXX0000 XXXXXXXXXXXX1002 | 0,(Merchant Id),20220124,S,PAN2NWT | 1,XXXXXXXXXXXX0000,1222,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) | 9,1 | | Badly formatted file | No trailer | 0,(Merchant Id),20220124,S,PAN2NWT | 1,XXXXXXXXXXXX0000,1222,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) | | | Duplicate file | Same file that was run recently | 0,(Merchant Id),20220124,S,PAN2NWT | 1,XXXXXXXXXXXX0000,1222,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) | 9,1 | | Badly formatted record | No expiry date and comma | 0,(Merchant Id),20220124,S,PAN2NWT | 1,XXXXXXXXXXXXX0000,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) 1,XXXXXXXXXXXXX1112,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) 1,XXXXXXXXXXXX0237,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) 1,XXXXXXXXXXXX1002,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) 1,XXXXXXXXXXXX0000,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) | 9,5 | | Provisioning error | Use Account-holder-referenceId: 302e20dc-bcbc3f5a9001 302e20dc-bcbc3f5a9002 | 0,(Merchant Id),20220124,S,PAN2NWT | 1,XXXXXXXXXXXX0000,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) 1,XXXXXXXXXXXX9999,1224,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-bcbc3f5a9001,,(TRID) 1,XXXXXXXXXXXX9876,1224,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-bcbc3f5a9002,,(TRID) 1,XXXXXXXXXXXX0987,1224,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-76a,,(TRID) 1,XXXXXXXXXXXX0098,1224,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-65a,,(TRID) 1,XXXXXXXXXXXX0009,1224,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-43a,,(TRID) | 9,6 | | Duplicate | Submit the same card that was tokenized previously | 0,(Merchant Id),20220124,S,PAN2NWT | 1,XXXXXXXXXXXX0000,1222,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) 1,XXXXXXXXXXXX0000,1222,ECOM,213-555-2621,example1@example.com,123.456.78.90,302e20dc-c3ac-4a,,(TRID) | 9,2 | ## Related [Network tokenization](/docs/commerce/optimization-protection/capabilities/tokenization/network-tokenization) [Safetech tokenization](/docs/commerce/optimization-protection/capabilities/tokenization/safetech-tokenization) [Bulk tokenization](/docs/commerce/optimization-protection/capabilities/tokenization/bulk-tokenization)