API21
API21
WHO NEEDS IT? This page gives you a brief description of the different sections you will find in this document.
Explains who the topic applies to.
PREREQUISITES
What is it?
Lists the processes or actions that must be completed Gives a description and high-level overview of the topic.
before you start a specific process.
ALSO KNOWN AS
Lists the alternative names that are used for certain
terms.
GOOD TO KNOW
Provides additional background information to help
you better understand the topic.
Contents
Implementation Quick Reference Guide /
Contents
1 2
Understanding Mastercard API
API Platforms
5 9
? 6 10
The Foundation
Welcome to Application Programming Interface
(API) – The Foundation
PREREQUISITES This document provides a broad introduction to Application Programming Interfaces (APIs)—how APIs work, why APIs are important
• Access to Mastercard ConnectTM for Mastercard, and Mastercard’s API Platform.
• Access to Mastercard Developers The primary intended audience of this guide is anyone wanting to learn the foundation of API.
The document is split into two sections:
Understanding API
We introduce the importance of APIs for Mastercard, including why Mastercard is focusing on APIs. We also explain in
detail what an API is, why we need APIs and its security at high level.
This document provides a relatively high-level overview with links to additional information where relevant.
5
API — The Foundation
Understanding API
Implementation Quick Reference Guide /
Understanding API
Mastercard APIs enable our customers to easily integrate our services into digital solutions, and fundamentally transform the way we
work with our customers and how our services are accessed.
Our APIs provide our customers a direct connection to Mastercard various platforms, such as:
Mastercard Digital
Rewards Rewards MDES Enablement Service MoneySend MoneySend
(MDES)
?
Implementation Quick Reference Guide /
Understanding API / What is an API?
What is an API?
When a company has a resource (such as data, like AT M locations) or function (such as payment processing) it wants to share (or sell) to
its partners, the company hires internal developers to create web services that serve the resource or perform the function.
These web services are then made available over the public internet, and are called APIs or Application Programming Interfaces.
These APIs, as their name suggests, enable programs to interface with other applications.
WHO NEEDS IT?
An API is used by our partners to build software applications, and essential for connecting developers to Mastercard services.
To speak plainly, an API is the messenger that runs and delivers requests to the API service provider ❶, and then delivers the response
back to the requestor (or client) ❷.
• Developers at issuers, acquirers, processors, and To give you a familiar example, think of an API as a waiter in a restaurant. Let’s imagine that, at the table, a client is ordering from a
technology companies. menu of choices, and the kitchen (Mastercard) is the service provider who will fulfill their order.
ALSO KNOWN AS
• Web Services
GOOD TO KNOW
• APIs are simply how separate services work together
to deliver a solution.
• APIs are quickly becoming the de facto standard, 1
where companies exchange data and build consistent
cross-channel customer experiences.
2
• A good API makes it easier to develop a program by
providing all the building blocks. The programmer
then can easily put the blocks together.
• A developer may use any number of APIs to build What is missing is the critical link (the messenger) to communicate the order to the kitchen and deliver the food (resource) back to the
their user facing application, including APIs outside
table. That’s where the waiter (or API) comes in. The waiter takes the order, delivers it to the kitchen ❶, and then delivers the food back
of Mastercard, such as Facebook, Google, or
Twitter. to you ❷. Note: API resources are the resources that a provider makes available so that other applications can interface with it.
An API connects business processes, services, content, and data to channel partners, internal teams, and independent developers in an
easy and secure way. In short, API enable applications to talk to each other.
7
API — The Foundation
Implementation Quick Reference Guide /
Understanding API / API Security at High Level
API Security at High Level
A key is similar to a password that gives the key-holder access to a particular resource or API.
A certificate contains a key, information about the key, its validity (for example, key expiration date), the key holder, and other
security related information. Certificates are signed by a third party responsible for ensuring the certificate and key are valid, also
known as a Certificate Authority (CA).
GOOD TO KNOW:
Below are some examples of keys and certificates and their roles during API connections:
• A certificate is an electronic document used to
identify an individual, a server, a company, or other
entity, and to bind that identity with a public key. MDES
• A certificate always includes: XML Gateway Client Certificate Client Authentication to XML Gateway
• A public key and the name of the entity it identifies
Wrapping Key or Digitize Public Key Transport key used with the MDES Digitize API to encrypt one-time use AES Key
• An expiration date (one-time key will be used during payment)
• A serial number Mastercard Public Key Used to encrypt the cardinfo object sent through the MDES Digitize API
• The digital signature and name of the issuing (Mastercard Key Encipherment)
Certificate Authority (CA) KekID Transport key used to encrypt specific RawTransactionCredential
(only required for non- Mastercard CMS-D)
ccmKeyID Used to encrypt transaction credentials sent through MDES Credentials
(only required for non-Mastercard CMS-D) Management API during token provisioning
CMS-D Public Key Wrapping key used to encrypt the AES key sent through the MDES Credentials
(required for all new Wallet Providers) Management API during token provisioning
In Control
Signing Certificate During API call, used to ensure integrity of the message
Client Certificate During API call, used to authenticate a client when he establishes a SSL connection
Server Certificate During API call, used to authenticate a server when it establishes a SSL connection
MoneySend
Signing Certificate During API call, used to ensure integrity of the message
Client Certificate During API call, used to authenticate a client when he establishes a SSL connection
Server Certificate During API call, used to authenticate a server when it establishes a SSL connection
9
API — The Foundation
GOOD TO KNOW:
• The SSL or TLS provides security which ensures that
the information transmitted between the partner and service provider client user
(Mastercard) (partner / issuer / DAC / acquirer) (cardholder)
the service provider is encrypted and not readable by
anyone that might intercept the message.
• A gateway typically provides additional security,
standards, and reporting.
❶ ❷ ❸ ❹ ❺
• An API Gateway perform multiple roles including load
balancing, throttling, security, and translation between
the partner’s application and Mastercard applications.
DATA
data
• While a gateway is the entry point for the application PARTNER
Over time, Mastercard creates more applications to serve more APIs for more products and features. Mastercard also has multiple
gateways, each with their own security benefits. All Mastercard partners can leverage these services to expand their offerings.
10
API — The Foundation
Implementation Quick Reference Guide /
Mastercard API Platforms / API Example—Location Services
API Example - Location Services
Problem
You are creating a mobile application to show the user where nearby ATMs are located.
Solution
Mastercard has developed an API called Location Services. By using this API, you can easily add functionality to your application to find
the ATM closest to the user.
ANY WALLET
ATM ATM
? ATM ATM
App determines App sends API calls Mastercard sends App displays
position The mobile application sends data information
Using the GPS included in your an API call to Mastercard Mastercard ATM database The app displays the positions
smartphone, the GPS is able Location Services. sends the position of the of the ATMs overlaid on a map.
to locate your current location. The API calls include: ATMs in the user’s area back
to the app.
• Signing and client
certificates, as required for
authentication
• Other info, such as file
identifiers and timestamp
• The body of the message
contains the action to be
performed by the API, that
is to check where the ATMs
are located in the area.
11
API — The Foundation
Implementation Quick Reference Guide /
Mastercard API Platforms / Mastercard Developers
Mastercard Developers
Support
• If you have questions about API, contact your Mastercard representative.
• During implementation, contact your assigned Implementation Manager.
Feedback
If you have suggestions for improving this document, please email us at:
[email protected]
13
API — The Foundation
Glossary
Implementation Quick Reference Guide /
Glossary
Terms Definition
Secure Socket Layers (SSL) The standard security technology for establishing an encrypted link between a client and a service
provider.
Hypertext Transfer Protocol How websites and APIs communicate over the internet, it is underlying protocol used by the World
(HTTP) Wide Web that defines how messages are formatted and transmitted.
The HTTP Methods are:
• GET: Retrieving data
• POST & PUT : Creating or updating data
• DELETE : Deleting data
Data Interchange Format A set of rules for transmitting data that is both human-readable and machine-readable.
• Extensible Markup Language XML and JSON are both Data Interchange Formats; both attempt to accomplish the same goal, but
(XML) JSON is newer and quickly replacing XML, primarily because JSON messages are smaller than XML
• JavaScript Object Notation messages. The following table shows the same information presented in XML and JSON.
(JSON)
XML JSON
<AddressBook> {
<Contact> “AddressBook” : [
<FirstName>John</FirstName> “Contact” : {
<LastName>Doe</LastName> “FirstName” : “John”;
<Email>[email protected]</Email> “LastName” : “Doe”;
</Contact> “Email” : “[email protected]”
<Contact> },
<FirstName>Jane</Firstname> “Contact” : {
<LastName>Doe</LastName> “FirstName” : “Jane”;
<Email>[email protected]</Email> “LastName” : “Doe”;
</Contact> “Email” : “[email protected]”
</AddressBook> }
]
}
14
API — The Foundation
If you like this guide, you can find similar ones in the Implementation Quick Reference Guides 1 2 3
series.
The Implementation Quick Reference Guides demystify complex subjects into easy-to-understand content.
All of the following guides are available at Technical Resource Center/References on Mastercard ConnectTM :
Mastercard Project
Network Implementation Settlement
Connectivity with Mastercard