AUD PayID
Cancel a PayID
Cancel an active pending PayID transaction, which will deregister the PayID and update the transaction status to expired. This action is irreversible and will prevent the PayID from being used for further transactions.
This endpoint is useful when a customer decides not to complete the payment, or if the PayID needs to be invalidated for other reasons. Once cancelled, the PayID will no longer be recognised as valid within the system.
POST
/
v1
/
payment_requests
/
cancel_payid
Cancel a PayID
curl --request POST \
--url https://api.cleverhub.co/api/v1/payment_requests/cancel_payid \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"payid": "abc.xyz@example.co"
}
'import requests
url = "https://api.cleverhub.co/api/v1/payment_requests/cancel_payid"
payload = { "payid": "abc.xyz@example.co" }
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({payid: 'abc.xyz@example.co'})
};
fetch('https://api.cleverhub.co/api/v1/payment_requests/cancel_payid', 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.cleverhub.co/api/v1/payment_requests/cancel_payid",
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([
'payid' => 'abc.xyz@example.co'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-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.cleverhub.co/api/v1/payment_requests/cancel_payid"
payload := strings.NewReader("{\n \"payid\": \"abc.xyz@example.co\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("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.cleverhub.co/api/v1/payment_requests/cancel_payid")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payid\": \"abc.xyz@example.co\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v1/payment_requests/cancel_payid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payid\": \"abc.xyz@example.co\"\n}"
response = http.request(request)
puts response.read_body{
"payid": "abc.xyz@example.co"
}Authorizations
A unique identifier assigned to each application.
A secure token associated with the app-id.
Body
application/json
The unique PayID to be cancelled, associated with the pending transaction.
Example:
"abc.xyz@example.co"
Response
PayID cancelled successfully.
The PayID that was cancelled.
Example:
"abc.xyz@example.co"
⌘I
Cancel a PayID
curl --request POST \
--url https://api.cleverhub.co/api/v1/payment_requests/cancel_payid \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"payid": "abc.xyz@example.co"
}
'import requests
url = "https://api.cleverhub.co/api/v1/payment_requests/cancel_payid"
payload = { "payid": "abc.xyz@example.co" }
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({payid: 'abc.xyz@example.co'})
};
fetch('https://api.cleverhub.co/api/v1/payment_requests/cancel_payid', 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.cleverhub.co/api/v1/payment_requests/cancel_payid",
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([
'payid' => 'abc.xyz@example.co'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-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.cleverhub.co/api/v1/payment_requests/cancel_payid"
payload := strings.NewReader("{\n \"payid\": \"abc.xyz@example.co\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("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.cleverhub.co/api/v1/payment_requests/cancel_payid")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payid\": \"abc.xyz@example.co\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v1/payment_requests/cancel_payid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payid\": \"abc.xyz@example.co\"\n}"
response = http.request(request)
puts response.read_body{
"payid": "abc.xyz@example.co"
}