North Shipping Manager hooks
These hooks let you change what North Shipping Manager sends to Sendify, react when a shipment changes, and add your own steps and actions. They are available in the free plugin, unless the table says otherwise.
Shipments
north_shipping_manager_shipment_payload (filter)
Changes the shipment before it is sent to Sendify as a draft. Runs every time a shipment is created or updated from an order.
| Parameter | Type | Description |
|---|---|---|
$payload | array | The shipment in Sendify’s API format |
$order | WC_Order | The order |
Return the changed payload. Keep the structure Sendify expects; the plugin validates the result before sending it.
// Print your own purchase order number as the receiver's reference on the label.
add_filter( 'north_shipping_manager_shipment_payload', function ( array $payload, WC_Order $order ) {
$po = (string) $order->get_meta( '_purchase_order_number' );
if ( '' !== $po ) {
$payload['receiver_reference'] = mb_substr( 'PO ' . $po, 0, 35 );
}
return $payload;
}, 10, 2 );
Labels have room for about 35 characters per reference.
north_shipping_manager_booking_blocked_reason (filter)
Stops booking until something is done. Return a non-empty reason to block; it is shown to the shop on the order.
| Parameter | Type | Description |
|---|---|---|
$reason | string | '' means the order can be booked |
$order | WC_Order | The order |
// Do not book orders that are still awaiting payment approval.
add_filter( 'north_shipping_manager_booking_blocked_reason', function ( string $reason, WC_Order $order ) {
if ( '' === $reason && 'yes' === $order->get_meta( '_awaiting_approval' ) ) {
return __( 'The payment has not been approved yet.', 'my-plugin' );
}
return $reason;
}, 10, 2 );
north_shipping_manager_customs_needed (filter)
Decides whether an order needs customs documents. By default this is true for destinations outside the EU customs territory.
| Parameter | Type | Description |
|---|---|---|
$needed | bool | Whether customs documents are needed |
$order | WC_Order | The order |
north_shipping_manager_shipment_updated (action)
Fires after the shipment status or tracking for an order has been stored, from polling or from a webhook.
| Parameter | Type | Description |
|---|---|---|
$order | WC_Order | The order |
north_shipping_manager_shipment_resent (action)
Fires when an order’s shipment is set aside and a new shipment starts (”Send again”). Use it to reset anything you track per shipment.
| Parameter | Type | Description |
|---|---|---|
$order | WC_Order | The order |
$entry | array | The archived shipment |
Customer communication
north_shipping_manager_customer_step (action)
Fires once per step when an order reaches a new stage for the customer: 1 booked, 2 picked up, 3 delivered. Use it to send your own notifications.
| Parameter | Type | Description |
|---|---|---|
$order | WC_Order | The order |
$level | int | The step |
add_action( 'north_shipping_manager_customer_step', function ( WC_Order $order, int $level ) {
if ( 3 === $level ) {
// The parcel has been delivered.
}
}, 10, 2 );
north_shipping_manager_tracking_url (filter)
Changes the tracking link in customer emails and SMS. By default it is the carrier’s own tracking page, or the order page in the customer’s account. Return '' to hide the button.
| Parameter | Type | Description |
|---|---|---|
$url | string | The link |
$order | WC_Order | The order |
$carrier | string | The carrier code, for example postnord |
The plugin never links to Sendify’s own tracking page. Please do not link to it from this filter either.
north_shipping_manager_tracking_find_order (filter, Premium)
Finds an order on the tracking page when your shop uses custom order numbers. Return the order, or null to let the plugin search.
| Parameter | Type | Description |
|---|---|---|
$order | WC_Order|null | The order, if already found |
$number | string | The order number the customer typed |
north_shipping_manager_tracking_tips (filter, Premium)
Changes the product tips on the tracking page.
| Parameter | Type | Description |
|---|---|---|
$tips | WC_Product[] | The products shown |
$order | WC_Order | The order |
Admin
north_shipping_manager_shipment_actions (filter)
Adds buttons to an order’s row on the Shipments page.
| Parameter | Type | Description |
|---|---|---|
$actions | array | Each action: label, url |
$order | WC_Order | The order |
north_shipping_manager_order_fix (filter)
Shows what must be done on an order before it can be booked, as a status chip and a button in the order list.
| Parameter | Type | Description |
|---|---|---|
$fix | array|null | chip (status text), label (button text), url, icon |
$order | WC_Order | The order |
Sendify webhooks
Sendify can push tracking events to the shop instead of the plugin polling for them.
- Endpoint:
POST https://your-shop.example/wp-json/north-shipping-manager/v1/webhook - Turn on: under Settings → General → Advanced, tick Receive webhooks from Sendify and paste the secret you created for the endpoint in Sendify (Settings → API).
- Security: every request must carry the
Sendify-Signatureheader (HMAC-SHA256 of the timestamp and the raw body). Requests without a valid signature, or older than five minutes, are rejected. Duplicate events are ignored. - Effect: events update the shipment and fire
north_shipping_manager_shipment_updated. Webhooks never change the order status and never send emails by themselves.
When webhooks are switched off, the endpoint returns 404. When no secret is set, it returns 503.
