National Commerce Docs
n8n flows

Log Into ShipHero → Auth Cookies

Performs a full browser-style login to the ShipHero web app for a brand and returns the authenticated session cookies.

Logs into the ShipHero web app for a given brand and hands back the authenticated session cookies. Other scenarios use those cookies to call ShipHero's internal dashboard endpoints that require a logged-in session rather than an API token.

At a glance

  • Status: Active, but the webhook has been disconnected from the rest of the flow since Oct 12, 2026. It answers {"message":"Workflow was started"} right away and returns no cookies. Only the manual trigger runs the login.
  • Trigger: POST webhook (/webhook/21593503-b13d-4fbb-a61c-d7b550598c48); also a manual trigger. The webhook uses Header Auth with the ShipHero Cookies Webhook Secret credential, so a call without the matching x-webhook-secret header gets 403.
  • Runs on: Called on demand by SKU flows that need a live ShipHero dashboard session. The SKU Information Handler and Pull Brand SKUs send the secret through the same credential. The portal's SKU sync calls the URL in N8N_SHIPHERO_COOKIES_WEBHOOK_URL without the secret, so its case check gets 403 and finds no case components.
  • Talks to: ShipHero (web login flow); Supabase (credential-lookup RPC).

How it works

  1. The flow enters via webhook (body.brand_id) or the manual trigger, which defaults brand_id to 1; both funnel through a "Pick One Input" node, which stops the run unless brand_id is a positive integer.
  2. Get Brand Shiphero Credentials calls the Supabase RPC get_shiphero_credentials for the brand's username and password.
  3. It walks ShipHero's multi-step login redirect chain with redirects disabled and the full response captured: Open First Page, Auth Scopes, Login ID, extract the hidden state value via regex, Verify, Password, Submit, Resume Auth, Do Login.
  4. After each hop, Cookie Array code nodes merge set-cookie headers into a running cookie jar, and If nodes gate each step on the expected HTTP status.
  5. The final merged cookie string is returned via Send Access Cookies Back.

Notes

  • Brittle by design. Each step asserts an exact redirect status, so any change to ShipHero's login flow breaks the chain.
  • Retry-on-fail is set on the credential fetch and the response node.
  • The response is a logged-in ShipHero session for any brand. Keep the Header Auth secret private. To rotate it, change the value in the ShipHero Cookies Webhook Secret credential. Both n8n callers read the same credential, so nothing else needs to change.
  • Reconnecting the webhook brings back cookies for the n8n callers only. The portal would also need to send the x-webhook-secret header before its case check works again.

On this page