Mastercard Transaction Notifications APIs

Mastercard Transaction notifications API collection contains the following collections:
  1. Authentication & Consent management APIs: Consent APIs are used to create and manage the consent from cardholders.
  2. Transaction Notifications APIs: APIs to create and receive transaction auth and clearing notifications.

Getting Started

If you are looking for a quick and easy way to get started with our APIs with no additional code, this is the place for you. Follow these steps to get up and running quickly with the APIs:
  • Sign up with Mastercard Developers
  • Follow the Quick Start Guide to get your project setup and get access to your API keys
  • Open the Environments tab and choose Mastercard API Sandbox Environment as the environment
  • Go to your Mastercard Developers Project Dashboard and copy the consumer key into the consumer key variable
  • The private key is a little trickier. We need to convert the P12 key into an RSA key. To do that, first download the P12 key file
  • Then convert the P12 key into an RSA key using the following command:
    openssl pkcs12 -in 'mykey.p12' | openssl rsa -out myrsa.key
    If the OpenSSL command isn't recognised, you can download the toolkit from here
  • When prompted, use the password/passphrase you configured when you first created the key
  • Now you can open the myrsa.key file you just created and copy the entire string value into the privateKey variable.
  • These keys are picked up through the {{privateKey}} and {{consumerKey}} variables in the Authorisation tab for each Collection which has already been configured to use OAuth 1.0. Go to the Authorization tab for Mastercard Authentication & Consent Management APIs and paste the private key in the Private Key field.
  • Go to your Mastercard Developers Project Dashboard download Client Encryption Key and copy its Fingerprint. For the publicKeyFingerprint environment variable, configure this fingerprint. Open the client encryption certificate(.pem) in a text editor and copy its content. This content needs to be configured for encryptionCert variable.
  • Make sure you set the Environment before you start calling the API endpoints in the collections.

How to use

  1. Start with Authentication and Consent management APIs. Run Create Consents collection. After successful run you have one card enrolled into the system with consent and should have received cardReference in the API response.
  2. Run Transaction Notifications APIs. This collection creates a test transaction on previosuly enrolled card, and fetches the transaction notifications using Undelivered notifications and Search Clearing APIs.