Gatemi Zapier Developer Reference

Both editions serve the REST namespace gatemi-zapier/v1. The free edition serves three routes; the full edition serves the rest. Topic names and the namespace are a contract with live Zaps and are never renamed.

Every route except POST /connect is authenticated with a WooCommerce API key pair (HTTP Basic, over HTTPS). Both editions tell WooCommerce that requests to this namespace are REST API requests (woocommerce_rest_is_request_to_rest_api), which is what makes WooCommerce accept the key here and not only under wc/v3.

REST routes — both editions

Method Route Does
POST /connect Exchange a login for a key pair. Public by design; checks the login itself.
GET /topics The topics this store can send. Needs manage_woocommerce.
GET POST /webhooks List webhooks; subscribe (WooCommerce's webhooks controller).
GET PUT DELETE /webhooks/{id} Read, change, unsubscribe.

POST /connect

Arguments: username, password (both required). Answer, status 201:

{
  "consumer_key": "ck_…",
  "consumer_secret": "cs_…",
  "user": { "id": 1, "login": "owner", "name": "Shop Owner" },
  "store": { "name": "My Shop", "url": "https://shop.example.com/", "namespace": "gatemi-zapier/v1", "version": "1.0.0" }
}

The full edition adds capabilities — orders, products, coupons, customers (true/false) — saying what the connecting account can change.

Errors: 400 HTTPS required (gmzf_tls_required / gatemi_zapier_tls_required), 406 login refused (gmzf_cannot_authenticate / gatemi_zapier_cannot_authenticate), 429 locked out (gmzf_too_many_attempts / gatemi_zapier_too_many_attempts).

GET /topics

A list of { "key", "name", "resource" }, for example { "key": "order.created", "name": "Order created", "resource": "orders" }. Full edition: filter with resource and search query arguments.

POST /webhooks

WooCommerce's webhook fields (topic, delivery_url, status, secret…). A missing name becomes Gatemi Zapier: <topic>. Free edition: a topic other than its four is refused with 400 gmzf_topic_not_served.

REST routes — Full edition

Method Route Does
DELETE /connect Revoke the calling user's Gatemi Zapier keys
GET /ping Check a connection still works; does no other work
GET /status Plugin version, site (URL, WordPress, PHP, timezone, SSL), WooCommerce (version, currency, HPOS), resources with their triggers, and active Zaps
GET /samples/{topic} The payload {topic} would send for the most recent matching record; 404 gatemi_zapier_unknown_topic for a topic not offered
GET /orders/statuses The store's order statuses, custom ones included
POST PUT PATCH /orders/status order_id, status, optional note
GET POST /order_notes List (order_id, type = any/customer/internal, search, page, per_page, orderby, order); add (order_id, note, customer_note)
GET DELETE /order_notes/{id} One note
POST PUT PATCH /products/price product_id or sku, adjustment, amount
POST PUT PATCH /products/stock product_id or sku, adjustment + quantity, stock_status
/orders, /products, /customers, /coupons WooCommerce's own controllers re-served and recorded in Activity
/subscriptions, /subscription_notes With WooCommerce Subscriptions
/bookings With WooCommerce Bookings (read)
/user_memberships, /membership_plans With WooCommerce Memberships

/products adds an include_variations list argument, and creating a product with "type": "variation" (and a parent_id) creates a variation. A variation cannot be moved to another parent (400 gatemi_zapier_cannot_reparent).

Routes containing /batch, /suggested-products, /duplicate or /related are removed from the namespace.

/products/price adjustments

set_regular_price, increase_regular_price, decrease_regular_price, set_sale_price, increase_sale_price, decrease_sale_price, set_sale_price_from_regular, remove_sale_price. amount is a number or a percentage such as 25%; it is not needed for remove_sale_price.

curl -u ck_xxx:cs_xxx -X POST 
  https://shop.example.com/wp-json/gatemi-zapier/v1/products/price 
  -d sku=MUG-01 -d adjustment=set_sale_price_from_regular -d amount=20%

/products/stock

adjustment: set, increase or decrease, with an integer quantity. stock_status: instock, outofstock or onbackorder. Give either or both; giving neither is 400 gatemi_zapier_nothing_to_change. A quantity change on a product that does not manage stock switches stock management on.

Product lookups fail with gatemi_zapier_product_identifier_required, gatemi_zapier_product_not_found or gatemi_zapier_skus_disabled.

Webhook topics

Free edition: order.created, order.updated, customer.created, customer.updated — WooCommerce core topics.

Full edition: the full list is in Settings → Events. Each delivery from a webhook the full edition manages carries the headers X-Gatemi-Zapier-Version, X-WC-Version, X-WordPress-GMT-Offset and X-WC-Webhook-Resource-ID, beside WooCommerce's own X-WC-Webhook-* headers.

The plugin's own topics are driven by its own actions, which you can fire or hook:

Action Argument
gatemi_zapier_order_status_changed order id
gatemi_zapier_product_low_stock, gatemi_zapier_product_out_of_stock, gatemi_zapier_product_stock_status_changed, gatemi_zapier_product_stock_status_changed_to_<status> product id (a variation's parent)
gatemi_zapier_subscription_created, …_status_changed, …_status_changed_to_<status>, …_renewed, …_renewal_failed subscription id
gatemi_zapier_booking_created, …_ordered, …_status_changed, …_cancelled, …_updated, …_deleted, …_restored booking id
gatemi_zapier_membership_created, …_status_changed, …_status_changed_to_<status> user membership id

Filters

Both editions

Free Full Default
gmzf_require_tls gatemi_zapier_require_tls true Refuse /connect over plain HTTP
gmzf_connect_ip gatemi_zapier_connect_ip REMOTE_ADDR The address sign-in failures are counted against
// Behind a trusted reverse proxy that sets X-Real-IP.
add_filter( 'gatemi_zapier_connect_ip', function ( $ip ) {
	return isset( $_SERVER['HTTP_X_REAL_IP'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_REAL_IP'] ) ) : $ip;
} );

Only do this when the proxy overwrites that header; otherwise a caller can choose their own address and escape the lockout.

Full edition

Filter Arguments
gatemi_zapier_resources $definitions The resource definitions (orders, notes, customers, products, coupons, and the extensions'). Push one array to add a resource.
gatemi_zapier_rest_controllers $controllers Controller class names registered under the namespace
gatemi_zapier_pruned_routes $fragments Route fragments removed (default /batch, /suggested-products, /duplicate, /related)
gatemi_zapier_health_checks $checks The readiness checks on the Setup tab
gatemi_zapier_delivery_hosts $hosts Hosts that mark a webhook as Zapier's (default zapier.com, zapierstaging.com)
gatemi_zapier_legacy_plugin_is_active $active Whether another Zapier plugin is active (stops adoption)
gatemi_zapier_logging_enabled $on Overrides Detailed logging
gatemi_zapier_dedupe_enabled $on Overrides Collapse duplicate sends
gatemi_zapier_retention_days $days Overrides Keep task history for … days
gatemi_zapier_key_retention_days $days Days an unused key is kept (default 90)
gatemi_zapier_max_keys_per_user $max Keys one user may keep (default 5)
gatemi_zapier_license_api_url $url The licence server
gatemi_zapier_update_cache_ttl, gatemi_zapier_update_retry_ttl, gatemi_zapier_sync_cache_ttl $seconds Licence and update cache lifetimes, never below 60

A resource definition is plain data: key, name, plural (the route base), controller (or null for trigger-only), triggers (a list of Gatemi_Zapier_Trigger objects, or a callable returning one — each a {resource}.{event} key, a name and the WordPress actions it fires on), and optional callables payload, admin_url, latest (for samples), matches and available.

The full edition also re-applies WooCommerce's own woocommerce_rest_check_permissions filter when it checks permissions, so code hooked there keeps working.

Actions — Full edition

Action Arguments
gatemi_zapier_task_recorded $task_id, $row A task history row was written
gatemi_zapier_before_replay $task, $resource_id Just before Send again re-sends a delivery
gatemi_zapier_db_upgrade_v_<n>_to_<n+1> — During a task-history schema upgrade

Options

The free edition stores no options. Its sign-in counters are transients named gmzf_attempts_<hash>.

Option — Full edition
gatemi_zapier_logging Detailed logging (yes/no, default off)
gatemi_zapier_retention_days Keep task history for … days (default 30, 0 = forever)
gatemi_zapier_dedupe Collapse duplicate sends (default on)
gatemi_zapier_delete_data Remove data on uninstall (default no)
gatemi_zapier_managed_webhooks Ids of webhooks the plugin created or adopted
gatemi_zapier_key_issued When each key was issued
gatemi_zapier_paused_webhooks, gatemi_zapier_upgrading, gatemi_zapier_db_version Upgrade state
gatemi_zapier_welcomed Whether the screen has shown its first-run view
gatemi_zapier_license Licence state

Sign-in counters are transients named gatemi_zapier_attempts_<hash>.

Task history table — Full edition

{prefix}gatemi_zapier_task_history: task_id, created_at, direction (trigger or action), status, topic, resource_type, resource_id, child_type, child_id, webhook_id, duration, message. No payload is stored.

Cron — Full edition

Hook Schedule
gatemi_zapier_purge_task_history daily Deletes history past the retention
gatemi_zapier_rotate_keys daily Revokes unused and surplus Gatemi Zapier keys
gatemi_zapier_license_check twice daily, while a key is saved Licence check

Webhook deliveries themselves run in WooCommerce's scheduled-action queue, not in these events.

API keys and webhooks

Connection keys are rows in {prefix}woocommerce_api_keys with the description Gatemi Zapier and permission read_write. Webhooks are WooCommerce webhooks named Gatemi Zapier: <topic>.

Constants

GMZF_VERSION (free edition) and GATEMI_ZAPIER_VERSION (full edition). When GATEMI_ZAPIER_VERSION is defined the free edition registers nothing.

Shopping Cart
Scroll to Top