Delete a merchant - WalletConnect Pay Docs
Delete a merchant
cURL
curl --request DELETE \
--url https://api.pay.walletconnect.com/v1/merchants/{merchantId} \
--header 'Api-Key: <api-key>'
Python
import requests
url = "https://api.pay.walletconnect.com/v1/merchants/{merchantId}"
headers = {"Api-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {method: 'DELETE', headers: {'Api-Key': '<api-key>'}};
fetch('https://api.pay.walletconnect.com/v1/merchants/{merchantId}', 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.pay.walletconnect.com/v1/merchants/{merchantId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pay.walletconnect.com/v1/merchants/{merchantId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Unirest (Java)
HttpResponse<String> response = Unirest.delete("https://api.pay.walletconnect.com/v1/merchants/{merchantId}")
.header("Api-Key", "<api-key>")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://api.pay.walletconnect.com/v1/merchants/{merchantId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body
Response
Status Code: 200
Example Response:
{
"id": "mrch_7kBz2qR9xPvLmN4Yw",
"deleted": true
}
Authorizations
- Api-Key (string, header, required)
Path Parameters
- merchantId (string, required) - The ID of the merchant to delete.
Response Format
Response: 200 - application/json
Fields:
- id (string, required) - Merchant ID
- deleted (boolean, required) - Whether the merchant was successfully deleted.