Confirm Funds for VRP Payment
curl --request POST \
--url https://api.yapily.com/variable-recurring-payments/funds-confirmation \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'consent: <consent>' \
--data '
{
"reference": "Own Account Commercial",
"paymentAmount": {
"amount": 10,
"currency": "GBP"
}
}
'import requests
url = "https://api.yapily.com/variable-recurring-payments/funds-confirmation"
payload = {
"reference": "Own Account Commercial",
"paymentAmount": {
"amount": 10,
"currency": "GBP"
}
}
headers = {
"consent": "<consent>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
consent: '<consent>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({
reference: 'Own Account Commercial',
paymentAmount: {amount: 10, currency: 'GBP'}
})
};
fetch('https://api.yapily.com/variable-recurring-payments/funds-confirmation', 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.yapily.com/variable-recurring-payments/funds-confirmation",
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([
'reference' => 'Own Account Commercial',
'paymentAmount' => [
'amount' => 10,
'currency' => 'GBP'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json;charset=UTF-8",
"consent: <consent>"
],
]);
$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.yapily.com/variable-recurring-payments/funds-confirmation"
payload := strings.NewReader("{\n \"reference\": \"Own Account Commercial\",\n \"paymentAmount\": {\n \"amount\": 10,\n \"currency\": \"GBP\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("consent", "<consent>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
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.yapily.com/variable-recurring-payments/funds-confirmation")
.header("consent", "<consent>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"reference\": \"Own Account Commercial\",\n \"paymentAmount\": {\n \"amount\": 10,\n \"currency\": \"GBP\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yapily.com/variable-recurring-payments/funds-confirmation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["consent"] = '<consent>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"reference\": \"Own Account Commercial\",\n \"paymentAmount\": {\n \"amount\": 10,\n \"currency\": \"GBP\"\n }\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"tracingId": "0f14e900011b445fa6b6c2c4272d7321"
},
"data": {
"id": "a9582f8e-08be-4cca-9f01-1ad3be96532d",
"fundsAvailable": {
"fundsAvailable": true,
"fundsAvailableAt": "2021-06-08T10:59:35.138Z"
},
"reference": "Own Account Commercial",
"paymentAmount": {
"amount": 10,
"currency": "GBP"
}
}
}{
"error": {
"tracingId": "0c2d0973bdd24224a65e5d0f7d1b6154",
"code": 401,
"status": "UNAUTHORIZED",
"supportUrl": "https://support.yapily.com/",
"source": "YAPILY",
"issues": [
{
"type": "CREDENTIALS",
"code": "CREDENTIALS_MISSING",
"message": "Authentication header not present"
}
]
}
}{
"error": {
"tracingId": "0c2d0973bdd24224a65e5d0f7d1b6154",
"code": 400,
"status": "BAD_REQUEST",
"supportUrl": "https://support.yapily.com/",
"source": "YAPILY",
"issues": [
{
"type": "BAD_REQUEST",
"code": "BAD_REQUEST",
"message": "The server could not understand the request due to invalid syntax"
}
]
}
}Variable Recurring Payments
Confirm Funds for VRP Payment
Check whether the requested funds amount is available on the VRP consent.
Note that you should not call this before each VRP payment submission because we do it for you.
Required feature: VARIABLE_RECURRING_PAYMENT_FUNDS_CONFIRMATION
Confirm Funds for VRP Payment
curl --request POST \
--url https://api.yapily.com/variable-recurring-payments/funds-confirmation \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'consent: <consent>' \
--data '
{
"reference": "Own Account Commercial",
"paymentAmount": {
"amount": 10,
"currency": "GBP"
}
}
'import requests
url = "https://api.yapily.com/variable-recurring-payments/funds-confirmation"
payload = {
"reference": "Own Account Commercial",
"paymentAmount": {
"amount": 10,
"currency": "GBP"
}
}
headers = {
"consent": "<consent>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
consent: '<consent>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({
reference: 'Own Account Commercial',
paymentAmount: {amount: 10, currency: 'GBP'}
})
};
fetch('https://api.yapily.com/variable-recurring-payments/funds-confirmation', 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.yapily.com/variable-recurring-payments/funds-confirmation",
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([
'reference' => 'Own Account Commercial',
'paymentAmount' => [
'amount' => 10,
'currency' => 'GBP'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json;charset=UTF-8",
"consent: <consent>"
],
]);
$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.yapily.com/variable-recurring-payments/funds-confirmation"
payload := strings.NewReader("{\n \"reference\": \"Own Account Commercial\",\n \"paymentAmount\": {\n \"amount\": 10,\n \"currency\": \"GBP\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("consent", "<consent>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
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.yapily.com/variable-recurring-payments/funds-confirmation")
.header("consent", "<consent>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"reference\": \"Own Account Commercial\",\n \"paymentAmount\": {\n \"amount\": 10,\n \"currency\": \"GBP\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yapily.com/variable-recurring-payments/funds-confirmation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["consent"] = '<consent>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"reference\": \"Own Account Commercial\",\n \"paymentAmount\": {\n \"amount\": 10,\n \"currency\": \"GBP\"\n }\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"tracingId": "0f14e900011b445fa6b6c2c4272d7321"
},
"data": {
"id": "a9582f8e-08be-4cca-9f01-1ad3be96532d",
"fundsAvailable": {
"fundsAvailable": true,
"fundsAvailableAt": "2021-06-08T10:59:35.138Z"
},
"reference": "Own Account Commercial",
"paymentAmount": {
"amount": 10,
"currency": "GBP"
}
}
}{
"error": {
"tracingId": "0c2d0973bdd24224a65e5d0f7d1b6154",
"code": 401,
"status": "UNAUTHORIZED",
"supportUrl": "https://support.yapily.com/",
"source": "YAPILY",
"issues": [
{
"type": "CREDENTIALS",
"code": "CREDENTIALS_MISSING",
"message": "Authentication header not present"
}
]
}
}{
"error": {
"tracingId": "0c2d0973bdd24224a65e5d0f7d1b6154",
"code": 400,
"status": "BAD_REQUEST",
"supportUrl": "https://support.yapily.com/",
"source": "YAPILY",
"issues": [
{
"type": "BAD_REQUEST",
"code": "BAD_REQUEST",
"message": "The server could not understand the request due to invalid syntax"
}
]
}
}Learn more: Confirm Availability of Funds
Authorizations
Use HTTP Basic Authentication with your Application ID as username and Application Secret as password. Manage credentials in the Yapily Console. See Authentication for details.
Headers
The user's VRP Consent Token
Body
application/json;charset=UTF-8
Was this page helpful?
⌘I