# Quick Start Guide source: https://developer.mastercard.com/transaction-notifications/documentation/quick-start-guide/index.md ## Overview {#overview} Use this guide to go from account setup to your first successful Sandbox request for Transaction Notifications. You will create a project, generate credentials, make a test call, and prepare the same project for Production access. ### Checklist {#checklist} | # | Step | What to Do | |-------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [1](https://developer.mastercard.com/transaction-notifications/documentation/quick-start-guide/index.md#step-1-get-access-to-mastercard-developers) | Get access to Mastercard Developers | Create your account and verify your email. | | [2](https://developer.mastercard.com/transaction-notifications/documentation/quick-start-guide/index.md#step-2-create-a-project-and-generate-sandbox-credentials) | Create a Project and Generate Sandbox Credentials | Create a project, add required APIs, and download keys. | | [3](https://developer.mastercard.com/transaction-notifications/documentation/quick-start-guide/index.md#step-3-authentication) | Authentication | Set up OAuth 1.0a request signing with your keys. | | [4](https://developer.mastercard.com/transaction-notifications/documentation/quick-start-guide/index.md#step-4-obtain-a-card-reference) | Obtain a Card Reference | Enroll a card through [Consent Management \& Enrollment](https://developer.mastercard.com/consent-management/documentation/) and record the `cardReference`. | | [5](https://developer.mastercard.com/transaction-notifications/documentation/quick-start-guide/index.md#step-5-make-your-first-sandbox-request) | Make your first Sandbox request | Send a sample `curl` request and verify the expected response. | | 6 | Validation | Use the sample response and [Testing](https://developer.mastercard.com/transaction-notifications/documentation/testing/index.md) page to validate test data, positive flows, and negative flows. | | 7 | Production | After Sandbox validation is complete, use the [Onboarding Checklist](https://developer.mastercard.com/transaction-notifications/documentation/tutorials-and-guides/onboarding-checklist/index.md) to request Production access. | ### Prerequisites {#prerequisites} For this tutorial you must ensure you have `Python` and `pip` installed on your system. If you don't already have Python installed, check out the [Python documentation](https://www.python.org/doc/). ## Step 1: Get Access to Mastercard Developers {#step-1-get-access-to-mastercard-developers} 1. Go to [Mastercard Developers](https://developer.mastercard.com/account/log-in), then log in or create an account. 2. Activate a new account by opening the link sent to your email address and log in. ## Step 2: Create a Project and Generate Sandbox Credentials {#step-2-create-a-project-and-generate-sandbox-credentials} Create a Mastercard Developers project to generate your Sandbox credentials. Sandbox provides mocked data so that you can validate your integration before requesting Production access. ### Project Details {#project-details} 1. Click **Create new project** on your [My Projects](https://developer.mastercard.com/dashboard) page. ![Transaction Notifications Project Creation](https://static.developer.mastercard.com/content/transaction-notifications/img/project-details.png) 2. Enter a project name. 3. Indicate whether you are creating the project on behalf of a client. 4. In the **Select at least one API** field, choose **Transaction Notifications** and [Consents](https://developer.mastercard.com/consent-management/documentation) and click **Proceed**. ### Project Credentials {#project-credentials} 5. On the **Project Credentials** page, create a key alias and keystore password for your OAuth keys, record them securely, and click **Create Project**. ![Transaction Notifications Project Project Credentials](https://static.developer.mastercard.com/content/transaction-notifications/img/project-credentials.png) ### Additional Credentials {#additional-credentials} 6. On the **Additional Credentials** page, create a key alias and keystore password for your encryption key, record them securely, and click **Proceed**. ### Project Creation {#project-creation} 7. Once the project is created, download the key files and store in a safe place. 8. Click **Open Project** . ![Project creation confirmation with key download links](https://static.developer.mastercard.com/content/transaction-notifications/img/project-creation.png) ### Save the Values you Will Need {#save-the-values-you-will-need} 9. From the project dashboard, record the Sandbox consumer key. ![Sandbox consumer key](https://static.developer.mastercard.com/content/transaction-notifications/img/consumer-key.png) ## Step 3: Authentication {#step-3-authentication} Mastercard uses OAuth 1.0a to authenticate your application. Mastercard provides [client authentication libraries](https://github.com/Mastercard?q=oauth) in several languages that you can integrate to your project or use as reference OAuth 1.0a implementations: | | ![Java](https://static.developer.mastercard.com/content/transaction-notifications/img/java.svg) **Java** | ![C#](https://static.developer.mastercard.com/content/transaction-notifications/img/csharp.svg) **C#** | ![Python](https://static.developer.mastercard.com/content/transaction-notifications/img/python.svg) **Python** | ![NodeJS](https://static.developer.mastercard.com/content/transaction-notifications/img/nodejs.svg) **NodeJS** | ![Go](https://static.developer.mastercard.com/content/transaction-notifications/img/go.svg) **Go** | |:--------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------:| | **Download/install** | [![](https://img.shields.io/maven-central/v/com.mastercard.developer/oauth1-signer.svg?style=flat&color=f99f1c&label=)](https://search.maven.org/artifact/com.mastercard.developer/oauth1-signer/) | [![](https://img.shields.io/nuget/v/Mastercard.Developer.OAuth1Signer.Core.svg?style=flat&color=f99f1c&label=)](https://www.nuget.org/packages/Mastercard.Developer.OAuth1Signer.RestSharpV2/) | [![](https://img.shields.io/pypi/v/mastercard-oauth1-signer.svg?style=flat&color=f99f1c&label=)](https://pypi.org/project/mastercard-oauth1-signer/) | [![](https://img.shields.io/npm/v/mastercard-oauth1-signer.svg?style=flat&color=f99f1c&label=)](https://www.npmjs.com/package/mastercard-oauth1-signer) | [![](https://img.shields.io/github/v/release/mastercard/oauth1-signer-go.svg?style=flat&color=f99f1c&label=)](https://github.com/Mastercard/oauth1-signer-go) | | **View on GitHub** | [![](https://img.shields.io/github/stars/mastercard/oauth1-signer-java.svg?label=&style=social)](https://github.com/Mastercard/oauth1-signer-java) | [![](https://img.shields.io/github/stars/mastercard/oauth1-signer-csharp.svg?label=&style=social)](https://github.com/Mastercard/oauth1-signer-csharp) | [![](https://img.shields.io/github/stars/mastercard/oauth1-signer-python.svg?label=&style=social)](https://github.com/Mastercard/oauth1-signer-python) | [![](https://img.shields.io/github/stars/mastercard/oauth1-signer-nodejs.svg?label=&style=social)](https://github.com/Mastercard/oauth1-signer-nodejs) | [![](https://img.shields.io/github/stars/mastercard/oauth1-signer-go.svg?label=&style=social)](https://github.com/Mastercard/oauth1-signer-go) | This guide uses Python to demonstrate how to use the Mastercard authentication library. For other languages, follow the README files on GitHub. 1. Install the `oauth signer` and the Python `requests` library using `pip`, via your command terminal: ```cmd pip install mastercard-oauth1-signer requests ``` 2. Create a Python file, let's call it `transactions.py`. Once the file is created, add the following imports: ```python import requests from requests.auth import AuthBase import oauth1.authenticationutils as authenticationutils from oauth1.signer import OAuthSigner ``` 3. Create a helper class using `AuthBase` from the `Requests` library that automatically signs all of the HTTP requests we send: ```python # MCSigner # Helper class for signing request objects class MCSigner(AuthBase): def __init__(self, consumer_key, signing_key): self.signer = OAuthSigner(consumer_key, signing_key) def __call__(self, request): self.signer.sign_request(request.url, request) return request ``` 4. Use the `load_signing_key` function to create a signing key using the .p12 key file that you downloaded from Mastercard Developers and your keystore password: ```python signing_key = authenticationutils.load_signing_key('./path/to/projectname-sandbox.p12', 'keystorepassword') ``` 5. Use the `MCSigner` helper class to create our HTTP request signer using the consumer key of your Mastercard Developers project: ```python base_url = 'https://sandbox.api.mastercard.com/openapis' consumer_key = 'consumer key' signer = MCSigner(consumer_key, signing_key) ``` We now have everything we need to authenticate a request. For a detailed overview of the OAuth 1.0a approach Mastercard uses, refer to [Using OAuth 1.0a to Access Mastercard APIs](https://developer.mastercard.com/platform/documentation/authentication/using-oauth-1a-to-access-mastercard-apis/). ## Step 4: Obtain a Card Reference {#step-4-obtain-a-card-reference} Before you can simulate a transaction, you need a `cardReference`. You obtain this by enrolling a card to the `notification` service through the [Consent Management \& Enrollment](https://developer.mastercard.com/consent-management/documentation/) APIs. Call `POST /consents` with the card details. The response contains the `cardReference`. Record the `cardReference` value. You must use it in the next step to identify the enrolled card in your test transaction request. For the full enrollment flow, see the [Consent Management \& Enrollment Quick Start Guide](https://developer.mastercard.com/consent-management/documentation/quick-start-guide/). ## Step 5: Make Your First Sandbox Request {#step-5-make-your-first-sandbox-request} Use the Sandbox base URL: `https://sandbox.api.mastercard.com/openapis` Update the `cardReference` in the following sample request with the value received from Consent Management \& Enrollment. ```bash curl --request POST \ --url https://sandbox.api.mastercard.com/openapis/notifications/transactions \ --header 'Content-Type: application/json' \ --data '{ "cardholderAmount": 10.99, "cardholderCurrency": "USD", "merchantName": "Merchant", "cardReference": "" }' ``` Warning: The curl example above does not include OAuth signing. For a working curl call, use the [Postman Collection](https://developer.mastercard.com/transaction-notifications/documentation/developer-tools/postman-collection/index.md) or the `MCSigner` helper class described in [Authentication](https://developer.mastercard.com/transaction-notifications/documentation/quick-start-guide/index.md#step-3-authentication). Expected successful response: * `200 OK` * Empty response body If sandbox webhook delivery is not configured, fetch notifications from Undelivered Notifications API. ## Next Steps {#next-steps} * For endpoint and payload details, go to [API Reference](https://developer.mastercard.com/transaction-notifications/documentation/api-reference/index.md). * For common failures and resolution guidance, go to [Codes and Formats](https://developer.mastercard.com/transaction-notifications/documentation/codes-and-formats/index.md). * For implementation walkthroughs, go to [Tutorials](https://developer.mastercard.com/transaction-notifications/documentation/tutorials-and-guides/index.md).