Skip to main content

Payment gateways

The payment gateways API allows you to view, and update individual payment gateways. Results are not paginated - all gateways will be returned.

Payment gateway properties

AttributeTypeDescription
idstringPayment gateway ID. READ-ONLY
titlestringPayment gateway title on checkout.
descriptionstringPayment gateway description on checkout.
orderintegerPayment gateway sort order.
enabledbooleanPayment gateway enabled status.
method_titlestringPayment gateway method title. READ-ONLY
method_descriptionstringPayment gateway method description. READ-ONLY
settingsobjectPayment gateway settings. See Payment gateway - Settings properties

Payment gateway - Settings properties

AttributeTypeDescription
idstringA unique identifier for the setting. READ-ONLY
labelstringA human readable label for the setting used in interfaces. READ-ONLY
descriptionstringA human readable description for the setting used in interfaces. READ-ONLY
typestringType of setting. Options: text, email, number, color, password, textarea, select, multiselect, radio, image_width and checkbox. READ-ONLY
valuestringSetting value.
defaultstringDefault value for the setting. READ-ONLY
tipstringAdditional help text shown to the user about the setting. READ-ONLY
placeholderstringPlaceholder text to be displayed in text inputs. READ-ONLY

Retrieve a payment gateway

This API lets you retrieve and view a specific payment gateway.

GET /wp-json/wc/v2/payment_gateways/<id>
curl https://example.com/wp-json/wc/v2/payment_gateways/bacs \
-u consumer_key:consumer_secret

List all payment gateways

This API helps you to view all the payment gateways.

GET /wp-json/wc/v2/payment_gateways
curl https://example.com/wp-json/wc/v2/payment_gateways \
-u consumer_key:consumer_secret

Update a payment gateway

This API lets you make changes to a payment gateway.

PUT /wp-json/wc/v2/payment_gateways/<id>
curl -X PUT https://example.com/wp-json/wc/v2/payment_gateways/bacs \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"enabled": false
}'