Skip to main content
GET
Get cost configuration
Required scope: costs:read Use this to audit what’s configured before a margin review, or to find a cost line’s id before you change it with Update a cost line or remove it with Delete a cost line. Cost settings explains what each setting does.

The response shape depends on type

  • Without type, the response is { "configs": { ... } } with one key per cost type. A type you’ve never configured is null.
  • With type, the response is { "config": ... }: that one configuration, or null.
  • An unrecognized type isn’t rejected. It returns {"config": null}, so check the spelling if you get null for a type you know is set up.
  • If the read itself fails, you get null values (or {}) with a 200 rather than an error. Don’t treat null alone as proof that nothing is configured.

Where each cost type lives

Per-variant product costs aren’t part of this response. Read them with Search products or Get a product variant. Each stored record also carries internal storage keys such as pk and env. Ignore them.

Authorizations

x-api-key
string
header
required

Your Upstack API key. Starts with upstack_.

x-pixel-id
string
header
required

The pixel id the request targets.

Query Parameters

type
enum<string>

Return only this cost type. An unrecognized value returns {"config": null} instead of an error.

Cost configuration type. Used to filter /api/costs.

Available options:
global_product_override,
order,
gateway,
shipping,
variable,
fixed

Response

The cost configuration, or the filtered subset.

With ?type=, the response is { "config": … } — that one config, or null when none is stored for the type. Without it, the response is { "configs": … }, every config keyed by cost type.

config
Global product override · object

Present when ?type= is supplied.

configs
object

Present when ?type= is omitted.