---
page_source: https://docs.juspay.io/upi-inapp/flutter/headless-process-payloads/set-reset-mpin
page_title: Set/Reset MPIN
---


## Set/Reset MPIN



The merchant can call this API to allow a customer to set/reset their UPI Account MPIN


###   Process Parameters



## Request Payload
- **RequestId**:
  - Description: Unique uuid-v4 string
  - Value: Example: abcd-12345-abcd-12345
  - Tags: String, Mandatory
- **Service**:
  - Description: Value: in.juspay.hyperapi
  - Tags: String, Mandatory
- **Payload**:
  - Description: Parameters required to call Hyper SDK API
  - Value:
    - **Action**:
      - Description: Action to be performed on SDK
      - Value: upiSetMpin
      - Tags: String, Mandatory
    - **CustomerVpa**:
      - Description: VPA of the customer linked to account
      - Tags: String, Mandatory
    - **Card**:
      - Description: The last 6 digits of customer's card
      - Tags: String, Mandatory
    - **Expiry**:
      - Description: Expiry date for the customer's card
      - Tags: String, Mandatory
    - **UpiRequestId**:
      - Description: Unique identifier (uuid) for the request sent to NPCI
      - Tags: String, Mandatory
    - **AccountReferenceId**:
      - Description: Unique Identifier for the account for which mpin is to be set
      - Tags: String, Mandatory
    - **UdfParameters**:
      - Description: Stringified json for udf parameters
      - Tags: String, Optional
    - **PrimaryAccountMapping**:
      - Description: Primary Account Mapping. Default: ONE_TO_ALL
      - Value: Possible values: ONE_TO_ONE (account in request will be set primary for vpa passed in request) / ONE_TO_ALL (account in request will be set primary for all vpas of a customer) / NONE (account in request will not be set primary for vpa passed in request and already existing entries won't be modified for other vpaaccounts)
      - Tags: String, Optional
  - Tags: JSON, Mandatory


## Response Payload
- **RequestId**:
  - Description: Unique uuid-v4 string
  - Value: Example: abcd-12345-abcd-12345
  - Tags: String
- **Service**:
  - Description: Value: in.juspay.hyperapi
  - Tags: String
- **Payload**:
  - Description: Response Parameters
  - Value:
    - **Action**:
      - Description: Action performed on SDK.
      - Value: upiSetMpin
      - Tags: String, Mandatory
    - **BankAccountUniqueId**:
      - Description: Unique Identifier for bank account across banks
      - Tags: String, Mandatory
    - **AccountReferenceId**:
      - Description: Unique Identifier for the account for which mpin is to be set
      - Tags: String, Mandatory
    - **BankCode**:
      - Description: IIN Code for the bank
      - Tags: String, Mandatory
    - **CustomerMobileNumber**:
      - Description: masked phone number of the customer
      - Value: <Customer mobile number>
      - Tags: String, Mandatory
    - **CustomerVpa**:
      - Description: Unique Identifier for the account for which mpin is to be set
      - Tags: String, Mandatory
    - **MaskedAccountNumber**:
      - Description: Account Number with last few digits visible
      - Tags: String, Mandatory
    - **Status**:
      - Description: Status of the API
      - Value: SUCCESS/FAILURE
      - Tags: String, Mandatory
    - **GatewayResponseCode**:
      - Description: Response Code received from NPCI
      - Tags: String, Mandatory
    - **GatewayResponseMessage**:
      - Description: Response message received from NPCI
      - Tags: String, Mandatory
    - **OtherInfo**:
      - Description: As passed in request
      - Tags: String, Optional
  - Tags: JSON
- **Error**:
  - Description: Possible values :- true/false
  - Tags: Boolean
- **ErrorMessage**:
  - Description: Error Message
  - Tags: String
- **ErrorCode**:
  - Description: Error Code
  - Tags: String
- **Event**:
  - Description: Value: process_result
  - Tags: String





#### Code Snippets: -

#### Java Code Snippet:

```java
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiSetMpin",
    "merchantKeyId": "<Merchant Key Id>",
    "signature": "<Generated signature for signature payload>",
    "customerVpa": "something@handle",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
    "card": "123456",
    "upiRequestId": "<UPI Request Id>",
    "accountReferenceId": "<Account Reference Id>",
    "expiry": "MMYY"
  }
}

"signaturePayload": {
  "merchant_id" = "stock",
  "customer_id" = "1234567",
  "timestamp" = "234562345",
  "customer_phone" = "9876543210"
}
```

#### Kotlin Code Snippet:

```kotlin
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiSetMpin",
    "merchantKeyId": "<Merchant Key Id>",
    "signature": "<Generated signature for signature payload>",
    "customerVpa": "something@handle",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
    "card": "123456",
    "upiRequestId": "<UPI Request Id>",
    "accountReferenceId": "<Account Reference Id>",
    "expiry": "MMYY"
  }
}

"signaturePayload": {
  "merchant_id" = "stock",
  "customer_id" = "1234567",
  "timestamp" = "234562345",
  "customer_phone" = "9876543210"
}
```


## Sample Code Snippets:
### Request snippets:

#### Request Code Snippet:

```request
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiSetMpin",
    "merchantKeyId": "<Merchant Key Id>",
    "signature": "<Generated signature for signature payload>",
    "customerVpa": "something@handle",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
    "card": "123456",
    "upiRequestId": "<UPI Request Id>",
    "accountReferenceId": "<Account Reference Id>",
    "expiry": "MMYY"
  }
}

"signaturePayload": {
  "merchant_id" = "stock",
  "customer_id" = "1234567",
  "timestamp" = "234562345",
  "customer_phone" = "9876543210"
}
```

### Response snippets:

#### Response:
```plaintext
{
  "requestId": "<request id passed>",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiSetMpin",
    "status": "SUCCESS" / "FAILURE",
    "bankAccountUniqueId": "<bankAccountUniqueId>",
    "accountReferenceId": "<Account Reference Id>",
    "bankCode": "11111",
    "customerMobileNumber": "XXXX7890",
    "customerVpa": "something@handle",
    "maskedAccountNumber": "XXXX203891",
    "gatewayResponseCode": "",
    "gatewayResponseMessage": "",
    "otherInfo": "{}"
  },
  "error": false,
  "errorMessage": "",
  "errorCode": "",
  "event": "process_result"
}
```

