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.

ParameterTypeDescription
$payloadarrayThe shipment in Sendify’s API format
$orderWC_OrderThe 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.

ParameterTypeDescription
$reasonstring'' means the order can be booked
$orderWC_OrderThe 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.

ParameterTypeDescription
$neededboolWhether customs documents are needed
$orderWC_OrderThe 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.

ParameterTypeDescription
$orderWC_OrderThe 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.

ParameterTypeDescription
$orderWC_OrderThe order
$entryarrayThe 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.

ParameterTypeDescription
$orderWC_OrderThe order
$levelintThe 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.

ParameterTypeDescription
$urlstringThe link
$orderWC_OrderThe order
$carrierstringThe 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.

ParameterTypeDescription
$orderWC_Order|nullThe order, if already found
$numberstringThe order number the customer typed

north_shipping_manager_tracking_tips (filter, Premium)

Changes the product tips on the tracking page.

ParameterTypeDescription
$tipsWC_Product[]The products shown
$orderWC_OrderThe order

Admin

north_shipping_manager_shipment_actions (filter)

Adds buttons to an order’s row on the Shipments page.

ParameterTypeDescription
$actionsarrayEach action: label, url
$orderWC_OrderThe 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.

ParameterTypeDescription
$fixarray|nullchip (status text), label (button text), url, icon
$orderWC_OrderThe 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-Signature header (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.