Zapier: Code by Zapier
In Zapier, the easiest way to connect ShipPickup is with the Code by Zapier step: ready code calculates the rate, buys the cheapest label, and returns tracking to the next steps.
Downloadable files
- zapier-code-step.js Code for Code by Zapier step
What you’ll need
- Zapier account with a Code by Zapier (JavaScript) step.
- 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
- Create a Zap: trigger (new order in your system or Webhooks by Zapier, Catch Hook).
- Add a 'Code by Zapier' step, 'Run JavaScript'. Paste the contents of
zapier-code-step.jsinto the Code field. - In 'Input Data', add fields from the file header and link them to the trigger data. Insert the live key into
api_key: it is stored in the step settings, not in the code. - Test the step. The output will include
tracking_number,order_id,price,carrier, andstatus. - Use the next steps to record tracking in your system, send an email or message.
Important to know
- The idempotency key is built from
order_id: rerunning for the same order will not purchase a second label.
Files contain no keys or passwords: all secrets are set by you in environment settings. Do not publish files with your values.