Get a campaign's commerce results
curl --request GET \
--url https://api.pineyard.ai/commerce/campaigns/{id}/analytics \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pineyard.ai/commerce/campaigns/{id}/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/commerce/campaigns/{id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"range": "today",
"window": {
"from": "<string>",
"to": "<string>",
"previousFrom": "<string>",
"previousTo": "<string>",
"timezone": "Asia/Kolkata"
},
"orders": 123,
"revenue": [
{
"currency": "<string>",
"amount": "<string>"
}
],
"spendInr": 123,
"roas": 123,
"funnel": {
"abandoned": 123,
"outreachAttempted": 123,
"reached": 123,
"clicked": 123,
"recovered": 123,
"revenueAtRisk": [
{
"currency": "<string>",
"amount": "<string>"
}
],
"rates": {
"outreach": 123,
"reached": 123,
"clicked": 123,
"recovered": 123
}
},
"codToPrepaid": {
"codOrders": 123,
"codOrdersContacted": 123,
"prepaidConfirmed": 123,
"conversionRate": 123,
"currency": "INR",
"revenueShifted": 123,
"paymentLinkClicks": 123,
"rtoSavings": 123,
"assumedRtoRatePct": 123
}
}Orders & revenue
Get a campaign's commerce results
One campaign’s commerce results — revenue, ROAS, cart funnel, COD→prepaid conversion
GET
/
commerce
/
campaigns
/
{id}
/
analytics
Get a campaign's commerce results
curl --request GET \
--url https://api.pineyard.ai/commerce/campaigns/{id}/analytics \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pineyard.ai/commerce/campaigns/{id}/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/commerce/campaigns/{id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"range": "today",
"window": {
"from": "<string>",
"to": "<string>",
"previousFrom": "<string>",
"previousTo": "<string>",
"timezone": "Asia/Kolkata"
},
"orders": 123,
"revenue": [
{
"currency": "<string>",
"amount": "<string>"
}
],
"spendInr": 123,
"roas": 123,
"funnel": {
"abandoned": 123,
"outreachAttempted": 123,
"reached": 123,
"clicked": 123,
"recovered": 123,
"revenueAtRisk": [
{
"currency": "<string>",
"amount": "<string>"
}
],
"rates": {
"outreach": 123,
"reached": 123,
"clicked": 123,
"recovered": 123
}
},
"codToPrepaid": {
"codOrders": 123,
"codOrdersContacted": 123,
"prepaidConfirmed": 123,
"conversionRate": 123,
"currency": "INR",
"revenueShifted": 123,
"paymentLinkClicks": 123,
"rtoSavings": 123,
"assumedRtoRatePct": 123
}
}Required scope:
sales.view
Requires commerce analytics enabled for your workspace. Otherwise the request is refused; see Errors.
Authorizations
Your API key, e.g. pk_live_xxxxxxxxxxxxxxxxxxxxxxxx.
Path Parameters
Query Parameters
Available options:
today, 7d, 30d, 90d Response
OK
Available options:
today, 7d, 30d, 90d Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes

