---
page_source: https://docs.juspay.io/upi-inapp/flutter/headless-process-payloads/collect-approve
page_title: Collect Approve
---


## Collect Approve



This operation will enable customers to approve collect request


###   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.
      - Value: upiPayCollect
      - Tags: String, Mandatory
    - **CustomerVpa**:
      - Description: If collectType is null or TRANSACTION, Vpa of the customer to be used for payment and if collectType is MANDATE, umn of the mandate.
      - Tags: String, Mandatory
    - **PayeeVpa**:
      - Description: Payee Vpa
      - Tags: String, Mandatory
    - **PayeeName**:
      - Description: Payee Name
      - Tags: String, Optional
    - **Amount**:
      - Description: Amount to be transfered. Numeric String with two decimals
      - Tags: String, Mandatory
    - **UpiRequestId**:
      - Description: Request id for upi transaction which will be same as the gatewayTransactionId received in the upiListPendingTransactions response
      - Tags: String, Mandatory
    - **AccountReferenceId**:
      - Description: Reference id for selected accounts.For MandateCollect should be the same one which was used during Approving Mandate.
      - Tags: String, Mandatory
    - **Timestamp**:
      - Description: Current timestamp
      - Tags: String, Mandatory
    - **MerchantKeyId**:
      - Description: Key ID to identify the public-private key pair used for signature generation
      - Tags: String, Mandatory
    - **Signature**:
      - Description: Signature generated for the signaturePayload
      - 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. Ex: stock
          - Tags: String, Mandatory
        - **Customer_id**:
          - Description: Any unique reference associated with your customer.
          - Tags: String, Mandatory
        - **Timestamp**:
          - Description: Time when request is created in milliseconds.
          - Tags: String, Mandatory
        - **Amount**:
          - Description: Amount to be paid. Numeric String with two decimals
          - Value: eg: 2.00
          - Tags: String, Mandatory
        - **Currency**:
          - Description: Currency to use
          - Value: eg: INR
          - Tags: String, Optional
        - **Customer_phone**:
          - Description: Mobile number
          - Tags: String, Optional
        - **Customer_email**:
          - Tags: String, Optional
      - Tags: String, Mandatory
    - **CollectType**:
      - Description: Required for Mandate Collect Request. Values :- "MANDATE" or "TRANSACTION" (default)
      - Value: MANDATE/TRANSACTION
      - Tags: String, Optional
    - **UdfParameters**:
      - Description: Stringified json for udf parameters
      - 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: Operation to be performed in the SDK.
      - Value: upiPayCollect
      - Tags: String, Mandatory
    - **Status**:
      - Description: If upiPayCollect call was success or failure
      - Value: SUCCESS / FAILURE
      - Tags: String, Mandatory
    - **BankAccountUniqueId**:
      - Description: Unique Identifier for bank account across banks
      - Tags: String, Mandatory
    - **BankCode**:
      - Description: IIN Code for the bank
      - Tags: String, Mandatory
    - **CustomerMobileNumber**:
      - Description: Masked phone number of the customer
      - Tags: String, Mandatory
    - **CustomerVpa**:
      - Tags: String, Mandatory
    - **MaskedAccountNumber**:
      - Description: Account Number with last few digits visible
      - Tags: String, Mandatory
    - **Amount**:
      - Description: Amount for which collect request is to be approved. Numeric String with two decimals
      - Tags: String, Mandatory
    - **PayeeMcc**:
      - Description: Merchant Category Code of the payee merchant
      - Tags: String, Mandatory
    - **GatewayResponseCode**:
      - Description: Response Code received from NPCI
      - Tags: String, Mandatory
    - **GatewayTransactionId**:
      - Description: upiRequestId as passed in request
      - Tags: String, Mandatory
    - **GatewayResponseMessage**:
      - Description: Response Message received from NPCI
      - Tags: String, Mandatory
    - **GatewayReferenceId**:
      - Description: upiResponseId as passed in request
      - Tags: String, Mandatory
    - **TransactionTimestamp**:
      - Description: Timestamp of transaction
      - Tags: String, Mandatory
    - **OtherInfo**:
      - Description: As passed in request
      - Tags: String, Optional
    - **RefUrl**:
      - 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
{
  "service": "in.juspay.hyperapi",
  "requestId": "96ad03b7-c298-4702-9257-83ce9225485d",
  "payload": {
    "upiRequestId": "XXXXXXXXXXXXXXXXXXXXXXXX",
    "timestamp": "1639168104341.0",
    "signaturePayload": "<signaturePayload>",
    "signature": "GFetNZC/UQ5hJF+MnaZ1dCD25GSeyFmm2cBY+rIkOhZDnR+icvl95g/1Dx4B9p/KE/ILkyBNOGNO\nDUBnxoaFeqhGE1pP3krWHcD2H2GoM13VVmFalSzSN/XvEyQBSMfurnb61FrrSl9/BW7iwsHVm6FP\+MEvzGGwyj1E9XoL3wyxAAR5Ep4C\nSSEb6crVpvMHj5F//uiHqSTNaHGHmzVnD33WdYdVk2xSeWRbZ9qSkd1vWjBry9Vtt8YHKVt4tQ23\nMEAS84TSKzsGmrKkA3IOGdJSTmcv7BvxeJKMdw==\n",
    "payeeVpa": "XXXXXXXXXXXXXXXX@XXXXXXXX",
    "merchantKeyId": "1234",
    "customerVpa": "XXXXXXXXXXXXXXXX@XXXXXXXX",
    "amount": "1.00",
    "accountReferenceId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "action": "upiPayCollect"
  }
}

"signaturePayload": {
  "merchant_id": "XXXXXX",
  "customer_id": "XXXXXX",
  "timestamp": "1639167811935",
  "amount": "5.00",
  "currency": "INR"
}
```

#### Kotlin Code Snippet:

```kotlin
{
  "service": "in.juspay.hyperapi",
  "requestId": "96ad03b7-c298-4702-9257-83ce9225485d",
  "payload": {
    "upiRequestId": "XXXXXXXXXXXXXXXXXXXXXXXX",
    "timestamp": "1639168104341.0",
    "signaturePayload": "<signaturePayload>",
    "signature": "GFetNZC/UQ5hJF+MnaZ1dCD25GSeyFmm2cBY+rIkOhZDnR+icvl95g/1Dx4B9p/KE/ILkyBNOGNO\nDUBnxoaFeqhGE1pP3krWHcD2H2GoM13VVmFalSzSN/XvEyQBSMfurnb61FrrSl9/BW7iwsHVm6FP\+MEvzGGwyj1E9XoL3wyxAAR5Ep4C\nSSEb6crVpvMHj5F//uiHqSTNaHGHmzVnD33WdYdVk2xSeWRbZ9qSkd1vWjBry9Vtt8YHKVt4tQ23\nMEAS84TSKzsGmrKkA3IOGdJSTmcv7BvxeJKMdw==\n",
    "payeeVpa": "XXXXXXXXXXXXXXXX@XXXXXXXX",
    "merchantKeyId": "1234",
    "customerVpa": "XXXXXXXXXXXXXXXX@XXXXXXXX",
    "amount": "1.00",
    "accountReferenceId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "action": "upiPayCollect"
  }
}

"signaturePayload": {
  "merchant_id": "XXXXXX",
  "customer_id": "XXXXXX",
  "timestamp": "1639167811935",
  "amount": "5.00",
  "currency": "INR"
}
```


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

#### Request Code Snippet:

```request
{
  "service": "in.juspay.hyperapi",
  "requestId": "96ad03b7-c298-4702-9257-83ce9225485d",
  "payload": {
    "upiRequestId": "XXXXXXXXXXXXXXXXXXXXXXXX",
    "timestamp": "1639168104341.0",
    "signaturePayload": "<signaturePayload>",
    "signature": "GFetNZC/UQ5hJF+MnaZ1dCD25GSeyFmm2cBY+rIkOhZDnR+icvl95g/1Dx4B9p/KE/ILkyBNOGNO\nDUBnxoaFeqhGE1pP3krWHcD2H2GoM13VVmFalSzSN/XvEyQBSMfurnb61FrrSl9/BW7iwsHVm6FP\+MEvzGGwyj1E9XoL3wyxAAR5Ep4C\nSSEb6crVpvMHj5F//uiHqSTNaHGHmzVnD33WdYdVk2xSeWRbZ9qSkd1vWjBry9Vtt8YHKVt4tQ23\nMEAS84TSKzsGmrKkA3IOGdJSTmcv7BvxeJKMdw==\n",
    "payeeVpa": "XXXXXXXXXXXXXXXX@XXXXXXXX",
    "merchantKeyId": "1234",
    "customerVpa": "XXXXXXXXXXXXXXXX@XXXXXXXX",
    "amount": "1.00",
    "accountReferenceId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "action": "upiPayCollect"
  }
}

"signaturePayload": {
  "merchant_id": "XXXXXX",
  "customer_id": "XXXXXX",
  "timestamp": "1639167811935",
  "amount": "5.00",
  "currency": "INR"
}
```

### Response snippets:

#### Response:
```plaintext
{
  "service": "in.juspay.hyperapi",
  "requestId": "96ad03b7-c298-4702-9257-83ce9225485d",
  "payload": {
    "udfParameters": "{}",
    "transactionTimestamp": "2021-12-11T01:54:28+05:30",
    "status": "SUCCESS",
    "maskedAccountNumber": "XXXXXXXXXX998898",
    "gatewayTransactionId": "XXXXXXXXXXXXXXXXXXXXXXXX",
    "gatewayResponseMessage": "PAYER AND PAYEE IFSC/ACNUM CAN'T BE SAME",
    "gatewayResponseCode": "U96",
    "gatewayReferenceId": "XXXXXXXXXXXX",
    "payeeMcc": "0000",
    "customerVpa": "XXXXXX@XXXXXX",
    "customerMobileNumber": "XXXXXXXXXXXX",
    "bankCode": "500007",
    "bankAccountUniqueId": "XXXXXXXXXXXXXXXXXXXXXXXXX",
    "amount": "1.00",
    "refUrl": "https://www.abcxyz.com/",
    "action": "upiPayCollect"
  },
  "event": "process_result",
  "errorMessage": "",
  "errorCode": "",
  "error": false
}
```

