# Create Pre-Debit Notification

Before each UPI Autopay recurring debit, NPCI requires notifying the customer in advance. This endpoint sends that notice through the payment provider and returns an `id` you must reference on the debit.

The flow has three steps:

1. **Notify**: call this endpoint with the mandate's `vaulted_token`, the upcoming `amount`, and the `billing_date`. Provider routing comes from `origin_payment_id` (the mandate-creation payment) or an explicit `provider_data`.
2. **Check the status**: `SENT` means the provider delivered the notification and returned its reference in `provider_data.provider_notification_id`.
3. **Debit**: create the recurring payment with `payment_method.detail.bank_transfer.pre_debit_notification_id` set to the returned `id`. WHITELABEL resolves the provider reference and forwards it automatically — see [Create payment](/reference/payments/create-payment).

This request requires an `X-Idempotency-Key`. Reusing a `merchant_reference` returns the existing notification for your account.

**POST** `/predebit-notify`

Base URL: `https://api-sandbox.whitelabel.com/v1`

Sends the NPCI-required pre-debit notification to the customer before a UPI Autopay recurring debit. The provider delivers the notice and returns a reference; keep the returned id and send it on the recurring debit as payment_method.detail.bank_transfer.pre_debit_notification_id.

## Authorization

- public-api-key (apiKey in header)
- private-secret-key (apiKey in header)

## Header parameters

- `X-Idempotency-Key` (string, required)
  Unique identifier used in HTTP headers to ensure that a request is processed only once, even if it is retried due to network issues or timeouts.

## Body

Content type: `application/json`

- `account_id` (string<uuid>, required)
  Your WHITELABEL account ID.
- `merchant_reference` (string, required)
  Your unique reference for this notification. Reusing a reference returns the existing notification (idempotent per account).
- `description` (string)
  Text shown to the customer in the notification (for example, the subscription name and renewal notice).
- `amount` (object, required)
  - `currency` (string, required)
    ISO 4217 currency code of the upcoming debit (for UPI Autopay, INR).
  - `value` (string, required)
    Amount of the upcoming debit.
- `billing_date` (string<date>, required)
  Date of the upcoming debit (YYYY-MM-DD). Per NPCI, notify the customer at least 24 hours before the debit.
- `billing_sequence_number` (string)
  Sequence number of the debit within the mandate (for example, 2 for the second charge).
- `origin_payment_id` (string<uuid>)
  ID of the mandate-creation payment. When provided, WHITELABEL derives the provider and connection from its successful charge. Either origin_payment_id or provider_data is required.
- `customer_payer` (object)
  - `id` (string<uuid>)
    WHITELABEL customer ID.
  - `merchant_customer_id` (string)
    Your identifier for the customer.
- `payment_method` (object)
  - `type` (string)
    Payment method type of the mandate.
  - `vaulted_token` (string<uuid>)
    Vaulted token of the enrolled mandate. WHITELABEL resolves the provider mandate credential from it.
- `provider_data` (object)
  Explicit provider routing. Either origin_payment_id or provider_data (id + connection_id) is required.
  - `id` (string)
    Provider ID (for example, EBANX).
  - `connection_id` (string<uuid>)
    Connection to send the notification through.

Example:

```json
{
  "account_id": "00000000-0000-0000-0000-000000000000",
  "merchant_reference": "string",
  "description": "string",
  "amount": {
    "currency": "INR",
    "value": "499.00"
  },
  "billing_date": "2024-01-01",
  "billing_sequence_number": "string",
  "origin_payment_id": "00000000-0000-0000-0000-000000000000",
  "customer_payer": {
    "id": "00000000-0000-0000-0000-000000000000",
    "merchant_customer_id": "string"
  },
  "payment_method": {
    "type": "UPI_AUTOPAY",
    "vaulted_token": "00000000-0000-0000-0000-000000000000"
  },
  "provider_data": {
    "id": "EBANX",
    "connection_id": "00000000-0000-0000-0000-000000000000"
  }
}
```

## Responses

### 201

Notification created. Check status: SENT means the provider delivered it.

- `id` (string<uuid>)
  Unique identifier of the pre-debit notification. Reference it on the recurring debit as payment_method.detail.bank_transfer.pre_debit_notification_id.
- `account_id` (string<uuid>)
  Your WHITELABEL account ID.
- `status` ("SENT" | "REJECTED" | "ERROR")
  SENT: the provider accepted and delivered the notification. REJECTED: the provider refused it. ERROR: the notification could not be relayed.
- `merchant_reference` (string)
  Your unique reference for this notification (idempotent per account).
- `description` (string)
  Text shown to the customer in the notification.
- `amount` (object)
  - `currency` (string, required)
    ISO 4217 currency code of the upcoming debit (for UPI Autopay, INR).
  - `value` (string, required)
    Amount of the upcoming debit.
- `billing_date` (string<date>)
  Date of the upcoming debit (YYYY-MM-DD).
- `origin_payment_id` (string<uuid>)
  The mandate-creation payment used to derive provider and connection, when provided.
- `provider_data` (object)
  - `id` (string)
    Provider that handled the notification (for example, EBANX).
  - `connection_id` (string<uuid>)
    Connection used to send the notification.
  - `provider_transaction_id` (string)
    Provider transaction reference, when available.
  - `provider_notification_id` (string)
    Provider reference of the delivered notification. WHITELABEL resolves and forwards it to the provider automatically when the recurring debit references this notification.
  - `raw_request` (object)
    Obfuscated provider request. Only returned for allowlisted organizations.
  - `raw_response` (object)
    Obfuscated provider response. Only returned for allowlisted organizations.
- `created_at` (string<date-time>)
- `updated_at` (string<date-time>)

Example:

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "account_id": "00000000-0000-0000-0000-000000000000",
  "status": "SENT",
  "merchant_reference": "string",
  "description": "string",
  "amount": {
    "currency": "INR",
    "value": "499.00"
  },
  "billing_date": "2024-01-01",
  "origin_payment_id": "00000000-0000-0000-0000-000000000000",
  "provider_data": {
    "id": "string",
    "connection_id": "00000000-0000-0000-0000-000000000000",
    "provider_transaction_id": "string",
    "provider_notification_id": "string",
    "raw_request": {},
    "raw_response": {}
  },
  "created_at": "1970-01-01T00:00:00.000Z",
  "updated_at": "1970-01-01T00:00:00.000Z"
}
```

### 400

Invalid parameters (for example, missing provider routing or malformed billing_date).

### 422

The vaulted_token has no stored credential for the resolved provider (STORED_CREDENTIAL_NOT_FOUND), or the origin payment has no usable connection (PROVIDER_CONNECTION_REQUIRED).