# Integration and Testing with Insomnia
source: https://developer.mastercard.com/account-to-account-commerce-for-dsp/tutorial/insomnia/index.md

## Overview {#overview}

Participants are often expected to validate the complete agreement lifecycle or payment journey when supporting Mastercard® Account‑to‑Account Commerce. This requires true end‑to‑end testing, where each interaction behaves exactly as it would in a real-world ecosystem.   

This guide empowers Participants to step into the shoes of the opposite entity, allowing them to accurately simulate counterpart behavior and drive their test cases to successful completion. By doing so, teams can confidently validate integrations without waiting on external dependencies.   

The Insomnia pack serves as a practical companion throughout this process, offering a clear view of sample request and response payloads and helping Participants understand how each API interaction should look and behave.   

From downloading Insomnia to executing calls and validating outcomes, this guide walks through the journey step by step, ensuring Participants can set up their environment, run tests seamlessly, and verify results with confidence.

### Prerequisites {#prerequisites}

Mastercard provides DSPs with Insomnia test packs containing scripts to simulate responses received from a CSP. Before testing Account to Account Commerce APIs with Insomnia, ensure the following prerequisites are met:

* Obtain MTLS Ceetificate from Mastercard Connect Key Management Portal and create a project for the Mastercard A2AC API. Refer to the 'Creating a Sandbox Project' section for details.
* Download and install the [Insomnia tool](https://insomnia.rest/).
* Install the Mastercard Insomnia Plugin. This plugin takes care of building the connection to Mastercard APIGW, generating and validating the signature, preparing the payload and calling the Account to Account Commerce APIs.
* Download the Insomnia test pack containing test cases and other supporting files in [DSP PACK for A2A.](https://static.developer.mastercard.com/content/account-to-account-commerce-for-dsp/uploads/DSP_PACK_FOR_A2A.zip)
* Review the test cases [Account to Account Commerce DSP Test Cases V6.0.](/uploads/A2ACommerce DSP Test Cases V6.1.xlsx)   

Following are the files which are available in the zip. Participants are just required to use them as described in the tutorial:

|            File Name            |                  Usage                  |
|---------------------------------|-----------------------------------------|
|                                 | A2ACommerce_DSP_TestCases.yaml          |
| signcertificate.key             | Key file used to generate the signature |
| signverificationcertificate.pem | Key file used to verify the signature   |

### Definitions {#definitions}

Defined terms used in this document (designated with initial capital letters) shall have the meaning given to them in the Account to Account Commerce Glossary unless the context specifically requires otherwise.
For ease of reference and understanding, the table below maps the terms defined under the Account to Account Commerce Glossary and used in this document with their corresponding terms defined under the technical naming convention.

|   Technical naming convention   |                                                                                                                                               Definition                                                                                                                                               |
|---------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Debtor Service Provider (DSP)   | An institution operating consumer accounts for consumers and making AtoAC available to them to allow payments to be made from consumer accounts using AtoAC via consumer interfaces on mobile devices.                                                                                                 |
| Creditor Service Provider (CSP) | An institution that meets the applicable criteria in the documentation and has been certified by the operator to extend the AtoAC service to a merchant. The institution is legally accountable to the operator for all matters concerning the merchant with respect to taking part in AtoAC and Zapp. |
| Creditor                        | Any provider of goods or services that is approved to accept AtoAC as a payment method by a distributor.                                                                                                                                                                                               |
| Debtor                          | A person that has a contractual relationship with a CFI to access and use AtoAC.                                                                                                                                                                                                                       |
| Agreement                       | The link made between the consumer's account and the merchant This is generally referred to as Link or Linking when the connection is being established.                                                                                                                                               |
| Payment with Agreement          | A payment made using the agreement ID, which uniquely identifies the link made between the consumer account and the merchant based on the agreement the consumer has set up with the merchant.                                                                                                         |

