Skip to main content

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​

DSPPoll?
Uber Eats, Wolt, Slice, ChowNow, Deliveroo, GlovoNo. The connection is APPROVED in the bind response.
DoorDash, DoorDash Retail, GrubhubYes, until APPROVED.
Uber Eats Retail, SkipTheDishesNo. 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_id query 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. APPROVED means live. needs_reconnection will not recover by itself, so stop polling and contact Stream support.
  • Escalate after 24 hours. If change_time shows a connection has been pending for 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.