Skip to main content
GET
/
media-buys
List every media buy on the storefront
curl --request GET \
  --url https://api.interchange.io/api/v2/storefront/media-buys \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.interchange.io/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.interchange.io/api/v2/storefront/media-buys', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "items": [
    {
      "mediaBuyId": "<string>",
      "buyer": {
        "customerId": 0,
        "name": "<string>"
      },
      "sourceStatus": "<string>",
      "pendingSince": "2023-11-07T05:31:56Z",
      "errorCode": "<string>",
      "flightStart": "<string>",
      "flightEnd": "<string>",
      "sourceCount": 4503599627370495,
      "esaId": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "forwardedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "total": 4503599627370495,
  "warnings": [
    "<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

Authorization
string
header
required

API key or access token

Query Parameters

status
enum<string>

Filter to one seller lifecycle state.

Available options:
pending_approval,
forwarding,
forward_failed,
awaiting_source,
rejected,
canceled,
booked,
delivering,
paused,
completed
buyerCustomerId
integer

Filter to one buyer (customer id).

Required range: 1 <= x <= 9007199254740991
sourceId
string

Filter to buys with a leg on this inventory source (routed buys) or managed by this ad server source.

Minimum string length: 1
flightStartFrom
string<date-time>

Only buys whose flight starts at/after this instant.

Pattern: ^(?:(?:\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))$
flightStartTo
string<date-time>

Only buys whose flight starts at/before this instant.

Pattern: ^(?:(?:\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))$
take
integer
default:50

Page size (max 200).

Required range: 1 <= x <= 200
skip
integer
default:0

Rows to skip (offset pagination over the sorted list).

Required range: 0 <= x <= 9007199254740991

Response

List every media buy on the storefront

Every buy on the storefront — the union of routed and source-managed buys — urgency-sorted by default.

items
object[]
required
total
integer
required

Total rows matching the filters (before pagination).

Required range: 0 <= x <= 9007199254740991
warnings
string[]
required

Non-fatal data-source problems (e.g. an upstream source that could not be reached). Empty when every source answered.