cURL
curl --request POST \
--url https://api.paycashless.com/v1/invoices/{id}/cancel \
--header 'Content-Type: application/json' \
--header 'Request-Signature: <request-signature>' \
--header 'Request-Timestamp: <request-timestamp>' \
--data '
{
"cancellationReason": "<string>"
}
'import requests
url = "https://api.paycashless.com/v1/invoices/{id}/cancel"
payload = { "cancellationReason": "<string>" }
headers = {
"Request-Signature": "<request-signature>",
"Request-Timestamp": "<request-timestamp>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Request-Signature': '<request-signature>',
'Request-Timestamp': '<request-timestamp>',
'Content-Type': 'application/json'
},
body: JSON.stringify({cancellationReason: '<string>'})
};
fetch('https://api.paycashless.com/v1/invoices/{id}/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://api.paycashless.com/v1/invoices/{id}/cancel",
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([
'cancellationReason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Request-Signature: <request-signature>",
"Request-Timestamp: <request-timestamp>"
],
]);
$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.paycashless.com/v1/invoices/{id}/cancel"
payload := strings.NewReader("{\n \"cancellationReason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Request-Signature", "<request-signature>")
req.Header.Add("Request-Timestamp", "<request-timestamp>")
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.paycashless.com/v1/invoices/{id}/cancel")
.header("Request-Signature", "<request-signature>")
.header("Request-Timestamp", "<request-timestamp>")
.header("Content-Type", "application/json")
.body("{\n \"cancellationReason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paycashless.com/v1/invoices/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Request-Signature"] = '<request-signature>'
request["Request-Timestamp"] = '<request-timestamp>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancellationReason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "draft",
"description": "<string>",
"currency": "NGN",
"maxInstallments": 123,
"number": "<string>",
"reference": "<string>",
"acceptPartialPayments": true,
"amountDue": 123,
"amountPaid": 123,
"amountOverpaid": 123,
"amountRemaining": 123,
"subTotal": 123,
"customerId": "<string>",
"sendEmail": true,
"totalInclusiveTaxAmount": 123,
"totalExclusiveTaxAmount": 123,
"cancellationReason": "<string>",
"taxRateIds": [
"<string>"
],
"logo": "<string>",
"invoicePdf": "<string>",
"receiptPdf": "<string>",
"callbackUrl": "<string>",
"returnUrl": "<string>",
"metadata": {},
"daysUntilDue": 123,
"dueDate": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"liveMode": true
}Invoices
Cancel an invoice
Cancel an invoice
POST
/
v1
/
invoices
/
{id}
/
cancel
cURL
curl --request POST \
--url https://api.paycashless.com/v1/invoices/{id}/cancel \
--header 'Content-Type: application/json' \
--header 'Request-Signature: <request-signature>' \
--header 'Request-Timestamp: <request-timestamp>' \
--data '
{
"cancellationReason": "<string>"
}
'import requests
url = "https://api.paycashless.com/v1/invoices/{id}/cancel"
payload = { "cancellationReason": "<string>" }
headers = {
"Request-Signature": "<request-signature>",
"Request-Timestamp": "<request-timestamp>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Request-Signature': '<request-signature>',
'Request-Timestamp': '<request-timestamp>',
'Content-Type': 'application/json'
},
body: JSON.stringify({cancellationReason: '<string>'})
};
fetch('https://api.paycashless.com/v1/invoices/{id}/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://api.paycashless.com/v1/invoices/{id}/cancel",
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([
'cancellationReason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Request-Signature: <request-signature>",
"Request-Timestamp: <request-timestamp>"
],
]);
$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.paycashless.com/v1/invoices/{id}/cancel"
payload := strings.NewReader("{\n \"cancellationReason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Request-Signature", "<request-signature>")
req.Header.Add("Request-Timestamp", "<request-timestamp>")
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.paycashless.com/v1/invoices/{id}/cancel")
.header("Request-Signature", "<request-signature>")
.header("Request-Timestamp", "<request-timestamp>")
.header("Content-Type", "application/json")
.body("{\n \"cancellationReason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paycashless.com/v1/invoices/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Request-Signature"] = '<request-signature>'
request["Request-Timestamp"] = '<request-timestamp>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancellationReason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "draft",
"description": "<string>",
"currency": "NGN",
"maxInstallments": 123,
"number": "<string>",
"reference": "<string>",
"acceptPartialPayments": true,
"amountDue": 123,
"amountPaid": 123,
"amountOverpaid": 123,
"amountRemaining": 123,
"subTotal": 123,
"customerId": "<string>",
"sendEmail": true,
"totalInclusiveTaxAmount": 123,
"totalExclusiveTaxAmount": 123,
"cancellationReason": "<string>",
"taxRateIds": [
"<string>"
],
"logo": "<string>",
"invoicePdf": "<string>",
"receiptPdf": "<string>",
"callbackUrl": "<string>",
"returnUrl": "<string>",
"metadata": {},
"daysUntilDue": 123,
"dueDate": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"liveMode": true
}Headers
SHA-512 HMAC signature of the request payload using the API secret
Minimum string length:
1Example:
"5e73d044c44d733fcf819ad3409aaaddca840d421b69cb0b04e2c750fc62ece7526d36296237663ad1f06f62a730c0466516507196b3ce6567493cc52a7cf63d"
UNIX timestamp when the request was created (in seconds)
Pattern:
^\d{10}$Example:
"1712336881"
Path Parameters
Example:
"inv_ff0c3z37zi40pvc82g74bgsm4q7fubbw"
Body
application/json
Response
200 - application/json
Invoice cancelled successfully
Available options:
draft, open, paid, partially_paid, cancelled Available options:
NGN, USD Show child attributes
Show child attributes