Payment Methods
The Payment Method APIs provide details about a payment method. You can retrieve, update, and delete payment methods.
Download Payment Methods OpenAPI Document
End Points
Update Payment Method
Retrieve Payment Method Details
Delete Payment Method
Attribute
payment_method_id
string
A unique identifier for the payment method.
customer_id
string
A unique identifier for the customer.
customer_name
string
Name of the customer.
customer_email
string
Email address of the customer.
type
string
The type of payment method. (e.g.,
card or ach_debit ) ach_debit
object
Contains ACH details
account_holder_name
string
Name of the account holder.
routing_number
string
Routing number.
account_holder_type
string
Account holder type. ( eg.,
individual or company) bank_name
string
Name of the bank.
account_type
string
Type of the account. (eg.,
savings) last_four_digits
string
The last four digits.
card
object
Contains card details.
brand
string
The brand of the card (e.g.,
others, amex, diners, discover, jcb, master_card, union_pay, visa). card_holder_name
string
The name of the cardholder.
last_four_digits
string
The last four digits of the card number.
expiry_month
string
The month when the card expires, formatted as MM.
expiry_year
string
The year when the card expires, formatted as YYYY.
funding
string
The funding type of the card (e.g.,
others, credit, debit, prepaid). country
string
The country where the card was issued, represented by a 2-letter ISO country code. Possible values include
US, IN, and GB. card_checks
object
Contains card checks. Card check status can be
pass, fail, unavailable, or unchecked. address_line_check
string
The result of the address line check.
postal_code_check
string
The result of the postal code check.
cvc_check
string
The result of the CVC check.
status
string
The status of the payment method. (e.g.,
active, expired, blocked, processing, or deleted) currency
string
The currency in which the payment method operates, represented by a 3-letter ISO currency code
(e.g.,
(e.g.,
USD). May be an empty string when not applicable. source
string
The source from which this payment method was created (e.g.,
customer, merchant, migration). billing_address
object
Contains billing address details.
name
string
Billing name.
address_id
string
A unique identifier for the billing address.
address_line1
string
First line of the customer’s billing address.
address_line2
string
Second line of the customer’s billing address.
city
string
City of the customer’s billing address.
state
string
State of the customer’s billing address.
country
string
Country of the customer’s billing address, represented by a 2-letter ISO country code (e.g.,
US). postal_code
string
Postal Code of the customer’s billing address.
created_time
long
The timestamp (milliseconds) indicating when the payment method was created.
last_modified_time
long
The timestamp (milliseconds) indicating when the payment method was last modified.
{
"payment_method_id": "1987000000724211",
"customer_id": "1987000000724207",
"customer_name": "Charles",
"customer_email": "charles@example.com",
"type": "card",
"card": {
"brand": "visa",
"card_holder_name": "Charles",
"last_four_digits": "3212",
"expiry_month": "01",
"expiry_year": "2030",
"funding": "credit",
"country": "US",
"card_checks": {
"address_line_check": "pass",
"postal_code_check": "pass",
"cvc_check": "pass"
}
},
"status": "active",
"currency": "USD",
"source": "customer",
"billing_address": {
"name": "Charles",
"address_id": "1987000000724208",
"address_line1": "123 Main St",
"address_line2": "Apt 4B",
"city": "Detroit",
"state": "Michigan",
"country": "US",
"postal_code": "12345"
},
"created_time": 1708950672,
"last_modified_time": 1708950672
}
Update Payment Method
This API endpoint allows you to update the details of a payment method.
OAuth Scope : ZohoPay.paymentmethods.UPDATE
Arguments
type
string
(Required)
The type of payment method. (e.g.,
card or ach_debit ) ach_debit
object
account_holder_type
string
Account holder type. ( eg.,
individual or company) card
object
expiry_month
string
The month when the card expires, formatted as MM.
expiry_year
string
The year when the card expires, formatted as YYYY.
billing_address
object
Contains billing address details.
name
string
Billing name.
address_line1
string
First line of the billing address.
address_line2
string
Second line of the billing address.
city
string
City of the billing address.
state
string
State of the billing address.
country
string
(Required)
Country of the billing address, represented by a 2-letter ISO country code (e.g.,
US). postal_code
string
Postal code of the billing address.
Path Parameters
payment_method_id
long
(Required)
A unique identifier for the payment method.
Query Parameters
account_id
long
(Required)
The Zoho Payments account ID.
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556")
.put(body)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse<String> response = Unirest.put("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556")
.header("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.header("content-type", "application/json")
.body("{\"field1\":\"value1\",\"field2\":\"value2\"}")
.asString();
const options = {
method: 'PUT',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
const settings = {
"async": true,
"crossDomain": true,
"url": "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556",
"method": "PUT",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
},
"processData": false,
"data": "{\"field1\":\"value1\",\"field2\":\"value2\"}"
};
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPSConnection("payments.zoho.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("PUT", "/api/v1/paymentmethods/173000002315115?account_id=23137556", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "PUT",
"hostname": "payments.zoho.com",
"port": null,
"path": "/api/v1/paymentmethods/173000002315115?account_id=23137556",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
const unirest = require("unirest");
const req = unirest("PUT", "https://payments.zoho.com/api/v1/paymentmethods/173000002315115");
req.query({
"account_id": "23137556"
});
req.headers({
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
});
req.type("json");
req.send({
"field1": "value1",
"field2": "value2"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const request = require('request');
const options = {
method: 'PUT',
url: 'https://payments.zoho.com/api/v1/paymentmethods/173000002315115',
qs: {account_id: '23137556'},
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: {field1: 'value1', field2: 'value2'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
request["content-type"] = 'application/json'
request.body = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
response = http.request(request)
puts response.read_body
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\"field1\":\"value1\",\"field2\":\"value2\"}",
CURLOPT_HTTPHEADER => [
"Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
<?php
$request = new HttpRequest();
$request->setUrl('https://payments.zoho.com/api/v1/paymentmethods/173000002315115');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'account_id' => '23137556'
]);
$request->setHeaders([
'Authorization' => 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type' => 'application/json'
]);
$request->setBody('{"field1":"value1","field2":"value2"}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$body = new http\Message\Body;
$body->append('{"field1":"value1","field2":"value2"}');
$request->setRequestUrl('https://payments.zoho.com/api/v1/paymentmethods/173000002315115');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'account_id' => '23137556'
]));
$request->setHeaders([
'Authorization' => 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
var client = new RestClient("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"field1\":\"value1\",\"field2\":\"value2\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556"),
Headers =
{
{ "Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" },
},
Content = new StringContent("{\"field1\":\"value1\",\"field2\":\"value2\"}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556"
payload := strings.NewReader("{\"field1\":\"value1\",\"field2\":\"value2\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const data = JSON.stringify({
"field1": "value1",
"field2": "value2"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556");
xhr.setRequestHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
curl --request PUT \
--url 'https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"type": "card",
"card": {
"expiry_month": "01",
"expiry_year": "2030"
},
"billing_address": {
"name": "Charles",
"address_line1": "123 Main St",
"address_line2": "Apt 4B",
"city": "Detroit",
"state": "Michigan",
"country": "US",
"postal_code": "12345"
}
}
{
"code": 0,
"message": "Payment method details updated",
"payment_method": {
"payment_method_id": "1987000000724211",
"customer_id": "1987000000724207",
"customer_name": "Charles",
"customer_email": "charles@example.com",
"type": "card",
"card": {
"brand": "visa",
"card_holder_name": "Charles",
"last_four_digits": "3212",
"expiry_month": "01",
"expiry_year": "2030",
"funding": "credit",
"country": "US",
"card_checks": {
"address_line_check": "pass",
"postal_code_check": "pass",
"cvc_check": "pass"
}
},
"status": "active",
"currency": "USD",
"source": "customer",
"billing_address": {
"name": "Charles",
"address_id": "1987000000724208",
"address_line1": "123 Main St",
"address_line2": "Apt 4B",
"city": "Detroit",
"state": "Michigan",
"country": "US",
"postal_code": "12345"
},
"created_time": 1708950672,
"last_modified_time": 1708950672
}
}
Retrieve Payment Method Details
This API endpoint allows you to retrieve the details of a specific payment method.
OAuth Scope : ZohoPay.paymentmethods.READ
Path Parameters
payment_method_id
long
(Required)
A unique identifier for the payment method.
Query Parameters
account_id
long
(Required)
The Zoho Payments account ID.
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
HttpResponse<String> response = Unirest.get("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556")
.header("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.asString();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
const settings = {
"async": true,
"crossDomain": true,
"url": "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556",
"method": "GET",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPSConnection("payments.zoho.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/api/v1/paymentmethods/173000002315115?account_id=23137556", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "payments.zoho.com",
"port": null,
"path": "/api/v1/paymentmethods/173000002315115?account_id=23137556",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const unirest = require("unirest");
const req = unirest("GET", "https://payments.zoho.com/api/v1/paymentmethods/173000002315115");
req.query({
"account_id": "23137556"
});
req.headers({
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const request = require('request');
const options = {
method: 'GET',
url: 'https://payments.zoho.com/api/v1/paymentmethods/173000002315115',
qs: {account_id: '23137556'},
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
response = http.request(request)
puts response.read_body
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
<?php
$request = new HttpRequest();
$request->setUrl('https://payments.zoho.com/api/v1/paymentmethods/173000002315115');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'account_id' => '23137556'
]);
$request->setHeaders([
'Authorization' => 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://payments.zoho.com/api/v1/paymentmethods/173000002315115');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'account_id' => '23137556'
]));
$request->setHeaders([
'Authorization' => 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
var client = new RestClient("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
IRestResponse response = client.Execute(request);
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556"),
Headers =
{
{ "Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556");
xhr.setRequestHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
xhr.send(data);
curl --request GET \
--url 'https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"payment_method": {
"payment_method_id": "1987000000724211",
"customer_id": "1987000000724207",
"customer_name": "Charles",
"customer_email": "charles@example.com",
"type": "card",
"card": {
"brand": "visa",
"card_holder_name": "Charles",
"last_four_digits": "3212",
"expiry_month": "01",
"expiry_year": "2030",
"funding": "credit",
"country": "US",
"card_checks": {
"address_line_check": "pass",
"postal_code_check": "pass",
"cvc_check": "pass"
}
},
"status": "active",
"currency": "USD",
"source": "customer",
"billing_address": {
"name": "Charles",
"address_id": "1987000000724208",
"address_line1": "123 Main St",
"address_line2": "Apt 4B",
"city": "Detroit",
"state": "Michigan",
"country": "US",
"postal_code": "12345"
},
"created_time": 1708950672,
"last_modified_time": 1708950672
}
}
Delete Payment Method
This API endpoint allows you to delete a payment method.
Note: If the payment method is used for recurring profiles, deleting it may affect future payments. Update or cancel the recurring profile before deletion.
OAuth Scope : ZohoPay.paymentmethods.DELETE
Path Parameters
payment_method_id
long
(Required)
A unique identifier for the payment method.
Query Parameters
account_id
long
(Required)
The Zoho Payments account ID.
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556")
.delete(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
HttpResponse<String> response = Unirest.delete("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556")
.header("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.asString();
const options = {
method: 'DELETE',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
const settings = {
"async": true,
"crossDomain": true,
"url": "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556",
"method": "DELETE",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPSConnection("payments.zoho.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("DELETE", "/api/v1/paymentmethods/173000002315115?account_id=23137556", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "DELETE",
"hostname": "payments.zoho.com",
"port": null,
"path": "/api/v1/paymentmethods/173000002315115?account_id=23137556",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const unirest = require("unirest");
const req = unirest("DELETE", "https://payments.zoho.com/api/v1/paymentmethods/173000002315115");
req.query({
"account_id": "23137556"
});
req.headers({
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const request = require('request');
const options = {
method: 'DELETE',
url: 'https://payments.zoho.com/api/v1/paymentmethods/173000002315115',
qs: {account_id: '23137556'},
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
response = http.request(request)
puts response.read_body
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556",
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: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
<?php
$request = new HttpRequest();
$request->setUrl('https://payments.zoho.com/api/v1/paymentmethods/173000002315115');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'account_id' => '23137556'
]);
$request->setHeaders([
'Authorization' => 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://payments.zoho.com/api/v1/paymentmethods/173000002315115');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'account_id' => '23137556'
]));
$request->setHeaders([
'Authorization' => 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
var client = new RestClient("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
IRestResponse response = client.Execute(request);
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556"),
Headers =
{
{ "Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556");
xhr.setRequestHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
xhr.send(data);
curl --request DELETE \
--url 'https://payments.zoho.com/api/v1/paymentmethods/173000002315115?account_id=23137556' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "Payment method deleted"
}