# Integrate Direct Payment
source: https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/direct-payment/integrate-direct-payment/index.md

To implement the basic Direct Payment solution in your system, follow the instructions.

## Prerequisites {#prerequisites}

Before implementing a Direct Payment solution, check with your payment service provider to ensure you meet the following prerequisites:

* Ensure that you have a [merchant profile](https://developer.mastercard.com/mastercard-gateway/documentation/getting-started/accessing-the-api/index.md) and that should support the API.
* Select and set up your API authentication method.

## Implementing a Direct Payment Solution {#implementing-a-direct-payment-solution}

The Direct Payment solution works through API Operations (requests and responses), which are used to, for example, initiate or retrieve information about various payment transactions and store card details. You can use all the API Operations available for the [REST Server APIs](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/index.md). For general information about making server API requests, see [Making a Server API Request](https://developer.mastercard.com/mastercard-gateway/documentation/getting-started/make-server-api-req/index.md).
Alert: To perform an operation, you must first have it enabled on your merchant profile by your payment service provider. To check which Operations are available for you or to troubleshoot any API errors, contact your payment service provider.

The Operations available to you are limited to the capability of the acquirers configured on your merchant profile with the Mastercard Gateway. If a functionality is not supported for the acquirer on the gateway, any operation requests to execute that functionality are rejected by the gateway for that acquirer.

Each task you perform with Direct Payment consists of the following steps:

1. [Define the needed data](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/direct-payment/integrate-direct-payment/payment-and-payer-data/index.md): Define the payment details and other related data required to create the transaction request.
2. [Send a request](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/direct-payment/integrate-direct-payment/send-transaction-request/index.md): Create a transaction request and send it to the Gateway.
3. [Interpret the response](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/direct-payment/integrate-direct-payment/interpret-transaction-response/index.md): Decode and parse the response to your transaction request and take appropriate action to complete the transaction.

For a collection of example requests covering the common transaction operation requests, download the [Postman collection](https://www.postman.com/mastercard/mastercard-developers/collection/4fakvrd/mastercard-gateway-api).

Warning: All Mastercard Gateway API requests must be made from the merchant's backend server. Do not invoke any API operation directly from the payer's browser. The only exception are requests related to [EMV 3-D Secure authentication](https://developer.mastercard.com/mastercard-gateway/documentation/security-and-fraud/authentication/3d-secure-auth/index.md), if you use it. With those requests, you need to use [session-authentication](https://developer.mastercard.com/mastercard-gateway/documentation/security-and-fraud/secure-int-pw-cert/index.md#session-authentication) at the customer side to keep your API password secret.

<br />

After your integration is completed and you can manage basic requests and responses:

1. Consider your payment lifecycles and needs for any subsequent Operations after the basic payment transaction is completed.
2. Determine any customizations that you need to make based on the specific [payment methods](https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/index.md) you want to support.
3. Consider what kind of [security](https://developer.mastercard.com/mastercard-gateway/documentation/security-and-fraud/index.md) or other [additional features](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/direct-payment/integrate-gateway-features/index.md) that you want to offer or use in your integration.
4. [Test](https://developer.mastercard.com/mastercard-gateway/documentation/testing/test-your-int/direct-payment/index.md) your entire solution.
