RetailCRM: label from trigger
The RetailCRM trigger calls a bridge script with the order number. The bridge fetches order data, buys the cheapest label, and records the tracking in a custom field and manager's comment.
Downloadable files
- retailcrm-bridge.php RetailCRM bridge: trigger with HTTP request
- shippickup.php API client in PHP, single file, no dependencies
What you’ll need
- A server with PHP 7.4+ and HTTPS, RetailCRM API key with read and write permissions for orders.
- A ShipPickup account and a live API key (
sk_live_…) with the permissions specified in the instructions. The key is created in the dashboard under “API” and stored in your system settings or environment variable.
Step-by-step instructions
- Download
retailcrm-bridge.phpandshippickup.php, upload them to the same folder on your server. - In the ShipPickup dashboard, create a live API key (
rates:read,labels:create). Set environment variables from the top of the file:SHIPPICKUP_API_KEY,SHIPPICKUP_FROM,SHIPPICKUP_PARCEL,BRIDGE_SECRET,RETAILCRM_URL,RETAILCRM_API_KEY. - Create a text custom field for tracking in the order with the code
shippickup_tracking(use a different code inRETAILCRM_TRACK_FIELDif needed). - In RetailCRM, go to “Administration”, “Triggers” and create a status change trigger with an “HTTP request” action: POST method, URL
https://your-server/retailcrm-bridge.php?secret=BRIDGE_SECRET_VALUE, JSON body with the order number{"order_id": ...}, replacing dots with the order number variable from the trigger editor. - Fill in the delivery address in the order (country as ISO code, postal code, region, city, street) and order weight in grams.
Important to know
- Repeating for the same order is safe: the idempotency key is built from the order number, and if the tracking field is filled, the bridge does nothing.
Files contain no keys or passwords: all secrets are set by you in environment settings. Do not publish files with your values.