# Migrating from In Control API (Retail API) to Business Payment Controls for SME
source: https://developer.mastercard.com/business-payment-controls/documentation/migrating-bpc/index.md

## Migration endpoint {#migration-endpoint}

**The endpoint is for existing Retail API users only. The endpoint is not applicable to users that are new to Business Payment Controls for SME.**

Corporates or issuers that use Retail API can use this endpoint to enable seamless migration of their existing cards from legacy Retail API to Business Payment Controls for SME. This endpoint allows users to pass a Virtual Card Number (VCN), Real Card Number (RCN), or CPN ID (the legacy card identifier) to fetch the corresponding globally unique identifier (GUID) (the Business Payment Controls card identifier) associated with the card.

After migration, users can continue to use the same cards by using the retrieved GUID.

**Once a card is migrated successfully to Business Payment Controls for SME, do not access the migrated card using the Retail API.**

### Prerequisites {#prerequisites}

* A Mastercard Developers project created for Business Payment Controls for SME.
* Coding and testing for Business Payment Controls for SME is complete in the sandbox.
* The Business Payment Controls for SME application is ready in production.
* The Owner GUID is available.

### Migration steps {#migration-steps}

When ready to migrate cards from Retail API to Business Payment Controls for SME, pass either the card number or CPNId, the card type (VCN or RCN), and the ownerGUID.

Migrate an RCN first before migrating the VCNs corresponding to that RCN.

#### Migrate a real card {#migrate-a-real-card}

The card number or CPNId, the card type (RCN), and the ownerGUID needs to be passed as part of the request. The RCN will be registered in Business Payment Controls for SME and the RCN will be associated with the funding source. The endpoint returns the real card GUID and funding source GUID.

1. The user passes the RCN (card number or CPNId) and other relevant details to the Business Payment Controls for SME migration endpoint using `POST/retail-account-migrations`.
2. Business Payment Controls for SME passes RCN and CPN type to In Control.
3. In Control validates the RCN and CPN type.
4. If the card exists, In Control sends back the card details to Business Payment Controls for SME.
5. Business Payment Controls for SME registers RCN using `POST/real-card-accounts` and creates a funding source using `POST/funding-sources`.
6. Business Payment Controls for SME sends the account GUID and funding source GUID to the user in the response.

Diagram 01-migrate-rcn

Use the following endpoints to fetch more information on the RCN and funding source:

##### Retrieve card account details by AccountGuid {#retrieve-card-account-details-by-accountguid}


API Reference: `GET /real-card-accounts/{account_guid}`

##### Retrieve funding source details {#retrieve-funding-source-details}


API Reference: `GET /funding-sources/{funding_source_guid}`

##### Register a virtual card {#register-a-virtual-card}


API Reference: `POST /virtual-card-accounts`

#### Migrate a virtual card {#migrate-a-virtual-card}

The VCN number and the card type (VCN) is passed in the request. The corresponding RCN GUID, the funding source GUID, and the VCN GUID are returned in the response.

1. The user passes the VCN (card number or CPNId), card type and other relevant details using `POST/retail-account-migrations`.
2. Business Payment Controls for SME sends the VCN and CPN card type to In Control.
3. In Control validates VCN and CPN type.
4. If the VCN exists, In Control returns the card details to Business Payment Controls for SME.
5. Business Payment Controls for SME checks if the RCN corresponding to the VCN is registered. If not, the RCN is registered using `POST/real-card-accounts` and a funding source is created using `POST/funding-sources`.
6. Business Payment Controls for SME also creates a VCN using `POST/virtual-card-accounts`.
7. Business Payment Controls for SME returns the RCN GUID, the funding source GUID, and the VCN GUID to the user.

Diagram 01-migrate-vcn

Use the following endpoints to fetch more information on the VCN and funding source:

##### Retrieve card account details by AccountGuid {#retrieve-card-account-details-by-accountguid-1}


API Reference: `GET /real-card-accounts/{account_guid}`

##### Retrieve funding source details {#retrieve-funding-source-details-1}


API Reference: `GET /funding-sources/{funding_source_guid}`

##### Retrieve virtual card account details {#retrieve-virtual-card-account-details}


API Reference: `GET /virtual-card-accounts/{account_guid}`

### More help {#more-help}

For more help on migration, refer to [Frequently asked questions](https://developer.mastercard.com/business-payment-controls/documentation/support/index.md).
