# During Purchase source: https://developer.mastercard.com/unified-installments/documentation/use-cases/mastercard-installments-payment-services/during-purchase/index.md Mastercard can enable the distribution of installments offers during checkout through distribution partners, such as Wallets, Browsers, Acquirers, Point of Sale (POS) terminal providers, Payment Gateway, Payment Service Provider (PSP) / Payment aggregators, and Merchants. ## API Overview {#api-overview} | No. | API Name | Access | High-Level Description | What It Does | Audience | |-----|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------| | 1. | [PAN List API](https://developer.mastercard.com/unified-installments/documentation/use-cases/mastercard-installments-payment-services/during-purchase/index.md#pan-list-api) | Inbound | Used for creating and maintaining a list of PANs (Primary Account Numbers) eligible for an Installments offer. | * Creates a new PAN List with a list of PANs * Modifies an existing PAN List to add/remove PANs | Issuer/Issuer Processor | | 2. | [Installments Offers API](https://developer.mastercard.com/unified-installments/documentation/use-cases/mastercard-installments-payment-services/during-purchase/index.md#installments-offers-api) | Inbound | Checks the cardholder's eligibility for installments and provides the installments plan calculation details | * Will run an eligibility check * Will return installments offers available for the transaction * Will return a valid error message if the transaction is ineligible | Distribution Partner | | 3. | [Real time eligibility API](https://developer.mastercard.com/unified-installments/documentation/use-cases/mastercard-installments-payment-services/during-purchase/index.md#real-time-eligibility-api) | Outbound | Retrieves eligible offers from issuer systems at runtime when distribution partners request them through Mastercard. | Enables Mastercard Installments to retrieve installments offers in the real time. | Issuer/ Issuer Processor | | 4. | [Installments Plan API](https://developer.mastercard.com/unified-installments/documentation/use-cases/mastercard-installments-payment-services/during-purchase/index.md#installments-plan-api) | Inbound | Used for saving the installment plan chosen by the cardholder | * Will save the cardholder-chosen plan and the associated transaction details in the Mastercard database * Will return a valid error message if the plan cannot be saved | Distribution Partner | | 5. | [Installments Notification API](https://developer.mastercard.com/unified-installments/documentation/use-cases/mastercard-installments-payment-services/during-purchase/index.md#installments-notification-api) | Outbound | Notifies Issuer/Processor of the cardholder chosen plan and associated transaction identifiers. | * Asynchronous notification - will notify Processor/Issuer about the cardholder chosen plan | Issuer/ Issuer Processor | ## PAN List API {#pan-list-api} The API allows you to create a list of PANs (Primary Account Numbers) that belong to the same account range. This list, known as a PAN List, is created in the Mastercard Installments database. Once the PAN List is created, it can be linked to an Installment offer group using the Mastercard Installments User Interface. This means that offers will only be available to the PANs in the respective PAN List. This feature is useful for issuers who wish to provide special installments offers to only a limited number of cardholders and not their entire portfolio/Account Range. Please note that when creating the PAN list, Issuers need to specify only the Funding PANs. Also, Issuers are allowed to add the same PAN to different PAN Lists. There are two endpoints available to maintain the PAN List: * [Create a PAN List and/or add PAN to a list](https://developer.mastercard.com/unified-installments/documentation/use-cases/mastercard-installments-payment-services/during-purchase/index.md#create-a-pan-list-andor-add-pan-to-a-list) * [Deregister PAN from a PAN List](https://developer.mastercard.com/unified-installments/documentation/use-cases/mastercard-installments-payment-services/during-purchase/index.md#deregister-pan-from-a-pan-list) ### Create a PAN List and/or add PAN to a list {#create-a-pan-list-andor-add-pan-to-a-list} This endpoint lets you create a new PAN list or add more PANs to an existing PAN List. Issuers need to send encrypted PANs in the request body, following the encryption scheme specified by Mastercard. Mastercard will then validate the API request. The API can return one of the following responses: * **Success** : All PANs are processed successfully. This is indicated by an HTTP response code of 200 and a `failureCount` parameter in the response body of '0'. * **Failure**: The API call fails. This is indicated by an HTTP response code that is not 200. * **Partial Success** : Some PANs are processed successfully, but others fail. This is indicated by an HTTP response code of 200 and a `failureCount` parameter in the response body that is not '0'. For each failed PAN processing, the API response body includes a `reasonCode` and `description` to explain the failure. Please note that the `pans` object in the response body is encrypted by Mastercard, so you need to decrypt it. ### Endpoint {#endpoint} API Reference: `POST /consumers/pans/registrations` Here are the use cases supported by this API endpoint: #### Scenario 1: Create an Empty PAN List {#scenario-1-create-an-empty-pan-list} Issuers can create an empty PAN List by providing just the name of the PAN List and Account Range details. Also, they can add PANs to this list later. #### Scenario 2: Create a PAN List with Account Range \& PANs {#scenario-2-create-a-pan-list-with-account-range--pans} Issuers can create a new PAN List by providing the name of the PAN List, Account Range details, and a set of PANs. Mastercard will then check the PANs against the Account Range to ensure the data is correct. #### Scenario 3: Create a PAN List with PANs {#scenario-3-create-a-pan-list-with-pans} Issuers can create a new PAN List by providing the name of the PAN List and a set of PANs. In this case, Mastercard will determine the account range that the PAN belongs to, ensuring they all belong to the same Account Range. #### Scenario 4: Add PANs to an Existing PAN List {#scenario-4-add-pans-to-an-existing-pan-list} Issuers can add PANs to an existing PAN List by providing the `panListid` and a set of PANs. For more detailed information and examples, refer to the [API specification](https://developer.mastercard.com/unified-installments/documentation/api-reference/mastercard-installments-services/inbound-api/index.md#apis). ### Deregister PAN from a PAN List {#deregister-pan-from-a-pan-list} This endpoint lets you remove a PAN (Primary Account Number) from a current PAN list. Issuers need to send encrypted PANs in the request body, following the encryption method specified by Mastercard. Mastercard will then validate the API request. The API can return one of the following responses: * **Success** : All PANs are processed successfully. This is shown when the HTTP response code is 200 and the `failureCount` parameter in the response body is '0'. * **Failure**: The API call fails. This is shown when the HTTP response code is not 200. * **Partial Success** : Some PANs are processed successfully, but others fail. This is shown when the HTTP response code is 200 and the `failureCount` parameter in the response body is not '0'. For each failed PAN processing, the API response body includes a `reasonCode` and `description` to explain the failure. Please note that the `pans` object in the response body is encrypted by Mastercard, so you need to decrypt it. ### Endpoint {#endpoint-1} API Reference: `POST /consumers/pans/deregistrations` Here are the use cases supported by this API endpoint: #### Scenario: Remove a PAN from an existing PAN List {#scenario-remove-a-pan-from-an-existing-pan-list} An Issuer can specify the `panListid` and the list of PANs that need to be removed from the current PAN List. For more detailed information and examples, refer to the detailed [API specification](https://developer.mastercard.com/unified-installments/documentation/api-reference/mastercard-installments-services/inbound-api/index.md#apis). ## Installments Offers API {#installments-offers-api} The API allows distribution partners to retrieve eligible installment offers for cardholders by providing the PAN, merchant information, and transaction information. The distribution partner must encrypt sensitive data in the API request body, as outlined in the API specification. The API uses the provided PAN, merchant details (like Merchant category code and merchant country), and transaction details (such as Amount, currency, and transaction timestamp) to check if there are any eligible offers. If eligible offers are found, the API returns the details of all offers. Distribution Partners can then share these offers with cardholders or consumers. For each offer, the API provides information about the tenure, interest rates, fees, terms and conditions, and a detailed loan repayment schedule. This information helps cardholders understand the repayment details. If no eligible offers match the request criteria, the API response will not include any offers. In this case, the Distribution Partner should inform the cardholders. For more detailed information and examples, refer to the [API specification](https://developer.mastercard.com/unified-installments/documentation/api-reference/mastercard-installments-services/inbound-api/index.md#apis). ### Endpoint {#endpoint-2} API Reference: `POST /offers` ## Real time eligibility API {#real-time-eligibility-api} This is an outbound API endpoint that retrieves eligible offers from issuer runtimes when distribution partners request eligible offers through Mastercard. The API takes transaction, merchant, and cardholder information as input, enabling the issuer to perform eligibility checks and return eligible offers. API Reference: `POST /card-offers/searches` ## Installments Plan API {#installments-plan-api} The API allows Distribution Partners to notify Mastercard when a cardholder chooses one of the installments offers previously shown through the Offer Presentment API. This chosen offer is known as an Installment Plan. The Distribution Partner needs to send the details of the selected offer, including the PAN, transaction information, merchant details, and offer specifics, without any changes. Mastercard then validates this data against the presented offer to ensure its integrity and provides a success or failure response. If the API processing is successful, it returns an HTTP status code of 201, a status of CREATED, and a unique Plan Identifier. In this scenario, the Distribution Partner can tell the cardholder that the installment offer has been processed successfully. However, if the API processing fails for some reason, it returns a corresponding HTTP status code. The response body includes a description and a `reasonCode`, which help the Distribution Partner understand why it failed and what corrective actions are needed. In this situation, the Distribution Partner should inform the cardholder about the failure in getting the installment. For more detailed information and examples, refer to the [API specification](https://developer.mastercard.com/unified-installments/documentation/api-reference/mastercard-installments-services/inbound-api/index.md#apis). ### Endpoint {#endpoint-3} API Reference: `POST /plans` ## Installments Notification API {#installments-notification-api} This is an outbound notification from Mastercard to the customer's API endpoint about the installment plan that a cardholder chose. It contains cardholder, transaction, merchant, and installment plan details, which the issuer or processor uses to post the transaction as installments. The Notification API always contains the funding PAN. If `POST /plans` is called with a token PAN, Mastercard converts the token PAN to the corresponding funding PAN and sends it through the Notification API. API Reference: `POST /plans`
To use the Notification API service, the issuer selects it during Mastercard Installments program onboarding. The customer must build and expose an API endpoint in its domain that meets the following expectations: * API specification should strictly adhere to the [POST /notifications](https://developer.mastercard.com/unified-installments/documentation/api-reference/mastercard-installments-services/outbound-api/index.md#apis) API definition. API Reference: `POST /notifications` * The URL needs to be public and reachable on the internet. * It needs to be FQDN (Fully Qualified Domain Name) and HTTPS. * The domain name should be resolvable. * The URL must end with `/notifications`. No other query parameter in the URL or header is allowed or required. * Example of an unsupported URL: `https://api.testcompany.com/?id=xxx` * Example of a supported URL: `https://api.testcompany.com/notifications` * Mastercard supports different destination paths for notifications in both MTF and Production environments. This endpoint requires partial request payload encryption using the JWE payload encryption. For implementation details, refer to the [Securing Sensitive Data Using Payload Encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/) section. When Mastercard sends the outbound notification, it encrypts the `sensitiveData` object into `encryptedValues` by using the customer's public key configured during project creation on Mastercard Developers. When the customer receives the call, it decrypts `encryptedValues` into `sensitiveData` with its private key to obtain the clear PAN data. ### API response {#api-response} When the customer successfully processes the notification, it returns HTTP response code **201**, as defined in the API specification. If the customer receives a call that does not follow the API specification, or encounters any other issue, it returns an appropriate HTTP response code and a response body that follows the API specification. ### API retry {#api-retry} If Mastercard receives an HTTP 5XX error from the customer's endpoint, it first retries up to 3 times at 1-minute intervals. It then sends 3 retries every hour until the customer returns HTTP 201. After the customer returns HTTP 201, Mastercard stops retrying. Mastercard does not retry automatically for any HTTP response other than 5XX. ## Workflow {#workflow} ### During Purchase Transaction Workflow {#during-purchase-transaction-workflow} #### Auth enriched with Plan ID {#auth-enriched-with-plan-id} Diagram auth-during-purchase ## Next Steps {#next-steps} Now that you understand the use cases the service supports, go to the [API Reference](https://developer.mastercard.com/unified-installments/documentation/api-reference/index.md) section to try all of the endpoints in the API explorer.