Tracking Activation
Stream does not send a notification when a DSP connection's status changes. To find out that a pending connection has gone live, read it with View Organization Locations until its status is APPROVED.
When to poll
| DSP | Poll? |
|---|---|
| Uber Eats, Wolt, Slice, ChowNow, Deliveroo, Glovo | No. The connection is APPROVED in the bind response. |
| DoorDash, DoorDash Retail, Grubhub | Yes, until APPROVED. |
| Uber Eats Retail, SkipTheDishes | No. Polling will not activate them. Contact Stream support after bind. |
See Activation by DSP for why.
How to poll
- Poll one location, not the whole org. Pass the location's ID in the
location_idquery parameter. - Back off. Check every minute for the first few minutes, then every 15 to 30 minutes. Activation time depends on the DSP's own review, so there is no fixed upper bound.
- Stop on any status other than
pending.APPROVEDmeans live.needs_reconnectionwill not recover by itself, so stop polling and contact Stream support. - Escalate after 24 hours. If
change_timeshows a connection has beenpendingfor more than 24 hours, contact Stream support.
Example
const ONE_MINUTE = 60_000;
const ESCALATE_AFTER = 24 * 60 * ONE_MINUTE;
async function waitForActivation(orgId: string, locationId: string, dspConnectionId: string) {
let delay = ONE_MINUTE;
while (true) {
const res = await fetch(
`${PARTNER_API}/onboarding/org/${orgId}/locations?location_id=${locationId}`,
{ headers: { Authorization: `Bearer ${accessToken}` } },
);
const { locations } = await res.json();
const dsp = locations[0]?.dsps.find((d) => d._id === dspConnectionId);
if (dsp?.status === 'APPROVED') return 'live';
if (dsp?.status !== 'pending') return 'contact_support'; // e.g. needs_reconnection
if (Date.now() - dsp.change_time > ESCALATE_AFTER) return 'contact_support';
await new Promise((r) => setTimeout(r, delay));
delay = Math.min(delay * 2, 30 * ONE_MINUTE); // back off to every 30 minutes
}
}
In production, persist the connection ID and run this from a scheduled job rather than holding a request open.