Get Hosted payment request
curl --request GET \
--url https://api.yapily.com/hosted/payment-requests/{paymentRequestId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.yapily.com/hosted/payment-requests/{paymentRequestId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.yapily.com/hosted/payment-requests/{paymentRequestId}', 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/hosted/payment-requests/{paymentRequestId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.yapily.com/hosted/payment-requests/{paymentRequestId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.yapily.com/hosted/payment-requests/{paymentRequestId}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yapily.com/hosted/payment-requests/{paymentRequestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"meta": {
"tracingId": "2dbfd85b4f2940c6a206e96dd90e52d0"
},
"data": {
"paymentRequestId": "eb39f8ae-aeff-4ffa-a23d-d4a5b3eff406",
"userId": "3ddf5dd0-aa48-4d0f-baa7-fa057e9e911d",
"applicationUserId": "string",
"applicationId": "64949de6-6510-4d70-9500-d4aa094c506c",
"institutionIdentifiers": {
"institutionId": "modelo-sandbox",
"institutionCountryCode": "GB"
},
"userSettings": {
"language": "en",
"location": "GB"
},
"redirectUrl": "https://tpp-application.com/",
"paymentRequestDetails": {
"amountDetails": {
"amountToPay": 1,
"currency": "GBP"
},
"reference": "Test Payment",
"contextType": "OTHER",
"type": "DOMESTIC_PAYMENT",
"payee": {
"name": "Jane Doe",
"accountIdentifications": [
{
"type": "SORT_CODE",
"identification": "123456"
},
{
"type": "ACCOUNT_NUMBER",
"identification": "12345678"
}
]
},
"payer": {
"name": "John Doe",
"accountIdentifications": [
{
"type": "SORT_CODE",
"identification": "121212"
},
{
"type": "ACCOUNT_NUMBER",
"identification": "87654321"
}
]
}
},
"createdAt": "2021-06-10T11:26:54.887Z",
"authorisationExpiresAt": "2021-06-10T11:36:54.887Z",
"status": "ACTIVE",
"payments": [
{
"paymentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"institutionIdentifiers": {
"institutionId": "string",
"institutionCountryCode": "GB"
},
"userIdentifiers": {
"psuId": "string",
"psuCorporateId": "string",
"psuIpAddress": "string"
},
"phases": [
{
"phaseName": "INITIATED",
"phaseCreatedAt": "2021-06-10T11:26:54.887Z"
},
{
"phaseName": "INSTITUTION_SUBMITTED",
"phaseCreatedAt": "2021-06-10T11:26:55.123Z"
},
{
"phaseName": "INPUT_CAPTURED",
"phaseCreatedAt": "2021-06-10T11:27:05.123Z"
},
{
"phaseName": "VALIDATION_COMPLETED",
"phaseCreatedAt": "2021-06-10T11:27:05.223Z"
},
{
"phaseName": "AUTHORISATION_CREATED",
"phaseCreatedAt": "2021-06-10T11:27:06.637Z"
},
{
"phaseName": "AUTHORISED",
"phaseCreatedAt": "2021-06-10T11:27:10.637Z"
},
{
"phaseName": "SUBMITTED",
"phaseCreatedAt": "2021-06-10T11:27:10.654Z"
},
{
"phaseName": "ACCEPTED",
"phaseCreatedAt": "2021-06-10T11:27:11.867Z"
},
{
"phaseName": "SETTLEMENT_COMPLETED",
"phaseCreatedAt": "2021-06-10T11:27:13.887Z"
}
],
"paymentStatus": "COMPLETED",
"statusDetails": [
{
"status": "PENDING",
"statusUpdateDate": "2021-06-10T11:27:11.867Z",
"isoStatus": {
"code": "PDNG",
"name": "Pending"
}
},
{
"status": "COMPLETED",
"statusUpdateDate": "2021-06-10T11:27:13.887Z",
"isoStatus": {
"code": "ACSC",
"name": "AcceptedSettlementCompleted"
}
}
],
"institutionPaymentId": "string",
"paymentLifecycleId": "string",
"paymentIdempotencyId": "04ab4536gaerfc0e1f93c4f4",
"reference": "Bill payment",
"contextType": "OTHER",
"type": "DOMESTIC_PAYMENT",
"payee": {
"name": "Jane Doe",
"accountIdentifications": [
{
"identification": "401016",
"type": "SORT_CODE"
},
{
"identification": "71518920",
"type": "ACCOUNT_NUMBER"
}
],
"address": {
"country": "GB"
},
"merchantId": "24589303",
"merchantCategoryCode": "5551"
},
"payer": {
"name": "John Doe",
"accountIdentifications": [
{
"type": "SORT_CODE",
"identification": "401016"
}
],
"address": {
"country": "GB"
}
},
"amount": {
"amount": 10,
"currency": "GBP"
}
}
]
}
}{
"error": {
"tracingId": "0c2d0973bdd24224a65e5d0f7d1b6154",
"code": 401,
"status": "UNAUTHORIZED",
"supportUrl": "https://support.yapily.com/",
"source": "YAPILY",
"issues": [
{
"type": "CREDENTIALS",
"code": 10700,
"message": "Authorization header invalid or credentials not authenticated"
}
]
}
}{
"error": {
"tracingId": "0c2d0973bdd24224a65e5d0f7d1b6154",
"code": 404,
"status": "NOT FOUND",
"supportUrl": "https://support.yapily.com/",
"source": "YAPILY",
"issues": [
{
"type": "INVALID_REQUEST",
"code": 10800,
"message": "Resource not found"
}
]
}
}{
"error": {
"tracingId": "0c2d0973bdd24224a65e5d0f7d1b6154",
"code": 500,
"status": "INTERNAL SERVER ERROR",
"supportUrl": "https://support.yapily.com/",
"source": "YAPILY",
"issues": [
{
"type": "INTERNAL_SERVER_ERROR",
"code": 11000,
"message": "Unexpected server error"
}
]
}
}{
"error": {
"code": 401,
"status": "UNAUTHORIZED",
"message": "Full authentication is required to access this resource"
}
}Hosted Payment Pages
Get Hosted payment request
Used to get details of a payment request
Get Hosted payment request
curl --request GET \
--url https://api.yapily.com/hosted/payment-requests/{paymentRequestId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.yapily.com/hosted/payment-requests/{paymentRequestId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.yapily.com/hosted/payment-requests/{paymentRequestId}', 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/hosted/payment-requests/{paymentRequestId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.yapily.com/hosted/payment-requests/{paymentRequestId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.yapily.com/hosted/payment-requests/{paymentRequestId}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yapily.com/hosted/payment-requests/{paymentRequestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"meta": {
"tracingId": "2dbfd85b4f2940c6a206e96dd90e52d0"
},
"data": {
"paymentRequestId": "eb39f8ae-aeff-4ffa-a23d-d4a5b3eff406",
"userId": "3ddf5dd0-aa48-4d0f-baa7-fa057e9e911d",
"applicationUserId": "string",
"applicationId": "64949de6-6510-4d70-9500-d4aa094c506c",
"institutionIdentifiers": {
"institutionId": "modelo-sandbox",
"institutionCountryCode": "GB"
},
"userSettings": {
"language": "en",
"location": "GB"
},
"redirectUrl": "https://tpp-application.com/",
"paymentRequestDetails": {
"amountDetails": {
"amountToPay": 1,
"currency": "GBP"
},
"reference": "Test Payment",
"contextType": "OTHER",
"type": "DOMESTIC_PAYMENT",
"payee": {
"name": "Jane Doe",
"accountIdentifications": [
{
"type": "SORT_CODE",
"identification": "123456"
},
{
"type": "ACCOUNT_NUMBER",
"identification": "12345678"
}
]
},
"payer": {
"name": "John Doe",
"accountIdentifications": [
{
"type": "SORT_CODE",
"identification": "121212"
},
{
"type": "ACCOUNT_NUMBER",
"identification": "87654321"
}
]
}
},
"createdAt": "2021-06-10T11:26:54.887Z",
"authorisationExpiresAt": "2021-06-10T11:36:54.887Z",
"status": "ACTIVE",
"payments": [
{
"paymentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"institutionIdentifiers": {
"institutionId": "string",
"institutionCountryCode": "GB"
},
"userIdentifiers": {
"psuId": "string",
"psuCorporateId": "string",
"psuIpAddress": "string"
},
"phases": [
{
"phaseName": "INITIATED",
"phaseCreatedAt": "2021-06-10T11:26:54.887Z"
},
{
"phaseName": "INSTITUTION_SUBMITTED",
"phaseCreatedAt": "2021-06-10T11:26:55.123Z"
},
{
"phaseName": "INPUT_CAPTURED",
"phaseCreatedAt": "2021-06-10T11:27:05.123Z"
},
{
"phaseName": "VALIDATION_COMPLETED",
"phaseCreatedAt": "2021-06-10T11:27:05.223Z"
},
{
"phaseName": "AUTHORISATION_CREATED",
"phaseCreatedAt": "2021-06-10T11:27:06.637Z"
},
{
"phaseName": "AUTHORISED",
"phaseCreatedAt": "2021-06-10T11:27:10.637Z"
},
{
"phaseName": "SUBMITTED",
"phaseCreatedAt": "2021-06-10T11:27:10.654Z"
},
{
"phaseName": "ACCEPTED",
"phaseCreatedAt": "2021-06-10T11:27:11.867Z"
},
{
"phaseName": "SETTLEMENT_COMPLETED",
"phaseCreatedAt": "2021-06-10T11:27:13.887Z"
}
],
"paymentStatus": "COMPLETED",
"statusDetails": [
{
"status": "PENDING",
"statusUpdateDate": "2021-06-10T11:27:11.867Z",
"isoStatus": {
"code": "PDNG",
"name": "Pending"
}
},
{
"status": "COMPLETED",
"statusUpdateDate": "2021-06-10T11:27:13.887Z",
"isoStatus": {
"code": "ACSC",
"name": "AcceptedSettlementCompleted"
}
}
],
"institutionPaymentId": "string",
"paymentLifecycleId": "string",
"paymentIdempotencyId": "04ab4536gaerfc0e1f93c4f4",
"reference": "Bill payment",
"contextType": "OTHER",
"type": "DOMESTIC_PAYMENT",
"payee": {
"name": "Jane Doe",
"accountIdentifications": [
{
"identification": "401016",
"type": "SORT_CODE"
},
{
"identification": "71518920",
"type": "ACCOUNT_NUMBER"
}
],
"address": {
"country": "GB"
},
"merchantId": "24589303",
"merchantCategoryCode": "5551"
},
"payer": {
"name": "John Doe",
"accountIdentifications": [
{
"type": "SORT_CODE",
"identification": "401016"
}
],
"address": {
"country": "GB"
}
},
"amount": {
"amount": 10,
"currency": "GBP"
}
}
]
}
}{
"error": {
"tracingId": "0c2d0973bdd24224a65e5d0f7d1b6154",
"code": 401,
"status": "UNAUTHORIZED",
"supportUrl": "https://support.yapily.com/",
"source": "YAPILY",
"issues": [
{
"type": "CREDENTIALS",
"code": 10700,
"message": "Authorization header invalid or credentials not authenticated"
}
]
}
}{
"error": {
"tracingId": "0c2d0973bdd24224a65e5d0f7d1b6154",
"code": 404,
"status": "NOT FOUND",
"supportUrl": "https://support.yapily.com/",
"source": "YAPILY",
"issues": [
{
"type": "INVALID_REQUEST",
"code": 10800,
"message": "Resource not found"
}
]
}
}{
"error": {
"tracingId": "0c2d0973bdd24224a65e5d0f7d1b6154",
"code": 500,
"status": "INTERNAL SERVER ERROR",
"supportUrl": "https://support.yapily.com/",
"source": "YAPILY",
"issues": [
{
"type": "INTERNAL_SERVER_ERROR",
"code": 11000,
"message": "Unexpected server error"
}
]
}
}{
"error": {
"code": 401,
"status": "UNAUTHORIZED",
"message": "Full authentication is required to access this resource"
}
}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 sub-application ID to which event type is being subscribed to
Path Parameters
Unique Identifier of the payment request
Was this page helpful?
⌘I