# Postman Collection
source: https://developer.mastercard.com/unified-installments/documentation/developer-tools/postman-collection/index.md

Use this page to integrate and test the Mastercard Installments APIs with Postman.

## Prerequisites {#prerequisites}

Create a Mastercard Installments API project in Sandbox on Mastercard Developers by following the [Quick Start Guide](https://developer.mastercard.com/unified-installments/documentation/quick-start-guide/index.md#step-1-get-access-to-the-api). Then download your API keys (`.p12` and `.pem` files) and record your consumer key.

## Postman Collection for Mastercard Installments API {#postman-collection-for-mastercard-installments-api}

The Mastercard Installments Postman collection is available in Postman:
Run in Postman

<br />

## Set Up and Configure Postman for Mastercard Installments API {#set-up-and-configure-postman-for-mastercard-installments-api}

For the generic steps to set up and configure Postman for Mastercard APIs, see the [Postman tutorial](https://developer.mastercard.com/platform/tutorial/use-postman-for-mastercard-apis/).  

While you follow the tutorial, use the following choices for the Mastercard Installments API, which uses OAuth 1.0a for authentication and JWE to encrypt sensitive data in request and response payloads.

**Step 1: Set up the Postman collection.** Fork the [Mastercard Installments API Postman collection](https://www.postman.com/mastercard/mastercard-developers/collection/rcbie26/mastercard-installments-api).  

**Step 2: Configure the Postman environment.** Select the *Mastercard API Sandbox Environment with JWE Encryption* environment.  

**Step 3: Set the base URL.** Use the following value:  

baseUrl : `https://sandbox.api.mastercard.com/installments`  

**Step 4: Enable authentication.** Follow the instructions in the OAuth 1.0a section of the tutorial.

* Configure the settings below on the **Authorization** tab of the *Mastercard Installments API* collection, at the parent level. For each individual request, set **Auth Type** to **Inherit auth from the parent** . ![step-4](https://static.developer.mastercard.com/content/unified-installments/uploads/authorization-03.png)
* Set `baseUrl`, `consumerKey`, and `privateKey` as environment variables.
  * Get the `consumerKey` from your Mastercard Developers project.
  * Generate the `privateKey` file from the signing key `.p12` file in your Mastercard Developers project, as described in the tutorial.
  * You can configure the private key in either of two ways:
    * Option #1: Paste the content of the key file into the `privateKey` field.
    * Option #2: Upload the private key file on the **Authorization** tab. ![Options](https://static.developer.mastercard.com/content/unified-installments/uploads/option-2-1.png)
* Enable **Include body hash** on the **Authorization** tab. ![step-4](https://static.developer.mastercard.com/content/unified-installments/uploads/include-body-hash.png)

**Step 5: Enable encryption.** Follow the instructions in the **JWE Encryption** section of the tutorial.  

* For the `POST /offers`, `POST /plans`, `POST /consumers/pans/registrations`, and `POST /consumers/pans/deregistrations` endpoints, configure the following environment variables:
  * `publicKeyFingerprint`: from your Mastercard Developers project
  * `baseUrl`: `https://sandbox.api.mastercard.com/installments` (add it if it is not already set)
  * `consumerKey`: from your Mastercard Developers project
  * `privateKey`: the key generated in Step 4
  * `encryptionCert`: the content of the `.pem` file from your Mastercard Developers project
  * `pathToRawData`: `$.sensitiveData`
  * `pathToEncryptedData`: `encryptedValue`
  * `encryptedValueFieldName`: `encryptedValue`
  * `encryptionType`: `jwe`

**Step 6: Call a Mastercard API from Postman.** Prepare the request payloads in one of the following ways.

**Option #1: Use the predefined Sandbox data**   

Mastercard preloads test data in Sandbox so that you can test your integration quickly. Each predefined request payload returns a predefined response. Review the test cases for each endpoint on the [Testing](https://developer.mastercard.com/unified-installments/documentation/testing/index.md) page. Copy a request payload into the matching request in your Postman collection, send it, and compare the response with the expected response. This lets you:  

a. Confirm that your API integration works.  

b. Experiment with the APIs using supported test data.

**Option #2: Use your own data**   

If you have set up your own data in Sandbox, such as installment offers for your own account ranges, prepare request payloads that match your data, send them with the Postman collection, and review the responses. This lets you:  

a. Confirm that your API integration works.  

b. Run user acceptance testing with data that matches Production.
