# Mastercard Processing Debit APIs
source: https://developer.mastercard.com/mastercard-processing-debit/documentation/index.md

## Overview {#overview}

Mastercard Processing offers modern, scalable, and configurable card processing solutions to fintech companies and financial institutions. The Mastercard Processing (MP) Debit APIs is an additional service to the [Core APIs](https://developer.mastercard.com/mastercard-processing-core/documentation/#overview) that support some specific use cases dedicated strictly to debit card products.

## How It Works {#how-it-works}

Debit card products rely on real-time account balance checking during the cardholder's transaction authorization in the issuer's core banking system (CBS). This is the only source of funds, so there is no need to exchange and synchronize the available funds between the issuer's host and Mastercard Processing platform. Alternatively, a host-to-host connection is established between Mastercard Processing and issuer CBS to check the available balance of the bank account to which the debit card is linked.  

The whole process for online authorization starts when a cardholder performs a transaction, for example, at the merchant by using the debit card. The merchant or merchant's acquirer routes the authorization request to the Banknet, and Mastercard Scheme receives it. Mastercard checks the availability of the issuer's processor (Mastercard Processing in our case).

When Mastercard Processing is connected to the Mastercard network, the request is routed. Mastercard Processing has a maximum of 7 seconds to process the request and respond to Mastercard. During this time, Mastercard Processing performs several card-related validations and checks, such as PAN, expiry date, card status, EMV check, limits, risk rules, and so on. As a final step, the authorization is sent through the host-to-host connection to the issuer's CBS for available balance validation and final approval. The authorization response is forwarded back from the issuer to Mastercard Processing, then to Mastercard Scheme, further to the acquirer, and finally to the merchant.

![](https://static.developer.mastercard.com/content/mastercard-processing-debit/uploads/how-it-works.png)

There is a risk of negative cardholder's impact during the scheduled host downtimes at the issuer and unexpected telecommunication or system failures or timeouts. To minimize the risk to zero, Mastercard Processing offers on-behalf authorization service and using the Mastercard Processing Debit API, you may provide Mastercard Processing with the current cardholder's debit account balance.

### Stand-In Processing (STIP) {#stand-in-processing-stip}

Mastercard Processing offers you double stand-in protection. One level of on-behalf authorization comes from the Mastercard network, and the second from Mastercard Processing. Authorization on behalf of the issuer must rely on fixed amounts allowed for specific transaction conditions.

Rules and parameters to be implemented in Stand-In Processing (STIP) are defined:

* During the initial project with payment scheme, for example, Mastercard STIP
* During the onboarding process, for example, Mastercard Processing STIP

Note: For this documentation, we use Mastercard STIP by default, but it is also feasible when you use Visa STIP, as we are ready to process transactions from both payment schemes.

#### Mastercard STIP {#mastercard-stip}

STIP is a complementary solution to authorizing the transaction in online mode. The issuer should set the service on the Mastercard network level as a fixed transaction amount.

When Mastercard enters STIP and generates a response on behalf of Mastercard Processing, there are two cases:

* Mastercard assessed Mastercard Processing is offline and cannot be reached. A request is not routed to Mastercard Processing and Mastercard authorizes the transaction based on STIP parameters.
* Mastercard Processing did not respond within 7 seconds. After this time-out period, Mastercard authorizes the transaction independently (STIP).

![](https://static.developer.mastercard.com/content/mastercard-processing-debit/uploads/stand-in-processing.png)
Note: Change of PIN initiated in ATM cannot be handled in Mastercard STIP mode.

#### Mastercard Processing STIP {#mastercard-processing-stip}

In case of unavailability of the issuer's system (for example, in case of downtimes or timeouts), Mastercard Processing can authorize transactions on behalf of the issuer based on the offline STIP balances provided by the issuer. There are two cases when Mastercard Processing enters STIP mode:

* The issuer connection to Mastercard Processing is offline and the issuer's system cannot be reached. The request cannot be routed to the issuer.
* The issuer did not respond within 4 seconds (time-out).

The Store-and-Forward (SAF) mechanism is used for Mastercard Processing STIP. When the issuer host system becomes available again, Mastercard Processing will send all advice and message notifications (0120 message type) to the issuer for each authorized transaction. Optionally, negative advice, with declined authorizations, is available.

![](https://static.developer.mastercard.com/content/mastercard-processing-debit/uploads/processing-stand-in-processing.png)

#### Balance management {#balance-management}

For providing STIP, Mastercard Processing needs to have an up-to-date account balance. There are three options to provide balance to Mastercard Processing:

* Authorization response: Balance sent in the response from the issuer to each authorization request.
* Batch file: Balance sent in a daily batch file.
* Debit API: Balance sent through the API; see use case with the `updateStipBalance` operation.

The first option, wherein the issuer sends the balance in the authorization response is preferred as it provides the most recent data and requires no additional effort.  

Account balances can also be provided in batch files when this type of communication is more convenient for you.  

The API endpoint is also available but it should be treated as an additional communication channel. It is suitable for situations when some transactions not requiring authorization were executed, for example, charging fees.
Note: All three ways of updating balance can be in use simultaneously. Mastercard Processing implemented a sophisticated method of counting balances, effective even when receiving balances through different communication channels.

## Getting Started {#getting-started}

Before issuing cards, you must fulfill the requirements. The following diagram illustrates the simplified process of physical card issuance.

When you set up a relationship with a payment network for step one (in this example, Mastercard Scheme), remember that we also support Visa projects. When you start cooperation with a processor for step two, the processor in reference is Mastercard Processing.

![](https://static.developer.mastercard.com/content/mastercard-processing-debit/uploads/getting-started.png)

1. Set up a Mastercard Scheme project: You must obtain a Mastercard license and have a signed agreement.
2. Set up a project with Payment Processor (in this example, with Mastercard Processing): After you sign the contract, the onboarding process requires the following actions in the Mastercard Processing Card Management System (CMS):  
   1. Define which product will be used: credit, debit, prepaid; types of limits; and currency.
   2. Choose parameters to define how the API operations will work.
3. Initiate the actual card production using API operations: The personalization bureau must be involved in the physical card production process.
4. Mastercard Processing APIs allow you to create objects and put, retrieve, and update data while managing the card lifecycle.

The API Sandbox provides a demo of what to expect even before you contact Mastercard Processing. Try it, customize it to your needs, and [contact us](https://developer.mastercard.com/support/) to share your experience.

## Next steps {#next-steps}

* Review the [Quick Start Guide](https://developer.mastercard.com/platform/documentation/getting-started-with-mastercard-apis/quick-start-guide/) to learn how to use the Mastercard Developers platform.
* See [API Basics](https://developer.mastercard.com/mastercard-processing-debit/documentation/api-basics-section/index.md) to learn more about authentication and encryption.
* Review the [Use Cases](https://developer.mastercard.com/mastercard-processing-debit/documentation/use-cases/index.md), their implementations, and sequence diagrams.
* Use the [API Reference](https://developer.mastercard.com/mastercard-processing-debit/documentation/api-reference/index.md) to review the OpenAPI Specification and execute each API endpoint.
* Review the [Error Codes](https://developer.mastercard.com/mastercard-processing-debit/documentation/code-and-formats/index.md) and the formats that we use.
* See the [Support](https://developer.mastercard.com/mastercard-processing-debit/documentation/support/index.md) in case of questions or support.
