---
page_source: https://juspay.io/in/docs/upi-merchant-stack/docs/submerchants/p2p-to-p2m-migration
page_title: P2P to P2M Migration
---

## API Version: default


## **P2P to P2M migration** 



This API is used to migrate p2p customers to submerchants.## Endpoints:
- Production: http://{{host}}/api/{uri}/merchants/sub/p2mMigration

## Request Type: 
POST

## Content-Type: 
application/json

## Headers:

#### Content-Type:
`application/json`
- Tags: String

#### x-merchant-id:
Will be shared while onboarding.
- Tags: String

#### x-merchant-channel-id:
Will be shared while onboarding.
- Tags: String

#### x-timestamp:
This is an epoch unix timestamp string. For example, `1496918882000`. It can be used by us to invalidate older requests.
- Tags: String

#### x-merchant-signature:
This is a signature over combination of headers, payload.
- Tags: String
## Sample Code Snippets:
### Code Snippets:

#### Shell Code Snippet:

```shell
{"success":false,"message":"No Data found for the given path"}
```

### Sample Request and Response:

#### Request:
```json
{"success":false,"message":"No Data found for the given path"}
```

#### Response:
```json
{"success":false,"message":"No Data found for the given path"}
```

## Body Parameters:
### Parameter:

#### subMerchantId:
- Description: Merchant generated sub-merchant id value

**Constraints:** Alphanumeric string. Maximum length is 256.
- Value: value
- Tags: String, Mandatory

#### subMerchantChannelId:
- Description: Sub-merchant channel id

**Constraints:** Alphanumeric string. Maximum length is 256.
- Tags: String, Mandatory

#### vpa:
- Description: Vpa which is linked to QR

**Constraints:** Special characters allowed(.-@).Maximum length is 25.
- Tags: String, Mandatory

#### accountNumber:
- Description: Account number for the sub-merchant

**Constraints:** Numeric string. Maximum length is 30.
- Tags: optional

#### ifsc:
- Description: Ifsc code of the sub-merchant bank account

**Constraints:** Alphanumeric string. Maximum length is 11.
- Tags: optional

#### mcc:
- Description: Mcc code of the sub-merchant

**Constraints:** Numeric String (4).
- Tags: String, Mandatory

#### callbackUrls:
- Description: Callback Urls are configured for each event

**Constraints:** Stringified Array of JSON objects.
- Tags: optional

#### merchantName:
- Description: Name of sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 100.
- Tags: String, Mandatory

#### marketingName:
- Description: Market name of the sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 50.
- Tags: String, Mandatory

#### city:
- Description: City of sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 50.
- Tags: String, Mandatory

#### address:
- Description: Address of sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 200.
- Tags: String, Mandatory

#### state:
- Description: State of sub-merchant

**Constraints:** Alphanumeric string . Maximum length is 50.
- Tags: String, Mandatory

#### pincode:
- Description: Pincode of sub-merchant

**Constraints:** Numeric String (6).
- Tags: String, Mandatory

#### owner:
- Description: Owner of sub-merchant firm

**Constraints:** Alphanumeric string. Maximum length is 50.
- Tags: String, Mandatory

#### partner1:
- Description: Partner name of sub-merchant firm

**Constraints:** Alphanumeric string. Maximum length is 50.
- Tags: String, Mandatory

#### partner2:
- Description: Partner name of sub-merchant firm

**Constraints:** Alphanumeric string. Maximum length is 50.
- Tags: String, Mandatory

#### mccDescription:
- Description: Description of mcc

**Constraints:** Alphanumeric string. Maximum length is 256.
- Tags: String, Mandatory

#### gstin:
- Description: GSTIN

**Constraints:** Alphanumeric string. Maximum length is 20.
- Tags: optional

#### panNumber:
- Description: PAN Number of sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 10.
- Tags: optional

#### mid:
- Description: Merchant identifier for sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 20.
- Tags: String, Mandatory

#### tid:
- Description: Terminal identifier for sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 20.
- Tags: String, Mandatory

#### sid:
- Description: Store id for sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 20.
- Tags: String, Mandatory

#### merchantType:
- Description: Merchant type for sub-merchant

**Constraints:** SMALL,LARGE.
- Tags: String, Mandatory

#### merchantGenre:
- Description: Genre of sub-merchant

**Constraints:** ONLINE, OFFLINE.
- Tags: String, Mandatory

#### onBoardingType:
- Description: Onboarding type of sub-merchant

**Constraints:** BANK, AGGREGATOR
- Tags: String, Mandatory

#### brand:
- Description: Brand name of sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 99.
- Tags: String, Mandatory

#### legal:
- Description: Legal name for sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 99.
- Tags: String, Mandatory

#### franchise:
- Description: franchise name for sub-merchant

**Constraints:** Alphanumeric string. Maximum length is 99.
- Tags: String, Mandatory

#### type:
- Description: Ownership type of sub-merchant

**Constraints:** PROPRIETARY,PARTNERSHIP,PRIVATE,PUBLIC,OTHERS.
- Tags: String, Mandatory

#### enabled:
- Description: Denotes if the sub-merchant is enabled or not

**Constraints:** true, false
- Tags: optional

#### isB2BMerchant:
- Description: Denotes if sub-merchant can accept payment as a B2B merchant.

**Constraints:** true, false.
- Tags: optional

#### replacementVpa:
- Description: Vpa that becomes primary vpa after the primary vpa is migrated.

**Constraints:** Special characters allowed(.-@).Maximum length is 25.
- Tags: optional

#### iat:
- Description: Timestamp to be used in JWS**Constraints:** As passed in the request body
- Tags: String, Mandatory
## API Responses:
### 200:

#### status:
- Description: PSP status of the API

**Values:** SUCCESS, FAILURE
- Tags: String, Mandatory

#### responseCode:
- Description: PSP response code for the API

**Values:** Refer error code section
- Tags: String, Mandatory

#### responseMessage:
- Description: PSP response message for the API

**Values:** Refer error code section
- Tags: String, Mandatory

#### merchantId:
- Description: Unique id for parent merchant

**Values:** As passed in request.
- Tags: String, Mandatory

#### merchantChannelId:
- Description: Unique id for the channel of the parent merchant

**Values:** As passed in request.
- Tags: String, Mandatory

#### subMerchantId:
- Description: Merchant generated sub-merchant id value

**Values:** Merchant generated sub-merchant id value
- Tags: String, Mandatory

#### subMerchantChannelId:
- Description: Sub-merchant channel id

**Values:** As passed in request.
- Tags: String, Mandatory

#### vpa:
- Description: Vpa for sub-merchant

**Values:** As passed in request.
- Tags: String, Mandatory

#### maskedAccountNumber:
- Description: Masked account number for the sub-merchant

**Values:** XXXX123456
- Tags: String, Mandatory

#### ifsc:
- Description: Ifsc code of the sub-merchant bank account

**Values:** As passed in request.
- Tags: String, Mandatory

#### mcc:
- Description: Mcc code of the sub-merchant

**Values:** As passed in request.
- Tags: String, Mandatory

#### enabled:
- Description: Tells whether the sub-merchant is enabled or not

**Values:** As passed in request, true if not passed.
- Tags: String, Mandatory

#### callbackUrls:
- Description: Callback Urls configured for each event

**Values:** As passed in request.
- Tags: String, Mandatory
