Webhooks¶
Webhooks let your systems react when your data changes: send an email when an order is placed, update a search index when a product changes, sync stock to a marketplace. ObjectsGrid calls your HTTPS endpoint with an event each time an object is created, updated, patched or deleted.
Events¶
Every event names the type and the change: ProductCreated, ProductUpdated (a PUT), ProductPatched (a PATCH) and ProductDeleted. Events exist for these types:
AppConfiguration, Brand, Cart, Course, Demand, EmployeeRole, Enum, Event, FeatureFlag, GenericObject, Inventory, Invoice, JSONObject, MemberProgram, MemberProgramTier, MerchantReturnPolicy, Offer, OfferCatalog, Order, Organization, PayAction, Permit, Place, ProgramMembership, Product, ProductGroup, ProductModel, Rating, Reservation, ReturnAction, Review, Service, ServiceChannel, ShippingService, and the webhook configuration itself.
The complete list is the WebhooksEventsEnumeration. Log events have no webhook events.
Two events are about your spending cap rather than an object:
| Event | Sent when |
|---|---|
MonthlyQuotaApproaching |
Your billable requests this month pass 80, 85, 90 or 95% of monthlyQuota |
MonthlyQuotaReached |
They reach 100%: requests now get 429 until the cap is raised or the month ends |
Each step is sent once a month; raising the cap re-arms the steps above your usage. Their data is a
MonthlyQuotaNotice:
{
"organizationAccountID": "org-123-4567",
"month": "2026-11",
"percentUsed": 90,
"usage": 90000,
"cap": 100000
}
Use these events to alert your team or raise the cap automatically.
Configure your endpoints¶
Your Organization Account has one webhook configuration, with any number of endpoints. Each endpoint lists the events it receives and can be switched off with enabled. Endpoints must use HTTPS.
Create the configuration once:
curl -X POST https://apis.objectsgrid.com/webhooks \
-H 'Content-Type: application/json' \
-H 'X-ObjectsGrid-AccessPoint: EU' \
-H "Authorization: Bearer $TOKEN" \
-d '{
"webhooksEndpointConfig": [
{
"endpoint": "https://hooks.example.com/objectsgrid/orders",
"events": ["OrderCreated", "OrderPatched"],
"enabled": true
},
{
"endpoint": "https://search.example.com/objectsgrid",
"events": ["ProductCreated", "ProductUpdated", "ProductPatched", "ProductDeleted"],
"enabled": true
}
]
}'
Then read and change it at /webhooks/webhooks-config, with GET, PUT or PATCH.
Deliveries follow your access policy
Each delivery is filtered with the permissions of the account that last changed the webhook configuration: an endpoint only receives events of objects that account may read, without the fields hidden from it. Configure webhooks with an account that may see what your endpoints need.
The delivery¶
ObjectsGrid sends each event as an HTTP POST to the endpoint, in CloudEvents 1.0 structured JSON:
POST /objectsgrid/orders HTTP/1.1
Host: hooks.example.com
Content-Type: application/cloudevents+json
Authorization: Bearer <signed JWT>
X-ObjectsGrid-CorrelationID: 4bf92f3577b34da6a3ce929d0e0e4736
{
"specversion": "1.0",
"id": "6d2f3c1e-8a9b-4c0d-9e1f-2a3b4c5d6e7f",
"source": "https://apis.objectsgrid.com/orders",
"type": "OrderCreated",
"datacontenttype": "application/json",
"time": "2026-11-13T09:30:00Z",
"orgacctid": "org-123-4567",
"objecttype": "Order",
"objectversion": "1763026200518312",
"operationname": "CreateOrder",
"correlationid": "4bf92f3577b34da6a3ce929d0e0e4736",
"data": {
"id": "8c7b6a59-4d3e-4f2a-9b1c-0d9e8f7a6b5c",
"orderNumber": "2026-000123",
"orderStatus": "https://schema.org/OrderProcessing"
}
}
datais the object as stored after the change; for a delete, the deleted object.idis unique per event and the same on every redelivery.objectversiongrows with every change of the object.
Every attribute is described in the CloudEvent schema of the Webhooks contract. More attributes may be added; ignore the ones you don't know.
Verify the signature¶
Anyone can send a request to your endpoint, so check that it comes from ObjectsGrid. Each delivery carries a JWT in Authorization: Bearer, signed with RS256. Verify:
- The signature, with the public key from the webhook JWKS whose
kidmatches the JWT header. issishttps://objectsgrid.com. This is not the token issuer of the APIs,https://apis.objectsgrid.com.audis your Organization Account id.exphasn't passed. Tokens expire five minutes after they are issued.
For example in Node.js with Express and jose:
import express from "express";
import { createRemoteJWKSet, jwtVerify } from "jose";
const JWKS = createRemoteJWKSet(
new URL("https://objectsgrid.com/.well-known/objects-catalog/Webhook/jwks.json"),
);
const ORGANIZATION_ACCOUNT_ID = "org-123-4567";
const app = express();
app.use(express.json({ type: ["application/json", "application/cloudevents+json"] }));
app.post("/objectsgrid/orders", async (req, res) => {
const token = (req.headers.authorization || "").replace(/^Bearer /, "");
try {
await jwtVerify(token, JWKS, {
issuer: "https://objectsgrid.com",
audience: ORGANIZATION_ACCOUNT_ID,
algorithms: ["RS256"],
});
} catch {
return res.sendStatus(401);
}
const event = req.body;
res.sendStatus(204); // answer first, then process
await handleEvent(event); // deduplicate by event.id
});
app.listen(8080);
Retries and duplicates¶
- Answer with a
2xxstatus as soon as you have the event, and do the work afterwards. Any other answer, or no answer, counts as a failed delivery, which is retried later. - Delivery is at least once: the same event can arrive more than once. Use the event
idto process it only once. - Events may arrive out of order. To keep only the newest state of an object, compare
objectversion, as a number, with the last version you processed and ignore older ones.