Error
A valid request URL is required to generate request examples{
"stripe": {
"id": "stripe",
"title": "Credit Card (Stripe)",
"description": "Pay securely with your credit card",
"supports": [
"products",
"refunds",
"subscriptions"
],
"has_fields": true,
"order_button_text": "Pay Now",
"method_title": "Stripe",
"method_description": "Accept credit card payments via Stripe",
"config": {
"test_mode": true,
"is_connected": true,
"supports_tokenization": true,
"supports_refunds": true,
"supports_subscriptions": true,
"requires_billing_address": true
}
},
"paypal": {
"id": "paypal",
"title": "PayPal",
"description": "Pay via PayPal",
"supports": [
"products",
"refunds"
],
"has_fields": false,
"order_button_text": "Proceed to PayPal",
"method_title": "PayPal",
"method_description": "Accept payments via PayPal",
"config": {
"test_mode": false,
"is_connected": true,
"supports_tokenization": false,
"supports_refunds": true,
"supports_subscriptions": false,
"requires_billing_address": false
}
}
}{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}Retrieve all available payment gateways with their configuration hints
GET
/
checkout
/
payment-methods
Get available payment methods
curl --request GET \
--url {protocol}://{host}/wp-json/cocart/preview/checkout/payment-methodsimport requests
url = "{protocol}://{host}/wp-json/cocart/preview/checkout/payment-methods"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('{protocol}://{host}/wp-json/cocart/preview/checkout/payment-methods', 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 => "{protocol}://{host}/wp-json/cocart/preview/checkout/payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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 := "{protocol}://{host}/wp-json/cocart/preview/checkout/payment-methods"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{protocol}://{host}/wp-json/cocart/preview/checkout/payment-methods")
.asString();require 'uri'
require 'net/http'
url = URI("{protocol}://{host}/wp-json/cocart/preview/checkout/payment-methods")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"stripe": {
"id": "stripe",
"title": "Credit Card (Stripe)",
"description": "Pay securely with your credit card",
"supports": [
"products",
"refunds",
"subscriptions"
],
"has_fields": true,
"order_button_text": "Pay Now",
"method_title": "Stripe",
"method_description": "Accept credit card payments via Stripe",
"config": {
"test_mode": true,
"is_connected": true,
"supports_tokenization": true,
"supports_refunds": true,
"supports_subscriptions": true,
"requires_billing_address": true
}
},
"paypal": {
"id": "paypal",
"title": "PayPal",
"description": "Pay via PayPal",
"supports": [
"products",
"refunds"
],
"has_fields": false,
"order_button_text": "Proceed to PayPal",
"method_title": "PayPal",
"method_description": "Accept payments via PayPal",
"config": {
"test_mode": false,
"is_connected": true,
"supports_tokenization": false,
"supports_refunds": true,
"supports_subscriptions": false,
"requires_billing_address": false
}
}
}{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}This endpoint is currently shown as a preview of what’s currently in development and is subject to change.
Response
Payment methods retrieved successfully
Show child attributes
Show child attributes
Was this page helpful?
⌘I