扣款前通知
创建预扣款通知
在 UPI Autopay 定期扣款之前,向客户发送 NPCI 要求的预扣款通知。
POST
/
predebit-notify
创建预扣款通知
curl --request POST \
--url https://api-sandbox.y.uno/v1/predebit-notify \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>' \
--data '
{
"account_id": "00000000-0000-0000-0000-000000000000",
"merchant_reference": "subscription-2026-08-INV-00187",
"description": "Your subscription renews soon",
"amount": {
"currency": "INR",
"value": "499.00"
},
"billing_date": "2026-08-01",
"billing_sequence_number": "2",
"customer_payer": {
"id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d"
},
"payment_method": {
"type": "UPI_AUTOPAY",
"vaulted_token": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
},
"provider_data": {
"id": "EBANX",
"connection_id": "6c1f6bfb-736b-439e-b568-32f671f65256"
}
}
'import requests
url = "https://api-sandbox.y.uno/v1/predebit-notify"
payload = {
"account_id": "00000000-0000-0000-0000-000000000000",
"merchant_reference": "subscription-2026-08-INV-00187",
"description": "Your subscription renews soon",
"amount": {
"currency": "INR",
"value": "499.00"
},
"billing_date": "2026-08-01",
"billing_sequence_number": "2",
"customer_payer": { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d" },
"payment_method": {
"type": "UPI_AUTOPAY",
"vaulted_token": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
},
"provider_data": {
"id": "EBANX",
"connection_id": "6c1f6bfb-736b-439e-b568-32f671f65256"
}
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: '00000000-0000-0000-0000-000000000000',
merchant_reference: 'subscription-2026-08-INV-00187',
description: 'Your subscription renews soon',
amount: {currency: 'INR', value: '499.00'},
billing_date: '2026-08-01',
billing_sequence_number: '2',
customer_payer: {id: '9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d'},
payment_method: {type: 'UPI_AUTOPAY', vaulted_token: '7c9e6679-7425-40de-944b-e07fc1f90ae7'},
provider_data: {id: 'EBANX', connection_id: '6c1f6bfb-736b-439e-b568-32f671f65256'}
})
};
fetch('https://api-sandbox.y.uno/v1/predebit-notify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.y.uno/v1/predebit-notify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => '00000000-0000-0000-0000-000000000000',
'merchant_reference' => 'subscription-2026-08-INV-00187',
'description' => 'Your subscription renews soon',
'amount' => [
'currency' => 'INR',
'value' => '499.00'
],
'billing_date' => '2026-08-01',
'billing_sequence_number' => '2',
'customer_payer' => [
'id' => '9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d'
],
'payment_method' => [
'type' => 'UPI_AUTOPAY',
'vaulted_token' => '7c9e6679-7425-40de-944b-e07fc1f90ae7'
],
'provider_data' => [
'id' => 'EBANX',
'connection_id' => '6c1f6bfb-736b-439e-b568-32f671f65256'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Idempotency-Key: <x-idempotency-key>",
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/predebit-notify"
payload := strings.NewReader("{\n \"account_id\": \"00000000-0000-0000-0000-000000000000\",\n \"merchant_reference\": \"subscription-2026-08-INV-00187\",\n \"description\": \"Your subscription renews soon\",\n \"amount\": {\n \"currency\": \"INR\",\n \"value\": \"499.00\"\n },\n \"billing_date\": \"2026-08-01\",\n \"billing_sequence_number\": \"2\",\n \"customer_payer\": {\n \"id\": \"9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d\"\n },\n \"payment_method\": {\n \"type\": \"UPI_AUTOPAY\",\n \"vaulted_token\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n },\n \"provider_data\": {\n \"id\": \"EBANX\",\n \"connection_id\": \"6c1f6bfb-736b-439e-b568-32f671f65256\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency-Key", "<x-idempotency-key>")
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.y.uno/v1/predebit-notify")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"00000000-0000-0000-0000-000000000000\",\n \"merchant_reference\": \"subscription-2026-08-INV-00187\",\n \"description\": \"Your subscription renews soon\",\n \"amount\": {\n \"currency\": \"INR\",\n \"value\": \"499.00\"\n },\n \"billing_date\": \"2026-08-01\",\n \"billing_sequence_number\": \"2\",\n \"customer_payer\": {\n \"id\": \"9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d\"\n },\n \"payment_method\": {\n \"type\": \"UPI_AUTOPAY\",\n \"vaulted_token\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n },\n \"provider_data\": {\n \"id\": \"EBANX\",\n \"connection_id\": \"6c1f6bfb-736b-439e-b568-32f671f65256\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/predebit-notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"00000000-0000-0000-0000-000000000000\",\n \"merchant_reference\": \"subscription-2026-08-INV-00187\",\n \"description\": \"Your subscription renews soon\",\n \"amount\": {\n \"currency\": \"INR\",\n \"value\": \"499.00\"\n },\n \"billing_date\": \"2026-08-01\",\n \"billing_sequence_number\": \"2\",\n \"customer_payer\": {\n \"id\": \"9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d\"\n },\n \"payment_method\": {\n \"type\": \"UPI_AUTOPAY\",\n \"vaulted_token\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n },\n \"provider_data\": {\n \"id\": \"EBANX\",\n \"connection_id\": \"6c1f6bfb-736b-439e-b568-32f671f65256\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "SENT",
"merchant_reference": "<string>",
"description": "<string>",
"amount": {
"currency": "INR",
"value": "499.00"
},
"billing_date": "2023-12-25",
"origin_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_data": {
"id": "<string>",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_transaction_id": "<string>",
"provider_notification_id": "<string>",
"raw_request": {},
"raw_response": {}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}在每次 UPI Autopay 定期扣款之前,NPCI 要求提前通知客户。此 endpoint 通过支付服务提供商发送该通知,并返回一个您必须在扣款时引用的
id。
该流程包含三个步骤:
- 通知:使用委托的
vaulted_token、即将扣款的amount和billing_date调用此 endpoint。服务提供商路由由origin_payment_id(创建委托的支付)或显式的provider_data决定。 - 检查状态:
SENT表示服务提供商已送达通知,并在provider_data.provider_notification_id中返回其参考号。 - 扣款:创建定期支付,并将
payment_method.detail.bank_transfer.pre_debit_notification_id设为返回的id。Yuno 会解析服务提供商参考号并自动转发,请参阅创建支付。
X-Idempotency-Key。重复使用 merchant_reference 会返回您账户中已有的通知。授权
请求体
application/json
响应
通知已创建。请检查 status:SENT 表示提供商已送达。
此页面对您有帮助吗?
⌘I
创建预扣款通知
curl --request POST \
--url https://api-sandbox.y.uno/v1/predebit-notify \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>' \
--data '
{
"account_id": "00000000-0000-0000-0000-000000000000",
"merchant_reference": "subscription-2026-08-INV-00187",
"description": "Your subscription renews soon",
"amount": {
"currency": "INR",
"value": "499.00"
},
"billing_date": "2026-08-01",
"billing_sequence_number": "2",
"customer_payer": {
"id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d"
},
"payment_method": {
"type": "UPI_AUTOPAY",
"vaulted_token": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
},
"provider_data": {
"id": "EBANX",
"connection_id": "6c1f6bfb-736b-439e-b568-32f671f65256"
}
}
'import requests
url = "https://api-sandbox.y.uno/v1/predebit-notify"
payload = {
"account_id": "00000000-0000-0000-0000-000000000000",
"merchant_reference": "subscription-2026-08-INV-00187",
"description": "Your subscription renews soon",
"amount": {
"currency": "INR",
"value": "499.00"
},
"billing_date": "2026-08-01",
"billing_sequence_number": "2",
"customer_payer": { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d" },
"payment_method": {
"type": "UPI_AUTOPAY",
"vaulted_token": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
},
"provider_data": {
"id": "EBANX",
"connection_id": "6c1f6bfb-736b-439e-b568-32f671f65256"
}
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: '00000000-0000-0000-0000-000000000000',
merchant_reference: 'subscription-2026-08-INV-00187',
description: 'Your subscription renews soon',
amount: {currency: 'INR', value: '499.00'},
billing_date: '2026-08-01',
billing_sequence_number: '2',
customer_payer: {id: '9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d'},
payment_method: {type: 'UPI_AUTOPAY', vaulted_token: '7c9e6679-7425-40de-944b-e07fc1f90ae7'},
provider_data: {id: 'EBANX', connection_id: '6c1f6bfb-736b-439e-b568-32f671f65256'}
})
};
fetch('https://api-sandbox.y.uno/v1/predebit-notify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.y.uno/v1/predebit-notify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => '00000000-0000-0000-0000-000000000000',
'merchant_reference' => 'subscription-2026-08-INV-00187',
'description' => 'Your subscription renews soon',
'amount' => [
'currency' => 'INR',
'value' => '499.00'
],
'billing_date' => '2026-08-01',
'billing_sequence_number' => '2',
'customer_payer' => [
'id' => '9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d'
],
'payment_method' => [
'type' => 'UPI_AUTOPAY',
'vaulted_token' => '7c9e6679-7425-40de-944b-e07fc1f90ae7'
],
'provider_data' => [
'id' => 'EBANX',
'connection_id' => '6c1f6bfb-736b-439e-b568-32f671f65256'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Idempotency-Key: <x-idempotency-key>",
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/predebit-notify"
payload := strings.NewReader("{\n \"account_id\": \"00000000-0000-0000-0000-000000000000\",\n \"merchant_reference\": \"subscription-2026-08-INV-00187\",\n \"description\": \"Your subscription renews soon\",\n \"amount\": {\n \"currency\": \"INR\",\n \"value\": \"499.00\"\n },\n \"billing_date\": \"2026-08-01\",\n \"billing_sequence_number\": \"2\",\n \"customer_payer\": {\n \"id\": \"9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d\"\n },\n \"payment_method\": {\n \"type\": \"UPI_AUTOPAY\",\n \"vaulted_token\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n },\n \"provider_data\": {\n \"id\": \"EBANX\",\n \"connection_id\": \"6c1f6bfb-736b-439e-b568-32f671f65256\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency-Key", "<x-idempotency-key>")
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.y.uno/v1/predebit-notify")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"00000000-0000-0000-0000-000000000000\",\n \"merchant_reference\": \"subscription-2026-08-INV-00187\",\n \"description\": \"Your subscription renews soon\",\n \"amount\": {\n \"currency\": \"INR\",\n \"value\": \"499.00\"\n },\n \"billing_date\": \"2026-08-01\",\n \"billing_sequence_number\": \"2\",\n \"customer_payer\": {\n \"id\": \"9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d\"\n },\n \"payment_method\": {\n \"type\": \"UPI_AUTOPAY\",\n \"vaulted_token\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n },\n \"provider_data\": {\n \"id\": \"EBANX\",\n \"connection_id\": \"6c1f6bfb-736b-439e-b568-32f671f65256\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/predebit-notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"00000000-0000-0000-0000-000000000000\",\n \"merchant_reference\": \"subscription-2026-08-INV-00187\",\n \"description\": \"Your subscription renews soon\",\n \"amount\": {\n \"currency\": \"INR\",\n \"value\": \"499.00\"\n },\n \"billing_date\": \"2026-08-01\",\n \"billing_sequence_number\": \"2\",\n \"customer_payer\": {\n \"id\": \"9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d\"\n },\n \"payment_method\": {\n \"type\": \"UPI_AUTOPAY\",\n \"vaulted_token\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n },\n \"provider_data\": {\n \"id\": \"EBANX\",\n \"connection_id\": \"6c1f6bfb-736b-439e-b568-32f671f65256\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "SENT",
"merchant_reference": "<string>",
"description": "<string>",
"amount": {
"currency": "INR",
"value": "499.00"
},
"billing_date": "2023-12-25",
"origin_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_data": {
"id": "<string>",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_transaction_id": "<string>",
"provider_notification_id": "<string>",
"raw_request": {},
"raw_response": {}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}