{"id":25609804,"url":"https://github.com/johnoconnor0/hubspot-x-woocommerce-integration","last_synced_at":"2026-03-04T14:01:59.965Z","repository":{"id":277471374,"uuid":"928205355","full_name":"web-lifter/hubspot-woocommerce-integration","owner":"web-lifter","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-09T01:37:50.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-14T05:14:57.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/web-lifter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["web-lifter"]}},"created_at":"2025-02-06T08:41:14.000Z","updated_at":"2025-02-09T01:37:52.000Z","dependencies_parsed_at":"2025-02-14T05:14:58.587Z","dependency_job_id":"aa458d10-8416-4d14-80fd-14015ce604da","html_url":"https://github.com/web-lifter/hubspot-woocommerce-integration","commit_stats":null,"previous_names":["web-lifter/hubspot-woocommerce-integration"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-lifter%2Fhubspot-woocommerce-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-lifter%2Fhubspot-woocommerce-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-lifter%2Fhubspot-woocommerce-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-lifter%2Fhubspot-woocommerce-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web-lifter","download_url":"https://codeload.github.com/web-lifter/hubspot-woocommerce-integration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240093148,"owners_count":19746781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-21T21:58:37.577Z","updated_at":"2026-03-04T14:01:59.956Z","avatar_url":"https://github.com/web-lifter.png","language":null,"funding_links":["https://github.com/sponsors/web-lifter"],"categories":[],"sub_categories":[],"readme":"# HubSpot WooCommerce Sync\n\n**Version:** 1.0.0\n**Author:** [Weblifter](https://weblifter.com.au)\n**Plugin URI:** [GitHub Repository](https://github.com/weblifter/hubspot-woocommerce-sync)\n**License:** GPL-3.0\n\n## Overview\n\nHubSpot WooCommerce Sync is a WordPress plugin that integrates WooCommerce with HubSpot, allowing store owners to **automatically sync orders as deals in HubSpot CRM**. This plugin uses a **public HubSpot app** to authenticate users and store their API tokens.\n\n---\n\n## Features\n\n* **HubSpot OAuth Authentication**\n  Securely connect your WooCommerce store to HubSpot using OAuth 2.0. Tokens are managed automatically and refreshed when needed. The connection is initiated via the admin settings panel and validated via the HubSpot API.\n\n* **Automatic Deal Creation for Online Orders**\n  When an online WooCommerce order is paid (via `woocommerce_payment_complete`), the plugin creates a corresponding **HubSpot Deal** in the selected pipeline. The deal includes:\n\n  * Order total and shipping costs\n  * Full billing and shipping details\n  * Contact association (customer email, phone, name)\n  * Optional company association\n  * Line items as HubSpot products (with price, quantity, GST, SKU)\n  * Deal notes from WooCommerce's customer note field\n  * PayWay transaction reference, if available\n  * Pipeline and stage mappings from WooCommerce order status. Each status can\n    be mapped separately for the **Online Orders Pipeline** and the\n    **Manual Orders Pipeline** using the `hubspot-online-mapping` and\n    `hubspot-manual-mapping` options.\n\n* **Automatic Order Completion**\n  Online orders can be marked **complete** automatically when enabled in the **Orders** tab.\n\n* **Order Cleanup**\n  Automatically delete orders that remain in a chosen status (e.g., Pending Payment) for a specified number of days. These controls live in the **Orders** tab.\n\n* **Manual Deal Creation**\n  For unpaid or offline WooCommerce orders, admins can click **\"Create Deal\"** in the Order Management screen. These orders are pushed to the pipeline chosen for manual sales and use the stage mappings defined under **Manual Orders Pipeline**.\n\n* **Manual Order Sync from HubSpot Deal**\n  Orders created manually in WooCommerce can be fully re-synced from their associated HubSpot deal using the **\"Sync\"** button. This updates:\n\n  * Billing/shipping fields\n  * Customer contact info\n  * Line items\n  * Deal stage and pipeline labels\n\n* **Deal Stage Updates**\n  At key moments, the plugin updates the **HubSpot deal stage** using admin-defined mappings.\n\n* **WooCommerce Admin Order Management UI**\n  A powerful admin screen at **HubSpot -\u003e Order Management** allows you to:\n\n  * Filter/search orders by status or customer name\n  * View order status\n  * Trigger actions: **Create Deal**, **Sync from HubSpot**\n  * See whether an order is \"Manual\" or \"Online\"\n\n* **PayWay Integration Support**\n  Automatically syncs `_payway_api_order_number` to the **HubSpot Deal** after payment. Ensures external transaction references are tracked.\n\n* **Smart Order Typing (Manual vs Online)**\n\n  * Admin-created, REST API, and CLI orders are marked as `manual`\n  * Frontend WooCommerce checkout orders are marked as `online`\n  * This distinction controls pipeline/stage logic\n\n* **Stage \u0026 Pipeline Label Caching**\n  Caches HubSpot pipeline and stage labels from the API to reduce repeated requests and provide readable names in the admin UI. Cached data lives in the `hubspot_cached_pipelines` option and can be refreshed from the **Pipelines** tab using the **Sync** button.\n\n* **Robust Error Handling and Logging**\n\n  * Errors during sync or API requests are logged via `error_log()` and `hubwoo_log()`\n  * Invalid configurations (e.g., missing pipeline) now trigger order notes or error returns\n  * Admin is alerted if deals aren't created due to missing mapping\n\n* **Custom Line Item Integration**\n  Each WooCommerce product is added to the HubSpot deal as a **line item** with:\n\n  * Product name, quantity, subtotal, SKU, and tax\n  * Proper associations via HubSpot v4 batch API\n\n* **Extensibility for Developers**\n  Clean separation of concerns across files:\n\n  * `create-object.php`: Deal, contact, and company creation\n  * `fetch-object.php`: Pulling HubSpot data\n  * `manual-order-sync.php`, `online-order-sync.php`: Contextual sync flows\n\n---\n\n## Installation\n\n### Manual Installation\n1. Download the latest release from [GitHub](https://github.com/weblifter/hubspot-woocommerce-sync).\n2. Upload the `.zip` file to WordPress via **Plugins -\u003e Add New -\u003e Upload Plugin**.\n3. Activate the plugin.\n\n### Using GitHub Updater\n1. Install the [GitHub Updater](https://github.com/afragen/github-updater) plugin.\n2. Add the repository URL in the GitHub Updater settings.\n3. The plugin will now receive updates directly from GitHub.\n\n## Setup \u0026 Authentication\n\n### 1. Configure HubSpot Credentials\n\nAdd the following constants to your `wp-config.php` file (recommended):\n\n```php\ndefine('HUBSPOT_WC_CLIENT_ID', 'your-hubspot-client-id');\ndefine('HUBSPOT_WC_CLIENT_SECRET', 'your-hubspot-client-secret');\ndefine('HUBSPOT_WC_REDIRECT_URI', 'https://your-site.com/wp-json/hubspot/v1/oauth/callback');\n```\n\nReplace the values with your HubSpot public app credentials.\n\n### 2. Connect to HubSpot\n\n1. **Go to WordPress Admin -\u003e HubSpot Sync**.\n2. Click the **Connect HubSpot** button and follow the authorization flow.\n3. Once authenticated, select a **pipeline for online orders** and a separate\n   **pipeline for manual orders** under the **Pipelines** tab.\n4. Map each WooCommerce order status to a HubSpot stage for both pipelines using\n   the status table on that tab (stored in `hubspot-online-mapping` and\n   `hubspot-manual-mapping`).\n5. Enable **Automatic Deal Creation** to sync new orders.\n6. In the **Orders** tab, enable **Auto-Complete Online Orders** to automatically mark paid orders complete.\n\n### Admin-Created Orders\nOrders created manually in WooCommerce are **not** synced automatically. After\ncreating an order in the admin, go to **HubSpot -\u003e Order Management** and click\nthe **Create Deal** button to push the order to HubSpot.\n\n## REST API Endpoints\n\nThe plugin provides the following API routes. All routes require an authenticated user with the `manage_options` capability. In practice, you must be logged in as an administrator when calling `/start-auth` and `/oauth/callback`. The **Connect HubSpot** link on the plugin settings page opens these routes for you so authentication is handled automatically:\n\n### Start OAuth Authentication\n`GET /wp-json/hubspot/v1/start-auth`\n\n**Query Parameter:**\n- `store_url` (required) - The WooCommerce store URL.\n\n### OAuth Callback\n`GET /wp-json/hubspot/v1/oauth/callback`\n\n**Handles HubSpot's OAuth response and stores the API tokens.**\n\nThe previous connection status endpoint has been removed for security. Only\nadministrators can access the OAuth routes.\n\n\n## Uninstallation\nTo remove the plugin:\n1. Deactivate the plugin in WordPress.\n2. Click \"Delete\" to remove all associated data.\n\n## License\nThis plugin is licensed under **GPL-3.0**.\n\n## Support \u0026 Contributions\nFor bug reports, feature requests, or contributions, visit the [GitHub Issues](https://github.com/weblifter/hubspot-woocommerce-sync/issues) page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnoconnor0%2Fhubspot-x-woocommerce-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnoconnor0%2Fhubspot-x-woocommerce-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnoconnor0%2Fhubspot-x-woocommerce-integration/lists"}