O2M Logo
One to Many
API and webhooks
Was this page helpful?

API and webhooks

Connect your own systems to O2M stock and orders.

Please reach out to your account manager to enable the public API and webhooks for your company.

Overview

The public API lets your other systems read and change O2M stock and orders with keys you control. Webhooks tell your systems the moment something happens.

Why use it

  • Connect an ERP, your own website or a 3PL client.
  • Get stock and order updates pushed to you.
  • See every request in the API logs.

Before you begin

  • The public API add-on is enabled.

What you can do

Good to know  The public API is an add-on. Once your O2M account manager enables it, Settings → API and Webhooks appears for admins.

With the public API add-on, your other systems (an ERP, your own website, a 3PL client) can read stock and orders and create orders, goods receipts and adjustments. Only people with the API permission (Admins by default) see this area: Settings → API and Webhooks.

API keys

Figure 21.1  Settings → API and Webhooks → API keys.
  1. 1Click Create key and give it a name.
  2. 2Choose its permissions (never more than your own), and optionally limit it to some warehouses, set an expiry, or tie it to a 3PL client.
  3. 3Copy the access key and secret key. Both are sent with every request.
  • A key can be shown again, revoked, and once revoked, deleted.

Important  Treat the secret key like a password. Revoke a key at once if it may have been shared.

API logs

Figure 21.2  Settings → API and Webhooks → API logs.

Every request is counted per key and month and shown on API logs, so your developers can see what was called and what came back.

Webhooks

Figure 21.3  Settings → API and Webhooks → Webhooks.

Register an https address to be told when something happens:

EventSent when
Stock changedAn item's available stock changes
New orderAn order is created
Order status changedAn order moves to a new status
Shipment dispatchedA parcel is handed over on a manifest
Goods receivedA goods receipt is received
  • Every message is signed so your system can check it came from O2M.
  • A failed delivery is tried again automatically, and can be sent again by hand.
  • An address that keeps failing is switched off, with an alert.

Good to know  Your developers can ask O2M support for the Public API guide, which describes every request with examples.