# Linking
source: https://developer.mastercard.com/mastercard-buyer-payment-agent/documentation/use_cases/business-payment-service/linking/index.md

## How linking works {#how-linking-works}

Linking helps to ensure that the correct entities do business through the Business Payment Service. Supplier Payment Agents can suggest a Buyer Payment Agent initiate a link between buyers and suppliers. However, the Buyer Payment Agent must initiate the link request in order for the link to be created. To integrate with the linking APIs, refer to the [linking tutorial](https://developer.mastercard.com/mastercard-buyer-payment-agent/tutorial/linking/index.md).

![alt text](https://static.developer.mastercard.com/content/mastercard-buyer-payment-agent/uploads/howlinkingworks.png)

The linking overview diagram displays the main steps for the linking process.
Note: With the April 2023 release, the previously required `buyerRegistrationId` field is now optional.

**Step 1** : The Buyer Payment Agent initiates the linking request by calling the POST linking API.   

**Step 2** : Business Payment Service notifies the Supplier Payment Agent of the linking request.   

**Step 3** : Supplier Payment Agent either accepts or rejects the linking request.   

**Step 4** : Business Payment Service notifies the Buyer Payment Agent of the approval.   
Note: If the linking request is rejected, the process ends once the Buyer Payment Agent receives the even notification with the linking rejection.

**Step 5**: Business Payment Service notifies the Buyer Payment Agent if the Supplier has any Supplier payment preferences in place.

**Step 6 - optional** : The Buyer Payment Agent submits the delete linking request by calling the DELETE linking API.   

**Step 7 and 8**: Business Payment Service notifies both the Buyer Payment Agent and the Supplier Payment Agents of the link removal.

**Step 9 - optional**: Buyer Payment Agent submits the search and filter the link request by calling the GET linking API.

**Step 10**: Business Payment Service returns linking information.

*** ** * ** ***

## Initiate a link request {#initiate-a-link-request}

Note: If a Supplier Payment Agent nudges a Buyer Payment Agent with a linking request, the Buyer Payment agent receives the SUPPLIER_SUGGESTING_LINK_REQUEST event notification. The Buyer Payment Agent can respond to the nudge request by initiating a link. However, the Buyer Payment Agent can initiate a linking request without a nudge from the Supplier Payment Agent.

![alt text](https://static.developer.mastercard.com/content/mastercard-buyer-payment-agent/uploads/initiatelinkreq.png)
Note: The Mastercard Business Payment Service assigned ICA is used for agent identification in all service requests for core operations. A customer service provider can use their API credentials to transact on behalf of a customer by providing their customer's ICA number in the request. Direct payment agents can still transact by entering their own ICA when sending a transaction to Mastercard Track Business Payment Service.
API Reference: `POST /buyer-payment-agents/{ica}/buyer-payment-profiles/{bpa_profile}/supplier-links`

## Delete an existing link {#delete-an-existing-link}

![alt text](https://static.developer.mastercard.com/content/mastercard-buyer-payment-agent/uploads/deleteexistinglink.png)
Note: If a Buyer or Supplier Payment Agent deletes a link, both agents receive the LINK_REMOVED event notification.
API Reference: `DELETE /buyer-payment-agents/{ica}/buyer-payment-profiles/{bpa_profile}/supplier-links/{spa_profile}`

## Search for an approved link {#search-for-an-approved-link}

![alt text](https://static.developer.mastercard.com/content/mastercard-buyer-payment-agent/uploads/searchapprovedlink.png)

API Reference: `GET /buyer-payment-agents/{ica}/buyer-supplier-links`

## Get all Supplier payment preferences {#get-all-supplier-payment-preferences}

![alt text](https://static.developer.mastercard.com/content/mastercard-buyer-payment-agent/uploads/getallsupplierpayref.png)

API Reference: `GET /buyer-payment-agents/{ica}/payment-profiles/{bpa_profile}/suppliers/{spa_reg}/payment-preferences`

## Get payment preference for Supplier profile {#get-payment-preference-for-supplier-profile}

![alt text](https://static.developer.mastercard.com/content/mastercard-buyer-payment-agent/uploads/getpayrefsupplierprof.png)

API Reference: `GET /buyer-payment-agents/{ica}/payment-profiles/{bpa_profile}/suppliers/{spa_reg}/payment-profiles/{spa_profile}/payment-preferences`

