WooCommerce#
The WooCommerce integration uses Karla's public API and WooCommerce's native webhooks. You don't need a plugin — just point WooCommerce's webhook system at Karla and you're done.
What you need#
- A WooCommerce store (WordPress 5.0+ with WooCommerce 3.5+)
- Admin access to your WooCommerce dashboard
- A Karla API key (generate one under Settings → API Keys in your Karla portal)
- Your Karla shop slug
Overview#
Karla ingests orders and tracking updates through a set of HTTP endpoints. WooCommerce can push data to those endpoints natively via webhooks, which means integration is a matter of configuration — no code, no plugin.
You'll configure three webhooks:
- Order created — when a customer completes checkout.
- Order updated — when an order status changes (e.g.
processing→completed). - Order deleted — when an order is cancelled or removed.
Karla receives each event, normalizes the payload, and begins tracking the shipment as soon as a tracking number is attached.
Step 1 — Generate your Karla API key#
- Sign in to the Karla Portal.
- Navigate to Settings → API Keys.
- Click Create API Key, pick the
editorrole, and copy the generated key. - Note your shop slug — it appears at the top of every Karla portal page.
Keep the key and slug handy; you'll paste them into WooCommerce.
Step 2 — Create the webhook endpoint URL#
Karla's order webhook endpoint is:
https://api.gokarla.io/v1/shops/{your-shop-slug}/orders/woocommerce
Replace {your-shop-slug} with your actual slug.
Step 3 — Configure WooCommerce webhooks#
-
In your WordPress admin, go to WooCommerce → Settings → Advanced → Webhooks.
-
Click Add webhook.
-
For each of the three events, create a webhook with these settings:
Field Value Name Karla — Order created(adjust per topic)Status ActiveTopic Order created/Order updated/Order deletedDelivery URL https://api.gokarla.io/v1/shops/{your-shop-slug}/orders/woocommerceSecret Leave empty (Karla authenticates with the header below) API Version WP REST API Integration v3(latest) -
Click Save webhook.
Step 4 — Add the Karla authorization header#
WooCommerce doesn't expose a headers field in the webhook UI by default. Use the
Webhook Tools plugin or a small
snippet in your theme's functions.php:
add_filter(
'woocommerce_webhook_http_args',
function ($http_args, $arg, $id) {
$webhook = wc_get_webhook($id);
if (str_contains($webhook->get_delivery_url(), 'api.gokarla.io')) {
$http_args['headers']['Authorization'] = 'Basic ' . base64_encode(
'{your-shop-slug}:{your-karla-api-key}'
);
}
return $http_args;
},
10,
3
);
Replace {your-shop-slug} and {your-karla-api-key} with your actual values.
This attaches HTTP Basic auth to every request Karla receives.
For production setups we recommend storing credentials in
wp-config.php constants
or a secrets manager, not directly in functions.php.
Step 5 — Verify#
- Place a test order in your WooCommerce store.
- Open the Karla Portal → Orders view — your test order should appear within a few seconds.
- Update the order status in WooCommerce (e.g. mark as completed) and verify Karla reflects the change.
If an order doesn't appear, check WooCommerce → Settings → Advanced → Webhooks → Logs for delivery errors (most commonly a 401 — double-check the authorization header).
Tracking numbers#
When you add a tracking number to an order in WooCommerce (via a plugin such as
Advanced Shipment Tracking or the native meta field), include it in the
order's line-item or order meta and WooCommerce will pass it along on the next
Order updated webhook. Karla reads these standard meta keys:
_tracking_number_tracking_provider(or_tracking_carrier)
For custom setups, you can also push tracking numbers directly to Karla using the shipments endpoint.
Next steps#
- Set up Notify integrations so your customers receive branded shipment updates.
- Connect carrier integrations so Karla can track each shipment in real time.
- Customize your tracking page to match your store's branding.