# Insights

> For AI agents: the index of these docs is at https://shippified.net/docs/llms.txt (every page it lists has a Markdown version like this one).

## Profit & loss for a calendar period.

**`GET https://shippified.net/api/profitability`** — Profit & loss for a calendar period.

Revenue is each order's `salePriceCents` and cost is its `costCents`, for orders received in the period; subscription overhead, pro-rated to the period, is subtracted for net profit. Includes a daily series, breakdowns by store and by source, and totals for the previous period for comparison. Periods are calendar-aligned in UTC.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `range` | query | string | no | Current month, quarter or year, or all time. Unknown values fall back to `month`. |

### Responses

**200** — OK

```json
{
  "range": "month",
  "window": {
    "range": "month",
    "start": "2024-01-01T00:00:00Z",
    "end": "2024-01-01T00:00:00Z",
    "label": "Q3 2026"
  },
  "previousWindow": {},
  "generatedAt": "2024-01-01T00:00:00Z",
  "revenueCents": 0,
  "cogsCents": 0,
  "subsCostCents": 0,
  "grossProfitCents": 0,
  "netProfitCents": 0,
  "orderCount": 0,
  "ordersWithSalePrice": 0,
  "coverage": 0,
  "daily": [
    {
      "date": "string",
      "revenueCents": 0,
      "cogsCents": 0,
      "profitCents": 0
    }
  ],
  "perStore": [
    {
      "name": "string",
      "revenueCents": 0,
      "cogsCents": 0,
      "profitCents": 0,
      "count": 0
    }
  ],
  "perSource": [
    {
      "name": "string",
      "revenueCents": 0,
      "cogsCents": 0,
      "profitCents": 0,
      "count": 0
    }
  ],
  "previous": {
    "revenueCents": 0,
    "netProfitCents": 0
  }
}
```

**401** — Not authenticated.

### Code samples

**cURL**

```curl
curl -X GET "https://shippified.net/api/profitability"
```

**TypeScript**

```typescript
const res = await fetch('https://shippified.net/api/profitability', {
  method: 'GET',
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "https://shippified.net/api/profitability",
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://shippified.net/api/profitability", nil)
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://shippified.net/api/profitability');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('https://shippified.net/api/profitability')
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://shippified.net/api/profitability"))
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Order, delivery and subscription-renewal events for one month.

**`GET https://shippified.net/api/calendar`** — Order, delivery and subscription-renewal events for one month.

Each order contributes an `order_received` event and either a `delivered` event (actual delivery date) or an `estimated_delivery` event. Active subscriptions contribute a `subscription_renewal` event on each renewal date in the month. Dates are days in your timezone (`POST /api/account/timezone`, default UTC) — an order received at 9pm in New York is on that day, not the next UTC day. Events are sorted by date, then kind.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `month` | query | string | no | Month as `YYYY-MM`. Defaults to the current month in your timezone. |

### Responses

**200** — OK

```json
{
  "month": "2026-09",
  "timezone": "America/New_York",
  "generatedAt": "2024-01-01T00:00:00Z",
  "events": [
    {
      "date": "string",
      "kind": "order_received",
      "label": "string",
      "amount": "string",
      "ref": {
        "type": "order",
        "id": "string"
      },
      "meta": {}
    }
  ]
}
```

**400** — `month` isn't a valid `YYYY-MM`.

```json
{
  "error": "string"
}
```

**401** — Not authenticated.

### Code samples

**cURL**

```curl
curl -X GET "https://shippified.net/api/calendar"
```

**TypeScript**

```typescript
const res = await fetch('https://shippified.net/api/calendar', {
  method: 'GET',
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "https://shippified.net/api/calendar",
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://shippified.net/api/calendar", nil)
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://shippified.net/api/calendar');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('https://shippified.net/api/calendar')
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://shippified.net/api/calendar"))
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Order-count leaderboard across workspaces.

**`GET https://shippified.net/api/leaderboard`** — Order-count leaderboard across workspaces.

Only workspaces that opted in with `POST /api/account/public-stats` are ranked, plus you (flagged `isYou`) so you can always see where you'd place, without being shown to anyone else. `week` and `month` are rolling 7- and 30-day windows ranked by `windowed`; `all` ranks by lifetime count.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `timeframe` | query | string | no | Unknown values fall back to `all`. |

### Responses

**200** — OK

```json
{
  "timeframe": "week",
  "generatedAt": "2024-01-01T00:00:00Z",
  "total": 0,
  "rows": [
    {
      "rank": 0,
      "userId": "string",
      "username": "string",
      "displayName": "string",
      "publicProfile": true,
      "lifetime": 0,
      "windowed": 0,
      "level": 0,
      "isYou": true
    }
  ]
}
```

**401** — Not authenticated.

### Code samples

**cURL**

```curl
curl -X GET "https://shippified.net/api/leaderboard"
```

**TypeScript**

```typescript
const res = await fetch('https://shippified.net/api/leaderboard', {
  method: 'GET',
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "https://shippified.net/api/leaderboard",
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://shippified.net/api/leaderboard", nil)
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://shippified.net/api/leaderboard');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('https://shippified.net/api/leaderboard')
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://shippified.net/api/leaderboard"))
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

---

## For AI agents

- This page for a human reader: https://shippified.net/docs/ref-insights
- The whole space as one Markdown file: https://shippified.net/docs/llms-full.txt
- Live search + fetch over MCP: https://shippified.net/docs/_api/public/orgs/5b8789b1-481a-41f5-8e5a-5f30d11f5151/spaces/ae0c5af4-cc84-4899-9078-2faf8e7a6fc5/mcp
  - Install (Claude CLI): `claude mcp add api-docs --transport http https://shippified.net/docs/_api/public/orgs/5b8789b1-481a-41f5-8e5a-5f30d11f5151/spaces/ae0c5af4-cc84-4899-9078-2faf8e7a6fc5/mcp`

This Markdown is the same content the page renders — safe to quote and to ground answers in.
