Cancel payment request
curl --request POST \
--url https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel \
--header 'x-api-key: <api-key>' \
--header 'x-client-id: <api-key>' \
--header 'x-location: <api-key>'import requests
url = "https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel"
headers = {
"x-client-id": "<api-key>",
"x-api-key": "<api-key>",
"x-location": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-api-key': '<api-key>',
'x-location': '<api-key>'
}
};
fetch('https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel', 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://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>",
"x-client-id: <api-key>",
"x-location: <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"
"net/http"
"io"
)
func main() {
url := "https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-location", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel")
.header("x-client-id", "<api-key>")
.header("x-api-key", "<api-key>")
.header("x-location", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["x-location"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ID": 123,
"Amount": 123,
"Status": "Pending",
"Type": "C2C",
"CreatedAt": "2023-11-07T05:31:56Z",
"UpdatedAt": "2023-11-07T05:31:56Z",
"PayTag": {
"ID": 123,
"Tag": "<string>",
"Name": "<string>"
},
"Payer": {
"ID": 123,
"Tag": "<string>",
"Name": "<string>"
},
"Reference": "<string>",
"Description": "<string>",
"ExpiresAt": "2023-11-07T05:31:56Z"
}Merchant Payment Request
Cancel payment request
POST
/
merchant
/
payment-request
/
{reference}
/
cancel
Cancel payment request
curl --request POST \
--url https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel \
--header 'x-api-key: <api-key>' \
--header 'x-client-id: <api-key>' \
--header 'x-location: <api-key>'import requests
url = "https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel"
headers = {
"x-client-id": "<api-key>",
"x-api-key": "<api-key>",
"x-location": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-api-key': '<api-key>',
'x-location': '<api-key>'
}
};
fetch('https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel', 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://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>",
"x-client-id: <api-key>",
"x-location: <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"
"net/http"
"io"
)
func main() {
url := "https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-location", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel")
.header("x-client-id", "<api-key>")
.header("x-api-key", "<api-key>")
.header("x-location", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.yourflexpay.com/v2/merchant/payment-request/{reference}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["x-location"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ID": 123,
"Amount": 123,
"Status": "Pending",
"Type": "C2C",
"CreatedAt": "2023-11-07T05:31:56Z",
"UpdatedAt": "2023-11-07T05:31:56Z",
"PayTag": {
"ID": 123,
"Tag": "<string>",
"Name": "<string>"
},
"Payer": {
"ID": 123,
"Tag": "<string>",
"Name": "<string>"
},
"Reference": "<string>",
"Description": "<string>",
"ExpiresAt": "2023-11-07T05:31:56Z"
}Authorizations
Path Parameters
Response
200 - application/json
Cancelled payment request
Available options:
Pending, Accepted, Declined, Cancelled, Expired Available options:
C2C, C2P, C2M, Top Up, Adjustment, Reversal, Withdrawal, Bank Transfer, FirestoreTransaction, Wallet Settlement, Reward Redemption, Reward, Bulk Transfer, Exchange, Partner Terminal, Partner Gateway, Card Top Up, Vas, Airtime Purchase, Mobile Data Purchase, Terminal Settlement, Virtual Account Transfer, QR Virtual Account Transfer, Idaas Outward Transfer, Idaas Inward Transfer Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I