Get media buy
curl --request GET \
--url https://api.interchange.io/api/v2/buyer/media-buys/{mediaBuyId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.interchange.io/api/v2/buyer/media-buys/{mediaBuyId}"
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/buyer/media-buys/{mediaBuyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"mediaBuy": {
"mediaBuyId": "mb_ETBn4gJ9Wu",
"name": "<string>",
"status": "PENDING_APPROVAL",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"campaignId": "cmp_ETBn4gJ9Wu",
"pendingAt": "storefront",
"pendingChange": {
"status": "PENDING_APPROVAL",
"differences": {
"endTime": {
"live": "<string>",
"proposed": "<string>"
},
"budget": {
"live": 123,
"proposed": 123
},
"creatives": {
"live": [
"<string>"
],
"proposed": [
"<string>"
]
}
},
"pendingAt": "storefront",
"reason": "Extended to 8/11 with W5+W6 gross budget"
},
"pendingReason": "forward_failed_needs_correction",
"pendingSince": "2023-11-07T05:31:56Z",
"errorCode": "product_no_longer_available",
"errorOwner": "buyer_input",
"sourceMessage": "<string>",
"forwardedAt": "2023-11-07T05:31:56Z",
"buyerReference": "sf:42:sf_mb_1783031864469_8pbc8mmr",
"startTime": "<string>",
"endTime": "<string>",
"optimizationGoals": [
{
"kind": "metric",
"metric": "clicks",
"reach_unit": "individuals",
"target_frequency": {},
"view_duration_seconds": 123,
"target": {
"kind": "cost_per",
"value": 123
},
"priority": 123
}
],
"pausedBy": "buyer"
}
}{
"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": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Campaigns
Get media buy
Get a single media buy with its why-visibility fields: pendingReason (why it is not delivering yet and since when), buyer-safe errorCode with ownership, the sanitized source message, forwardedAt, and the buyerReference support handle. One call answers “why is my buy stuck”. Use GET /campaigns/ for packages, products, and delivery.
GET
/
media-buys
/
{mediaBuyId}
Get media buy
curl --request GET \
--url https://api.interchange.io/api/v2/buyer/media-buys/{mediaBuyId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.interchange.io/api/v2/buyer/media-buys/{mediaBuyId}"
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/buyer/media-buys/{mediaBuyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"mediaBuy": {
"mediaBuyId": "mb_ETBn4gJ9Wu",
"name": "<string>",
"status": "PENDING_APPROVAL",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"campaignId": "cmp_ETBn4gJ9Wu",
"pendingAt": "storefront",
"pendingChange": {
"status": "PENDING_APPROVAL",
"differences": {
"endTime": {
"live": "<string>",
"proposed": "<string>"
},
"budget": {
"live": 123,
"proposed": 123
},
"creatives": {
"live": [
"<string>"
],
"proposed": [
"<string>"
]
}
},
"pendingAt": "storefront",
"reason": "Extended to 8/11 with W5+W6 gross budget"
},
"pendingReason": "forward_failed_needs_correction",
"pendingSince": "2023-11-07T05:31:56Z",
"errorCode": "product_no_longer_available",
"errorOwner": "buyer_input",
"sourceMessage": "<string>",
"forwardedAt": "2023-11-07T05:31:56Z",
"buyerReference": "sf:42:sf_mb_1783031864469_8pbc8mmr",
"startTime": "<string>",
"endTime": "<string>",
"optimizationGoals": [
{
"kind": "metric",
"metric": "clicks",
"reach_unit": "individuals",
"target_frequency": {},
"view_duration_seconds": 123,
"target": {
"kind": "cost_per",
"value": 123
},
"priority": 123
}
],
"pausedBy": "buyer"
}
}{
"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": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Authorizations
API key or access token
Path Parameters
Buyer media buy ID
Minimum string length:
1Example:
"mb_ETBn4gJ9Wu"
Response
Get media buy
Response containing a single media buy with why-visibility
A single media buy with its optimization goals and why-visibility annotation (pendingReason, errorCode, forwardedAt, buyerReference). Use get_campaign for packages, products, and delivery.
Show child attributes
Show child attributes