---
page_source: https://juspay.io/in/docs/upi-consumer-stack/docs/customer-mandates/create-mandate
page_title: Create Mandate
---

## API Version: default


# Create Mandate



This api will be used for creation of a mandate. It can be initiated by both Payer as well as Payee for mandate creation. 

There are following scenarios : 

1) When Payee creates a mandate, it requires mandate approval from Payer side. Cred block is not required for this case. 

2) When Payer creates a mandate, then cred block is required and no approval is required.## Endpoints:
- Production: http://{{host}}/api/{uri}/merchants/mandates/create

## Request Type: 
POST

## Headers:

#### Content-Type:
`application/json`
- Value: application/json
- Tags: string, Required

#### x-merchant-id:
Will be shared while onboarding.
- Value: {{mid}}
- Tags: string, Required

#### x-merchant-channel-id:
Will be shared while onboarding.
- Value: {{mcid}}
- Tags: string, Required

#### Accept:
`application/json`
- Value: application/json
- Tags: string, Required

#### x-timestamp:
This is an epoch unix timestamp string. For example, `1496918882000`. It can be used by us to invalidate older requests.
- Value: {{$timestamp}}
- Tags: string, Required
## 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:

#### amount:
- Description: Amount for mandate

**Constraints:** Amount in two decimals. Decimals are mandatory.
- Value: value
- Tags: String, Mandatory

#### amountRule:
- Description: Rule on Mandate Amount. If amountRule is MAX, then mandate can be executed for amount less than or equal to the passed amount . If amountRule is EXACT, then mandate should always be executed for the same amount.

**Constraints:** `MAX`,`EXACT`
- Tags: String, Mandatory

#### bankAccountUniqueId:
- Description: Unique id for the selected bank account

**Constraints:** `bankAccountUniqueId` in the response of `Fetch Accounts` api call.
- Tags: String, Mandatory

#### blockFund:
- Description: Denotes whether customer's fund should be blocked or not. Only applicable for ONETIME mandate. For recurring mandate it should always be false, for onetime it can be true or false. If blockFund and payerRevocable are both send false for a request then request will be rejected. Default value is false.

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

#### credBlock:
- Description: Encrypted credblock containing user mpin. It is required if mandate is initiatedBy Payer.

**Constraints:** As returned by Common Library
- Tags: optional, Json String

#### currency:
- Description: Currency code

**Constraints:** String - INR
- Tags: optional, String

#### deviceFingerPrint:
- Description: Device fingerprint of the customer. It is required if mandate is initiatedBy Payer.
- Tags: optional, String

#### expiry:
- Description: **Constraints:** Minutes for which request is valid. Only applicable if initiatedBy PAYEE

**Constraints:** A numeric string between 2 to 64800 (both inclusive)
- Tags: optional, String

#### initiatedBy:
- Description: Describes whether PAYER or PAYEE has initiated the create mandate request.

**Constraints:** PAYER,PAYEE
- Tags: String, Mandatory

#### makeAsync:
- Description: Denotes whether the API call will be done in synchronous or asynchronous manner. If it is not passed by default API call will be in synchronous. It is not required if initiatedBy `PAYEE` as it will be default async as it required approval from Customer.

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

#### mandateName:
- Description: Name of the mandate
- Tags: String, Mandatory

#### merchantCustomerId:
- Description: Merchant generated unique profile id for customer

**Constraints:** Alphanumeric string with dot(.). Maximum length is 256.
- Tags: String, Mandatory

#### merchantRequestId:
- Description: Merchant generated id for the mandate request

**Constraints:** 35 character alphanumeric unique id.
- Tags: String, Mandatory

#### payeeVpa:
- Description: Vpa of the payee.

**Constraints:** Valid VPA
- Tags: String, Mandatory

#### payerRevocable:
- Description: Defines whether mandate is revocable by PAYER or not. Applicable only when it is ONETIME mandate and initiatedBy PAYEE. For recurring mandate it should always be true, for onetime it can be true or false. If blockFund and payerRevocable are both send false for a request then request will be rejected. Default value is true.

**Constraints:** String - true/false.
- Tags: optional, Boolean String

#### payerVpa:
- Description: Vpa of the payer.

**Constraints:** Valid VPA
- Tags: String, Mandatory

#### recipientName:
- Description: Name against which mandate is triggered. If initiatedBy is PAYER then payeeName or vice-versa. If name is not present with merchant payerVpa can be sent.
- Tags: String, Mandatory

#### recurrencePattern:
- Description: Recurrence Pattern for Mandate. Denotes at what frequency mandate can be executed.

**Constraints:** ONETIME, DAILY, WEEKLY, FORTNIGHTLY,MONTHLY, BIMONTHLY, QUARTERLY, HALFYEARLY, YEARLY, ASPRESENTED
- Tags: String, Mandatory

#### recurrenceRule:
- Description: Recurrence Rule for Mandate. It is not required for ONETIME, DAILY and ASPRENTED recurrencePattern.

**Constraints:** ON, BEFORE, AFTER.
- Tags: optional, String

#### recurrencValue:
- Description: Recurrence Value for Mandate. It is not required for ONETIME, DAILY and ASPRENTED recurrencePattern.

**Constraints:** between 1-31 and depends on recurrencePattern.
- Tags: optional, String

#### refUrl:
- Description: Reference url for the mandate. It is mainly kept for future purpose for invoice in inbox feature, if nothing is passed then a default value is set for this tag and same will be send back in response.
- Tags: optional, String

#### remarks:
- Description: Any mandate summary
- Tags: String, Optional

#### shareToPayee:
- Description: Descibes whether mandate will be shared with payee or not. Required only when it is ONETIME mandate and initiatedBy PAYER. For recurring mandate it should always be true, for onetime it can be true or false. Default value is true.

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

#### transactionType:
- Description: Type of Mandate Creation. `UPI_MANDATE` should be used for normal requests. `QR_MANDATE` should be used if mandate is created using QR. `INTENT_MANDATE` should be used if mandate is created using intent flow. `P2M_MANDATE` should be used if customer is directly creating a mandate with payeeVpa of merchant.

**Constraints:** `UPI_MANDATE`, `QR_MANDATE`, `INTENT_MANDATE`, `P2M_MANDATE`
- Tags: String, Mandatory

#### udfParameters:
- Description: Stringified JSON for udf parameters
- Tags: JSON string, optional

#### upiRequestId:
- Description: Unique id sent to UPI switch for the request

**Constraints:** 35 character alphanumeric. Should always start with a unique merchant prefix. Max length is 35.
- Tags: String, Mandatory

#### validityEnd:
- Description: Date before which mandate can be execute

**Constraints:** String with proper date format YYYY/MM/DD
- Tags: String, Mandatory

#### validityStart:
- Description: Date after which mandate can be executed

**Constraints:** String with proper date format YYYY/MM/DD
- Tags: String, Mandatory

#### refCategory:
- Description: Details for refUrl, whether it is 01 (advertisement), 02(Invoice). If nothing is passed, a default value of "00" is set up and same will be sent back in response.

**Constraints:** Numeric String
- Tags: String, optional

#### transactionReference:
- Description: Transaction reference id
- Tags: String, optional

#### purpose:
- Description: Defines the purpose code of the mandate

**Constraints:** Numeric String
- Tags: String, optional

#### initiationMode:
- Description: Defines the initiationMode of the mandate

**Constraints:** Numeric String
- Tags: String, optional

#### umn:
- Description: Unique mandate number. Only applicable for PAYER initiated mandate. If not passed, it is autogenerated.
- Tags: String, Optional

#### mcc:
- Description: Merchant category code
- Tags: String, Optional

#### clVersion:
- Description: Common Library Version of the UPI application clVersion**Constraints:** Common Library Version of the UPI application (Mandatory for BioAuth payments)
- Tags: String, Optional
## 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 code for the API

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

#### payload:
- Value:
  - **Amount**:
    - Description: Amount for mandate
      
      **Values:** Numeric String with two decimals. As passed for amount in request.
    - Tags: String, Mandatory
  - **AmountRule**:
    - Description: Rule on Mandate Amount. If amountRule is MAX, then mandate can be executed for amount less than or equal to the passed amount . If amountRule is EXACT, then mandate should always be executed for the same amount.
      
      **Values:** As passed for amountRule in request.
    - Tags: String, Mandatory
  - **BankAccountUniqueId**:
    - Description: Unique id for the selected bank account
      
      **Values:** `bankAccountUniqueId` in the response of `Fetch Accounts` api call. As passed for bankAccountUniqueId in request.
    - Tags: String, Mandatory
  - **BlockFund**:
    - Description: Defines whether customer's fund should be blocked or not. For onetime mandate it can be true or false. Default value is false.
      
      **Values:** String - true, false
    - Tags: String, optional
  - **Expiry**:
    - Description: Timestamp upto which mandate creation request is valid. It will only be present if mandate is initiated by PAYEE.
      
      **Values:** Timestamp in YYYY-MM-DDTHH:MM:SS+05:30 format, request timestamp plus expiry minutes passed in request.
    - Tags: String, optional
  - **GatewayMandateId**:
    - Description: UPI request id returned by gateway for the mandate
      
      **Values:** As passed for upiRequestId in request
    - Tags: String, Mandatory
  - **GatewayReferenceId**:
    - Description: Customer reference number (rrn) for the mandate operation.
    - Tags: String, Mandatory
  - **GatewayResponseCode**:
    - Description: Response code returned by gateway for the mandate operation.
      
      **Values:** Refer table below.
    - Tags: String, Mandatory
  - **GatewayResponseMessage**:
    - Description: Response message returned by gateway for the mandate operation.
    - Tags: String, Mandatory
  - **GatewayResponseStatus**:
    - Description: Response status returned by gateway
      
      **Values:** `SUCCESS`, `FAILURE`
    - Tags: String, Mandatory
  - **InitiatedBy**:
    - Description: Describes whether PAYER or PAYEE has initiated the mandate.
      
      **Values:** As passed for initiatedBy in request.
    - Tags: String, Mandatory
  - **MakeAsync**:
    - Description: Denotes whether the API call will be done in synchronous or asynchronous manner
      
      **Values:** Only present if passed in reqBody and same value as in request.
    - Tags: String, optional
  - **MandateApprovalTimestamp**:
    - Description: Time instant at which create mandate request was approved. Only present if mandate type is create and approved.
      
      **Values:** YYYY-MM-DDTHH:MM:SS+05:30.
    - Tags: String, Mandatory
  - **MandateName**:
    - Description: Name of the mandate.
      
      **Values:** As passed for mandateName in request.
    - Tags: String, Mandatory
  - **MandateTimestamp**:
    - Description: Timestamp of when this request was attempted
      
      **Values:** YYYY-MM-DDTHH:MM:SS+05:30
    - Tags: String, Mandatory
  - **MerchantChannelId**:
    - Description: Unique id for the merchant channel.
      
      **Values:** As passed for x-merchant-channel-id in request headers
    - Tags: String, Mandatory
  - **MerchantCustomerId**:
    - Description: Merchant generated unique profile id for customer
      
      **Values:** Alphanumeric string with dot(.). Maximum length is 256. As passed for merchantCustomerId in request.
    - Tags: String, Mandatory
  - **MerchantId**:
    - Description: Unique id for the merchant.
      
      **Values:** As passed for x-merchant-id in request headers
    - Tags: String, Mandatory
  - **MerchantRequestId**:
    - Description: Merchant generated id for the mandate request.
      
      **Values:** As passed for merchantRequestId in request body.
    - Tags: String, Mandatory
  - **OrgMandateId**:
    - Description: upiRequestId of the create request.
      
      **Values:** As passed for upiRequestId in the request.
    - Tags: String, Mandatory
  - **PayeeMcc	**:
    - Description: Merchant Category Code of the payee merchant.
    - Tags: String, Mandatory
  - **PayeeName**:
    - Description: Name of the Payee involved in mandate.
    - Tags: String, optional
  - **PayeeVpa**:
    - Description: VPA of payee
      
      **Values:** As passed for payeeVpa in request
    - Tags: String, Mandatory
  - **PayerName**:
    - Description: Name of the Payer involved in mandate.
    - Tags: String, optional
  - **PayerRevocable**:
    - Description: Defines whether mandate is revocable by PAYER or not. For onetime mandate it can be true or false. Default value is true.
      
      **Values:** String - true, false
    - Tags: String, Mandatory
  - **PayerVpa**:
    - Description: VPA of payer
      
      **Values:** As passed for payerVpa in request
    - Tags: String, Mandatory
  - **RecurrencePattern**:
    - Description: Recurrence Pattern for Mandate
      
      **Values:** As passed for recurrencePattern in request
    - Tags: String, Mandatory
  - **RecurrenceRule**:
    - Description: Recurrence Rule for Mandate. It will not be present for ONETIME, DAILY and ASPRESENTED recurrence pattern.
      
      **Values:** As passed for recurrenceRule in request
    - Tags: String, conditional
  - **RecurrencValue**:
    - Description: Recurrence Value for Mandate. It will not be present for ONETIME, DAILY and ASPRESENTED recurrence pattern.
      
      **Values:** As passed for recurrencValue in request.
    - Tags: String, conditional
  - **RefUrl**:
    - Description: Reference url for the mandate. It will be same value if passed in request else it will be a default url.
    - Tags: String, Mandatory
  - **Remarks**:
    - Description: Any mandate summary. If pssed in request, it will be same in response else a default value is send.
    - Tags: String, optional
  - **Role**:
    - Description: Role of the customer for this mandate.
      
      **Values:** `PAYER`, `PAYEE`
    - Tags: String, Mandatory
  - **ShareToPayee**:
    - Description: Descibes whether mandate will be shared with payee or not. For onetime mandate it can be true or false. Default value is true.
      
      **Values:** String - true, false.
    - Tags: String, Mandatory
  - **TransactionType**:
    - Description: Type of Mandate Creation
      
      **Values:** As passed for transactionType in request.
    - Tags: String, Mandatory
  - **Umn**:
    - Description: Unique Mandate Number used for execution of the mandate. Will be sent only if mandate is initiated by Payer.
    - Tags: String, optional
  - **ValidityEnd**:
    - Description: Date before which mandate can be executed.
      
      **Values:** As passed for validityEnd in request
    - Tags: String, Mandatory
  - **ValidityStart**:
    - Description: Date after which mandate can be executed.
      
      **Values:** As passed for validityStart in request
    - Tags: String, Mandatory
- Tags: json

#### udfParameters:
- Description: Udf parameters as passed in the request.

**Values:** As passed for udfParameters in request
- Tags: json String, Optional
