amoCRM

amoCRM: label by funnel stage

When a deal reaches the required funnel stage, amoCRM calls the bridge script. It takes the address and contact from the deal, purchases the cheapest label, and records the tracking number in the deal's field and note.

Downloadable files

What you’ll need

Step-by-step instructions

  1. Download amocrm-bridge.php and shippickup.php and upload both files to the same folder on your server.
  2. In the ShipPickup dashboard, create a live API key with rates:read and labels:create permissions. Set the environment variables on the server from the top of the file: SHIPPICKUP_API_KEY, SHIPPICKUP_FROM (sender address JSON), SHIPPICKUP_PARCEL (default parcel JSON), BRIDGE_SECRET (a long random string).
  3. In amoCRM, create a private integration and copy the long-term token into AMO_TOKEN, and the account domain (e.g., mycompany.amocrm.ru) into AMO_DOMAIN.
  4. Add fields to deals: street, city, state, postal code, country (two-letter code), weight in grams (optional), and “Tracking”. Record the field IDs in AMO_FIELDS as JSON, example at the top of the file. The deal budget is used as the declared value in dollars.
  5. In the funnel settings at the required stage (e.g., “Ready to Ship”), add a “Webhook” trigger on stage entry with the URL https://your-server/amocrm-bridge.php?secret=BRIDGE_SECRET_VALUE.
  6. For testing, connect a test key: on purchase, the bridge will write a note with the error test_key_cannot_buy in the deal, indicating the chain works. Then replace the key with a live one.

Important to know

Files contain no keys or passwords: all secrets are set by you in environment settings. Do not publish files with your values.

← All ready-made solutions · Common Scenarios