---
title: "The fiscal year week by week, against the plan and the envelope"
method: GET
path: "/api/v1/finance/reports/open-to-buy"
tags: ["finance_reports"]
---

# The fiscal year week by week, against the plan and the envelope

`GET /api/v1/finance/reports/open-to-buy`

## Request

- Base URL: `https://api.app.tightly.io`
- URL: `https://api.app.tightly.io/api/v1/finance/reports/open-to-buy`
- Auth: HTTP bearer

The fiscal year week by week against the plan and the envelope, as one read. Three bands: every 4-5-4 week of the year with what sold, what was placed, what arrived and the same week last year, footed by a total row; the plan of record's budget and forecast lines at cost by the Gregorian month they were written for; and the buying envelope behind both.

THE CALENDAR IS NAMED, NOT PAPERED OVER. The weeks are 4-5-4 and the plan is Gregorian months. `calendar_note` says so, and nothing here spreads a month into weeks: a weekly plan nobody wrote is a figure nobody can be held to.

LEVELS DO NOT SUM. The footer totals what flows, sales and intake, and never what is held.

Scope: `reports:read`.

## Query parameters

- `fiscal_year` string, required

## Headers

- `Tightly-Version` string

## Response `200`

The open to buy report

## Other responses

- `400`: The fiscal year could not be read
- `401`: No usable key: malformed, unknown, revoked, expired or stopped. One refusal covers all five, telling a caller which is which maps the surface for them. A request with no Authorization header at all is refused 400 before any key is looked for.
- `403`: The key may not reach this operation. `plan_excludes` when Reports is sold with Pro and this organisation's plan does not include it; `scope_missing` when the key does not hold Reports; `organization_mismatch` when the path names an organisation that is not the key's; `ip_not_allowed` when the caller's address is outside the key's allowlist.
- `429`: The key has spent its allowance for this minute. 600 reads and 120 writes a minute, counted per key, refused calls included. `Retry-After` says how long to wait.
- `503`: The database is briefly out of reach, which is what a failover or a full connection pool looks like from outside. Wait the seconds `Retry-After` names and send the request again. A read is safe to repeat. A write is not, because the connection was lost in the middle of it, so read the object back before sending it a second time. Branch on the status rather than on `code`, which is `POSTGRES_UNAVAILABLE` from one of the two seams that raise this and `SERVICE_UNAVAILABLE` from the other.

---

[API](https://skmtc.dev/tightly/apis/tightly-api.md) · [All operations](https://skmtc.dev/tightly/apis/tightly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tightly/apis/tightly-api/revisions/199f7eb35afb?raw)
