curl --request POST \
--url https://api.sandbox.lead.bank/v1/instant_payments/{instant_payment_id}/request_return \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"reason": "duplication",
"additional_information": "<string>"
}
'import requests
url = "https://api.sandbox.lead.bank/v1/instant_payments/{instant_payment_id}/request_return"
payload = {
"reason": "duplication",
"additional_information": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({reason: 'duplication', additional_information: '<string>'})
};
fetch('https://api.sandbox.lead.bank/v1/instant_payments/{instant_payment_id}/request_return', 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.lead.bank/v1/instant_payments/{instant_payment_id}/request_return",
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([
'reason' => 'duplication',
'additional_information' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.lead.bank/v1/instant_payments/{instant_payment_id}/request_return"
payload := strings.NewReader("{\n \"reason\": \"duplication\",\n \"additional_information\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.lead.bank/v1/instant_payments/{instant_payment_id}/request_return")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"duplication\",\n \"additional_information\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v1/instant_payments/{instant_payment_id}/request_return")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"duplication\",\n \"additional_information\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "instant_payment_xyz123",
"account_id": "account_xyz123",
"account_number_id": "account_number_xyz123",
"direction": "outgoing",
"status": "posted",
"amount": 5000,
"currency_code": "USD",
"debtor": {
"name": "Alex Smith",
"account_number": "1234567890"
},
"debtor_agent": {
"routing_number": "111000111"
},
"creditor_agent": {
"routing_number": "111000111"
},
"creditor": {
"name": "Alex Smith",
"account_number": "1234567890"
},
"payment_identifiers": {
"end_to_end_id": "033me5upSkktRorr3J6TKZ",
"uetr": "8dc981d2-e8c2-4a7b-8df0-0781b46328d9",
"transaction_id": "3G0CQxK8gKLpzaaxc7A9spDiifK"
},
"related_objects": {
"original_payment_id": "instant_payment_xyz123",
"return_payment_ids": [
"instant_payment_xyz456"
]
},
"return_requests": [
{
"status": "pending",
"reason": "duplicate",
"created_at": "2022-06-27T11:22:33Z",
"details": "<string>",
"deadline": "2022-07-11T23:30:00-04:00",
"resolution": {
"resolved_at": "2022-06-27T11:22:33Z",
"resolved_by": "counterparty",
"rejection_reason": "customer_no_response",
"rejection_details": "<string>"
}
}
],
"created_at": "2022-06-27T11:22:33Z",
"updated_at": "2022-06-27T11:22:40Z",
"counterparty_status": "posted",
"description": "Payment for invoice 12345",
"return": {
"reason": "duplication",
"details": "<string>"
},
"rejection": {
"rejected_by": "lead",
"reason": "non_sufficient_funds",
"details": "<string>"
}
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}Request Return for Instant Payment
Send a return request to the counterparty for a previously posted outgoing instant payment. Returns the updated instant payment object with a new entry in the return_requests array.
curl --request POST \
--url https://api.sandbox.lead.bank/v1/instant_payments/{instant_payment_id}/request_return \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"reason": "duplication",
"additional_information": "<string>"
}
'import requests
url = "https://api.sandbox.lead.bank/v1/instant_payments/{instant_payment_id}/request_return"
payload = {
"reason": "duplication",
"additional_information": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({reason: 'duplication', additional_information: '<string>'})
};
fetch('https://api.sandbox.lead.bank/v1/instant_payments/{instant_payment_id}/request_return', 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.lead.bank/v1/instant_payments/{instant_payment_id}/request_return",
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([
'reason' => 'duplication',
'additional_information' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.lead.bank/v1/instant_payments/{instant_payment_id}/request_return"
payload := strings.NewReader("{\n \"reason\": \"duplication\",\n \"additional_information\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.lead.bank/v1/instant_payments/{instant_payment_id}/request_return")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"duplication\",\n \"additional_information\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v1/instant_payments/{instant_payment_id}/request_return")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"duplication\",\n \"additional_information\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "instant_payment_xyz123",
"account_id": "account_xyz123",
"account_number_id": "account_number_xyz123",
"direction": "outgoing",
"status": "posted",
"amount": 5000,
"currency_code": "USD",
"debtor": {
"name": "Alex Smith",
"account_number": "1234567890"
},
"debtor_agent": {
"routing_number": "111000111"
},
"creditor_agent": {
"routing_number": "111000111"
},
"creditor": {
"name": "Alex Smith",
"account_number": "1234567890"
},
"payment_identifiers": {
"end_to_end_id": "033me5upSkktRorr3J6TKZ",
"uetr": "8dc981d2-e8c2-4a7b-8df0-0781b46328d9",
"transaction_id": "3G0CQxK8gKLpzaaxc7A9spDiifK"
},
"related_objects": {
"original_payment_id": "instant_payment_xyz123",
"return_payment_ids": [
"instant_payment_xyz456"
]
},
"return_requests": [
{
"status": "pending",
"reason": "duplicate",
"created_at": "2022-06-27T11:22:33Z",
"details": "<string>",
"deadline": "2022-07-11T23:30:00-04:00",
"resolution": {
"resolved_at": "2022-06-27T11:22:33Z",
"resolved_by": "counterparty",
"rejection_reason": "customer_no_response",
"rejection_details": "<string>"
}
}
],
"created_at": "2022-06-27T11:22:33Z",
"updated_at": "2022-06-27T11:22:40Z",
"counterparty_status": "posted",
"description": "Payment for invoice 12345",
"return": {
"reason": "duplication",
"details": "<string>"
},
"rejection": {
"rejected_by": "lead",
"reason": "non_sufficient_funds",
"details": "<string>"
}
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Idempotency key
255Path Parameters
ID of the instant payment object you want to request a return for.
^instant_payment_\w+$Body
The reason for the return request.
creditor_account_number_invalid, wrong_amount, customer_requested, duplication, fraud_suspected, narrative, service_not_rendered, technical_problem, undue_payment "duplication"
Accompanying free text explanation for the reason. Required if reason is "narrative", "wrong_amount", or "service_not_rendered".
140Response
The updated instant payment object with a new return request in the return_requests array.
The unique identifier of the instant payment object.
^instant_payment_\w+$"instant_payment_xyz123"
The ID of the Account object.
^account_\w+$"account_xyz123"
The ID of the Lead Bank Account Number object.
^account_number_\w+$"account_number_xyz123"
Who is initiating the transaction.
outgoing: You are sending a transaction to a counterparty. incoming: You are receiving a transaction from a counterparty.
outgoing, incoming "outgoing"
The current status of the instant payment object. If outgoing: created, under_review, canceled, rejected, posted. If incoming: under_review, rejected, posted.
created, under_review, canceled, rejected, posted "posted"
The amount of the instant payment in cents.
x >= 05000
A three-letter currency code as defined in ISO 4217.
USD "USD"
The details of the debtor (payer) sending the funds.
Show child attributes
Show child attributes
The details of the financial institution where the debtor (payer) holds their account.
Show child attributes
Show child attributes
The details of the financial institution where the creditor (payee) holds their account.
Show child attributes
Show child attributes
The details of the creditor (payee) receiving the funds.
Show child attributes
Show child attributes
The instant payment's identifiers.
Show child attributes
Show child attributes
This instant payment's related instant payments or other objects.
Show child attributes
Show child attributes
The return requests that reference this instant payment.
Show child attributes
Show child attributes
The ISO 8601 format timestamp that represents when the instant payment object was created.
"2022-06-27T11:22:33Z"
The ISO 8601 format timestamp that represents when the instant payment object was last updated.
"2022-06-27T11:22:40Z"
The current status of the instant payment from the counterparty's perspective. If outgoing: posted, under_review, or rejected. If incoming: posted or null.
posted, under_review, rejected "posted"
Free-form information on the reason for the payment.
"Payment for invoice 12345"
If this instant payment is a return, this object contains details on the return.
Show child attributes
Show child attributes
If this instant payment was rejected, this object contains details on the rejection.
Show child attributes
Show child attributes
Was this page helpful?

