curl --request GET \
--url https://api.example.com/v1/panel/reports/salesimport requests
url = "https://api.example.com/v1/panel/reports/sales"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/panel/reports/sales', 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://api.example.com/v1/panel/reports/sales",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/panel/reports/sales"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/panel/reports/sales")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/panel/reports/sales")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"byOperation": [
{
"operation": "<string>",
"currency": "<string>",
"orders": 123,
"subtotalMinor": 123,
"discountMinor": 123,
"paidMinor": 123,
"walletMinor": 123
}
],
"byPlan": [
{
"planCode": "<string>",
"planVersion": 123,
"billingPeriod": "<string>",
"currency": "<string>",
"orders": 123,
"grossMinor": 123
}
],
"byDay": [
{
"day": "2023-12-25",
"currency": "<string>",
"orders": 123,
"paidMinor": 123,
"walletMinor": 123
}
],
"refunds": [
{
"currency": "<string>",
"refunds": 123,
"refundedMinor": 123
}
],
"trials": {
"trials": 123,
"converted": 123,
"cohort": true
},
"generatedAt": "2023-11-07T05:31:56Z",
"currency": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}Get v1panelreportssales
Requires finance.read. What was sold over a chosen period, by kind of sale, by plan version, and by day, with trial conversion and refunds issued. The period keys on orders.paid_at, which is set once when an order first settles and never moved afterwards, so re-running a report over a closed period returns the same figures. Provider money and wallet credit are reported apart and must never be added: the balance was already revenue when it was funded. A period longer than two years is refused.
curl --request GET \
--url https://api.example.com/v1/panel/reports/salesimport requests
url = "https://api.example.com/v1/panel/reports/sales"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/panel/reports/sales', 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://api.example.com/v1/panel/reports/sales",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/panel/reports/sales"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/panel/reports/sales")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/panel/reports/sales")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"byOperation": [
{
"operation": "<string>",
"currency": "<string>",
"orders": 123,
"subtotalMinor": 123,
"discountMinor": 123,
"paidMinor": 123,
"walletMinor": 123
}
],
"byPlan": [
{
"planCode": "<string>",
"planVersion": 123,
"billingPeriod": "<string>",
"currency": "<string>",
"orders": 123,
"grossMinor": 123
}
],
"byDay": [
{
"day": "2023-12-25",
"currency": "<string>",
"orders": 123,
"paidMinor": 123,
"walletMinor": 123
}
],
"refunds": [
{
"currency": "<string>",
"refunds": 123,
"refundedMinor": 123
}
],
"trials": {
"trials": 123,
"converted": 123,
"cohort": true
},
"generatedAt": "2023-11-07T05:31:56Z",
"currency": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}Query Parameters
Start of the period, inclusive. Defaults to thirty days before until.
End of the period, exclusive. Defaults to now.
The zone the day boundaries are computed in. "Sales on the third" means the operator's third, and a report bucketed in UTC puts an evening sale several hours east on the wrong day.
ISO currency to restrict the report to. Omit for every currency.
Response
Sales report
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes