Get order settings
curl --request GET \
--url https://api.upstackdata.com/accounts/api/account/settings/order \
--header 'x-api-key: <api-key>' \
--header 'x-pixel-id: <api-key>'import requests
url = "https://api.upstackdata.com/accounts/api/account/settings/order"
headers = {
"x-api-key": "<api-key>",
"x-pixel-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>', 'x-pixel-id': '<api-key>'}};
fetch('https://api.upstackdata.com/accounts/api/account/settings/order', 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.upstackdata.com/accounts/api/account/settings/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>",
"x-pixel-id: <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"
"net/http"
"io"
)
func main() {
url := "https://api.upstackdata.com/accounts/api/account/settings/order"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-pixel-id", "<api-key>")
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.upstackdata.com/accounts/api/account/settings/order")
.header("x-api-key", "<api-key>")
.header("x-pixel-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstackdata.com/accounts/api/account/settings/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["x-pixel-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"orderSettings": {
"countPendingOrders": true,
"countVoidedOrders": false,
"refundDateAttribution": "refund_date",
"exclusionFilters": [
{
"id": "3f6c1e2a-8b4d-4c7e-9f10-2a5b6c7d8e90",
"name": "Exclude POS",
"enabled": true,
"conditionGroups": [
{
"id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"logic": "and",
"conditions": [
{
"id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"field": "sourceName",
"operator": "equals",
"value": "pos"
}
]
}
],
"createdAt": "2026-06-03T14:22:51.300Z",
"updatedAt": "2026-09-18T10:05:12.447Z"
},
{
"id": "b8e7d6c5-4a3b-4c2d-9e1f-0a9b8c7d6e5f",
"name": "Exclude wholesale",
"enabled": true,
"conditionGroups": [
{
"id": "e4f5a6b7-c8d9-4e0f-a1b2-c3d4e5f6a7b8",
"logic": "and",
"conditions": [
{
"id": "f6a7b8c9-d0e1-4f2a-b3c4-d5e6f7a8b9c0",
"field": "tags",
"operator": "array_includes_any",
"value": [
"wholesale",
"b2b"
]
}
]
}
],
"createdAt": "2026-09-18T10:05:12.447Z",
"updatedAt": "2026-09-18T10:05:12.447Z"
}
]
}
}ACCOUNT
Get order settings and order exclusion filters
Read the account’s order settings, which decide whether pending and voided orders count, which date refunds land on, and which orders are excluded from reporting.
GET
/
accounts
/
api
/
account
/
settings
/
order
Get order settings
curl --request GET \
--url https://api.upstackdata.com/accounts/api/account/settings/order \
--header 'x-api-key: <api-key>' \
--header 'x-pixel-id: <api-key>'import requests
url = "https://api.upstackdata.com/accounts/api/account/settings/order"
headers = {
"x-api-key": "<api-key>",
"x-pixel-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>', 'x-pixel-id': '<api-key>'}};
fetch('https://api.upstackdata.com/accounts/api/account/settings/order', 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.upstackdata.com/accounts/api/account/settings/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>",
"x-pixel-id: <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"
"net/http"
"io"
)
func main() {
url := "https://api.upstackdata.com/accounts/api/account/settings/order"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-pixel-id", "<api-key>")
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.upstackdata.com/accounts/api/account/settings/order")
.header("x-api-key", "<api-key>")
.header("x-pixel-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstackdata.com/accounts/api/account/settings/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["x-pixel-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"orderSettings": {
"countPendingOrders": true,
"countVoidedOrders": false,
"refundDateAttribution": "refund_date",
"exclusionFilters": [
{
"id": "3f6c1e2a-8b4d-4c7e-9f10-2a5b6c7d8e90",
"name": "Exclude POS",
"enabled": true,
"conditionGroups": [
{
"id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"logic": "and",
"conditions": [
{
"id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"field": "sourceName",
"operator": "equals",
"value": "pos"
}
]
}
],
"createdAt": "2026-06-03T14:22:51.300Z",
"updatedAt": "2026-09-18T10:05:12.447Z"
},
{
"id": "b8e7d6c5-4a3b-4c2d-9e1f-0a9b8c7d6e5f",
"name": "Exclude wholesale",
"enabled": true,
"conditionGroups": [
{
"id": "e4f5a6b7-c8d9-4e0f-a1b2-c3d4e5f6a7b8",
"logic": "and",
"conditions": [
{
"id": "f6a7b8c9-d0e1-4f2a-b3c4-d5e6f7a8b9c0",
"field": "tags",
"operator": "array_includes_any",
"value": [
"wholesale",
"b2b"
]
}
]
}
],
"createdAt": "2026-09-18T10:05:12.447Z",
"updatedAt": "2026-09-18T10:05:12.447Z"
}
]
}
}Required scope:
account:read
Call this in two situations:
- Before you run API queries, so your numbers match the dashboard. The web app
applies these settings to every revenue, attribution, and cohort figure, but the
query endpoints only use the
orderSettingsyou send them. Pass this endpoint’sorderSettingsobject as-is to Run an analytics query or Run a cohort analysis. - Before you change the settings. Replace order settings overwrites the whole object, so read it here, edit it, and send it all back.
What you get back
- All four fields, always. An account that never saved settings gets the defaults:
countPendingOrders: false,countVoidedOrders: false,refundDateAttribution: "refund_date", and no exclusion filters. - Every filter, condition group, and condition with its
id, plus each filter’screatedAtandupdatedAt.
How exclusion filters match
An order is excluded when it matches any enabled filter. A filter matches when any one of its condition groups matches, and a group joins its conditions with its ownlogic (and or or). Disabled filters are kept but have no effect.
Related
- Replace order settings to change them.
upstack account settings order showprints them from the CLI.
Authorizations
Response
The current order settings.
Was this page helpful?