Browse all articles

Purchasing webhooks

Last updated

A webhook lets ChannelDock call an address of your own system when something happens. With the Purchasing add-on on, you can choose five purchasing events, for example to tell your ERP that a purchase order was placed or that the supplier confirmed it. Purchasing webhooks use the same webhook settings as the rest of ChannelDock.

The events

Event When it is sent
purchase_order.placed A purchase order is placed.
purchase_order.proposed A new proposed order appeared after the nightly run or a replan.
purchase_order.confirmed The supplier confirmed quantities or dates on a placed order. Sent again when they change.
purchase_order.received The inbound delivery of the order is stocked.
purchase_advice.changed The nightly run changed the advice: a summary and the 25 biggest changes.

Steps

  1. Open the webhook settings. Go to Settings > API & webhooks, or click Manage webhooks on Purchasing > Settings > Integrations.
  2. Add a webhook. Give it a name, the address (URL) of your system and choose one of the purchasing events. Only events from the list can be saved. Add a secret so every call is signed.
  3. Save. The webhook now shows on the Integrations page in the Webhooks card.

The Integrations page

  1. Test it. On Purchasing > Settings > Integrations, click Send test next to the webhook. The Last delivery column shows the HTTP status your system answered.

What you see on the Integrations page

  • Events: the list of the five purchasing events.
  • Per webhook: Name and address, Event, Status (Active or Inactive, Not signed when there is no secret, and the number of failed attempts) and Last delivery, in your time zone.
  • With no purchasing webhooks yet, the card says No purchasing webhooks yet.

Delivery and security

  • Each call is signed with your secret: the header X-Channeldock-Signature holds sha256= and the HMAC-SHA256 of the raw body. Check it against the raw body as received.
  • When your system does not answer, ChannelDock tries again up to 5 times, after 2, 4, 8 and 16 minutes.
  • A webhook is switched off after 10 failed deliveries in a row. The Integrations page then shows it as Inactive.
  • Only events that happen after you created the webhook are sent, so you do not get a flood of history.
  • Each event is sent once per state change of an order.
  • Addresses inside private networks are blocked.

Good to know

  • The proposed, confirmed, received and advice events are picked up every 5 minutes, so they can arrive a few minutes after the change. The placed event is sent right after placing.
  • The purchasing events are only offered to accounts with the add-on on.
  • Send test needs the Purchasing settings right and is limited to 20 tests per hour.
  • The webhook log under Settings > API & webhooks shows every attempt and answer.

Related articles


Was this helpful?

Related articles