Skip to main content
SmartPyme exposes webhook endpoints that accept incoming events from WooCommerce and Shopify, forwarding them into your SmartPyme account as sales and inventory updates. You register these URLs inside each external platform, and SmartPyme handles everything from there — no manual imports required.

Available Webhook Endpoints

EndpointMethodSourceDescription
/api/webhook/woocommerce/{token}POSTWooCommerceProcess an incoming order as a SmartPyme sale
/api/webhook/woocommerce/{token}/productoPOSTWooCommerceUpdate a product from WooCommerce
/api/webhook/shopify/{token}POSTShopifyProcess a Shopify order as a SmartPyme sale
All endpoints are hosted at the base URL https://api.smartpyme.site.

Finding Your Webhook Token

Each SmartPyme user has a unique token that authenticates incoming webhook calls. To locate yours:
  1. Go to Settings → Users and open your user profile.
  2. Click the Integrations tab.
  3. Copy the token displayed — you will paste it into the webhook URL when configuring the external platform.

Security

The {token} segment in each webhook URL acts as a per-user secret that authorizes requests to your SmartPyme account. Treat it like a password:
  • Do not share your token in public repositories, documentation, or client-side code.
  • Do not expose it in screenshots or support tickets.
  • If you believe your token has been compromised, contact your SmartPyme administrator immediately to rotate your credentials.

Payload Handling

When SmartPyme receives a valid webhook event, it automatically:
  • Creates a new sale from the order data, including customer details, line items, totals, and payment method.
  • Deducts inventory for each product sold, keeping your stock levels accurate.
  • Links the external order ID to the SmartPyme sale record so you can trace any transaction back to its source.
No additional configuration is required — SmartPyme parses the standard WooCommerce and Shopify payload formats out of the box.

Testing Webhooks

Before going live, verify that your webhook endpoint is working correctly by sending a sample payload.
curl -X POST https://api.smartpyme.site/api/webhook/woocommerce/{your_token} \
  -H "Content-Type: application/json" \
  -d '{
    "id": 9999,
    "status": "processing",
    "billing": {
      "first_name": "Jane",
      "last_name": "Doe",
      "email": "jane@example.com"
    },
    "line_items": [
      {
        "product_id": 42,
        "name": "Sample Product",
        "quantity": 1,
        "total": "19.99"
      }
    ],
    "total": "19.99",
    "payment_method": "stripe"
  }'
After sending the request, open SmartPyme and confirm that a new sale record was created with the correct details.
For WooCommerce, you can trigger a webhook replay without placing a real order. Go to WooCommerce Admin → Settings → Webhooks, select the webhook you want to test, and click Deliver. This resends the most recent event to your SmartPyme endpoint.