Delete a payment request

Delete a payment request

Occasionally, a payment request might be no longer valid. In order to avoid your customers still using it and some other potential confusion, we recommend you to delete them.

The following code deletes an existing payment request given its ID. Consider the ID is 629507f5ac8fcd5d4882718a:

curl --request DELETE \
     --url https://cloud.handcash.io/v2/paymentRequests/9ac9182acae19902 \
     --header 'app-id: your-app-id' \
     --header 'app-secret: your-app-secret'
const axios = require("axios").default;

const options = {
  method: 'DELETE',
  url: 'https://cloud.handcash.io/v2/paymentRequests/629507f5ac8fcd5d4882718a',
  headers: {'app-secret': 'your-app-secret', 'app-id': 'your-app-id'}
};

axios.request(options).then(function (response) {
  console.log(response.data);
}).catch(function (error) {
  console.error(error);
});
import requests

url = "https://cloud.handcash.io/v2/paymentRequests/629507f5ac8fcd5d4882718a"

headers = {
    "app-secret": "your-app-secret",
    "app-id": "your-app-id"
}

response = requests.delete(url, headers=headers)

print(response.text)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://cloud.handcash.io/v2/paymentRequests/629507f5ac8fcd5d4882718a', [
  'headers' => [
    'app-id' => 'your-app-id',
    'app-secret' => 'your-app-secret',
  ],
]);

echo $response->getBody();
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://cloud.handcash.io/v2/paymentRequests/629507f5ac8fcd5d4882718a")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["app-secret"] = 'your-app-secret'
request["app-id"] = 'your-app-id'

response = http.request(request)
puts response.read_body

Did this page help you?