# Invoking an API using Insomnia
source: https://developer.mastercard.com/account-to-account-commerce-for-csp/tutorial/insomnia/step_5/index.md

## Invoking an API {#invoking-an-api}

Make sure the Environment A2A_ACCREDITATION_TEST_ENVIRONMENT_Sandbox is chosen before executing the APIs.
We are going to showcase executing 2 APIs - Agreement Linking and Linked Payment with Step up. Participants are required to test all mandatory APIs.

### Run Test Cases for CSP Link Account {#run-test-cases-for-csp-link-account}

1. Open the folder named **TC-3A_CSP Link Account**.

2. Create agreement using your Application and note down the Agreement ID. Update this ID in the environment **A2A_ACCREDITATION_TEST_ENVIRONMENT_Sandbox** .
   ![agreementid](https://static.developer.mastercard.com/content/account-to-account-commerce-for-csp/uploads/insomniaslides/agreementid1.png)

3. Click on **RETRIEVE_AGREEMENT** and then click "Send". View the response on the right-hand side of the page and validate if the status is OK.
   ![runthetestcase](https://static.developer.mastercard.com/content/account-to-account-commerce-for-csp/uploads/insomniaslides/csplinkaccount1.png)

4. Click on **UPDATE_AGREEMENT** and then click "Send". View the response on the right-hand side of the page and validate if the status is OK.
   ![runthetestcase2](https://static.developer.mastercard.com/content/account-to-account-commerce-for-csp/uploads/insomniaslides/csptestcasesrun1.png)

5. CSP should have received an Agreement Update notification from A2AC platform.

### Run Test Cases for CSP Pay with Linked Account with Step Up Advice {#run-test-cases-for-csp-pay-with-linked-account-with-step-up-advice}

1. Open the folder named **TC-4B_CSP Pay with Linked Account with step up advice**.

2. Create agreement using your Application and note down the Agreement ID. Update this ID in the environment **A2A_ACCREDITATION_TEST_ENVIRONMENT_Sandbox** .
   ![agreementid](https://static.developer.mastercard.com/content/account-to-account-commerce-for-csp/uploads/insomniaslides/agreementid1.png)

3. Click on **RETRIEVE_AGREEMENT** and then click "Send". View the response on the right-hand side of the page and validate if the status is OK.
   ![runthetestcase](https://static.developer.mastercard.com/content/account-to-account-commerce-for-csp/uploads/insomniaslides/csplinkstepup1.png)

4. Click on **CONFIRM_AGREEMENT** and then click "Send". View the response on the right-hand side of the page and validate if the status is OK.
   ![runthetestcase2](https://static.developer.mastercard.com/content/account-to-account-commerce-for-csp/uploads/insomniaslides/csp4bconfirmagreement.png)

5. Create Payment Request using your application with the Agreement ID mentioned in step 2, and note down the **Payment Lifecycle ID** . Update this ID in the environment **A2A_ACCREDITATION_TEST_ENVIRONMENT_Sandbox** .
   ![runthetestcase2](https://static.developer.mastercard.com/content/account-to-account-commerce-for-csp/uploads/insomniaslides/pmtlfecycleid.png)

6. Click on **STEP_UP_REQUEST** and then click "Send". View the response on the right-hand side of the page and validate if the status is OK.
   ![runthetestcase2](https://static.developer.mastercard.com/content/account-to-account-commerce-for-csp/uploads/insomniaslides/csp4bstepup1.png)

7. Click on **CONFIRMADVICE_REQUEST** and then click "Send". View the response on the right-hand side of the page and validate if the status is OK.
   ![runthetestcase2](https://static.developer.mastercard.com/content/account-to-account-commerce-for-csp/uploads/insomniaslides/csp4bstepup2.png)

8. CSP should have received a Payment Confirmation Advice from A2AC platform.

