> ## Documentation Index
> Fetch the complete documentation index at: https://docs.queryful.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Profitability

> Each order's revenue, costs and profit before returns, as Shopify measures them, by order and market.

Each order's revenue, costs and profit before returns, as Shopify measures them, by order and market.

## Example

```sql theme={null}
FROM profitability
  SHOW average_revenue_before_returns, average_store_costs_before_returns
  GROUP BY order_name
  SINCE startOfMonth(-1m) UNTIL today
  ORDER BY average_revenue_before_returns DESC
```

## Metrics

| Metric | Type | Description |
| - | - | - |
| `average_revenue_before_returns` | Currency | Revenue per order before returns: product sales after discounts, the shipping and duties customers paid. |
| `average_store_costs_before_returns` | Currency | What each order cost the store to fulfil before returns: product cost, shipping, duties and fees. |
| `average_profit_at_delivery_before_returns` | Currency | Profit per order measured at delivery, before returns and without marketing or packaging costs. |
| `average_sale_after_discounts` | Currency | What customers paid for products per order before returns. |
| `average_sales_taxes` | Currency | Taxes collected per order. |
| `average_customer_price_adjustments` | Currency | Price adjustments that changed what customers paid, per order. |
| `average_customer_shipping_charges` | Currency | Shipping customers paid per order. |
| `average_store_shipping_costs` | Currency | Shipping the store paid per order, labels and their adjustments included. |
| `average_customer_duties_and_import_taxes` | Currency | Duties and import taxes customers paid per order. |
| `average_store_duties_and_import_taxes` | Currency | Duties and import taxes the store paid per order. |
| `average_cost_of_goods_sold` | Currency | Product cost per order, before returns. |
| `average_international_fees` | Currency | International fees per order. |
| `average_shopify_payments_processing_fees` | Currency | Shopify Payments processing fees per order. |

## Dimensions

| Dimension | Description |
| - | - |
| `order_name` | Order name, such as #1001. |
| `market` | The order's market. |
| `order_fulfillment_status` | Fulfilled, partially fulfilled, unfulfilled and so on. |

## Filters

| Filter | Type | Description |
| - | - | - |
| `market` | Text | The order's market. |
| `order_fulfillment_status` | Text | FULFILLED, PARTIALLY\_FULFILLED, UNFULFILLED and so on. |

## Linked records

Fields of the records this dataset reaches can be shown, grouped by and filtered on, written with a dot after the record (for example `shop.name`). Each record's page lists its fields.

| Write | Record | Reached through |
| - | - | - |
| `shop.<field>` | [Store](https://docs.queryful.app/queryfulql/records/shop.md) | Store |

## Related datasets

* [Sales](https://docs.queryful.app/queryfulql/datasets/sales.md)
* [Orders](https://docs.queryful.app/queryfulql/datasets/orders.md)
* [Order line items](https://docs.queryful.app/queryfulql/datasets/order_lines.md)
* [Returns](https://docs.queryful.app/queryfulql/datasets/returns.md)
* [Restocks](https://docs.queryful.app/queryfulql/datasets/refund_lines.md)
* [Refunds](https://docs.queryful.app/queryfulql/datasets/refunds.md)
* [Sales taxes](https://docs.queryful.app/queryfulql/datasets/sales_taxes.md)
* [Write-offs](https://docs.queryful.app/queryfulql/datasets/sale_write_offs.md)
* [Agentic sales](https://docs.queryful.app/queryfulql/datasets/agentic_sales.md)
* [Products bought together](https://docs.queryful.app/queryfulql/datasets/product_pairs.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.