curl --request GET \
--url https://api.apostra.com/api/v2/storefront/media-buys \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.apostra.com/api/v2/storefront/media-buys"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.apostra.com/api/v2/storefront/media-buys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"items": [
{
"mediaBuyId": "<string>",
"kind": "routed",
"buyer": {
"customerId": 0,
"name": "<string>"
},
"advertiser": {
"name": "<string>"
},
"operator": {
"name": "<string>"
},
"commercial": {
"budget": 1,
"currency": "<string>",
"denomination": "net_media",
"cpm": 1
},
"delivery": {
"impressions": 1,
"spend": 1,
"clicks": 4503599627370495,
"views": 4503599627370495,
"completedViews": 4503599627370495,
"conversions": 4503599627370495,
"leads": 4503599627370495,
"pacingAgainstBookedBudget": 1,
"pace": {
"flightElapsed": 123,
"measuredFraction": 123,
"expectedSpend": 123,
"actualSpend": 123,
"ratio": 123,
"spendPerDay": 123,
"budgetPerDay": 123,
"currency": "<string>",
"verdict": "on_pace",
"verdictWithheld": "no_budget"
},
"sourcesReported": 4503599627370495,
"sourcesRouted": 4503599627370495,
"lastDeliveryDate": "<string>"
},
"adServerDelivery": {
"impressions": 1,
"spend": 1,
"clicks": 4503599627370495,
"views": 4503599627370495,
"completedViews": 4503599627370495,
"conversions": 4503599627370495,
"leads": 4503599627370495,
"pacingAgainstBookedBudget": 1,
"pace": {
"flightElapsed": 123,
"measuredFraction": 123,
"expectedSpend": 123,
"actualSpend": 123,
"ratio": 123,
"spendPerDay": 123,
"budgetPerDay": 123,
"currency": "<string>",
"verdict": "on_pace",
"verdictWithheld": "no_budget"
}
},
"attention": {
"tier": "money_at_risk",
"moneyAtRisk": 123,
"shareAtRisk": 123,
"flags": [
{
"family": "task",
"level": "critical",
"label": "<string>"
}
]
},
"goal": {
"goal": {
"kind": "metric",
"subject": "<string>",
"eventTypes": [
"<string>"
],
"target": {
"kind": "cost_per",
"value": 123
}
},
"askedTarget": {
"kind": "cost_per",
"value": 123
},
"answeredTarget": {
"kind": "cost_per",
"value": 123
},
"commitment": "guaranteed",
"commitmentSource": "proposal",
"actual": {
"kind": "cost_per",
"value": 123,
"unit": "impressions",
"units": 1,
"denominatorUnits": 1,
"perUnits": 1,
"currency": "<string>"
},
"verdict": "on_track",
"judgedAgainst": "asked",
"verdictWithheld": "no_goal",
"basis": {
"kind": "seller_attested"
},
"freshness": {
"dataThrough": "<string>",
"reportingPeriodEnd": "<string>",
"nextExpectedAt": "<string>",
"notificationType": "<string>",
"sequenceNumber": 123,
"awaitingLaterReport": true,
"missingMetrics": [
"<string>"
]
},
"optimizedBy": {
"actor": "ad_server",
"detail": "<string>"
}
},
"reporting": {
"state": "reported",
"detail": null
},
"creative": {
"state": "pending",
"attachedCount": 4503599627370495,
"failureReason": "format_translation_failed"
},
"openWork": {
"count": 4503599627370495,
"actionableCount": 4503599627370495,
"blockedCount": 4503599627370495,
"sourceIds": [
"<string>"
],
"workItemIds": [
"<string>"
]
},
"nextAction": {
"owner": "seller",
"label": "<string>"
},
"status": "pending_approval",
"sourceStatus": "<string>",
"settlementMethod": "interchange",
"pendingReason": "forward_failed_needs_correction",
"pendingSince": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"forwardOutcome": "not_forwarded",
"flightStart": "<string>",
"flightEnd": "<string>",
"sourceCount": 4503599627370495,
"esaId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"forwardedAt": "2023-11-07T05:31:56Z"
}
],
"total": 4503599627370495,
"warnings": [
"<string>"
],
"attentionRanked": true,
"statusFreshness": {
"lastConfirmedAt": "2023-11-07T05:31:56Z",
"hoursSinceConfirmed": 4503599627370495,
"message": "<string>"
},
"delivery": {
"impressions": 1,
"spend": 1,
"pacingAgainstBookedBudget": 1,
"lastDeliveryDate": "<string>"
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}List every media buy on the storefront
The union of routed buys (approval queue + per-source forwarding routes) and ESA-managed buys, with status filters. Default sort is urgency: buys still waiting on someone whose flight starts within 48 hours come first. Each row carries the shared pendingReason vocabulary (the same enum buyers see), the latest structured error code, and the forward outcome.
curl --request GET \
--url https://api.apostra.com/api/v2/storefront/media-buys \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.apostra.com/api/v2/storefront/media-buys"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.apostra.com/api/v2/storefront/media-buys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"items": [
{
"mediaBuyId": "<string>",
"kind": "routed",
"buyer": {
"customerId": 0,
"name": "<string>"
},
"advertiser": {
"name": "<string>"
},
"operator": {
"name": "<string>"
},
"commercial": {
"budget": 1,
"currency": "<string>",
"denomination": "net_media",
"cpm": 1
},
"delivery": {
"impressions": 1,
"spend": 1,
"clicks": 4503599627370495,
"views": 4503599627370495,
"completedViews": 4503599627370495,
"conversions": 4503599627370495,
"leads": 4503599627370495,
"pacingAgainstBookedBudget": 1,
"pace": {
"flightElapsed": 123,
"measuredFraction": 123,
"expectedSpend": 123,
"actualSpend": 123,
"ratio": 123,
"spendPerDay": 123,
"budgetPerDay": 123,
"currency": "<string>",
"verdict": "on_pace",
"verdictWithheld": "no_budget"
},
"sourcesReported": 4503599627370495,
"sourcesRouted": 4503599627370495,
"lastDeliveryDate": "<string>"
},
"adServerDelivery": {
"impressions": 1,
"spend": 1,
"clicks": 4503599627370495,
"views": 4503599627370495,
"completedViews": 4503599627370495,
"conversions": 4503599627370495,
"leads": 4503599627370495,
"pacingAgainstBookedBudget": 1,
"pace": {
"flightElapsed": 123,
"measuredFraction": 123,
"expectedSpend": 123,
"actualSpend": 123,
"ratio": 123,
"spendPerDay": 123,
"budgetPerDay": 123,
"currency": "<string>",
"verdict": "on_pace",
"verdictWithheld": "no_budget"
}
},
"attention": {
"tier": "money_at_risk",
"moneyAtRisk": 123,
"shareAtRisk": 123,
"flags": [
{
"family": "task",
"level": "critical",
"label": "<string>"
}
]
},
"goal": {
"goal": {
"kind": "metric",
"subject": "<string>",
"eventTypes": [
"<string>"
],
"target": {
"kind": "cost_per",
"value": 123
}
},
"askedTarget": {
"kind": "cost_per",
"value": 123
},
"answeredTarget": {
"kind": "cost_per",
"value": 123
},
"commitment": "guaranteed",
"commitmentSource": "proposal",
"actual": {
"kind": "cost_per",
"value": 123,
"unit": "impressions",
"units": 1,
"denominatorUnits": 1,
"perUnits": 1,
"currency": "<string>"
},
"verdict": "on_track",
"judgedAgainst": "asked",
"verdictWithheld": "no_goal",
"basis": {
"kind": "seller_attested"
},
"freshness": {
"dataThrough": "<string>",
"reportingPeriodEnd": "<string>",
"nextExpectedAt": "<string>",
"notificationType": "<string>",
"sequenceNumber": 123,
"awaitingLaterReport": true,
"missingMetrics": [
"<string>"
]
},
"optimizedBy": {
"actor": "ad_server",
"detail": "<string>"
}
},
"reporting": {
"state": "reported",
"detail": null
},
"creative": {
"state": "pending",
"attachedCount": 4503599627370495,
"failureReason": "format_translation_failed"
},
"openWork": {
"count": 4503599627370495,
"actionableCount": 4503599627370495,
"blockedCount": 4503599627370495,
"sourceIds": [
"<string>"
],
"workItemIds": [
"<string>"
]
},
"nextAction": {
"owner": "seller",
"label": "<string>"
},
"status": "pending_approval",
"sourceStatus": "<string>",
"settlementMethod": "interchange",
"pendingReason": "forward_failed_needs_correction",
"pendingSince": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"forwardOutcome": "not_forwarded",
"flightStart": "<string>",
"flightEnd": "<string>",
"sourceCount": 4503599627370495,
"esaId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"forwardedAt": "2023-11-07T05:31:56Z"
}
],
"total": 4503599627370495,
"warnings": [
"<string>"
],
"attentionRanked": true,
"statusFreshness": {
"lastConfirmedAt": "2023-11-07T05:31:56Z",
"hoursSinceConfirmed": 4503599627370495,
"message": "<string>"
},
"delivery": {
"impressions": 1,
"spend": 1,
"pacingAgainstBookedBudget": 1,
"lastDeliveryDate": "<string>"
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Authorizations
API key or access token
Query Parameters
Filter to one seller lifecycle state.
pending_approval, forwarding, forward_failed, awaiting_source, rejected, canceled, booked, delivering, paused, completed Filter to one buyer (customer id).
0 < x <= 9007199254740991Filter to one seller-owned account relationship. This is the authoritative transaction boundary for an External advertiser, never a buyer-id heuristic.
^[1-9][0-9]*$Filter to buys with a leg on this inventory source (routed buys) or managed by this ad server source.
1Only buys whose flight starts at/after this instant.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$Only buys whose flight starts at/before this instant.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$Exclude buys that are finished and cannot need anyone: completed, canceled and rejected. The default list is the complete inventory, but a surface asking "what needs me now" wants only live work — and because the list is newest-first, a buy that settled yesterday otherwise outranks an older buy that is still running.
urgency (default) is the stable list order: buys still waiting on someone whose flight starts within 48h first, then by flight start, then newest. attention re-orders THIS PAGE by what needs the seller — money the flight will not deliver, then work waiting on the seller, then a goal being missed. Because that ranking needs delivery and goal verdicts that exist only after the page is hydrated, it ranks a page and never the storefront, so it is REJECTED with skip above 0 rather than quietly served in urgency order. The response echoes attentionRanked.
urgency, attention Page size (max 200).
0 < x <= 200Rows to skip (offset pagination over the sorted list).
0 <= x <= 9007199254740991Response
List every media buy on the storefront
Every buy on the storefront — the union of routed and source-managed buys — urgency-sorted by default.
Show child attributes
Show child attributes
Total rows matching the filters (before pagination).
0 <= x <= 9007199254740991Non-fatal data-source problems (e.g. an upstream source that could not be reached). Empty when every source answered.
True when items was re-ordered by what needs the seller. The ranking covers THIS PAGE only — the tiers depend on delivery and goal verdicts that exist only after hydration — so a page is never evidence of the storefront's worst buys. False on the default urgency order, which is a stable server-side sort over the whole population.
Non-null when this storefront routes buys through an ad-platform connection whose status sync has been failing long enough that displayed statuses may be out of date. Null when statuses are current (or the storefront has no such connection).
Show child attributes
Show child attributes
Relationship delivery rollup. Null means none of the matching buys has a delivery record, never a zero-valued delivery total.
Show child attributes
Show child attributes