---
page_source: https://juspay.io/in/docs/upi-plugin-sdk/cordova/backend-apis/mandate-notification-1
page_title: Mandate Notification
---

## API Version: default


# Notification API



This API is required if mandate notification is handled at merchants end. This sends a notification to the customer before the mandate transaction is exercised. A notification has to be sent to the user 24 hours before the execution of the mandate. This API is called using the mandate_id generated while creation of mandate. In case of Razorpay, Gocashfree, PhonePe the notification is taken care at PG end.

> **Note**
> Length upto 25 and alphanumeric characters are only accepted.

## Endpoints:
- Sandbox: https://sandbox.juspay.in/mandates/{mandate_id}

- Production: https://api.juspay.in/mandates/{mandate_id}

## Request Type: 
POST

## Authorization:

#### Basic Auth:
Consists of two parts.

* Username: API Key obtained from Juspay dashboard
* Password: Empty string

Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: Base64 Encoded Username:Password, Mandatory
## Headers:

#### Content-Type:
application/x-www-form-urlencoded
- Tags: String

#### x-routing-id:
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.

> **Warning**
> This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.


- Value: customer_1122
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location --request POST 'https://api.juspay.in/mandates/b70vxxxxxjGyUhVrV8' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'x-routing-id: customer_1122'\
--header 'Authorization: Basic BaxxxxxxxxERTxxxxxxxxx0Og==' \
--data-urlencode 'command=pre_debit_notify' \
--data-urlencode 'object_reference_id=abcxyz' \
--data-urlencode 'description=Sending pre-debit notification' \
--data-urlencode 'source_info={"amount": "1","txn_date": "1686576938"}'
--data-urlencode 'metadata={\"udf1\": \"test1\",\"udf2\": \"test2\"}'
```

### Sample Response:

#### Response:
```json
{
  "status": "SUCCESS",
  "source_object": "MANDATE",
  "source_info": {
    "txn_date": "1634057114",
    "mandate.display_invoice_number": "INVN67Mzd6wMX4xPVBC",
    "amount": "1"
  },
  "provider_response": {
    "provider_ref_id": "IN0DF815118772"
  },
  "provider_name": "BILLDESK",
  "object_reference_id": "2QNPw8KSbpHL122bNPgAK07",
  "object": "notification",
  "notification_type": "SMS",
  "mandate": {
    "mandate_id": "4rKxSj3bNXs7RQcdtajAkb"
  },
  "metadata": "{\\\"udf1\\\": \\\"test1\\\",\\\"udf2\\\": \\\"test2\\\"}",
  "last_updated": "1644071838",
  "id": "1957069",
  "description": "Notification for upcoming mandate",
  "date_created": "1644071838"
}
```

## Path Parameters:

#### mandate_id:
Mandate Id
- Value: Example:- b70vxxxxxjGyUhVrV8
- Tags: String, Mandatory
## Body Parameters:
### Parameters:

#### command:
- Description: “pre_debit_notify” for sending notification before execute mandate
- Tags: string, Mandatory

#### object_reference_id:
- Description: Merchants unique Identifier for the request.
- Tags: string, Mandatory

#### source_info:
- Description: Json block to pass detailed information to gateway
- Value:
  - **Amount**:
    - Description: Amount for which notification is to be sent to customer I.e. 100.00
    - Tags: string, Mandatory
  - **Txn_date**:
    - Description: Date on which debit is intended to happen in UNIX EPOCH timestamp (UTC timezone) format
    - Tags: string, Mandatory
  - **Mandate**:
    - Value:
      - **Display_invoice_number**:
        - Description: If merchant wants to generate invoice display number, this needs to be passed in notification call. If not passed, Juspay will create a unique invoice number and pass it to downstream system. It should be alphanumeric and length upto 25 characters. (Applicable only for cards SI)
        - Tags: String
    - Tags: object
- Tags: object

#### description:
- Description: Reason for debit that will be sent to user - Max Length: 50
- Tags: string, Mandatory

#### metadata:
- Description: To be passed as Stringified JSON
- Value:
  - **Key1**:
    - Description: Any key value pair can be passed and will be returned in response
    - Tags: String
- Tags: String
## API Responses:
### 200:

#### status:
- Description: Status of NotificationCREATED/PENDING/SUCCESS/FAILURECREATED- Created and not yet initiated to gatewayPENDING- Initiated to gatewaySUCCESS- Success from gatewayFAILURE- Failed from gateway
- Tags: string

#### source_object:
- Description: Source object for notification. i.e. “Mandate”
- Tags: string

#### source_info:
- Description: Json block of source info provided in the request
- Value:
  - **Txn_date**:
    - Description: txn_date passed in the request.Format: UNIX EPOCH timestamp (UTC timezone).I.e. 1634057114
    - Tags: string
  - **Amount**:
    - Description: Amount passed in the request.I.e. 100.00
    - Tags: string
  - **Mandate.display_invoice_number**:
    - Description: The display invoice number that is passed in the request.
    - Tags: String
- Tags: object

#### provider_response:
- Description: Json block of response from gateway
- Value:
  - **Provider_ref_id**:
    - Description: Reference Number provided by downstream gateway.
    - Tags: string
  - **Notification_date**:
    - Description: Date on which notification has been sent by downstream gateway.Format: UNIX EPOCH timestamp (UTC timezone).I.e. 1634057114Specific to PAYTM_V2
    - Tags: String
- Tags: object

#### provider_name:
- Description: Name of the provider. Gateway name in this caseI.e. PAYTM_V2
- Tags: string

#### object_reference_id:
- Description: Unique Identifier passed in the request.I.e. 1234578
- Tags: string

#### object:
- Description: notification
- Tags: string

#### notification_type:
- Description: Type of notification.I.e. “SMS”
- Tags: string

#### mandate:
- Description: Json block for Mandate ID provided in the request:
- Value:
  - **Mandate_id**:
    - Description: Mandate id provided in the request
    - Tags: String
- Tags: object

#### last_updated:
- Description: Date-time of notification updated in UNIX EPOCH timestamp (UTC timezone) format
- Tags: string

#### id:
- Description: Unique identifier provided by Juspay
- Tags: string

#### description:
- Description: Reason for debit passed in the request
- Tags: string

#### date_created:
- Description: Date-time of notification created in UNIX EPOCH timestamp (UTC timezone) format
- Tags: string
### 400:

#### Duplicate Object Reference ID:
- Value:
  - **User_message**:
    - Tags: String
  - **Type**:
    - Tags: String
  - **Session_id**:
    - Tags: String
  - **Message**:
    - Tags: String
  - **Code**:
    - Tags: String
- Tags: JSON

#### Invalid Mandate ID:
- Value:
  - **Status**:
    - Tags: String
  - **Error_message**:
    - Tags: String
  - **Error_code**:
    - Tags: String
- Tags: JSON
