---
page_source: https://docs.juspay.io/upi-inapp/flutter/headless-process-payloads/p2m-pay
page_title: P2M Pay
---


## P2M Pay



This operation will enable customers to pay for the order.


###   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: Operation to be performed in the SDK. Should be upiTxn for this call.
      - Value: Value: upiTxn
      - Tags: String, Mandatory
    - **MerchantKeyId**:
      - Description: Key ID to identify the public-private key pair used for signature generation.
      - Value: Example: 1234
      - Tags: String, Mandatory
    - **Signature**:
      - Description: Signature generated for the signaturePayload.
      - Tags: String, Mandatory
    - **AccountRefId**:
      - Description: Reference ID for selected account
      - Value: Example: ABC123456789
      - Tags: String, Mandatory
    - **SignaturePayload**:
      - Description: Signature payload is a stringified JSON of the details mentioned in the below table.
      - Value:
        - **Merchant_id**:
          - Description: Unique identifier associated with an account created by juspay.
          - Value: Example: stock
          - Tags: String, Mandatory
        - **Order_id**:
          - Description: Order ID for the transaction.
          - Value: Example: ABC123456789
          - Tags: String, Mandatory
        - **Amount**:
          - Description: Amount to be paid. Numeric String with two decimals
          - Value: Example: 2.00
          - Tags: String, Mandatory
        - **Currency**:
          - Description: Currency to use
          - Value: Example: INR
          - Tags: String, Optional
        - **Customer_phone**:
          - Description: Mobile no
          - Value: Example: 1234567890
          - Tags: String, Optional
        - **Customer_email**:
          - Description: Customer Email
          - Value: Example: abc@xyz.com
          - Tags: String, Optional
        - **Customer_id**:
          - Description: Any unique reference associated with your customer.
          - Value: Example: abcde12345
          - Tags: String, Mandatory
        - **Timestamp**:
          - Description: Time when request is created in milliseconds.
          - Value: Example: 1665996901100
          - Tags: String, Mandatory
        - **Udf1**:
          - Description: User defined field which will be echoed back in the response from Juspay with a Max character limit of 255. If there are any special characters that need to be passed in UDF values, please use udf6 to udf10 for passing the same. udf1 to udf5 can be used to pass values which do not have any special characters.
          - Value: Example: helloWorld
          - Tags: String, Optional
      - Tags: String, Mandatory
  - 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: Operation performed in the SDK.
      - Value: Value: upiTxn
      - Tags: String
    - **Status**:
      - Description: Status of the Operation. Possible values : SUCCESS, PENDING, FAILURE
      - Value: Example: SUCCESS
      - Tags: String
    - **Order_id**:
      - Description: Order ID for the transaction.
      - Value: Example: ABC123456789
      - Tags: String
  - 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": "79fc93aa-2d98-49c9-bbb1-2beaafd4f3b6",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiTxn",
    "accountRefId": "ABC123456789",
    "merchantKeyId": "<Merchant Key Id>",
    "signature": "<Generated signature for signature payload>",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
  }
}

"signaturePayload": {
  "merchant_id": "stock",
  "customer_id": "abcde12345",
  "timestamp": "1668389349848",
  "amount": "200.00",
  "order_id": "ABC1234567890"
}
```

#### Kotlin Code Snippet:

```kotlin
{
  "requestId": "79fc93aa-2d98-49c9-bbb1-2beaafd4f3b6",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiTxn",
    "accountRefId": "ABC123456789",
    "merchantKeyId": "<Merchant Key Id>",
    "signature": "<Generated signature for signature payload>",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
  }
}

"signaturePayload": {
  "merchant_id": "stock",
  "customer_id": "abcde12345",
  "timestamp": "1668389349848",
  "amount": "200.00",
  "order_id": "ABC1234567890"
}
```


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

#### Request Code Snippet:

```request
{
  "requestId": "79fc93aa-2d98-49c9-bbb1-2beaafd4f3b6",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiTxn",
    "accountRefId": "ABC123456789",
    "merchantKeyId": "<Merchant Key Id>",
    "signature": "<Generated signature for signature payload>",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
  }
}

"signaturePayload": {
  "merchant_id": "stock",
  "customer_id": "abcde12345",
  "timestamp": "1668389349848",
  "amount": "200.00",
  "order_id": "ABC1234567890"
}
```

### Response snippets:

#### Response:
```plaintext
{
  "requestId": "79fc93aa-2d98-49c9-bbb1-2beaafd4f3b6",
  "service": "in.juspay.hyperupi",
  "payload": {
    "action": "upiTxn",
    "status": "SUCCESS"
    "orderId": "ABC1234567890"
  },
  "error": false,
  "errorMessage": "",
  "errorCode": "",
  "event": "process_result"
}
```

