n8n flows
Create PO on ShipHero
Takes a submitted purchase-order form and creates the matching purchase order directly in ShipHero.
This flow backs the front-end "create purchase order" form. It validates the submission, builds the line items, and creates the real purchase order in ShipHero, then returns a success or failure status to the caller.
At a glance
- Status: Active
- Trigger: Webhook (
POST /webhook/weweb-form-create-purchase-order), answered by a Respond-to-Webhook node. - Runs on: The WeWeb front-end form submission.
- Talks to: ShipHero (GraphQL API); the WeWeb front-end (webhook source).
How it works
- The webhook receives the form: SKUs, quantities, prices, weights, vendor names, PO name, vendor and warehouse IDs, estimated arrival, tracking number, and a ShipHero vendor access token in the body.
Format Querynormalizes the arrays, builds PO line items (skipping blanks, computing subtotal and total), validates the required fields, and assembles apurchase_order_createGraphQL mutation.Create ShipHero POposts the mutation tohttps://public-api.shiphero.com/graphql/, authenticating with the per-request Bearer token from the body.Ifchecks whetherdata.purchase_order_create.purchase_order.idcame back, then routes to the success or failure Respond node returning aPO_creation_status.
Notes
- The ShipHero token is passed in the request body per call rather than stored as an n8n credential.
- The GraphQL call uses
continueErrorOutput, so a ShipHero error still routes cleanly to the failure response. - Shared
error-handlerset as the error workflow.