{"id":162258,"date":"2022-09-10T00:23:20","date_gmt":"2022-09-10T00:23:20","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/waffarad-affiliate\/"},"modified":"2026-06-17T14:13:34","modified_gmt":"2026-06-17T14:13:34","slug":"waffarad-affiliate","status":"publish","type":"plugin","link":"https:\/\/hu.wordpress.org\/plugins\/waffarad-affiliate\/","author":20328133,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"2.0.0","stable_tag":"2.0.0","tested":"7.0","requires":"6.2","requires_php":"7.4","requires_plugins":null,"header_name":"WaffarAD Affiliate Network","header_author":"waffarx","header_description":"Waffarad order tracking for woocommerce","assets_banners_color":"","last_updated":"2026-06-17 14:13:34","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/waffarad-affiliate\/","header_author_uri":"https:\/\/www.waffarad.com","rating":0,"author_block_rating":0,"active_installs":10,"downloads":67236,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","faq","changelog"],"tags":{"1.0.3":{"tag":"1.0.3","author":"waffarx","date":"2022-09-10 00:23:00"},"1.0.4":{"tag":"1.0.4","author":"waffarx","date":"2026-06-08 15:22:54"},"2.0.0":{"tag":"2.0.0","author":"waffarx","date":"2026-06-17 14:13:34"}},"upgrade_notice":[],"ratings":[],"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.3","1.0.4","2.0.0"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[369,42198,1890,507,286],"plugin_category":[35,45],"plugin_contributors":[266218],"plugin_business_model":[],"class_list":["post-162258","plugin","type-plugin","status-publish","hentry","plugin_tags-affiliate","plugin_tags-cashback","plugin_tags-gateway","plugin_tags-payment","plugin_tags-woocommerce","plugin_category-advertising","plugin_category-ecommerce","plugin_contributors-waffarx","plugin_committers-waffarx"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/waffarad-affiliate.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>WaffarAD is WaffarX's affiliate network. WaffarX is the first cashback aggregator in the MENA region. This plugin connects your WooCommerce store to WaffarAD\/WaffarX and provides three features, each of which can be enabled independently:<\/p>\n\n<ol>\n<li><p>Affiliate order tracking \u2014 reports orders referred through WaffarAD (and their status changes) to the WaffarX conversion server so conversions and cashback can be attributed and reconciled.<\/p><\/li>\n<li><p>In-App Order payment gateway \u2014 an API-only gateway (hidden from the storefront checkout) that lets WaffarX place orders on your store via a private REST API, carrying installment\/BNPL transaction metadata (e.g. ValU).<\/p><\/li>\n<li><p>WaffarX Coupons \u2014 an API-only feature that lets WaffarX mint single-use WooCommerce coupons when a customer redeems a WaffarX gift-card voucher. Issuance, redemption (with the actual discount applied), and reversal are reported to WaffarX for billing reconciliation.<\/p><\/li>\n<li><p>WaffarX Platform API \u2014 a private REST API that lets WaffarX run the full in-app commerce flow (browse products, read payment gateways and shipping data, quote shipping rates, place\/fetch\/cancel\/refund orders, and manage a cart) authenticated by the single WaffarX credential. This means WaffarX does not need separate WooCommerce REST consumer keys; the merchant only configures one API Key and API Secret.<\/p><\/li>\n<\/ol>\n\n<h3>External services<\/h3>\n\n<p>This plugin connects to services operated by WaffarAD\/WaffarX:<\/p>\n\n<ol>\n<li><p>Tracking script \u2014 https:\/\/waffarad.com\/integration\/general.js\nA JavaScript file loaded on the front end that sets and reads the WaffarAD affiliate tracking cookies. Loaded only while affiliate tracking is enabled.<\/p><\/li>\n<li><p>Conversion server \u2014 https:\/\/conversion.waffarx.com\nThe plugin POSTs to this server:<\/p>\n\n<ul>\n<li>Woo\/AddOrder \u2014 when a tracked order is created (the order details and affiliate identifiers).<\/li>\n<li>Woo\/UpdateOrder \u2014 when a tracked order changes status (updated status and totals).<\/li>\n<li>Woo\/PluginState \u2014 when the plugin or a feature is activated, deactivated, toggled, or uninstalled.<\/li>\n<li>Woo\/Settings \u2014 read periodically (hourly) for WaffarX-controlled settings, such as whether to report updates for all orders.<\/li>\n<li>Woo\/Coupon \u2014 when a WaffarX-issued coupon is created (issued), redeemed on an order, or reversed (the order is cancelled\/refunded). Each event carries a unique event id and, for redemptions\/reversals, the actual discount applied.<\/li>\n<\/ul>\n\n<p>When an API secret is configured, requests are signed with HMAC-SHA256 (X-WaffarX-Key \/ X-WaffarX-Timestamp \/ X-WaffarX-Signature); the secret itself is never transmitted.<\/p><\/li>\n<\/ol>\n\n<p>The plugin also exposes an inbound REST API (namespace waffarx\/v1) that WaffarX calls to place\/fetch\/cancel\/refund orders, mint\/fetch\/void coupons, and read catalog\/shipping\/payment data (the WaffarX Platform API). All of it is authenticated with the single WaffarX API credential \u2014 either a Bearer token (the API Secret) or an HMAC signature \u2014 so no WooCommerce consumer keys are required. See the FAQ.<\/p>\n\n<p>These services are provided by WaffarAD. For details, see https:\/\/waffarad.com\/Home\/PrivacyPolicy<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id=\"how%20do%20i%20enable%20or%20disable%20each%20feature%3F\"><h3>How do I enable or disable each feature?<\/h3><\/dt>\n<dd><p>Affiliate tracking: Settings \u2192 WaffarAD Tracking \u2192 \"Enable affiliate order tracking\" (on by default).\nIn-App Order gateway: WooCommerce \u2192 Settings \u2192 Payments \u2192 In-App Order \u2192 Enable\/Disable.\nWaffarX Coupons: Settings \u2192 WaffarAD Tracking \u2192 \"Enable WaffarX Coupons\" (on by default).\nWaffarX Platform API: Settings \u2192 WaffarAD Tracking \u2192 \"Enable the WaffarX Platform API\" (on by default). Turn this off if you do not want the catalog\/cart\/shipping\/order-list\/refund API exposed.\nEach toggle notifies WaffarX.<\/p><\/dd>\n<dt id=\"where%20do%20i%20configure%20the%20credentials%3F\"><h3>Where do I configure the credentials?<\/h3><\/dt>\n<dd><p>Settings \u2192 WaffarAD Tracking \u2192 \"WaffarX API Credentials\": a single API Key and API Secret, provided to you by WaffarX. This one pair powers everything \u2014 it identifies your store, signs outbound reporting, and authenticates every inbound WaffarX API call. Alternatively, define WAFFARAD_API_KEY and WAFFARAD_API_SECRET in wp-config.php; those constants take precedence. No WooCommerce REST consumer keys are needed. Inbound requests are not run as any WordPress user; the Platform API authorizes its internal WooCommerce calls only for the duration of each request.<\/p><\/dd>\n<dt id=\"how%20does%20waffarx%20authenticate%20to%20the%20api%3F\"><h3>How does WaffarX authenticate to the API?<\/h3><\/dt>\n<dd><p>With the single API Secret, either way:\n* Bearer token: Authorization: Bearer \n* HMAC signature: X-WaffarX-Key + X-WaffarX-Timestamp + X-WaffarX-Signature, where the signature is HMAC-SHA256 of \"timestamp.rawBody\" using the secret (a short timestamp window guards against replay).<\/p><\/dd>\n<dt id=\"where%20do%20i%20configure%20the%20in-app%20order%20gateway%3F\"><h3>Where do I configure the In-App Order gateway?<\/h3><\/dt>\n<dd><p>WooCommerce \u2192 Settings \u2192 Payments \u2192 In-App Order: the allowed gateway values and allowed gateway statuses. (Authentication uses the unified WaffarX API Secret above \u2014 there is no separate gateway token.)<\/p><\/dd>\n<dt id=\"what%20are%20the%20in-app%20order%20rest%20endpoints%3F\"><h3>What are the In-App Order REST endpoints?<\/h3><\/dt>\n<dd><p>Base: https:\/\/your-domain.com\/wp-json\/waffarx\/v1\n* POST \/order \u2014 place an order (requires gateway + transaction metadata; accepts optional affiliate attribution).\n* GET  \/order\/{id} \u2014 fetch an order.\n* GET  \/order\/by-idempotency-key?key=\u2026 \u2014 look up an order by idempotency key (full WooCommerce data).\n* POST \/order\/{id}\/cancel \u2014 cancel an order.\nAll require the unified WaffarX authentication (Bearer token = the API Secret, or an X-WaffarX HMAC signature).<\/p><\/dd>\n<dt id=\"what%20are%20the%20waffarx%20platform%20api%20endpoints%3F\"><h3>What are the WaffarX Platform API endpoints?<\/h3><\/dt>\n<dd><p>Base: https:\/\/your-domain.com\/wp-json\/waffarx\/v1 (all authenticated with the unified WaffarX credential; enabled via Settings \u2192 WaffarAD Tracking \u2192 \"WaffarX Platform API\"):\n* GET  \/products, GET \/products\/{id}, GET \/products\/{id}\/variations \u2014 catalog.\n* GET  \/payment-gateways \u2014 available payment methods.\n* GET  \/data\/countries, GET \/data\/countries\/{code} \u2014 countries and provinces.\n* GET  \/shipping\/zones, GET \/shipping\/zones\/{id}\/methods \u2014 shipping configuration.\n* POST \/shipping-rates \u2014 stateless shipping quote for given line_items + destination.\n* GET  \/orders \u2014 list orders.\n* POST \/order\/{id}\/refund \u2014 refund an order (send api_refund=false for a manual\/records-only refund).\n* GET  \/cart, POST \/cart\/add-item, POST \/cart\/update-customer, POST \/cart\/select-shipping-rate \u2014 cart (Store API; pass the Cart-Token header returned by GET \/cart).\nThese forward to WooCommerce's own REST endpoints internally, so behavior and schemas match core WooCommerce.<\/p><\/dd>\n<dt id=\"what%20are%20the%20waffarx%20coupons%20rest%20endpoints%3F\"><h3>What are the WaffarX Coupons REST endpoints?<\/h3><\/dt>\n<dd><p>Base: https:\/\/your-domain.com\/wp-json\/waffarx\/v1\n* POST \/coupon \u2014 mint a single-use coupon. Body: amount (required), waffarx_reference (required object with voucher_id and optional batch_id\/third_party_id\/partner_id), and optional code, discount_type (default fixed_cart), expiry_date (YYYY-MM-DD), and individual_use (default false). If no code is supplied the plugin generates one and returns it. Minting is idempotent per voucher_id; a supplied code that already exists is rejected.\n* GET  \/coupon\/{code} \u2014 fetch a WaffarX-issued coupon.\n* POST \/coupon\/{code}\/void \u2014 disable an unused WaffarX-issued coupon.\nThe same authentication as the In-App Order API applies; mutating routes (create, void) require the feature to be enabled.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.0.0<\/h4>\n\n<ul>\n<li>Renamed to \"WaffarAD Affiliate Network\" and merged in the WaffarX In-App Order payment gateway.<\/li>\n<li>Affiliate tracking, the In-App Order gateway, and WaffarX Coupons can each be enabled\/disabled independently; each toggle notifies WaffarX.<\/li>\n<li>In-App Order: API-only WooCommerce gateway (hidden from checkout) with REST endpoints to place\/fetch\/cancel orders, idempotency, and a custom transactions table.<\/li>\n<li>Orders placed via the gateway are marked paid + processing (BNPL authorized &amp; captured) and reported to the conversion server; the order API accepts optional affiliate attribution.<\/li>\n<li>WaffarX Coupons: API-only minting of single-use WooCommerce coupons (REST endpoints to create\/fetch\/void), idempotent per voucher, with issuance, redemption (actual discount applied), and reversal reported to the conversion server on a single Woo\/Coupon route carrying an event field and a unique event id.<\/li>\n<li>Unified credentials: a single WaffarX API Key + API Secret powers every feature (signing outbound reporting AND authenticating all inbound calls). Inbound authentication accepts either a Bearer token (the API Secret) or an HMAC signature (X-WaffarX-Key \/ X-WaffarX-Timestamp \/ X-WaffarX-Signature) with replay protection.<\/li>\n<li>WaffarX Platform API (namespace waffarx\/v1, separately toggleable): products, payment gateways, countries\/provinces, shipping zones, a stateless shipping-rate quote, order listing and refunds, and cart (Store API) \u2014 all authenticated by the single WaffarX credential, with WooCommerce calls authorized per-request (no user impersonation), so WooCommerce REST consumer keys are not required.<\/li>\n<li>Webhook on plugin\/feature activate, deactivate, toggle, and uninstall.<\/li>\n<li>Class-based structure; HPOS compatible.<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Order-insertion rewrite: send on order creation (classic + block checkout), idempotency guard, presence-based attribution check, paid-price fix, HMAC signing, settings screen, status-change reporting (UpdateOrder), optional all-orders reporting via a remote switch, privacy disclosure.<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>WordPress.org standards\/security pass (ABSPATH guard, GPL header, escaping, cookie sanitization, documented external services).<\/li>\n<\/ul>","raw_excerpt":"WaffarAD (WaffarX&#039;s affiliate network) integration for WooCommerce: affiliate order tracking plus the WaffarX In-App Order payment gateway.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/162258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=162258"}],"author":[{"embeddable":true,"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/waffarx"}],"wp:attachment":[{"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=162258"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=162258"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=162258"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=162258"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=162258"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/hu.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=162258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}