# Testing the ACS Detail Response API in Sandbox source: https://developer.mastercard.com/account-catalog-services/documentation/tutorials-and-guides/testing-acs-detail-response-api-in-sandbox-tutorial/index.md ## Overview {#overview} This tutorial walks you through how to onboard the outbound MTLS process and the decryption flow works for the Account Catalog Services Detail Response API. However, this Outbound API service tutorial is only applicable if you opt for it. ### You will learn how to: {#you-will-learn-how-to} * Request a Customer Implementation Services project * MTLS Certificates Set up for Outbound API Authentication * Set up Outbound Account Catalog Service Detail Response API * Decryption * Create Customer Client Application ## Request a Customer Implementation Services (CIS) project {#request-a-customer-implementation-services-cis-project} * You do not need to create a project explicitly for the Outbound service API. * Before using the Outbound API service, create a project for the [Inbound Account Catalog Services API](https://developer.mastercard.com/account-catalog-services/documentation/tutorials-and-guides/tutorial-1/index.md). * Save the downloaded certificate generated for the above project. This will be used to decrypt the outbound response send by Mastercard. ## MTLS Certificates Setup for Outbound API Authentication {#mtls-certificates-setup-for-outbound-api-authentication} * This Outbound API involves a Mutual Secure Connection to be established between Mastercard and the external partner server, which exposes the endpoint (URL). This is achieved through the Mutual TLS (MTLS) authentication method, which requires the exchange of TLS certificates. * During the MTLS process, Mastercard will provide the external partner system with the Mastercard TLS client certificate. Then, the External Partner Server will provide its own Server Certificate back to the Mastercard. * Mastercard client certificate exchange will be performed through the Key Management Portal (KMP) application in Mastercard Connect. Mastercard KMP team will deliver the TLS certificate to the customer by means of this portal. * The further steps outline the process that must be followed by a customer to set up MTLS authentication for outbound response. Tip: For more information on the onboarding process, reach out to [Global Customer Support](mailto:customer_support@mastercard.com). ## Set up Outbound Account Catalog Service Detail Response API {#set-up-outbound-account-catalog-service-detail-response-api} Mastercard requires the following information to enable the outbound APIs. * Test and Production endpoints ### Test and Production endpoints {#test-and-production-endpoints} Mastercard requires the Test and Production endpoints that Mastercard will call for each API. Test and Production endpoints examples are shown in the following table. | Method | Test Customer End Point (example) | Production Customer End Point (example) | Resource | |--------|-----------------------------------------------|-----------------------------------------|----------| | POST | | | /reports | Once the information is provided, CIS can set up both inbound and outbound APIs on the Mastercard infrastructure for the MTF environment. ## Decryption {#decryption} The decryption of the payload for each call are done using classes defined by the Mastercard Client Encryption library. The request body of the service calls is encrypted and put in Mastercard Encryption format. The details of what kind of keys to use, how to request and manage keys, and the algorithms used to encrypt or decrypt are present on the [API Basics](https://developer.mastercard.com/account-catalog-services/documentation/api-basics/index.md) page. ```java // change these values accordingly String mastercardEncryptionKeyFilePath = "#PATH AND NAME OF YOUR P12 FILE HERE#"; String mastercardEncryptionAlias = "#YOUR KEY ALIAS HERE#"; String mastercardEncryptionPass = "#YOUR KEY PASSWORD HERE#"; // Step 1.1 - The response received from the call will need to be decrypted using this key PrivateKey decryptionKey = EncryptionUtils.loadDecryptionKey( mastercardEncryptionKeyFilePath, mastercardEncryptionAlias, mastercardEncryptionPass); // Step 1.2 -- Prepare JWEConfig JweConfig config = JweConfigBuilder.aJweEncryptionConfig() .withDecryptionKey(decryptionKey) .withDecryptionPath("$.encryptedValue", "$") .withEncryptedValueFieldName("encryptedValue") .build(); // Step 1.3 -- Prepare FieldLevelEncryptionConfig String decryptedPayload =FieldLevelEncryption.decryptPayload(encryptedPayload, decryptionConfig); ``` ## Create Customer Client Application {#create-customer-client-application} Account Catalog Services Detail Response API has a reference application working in Springboot / Java. For more details, refer to the [Reference App](https://developer.mastercard.com/account-catalog-services/documentation/developer-tools/reference-app/index.md). The Reference Application talks about the following points: 1. How to expose an endpoint. 2. How to decrypt the response send by Mastercard. 3. To use the MTLS setup for this application, we have used a self-signed Certificate Authority. However, DigiCert will be used in the real time. Tip: You must configure the security for this application by using [step-2](https://developer.mastercard.com/account-catalog-services/documentation/tutorials-and-guides/testing-acs-detail-response-api-in-sandbox-tutorial/index.md). Note: For more information about test cases, refer to the [testing](https://developer.mastercard.com/account-catalog-services/documentation/testing/index.md).