Payment Method - Delete
curl --request DELETE \
--url https://sandbox.hyperswitch.io/v2/payment-methods/{id} \
--header 'Authorization: <api-key>' \
--header 'X-Profile-Id: <x-profile-id>'import requests
url = "https://sandbox.hyperswitch.io/v2/payment-methods/{id}"
headers = {
"X-Profile-Id": "<x-profile-id>",
"Authorization": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-Profile-Id': '<x-profile-id>', Authorization: '<api-key>'}
};
fetch('https://sandbox.hyperswitch.io/v2/payment-methods/{id}', 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://sandbox.hyperswitch.io/v2/payment-methods/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"X-Profile-Id: <x-profile-id>"
],
]);
$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://sandbox.hyperswitch.io/v2/payment-methods/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-Profile-Id", "<x-profile-id>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://sandbox.hyperswitch.io/v2/payment-methods/{id}")
.header("X-Profile-Id", "<x-profile-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/v2/payment-methods/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Profile-Id"] = '<x-profile-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "0a_pm_01926c58bc6e77c09e809964e72af8c8"
}Payment Methods
Payment Method - Delete
Deletes a payment method of a customer.
DELETE
/
v2
/
payment-methods
/
{id}
Payment Method - Delete
curl --request DELETE \
--url https://sandbox.hyperswitch.io/v2/payment-methods/{id} \
--header 'Authorization: <api-key>' \
--header 'X-Profile-Id: <x-profile-id>'import requests
url = "https://sandbox.hyperswitch.io/v2/payment-methods/{id}"
headers = {
"X-Profile-Id": "<x-profile-id>",
"Authorization": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-Profile-Id': '<x-profile-id>', Authorization: '<api-key>'}
};
fetch('https://sandbox.hyperswitch.io/v2/payment-methods/{id}', 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://sandbox.hyperswitch.io/v2/payment-methods/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"X-Profile-Id: <x-profile-id>"
],
]);
$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://sandbox.hyperswitch.io/v2/payment-methods/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-Profile-Id", "<x-profile-id>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://sandbox.hyperswitch.io/v2/payment-methods/{id}")
.header("X-Profile-Id", "<x-profile-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/v2/payment-methods/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Profile-Id"] = '<x-profile-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "0a_pm_01926c58bc6e77c09e809964e72af8c8"
}Authorizations
Format: api-key=<api_key>
Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.
Headers
Profile ID associated to the payment method
Path Parameters
The unique identifier for the Payment Method
Response
Payment Method Retrieved
The unique identifier of the Payment method
Example:
"0a_pm_01926c58bc6e77c09e809964e72af8c8"
Was this page helpful?
⌘I