curl --request POST \
--url https://mm-api.merchantspring.io/reports/view/salesByPeriod \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"merchantId": "<string>",
"channelId": "<string>",
"reportOptions": {
"fromDate": 123,
"toDate": 123,
"priorFromDate": 123,
"priorToDate": 123,
"timezone": "<string>"
},
"includeTax": true,
"sellerSkus": [
"<string>"
]
}
'import requests
url = "https://mm-api.merchantspring.io/reports/view/salesByPeriod"
payload = {
"merchantId": "<string>",
"channelId": "<string>",
"reportOptions": {
"fromDate": 123,
"toDate": 123,
"priorFromDate": 123,
"priorToDate": 123,
"timezone": "<string>"
},
"includeTax": True,
"sellerSkus": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '<string>',
channelId: '<string>',
reportOptions: {
fromDate: 123,
toDate: 123,
priorFromDate: 123,
priorToDate: 123,
timezone: '<string>'
},
includeTax: true,
sellerSkus: ['<string>']
})
};
fetch('https://mm-api.merchantspring.io/reports/view/salesByPeriod', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mm-api.merchantspring.io/reports/view/salesByPeriod",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merchantId' => '<string>',
'channelId' => '<string>',
'reportOptions' => [
'fromDate' => 123,
'toDate' => 123,
'priorFromDate' => 123,
'priorToDate' => 123,
'timezone' => '<string>'
],
'includeTax' => true,
'sellerSkus' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mm-api.merchantspring.io/reports/view/salesByPeriod"
payload := strings.NewReader("{\n \"merchantId\": \"<string>\",\n \"channelId\": \"<string>\",\n \"reportOptions\": {\n \"fromDate\": 123,\n \"toDate\": 123,\n \"priorFromDate\": 123,\n \"priorToDate\": 123,\n \"timezone\": \"<string>\"\n },\n \"includeTax\": true,\n \"sellerSkus\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mm-api.merchantspring.io/reports/view/salesByPeriod")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"<string>\",\n \"channelId\": \"<string>\",\n \"reportOptions\": {\n \"fromDate\": 123,\n \"toDate\": 123,\n \"priorFromDate\": 123,\n \"priorToDate\": 123,\n \"timezone\": \"<string>\"\n },\n \"includeTax\": true,\n \"sellerSkus\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mm-api.merchantspring.io/reports/view/salesByPeriod")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"<string>\",\n \"channelId\": \"<string>\",\n \"reportOptions\": {\n \"fromDate\": 123,\n \"toDate\": 123,\n \"priorFromDate\": 123,\n \"priorToDate\": 123,\n \"timezone\": \"<string>\"\n },\n \"includeTax\": true,\n \"sellerSkus\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"currency": "<string>",
"formattedChartData": [
{
"startTime": "<string>",
"endTime": "<string>",
"sales": "<string>",
"priorSales": "<string>",
"unitsSold": 123,
"priorUnitsSold": 123,
"lineItemCount": 123,
"priorLineItemCount": 123,
"avgLineItemValue": "<string>",
"priorAvgLineItemValue": "<string>",
"pageViews": 123,
"priorPageViews": 123,
"pageViewsConversions": "<string>",
"priorPageViewsConversions": "<string>",
"totalSessions": 123,
"priorTotalSessions": 123,
"sessionConversions": "<string>",
"priorSessionConversions": "<string>",
"buyboxWinPercentage": "<string>",
"priorBuyboxWinPercentage": "<string>",
"adSpend": "<string>",
"priorAdSpend": "<string>",
"adSales": "<string>",
"priorAdSales": "<string>",
"impressions": 123,
"priorImpressions": 123,
"clickThroughRate": "<string>",
"priorClickThroughRate": "<string>",
"acos": "<string>",
"priorAcos": "<string>",
"tacos": "<string>",
"priorTacos": "<string>",
"currency": "<string>"
}
]
}{
"status": "error",
"error": "<string>"
}{
"status": "error",
"error": "<string>"
}Retrieve sales-by-period performance
Retrieve aggregated GMV, traffic, and advertising metrics for a merchant over the selected date range, grouped by the requested interval.
curl --request POST \
--url https://mm-api.merchantspring.io/reports/view/salesByPeriod \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"merchantId": "<string>",
"channelId": "<string>",
"reportOptions": {
"fromDate": 123,
"toDate": 123,
"priorFromDate": 123,
"priorToDate": 123,
"timezone": "<string>"
},
"includeTax": true,
"sellerSkus": [
"<string>"
]
}
'import requests
url = "https://mm-api.merchantspring.io/reports/view/salesByPeriod"
payload = {
"merchantId": "<string>",
"channelId": "<string>",
"reportOptions": {
"fromDate": 123,
"toDate": 123,
"priorFromDate": 123,
"priorToDate": 123,
"timezone": "<string>"
},
"includeTax": True,
"sellerSkus": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '<string>',
channelId: '<string>',
reportOptions: {
fromDate: 123,
toDate: 123,
priorFromDate: 123,
priorToDate: 123,
timezone: '<string>'
},
includeTax: true,
sellerSkus: ['<string>']
})
};
fetch('https://mm-api.merchantspring.io/reports/view/salesByPeriod', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mm-api.merchantspring.io/reports/view/salesByPeriod",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merchantId' => '<string>',
'channelId' => '<string>',
'reportOptions' => [
'fromDate' => 123,
'toDate' => 123,
'priorFromDate' => 123,
'priorToDate' => 123,
'timezone' => '<string>'
],
'includeTax' => true,
'sellerSkus' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mm-api.merchantspring.io/reports/view/salesByPeriod"
payload := strings.NewReader("{\n \"merchantId\": \"<string>\",\n \"channelId\": \"<string>\",\n \"reportOptions\": {\n \"fromDate\": 123,\n \"toDate\": 123,\n \"priorFromDate\": 123,\n \"priorToDate\": 123,\n \"timezone\": \"<string>\"\n },\n \"includeTax\": true,\n \"sellerSkus\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mm-api.merchantspring.io/reports/view/salesByPeriod")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"<string>\",\n \"channelId\": \"<string>\",\n \"reportOptions\": {\n \"fromDate\": 123,\n \"toDate\": 123,\n \"priorFromDate\": 123,\n \"priorToDate\": 123,\n \"timezone\": \"<string>\"\n },\n \"includeTax\": true,\n \"sellerSkus\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mm-api.merchantspring.io/reports/view/salesByPeriod")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"<string>\",\n \"channelId\": \"<string>\",\n \"reportOptions\": {\n \"fromDate\": 123,\n \"toDate\": 123,\n \"priorFromDate\": 123,\n \"priorToDate\": 123,\n \"timezone\": \"<string>\"\n },\n \"includeTax\": true,\n \"sellerSkus\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"currency": "<string>",
"formattedChartData": [
{
"startTime": "<string>",
"endTime": "<string>",
"sales": "<string>",
"priorSales": "<string>",
"unitsSold": 123,
"priorUnitsSold": 123,
"lineItemCount": 123,
"priorLineItemCount": 123,
"avgLineItemValue": "<string>",
"priorAvgLineItemValue": "<string>",
"pageViews": 123,
"priorPageViews": 123,
"pageViewsConversions": "<string>",
"priorPageViewsConversions": "<string>",
"totalSessions": 123,
"priorTotalSessions": 123,
"sessionConversions": "<string>",
"priorSessionConversions": "<string>",
"buyboxWinPercentage": "<string>",
"priorBuyboxWinPercentage": "<string>",
"adSpend": "<string>",
"priorAdSpend": "<string>",
"adSales": "<string>",
"priorAdSales": "<string>",
"impressions": 123,
"priorImpressions": 123,
"clickThroughRate": "<string>",
"priorClickThroughRate": "<string>",
"acos": "<string>",
"priorAcos": "<string>",
"tacos": "<string>",
"priorTacos": "<string>",
"currency": "<string>"
}
]
}{
"status": "error",
"error": "<string>"
}{
"status": "error",
"error": "<string>"
}Authorizations
Body
Report filters that identify the merchant, time range, and marketplace scope to evaluate.
Payload used to request the sales-by-period view report.
MerchantSpring merchant identifier for the account whose performance should be returned.
MerchantSpring channel identifier for the account whose performance should be returned.
Defines the reporting window and comparison period that should be analysed.
Show child attributes
Show child attributes
True by default. When true, gross sales figures include tax; when false, results are reported net of tax.
Optional list of seller SKUs to restrict the dataset to specific products.
Response
Aggregated performance data grouped to match the requested interval.
Successful response returned by the sales-by-period report endpoint.
Indicates that the request completed successfully.
success Currency code associated with the returned metrics.
Display-ready metrics including formatted strings and comparison values for each interval.
Show child attributes
Show child attributes
Was this page helpful?