> For the complete documentation index, see [llms.txt](https://manual.firstresonance.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.firstresonance.io/plans-and-autoplan/plan-reservations.md).

# Plan Reservations

Create plan reservations to hard allocate supply to demand.

When you have a constraint that cannot be represented in ION via other methods as mentioned in this documentation, than as a last resort, use reservations to manually manipulate your results.

## Overview

If there are no reservations, Autoplan will allocate the first supply to the first demand. This should be the preferred approach because it will adjust your plan as supply and demand change, with no additional manual input required. However, at times, it may be useful to reserve supply for a specific plan. There may be certain constraints in your factory that necessitate a specific supply is used on a specific project.

When a plan reservation is in place, Autoplan will allocate that supply to demand from that plan and if there is no demand for that part on that plan, it will not be allocated.

See the video below for an example.

## Adding/updating plan reservations

Plan reservations can be added via the inventory interface. Plan reservations can be added via the "Planned for" column:

<figure><img src="https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LkRqYp6lJhwxjYdzYG8%2Fuploads%2Fgit-blob-1299cc66ce1277adaeae8020b532eabca115e5e4%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Clicking "Add Plan reservation" will bring up a modal with options to select the plan and quantity. The quantity will default to the inventory quantity.

<figure><img src="https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LkRqYp6lJhwxjYdzYG8%2Fuploads%2Fgit-blob-0834c960da5e008894d44f6248496af835e9bc6c%2Fimage.png?alt=media" alt=""><figcaption><p>Creating a plan reservation</p></figcaption></figure>

Clicking on the column again allows for the plan reservation to be edited or deleted.

<figure><img src="https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LkRqYp6lJhwxjYdzYG8%2Fuploads%2Fgit-blob-73c0d59dfa2770111c987466d20ac439e28c58ad%2Fimage.png?alt=media" alt=""><figcaption><p>Editing a plan reservation</p></figcaption></figure>

## API

Please see below for the different mutations and check out the video for more info.

```graphql
mutation CreatePlanReservation($input: CreatePlanReservationInput!) {
    createPlanReservation(input: $input) {
        planReservation {
            id
            partInventoryId
            planId
            quantity
        }
    }
}
```

```graphql
query GetPlanReservations($filters: PlanReservationsInputFilters, $sort: [PlanReservationSortEnum]) {
    planReservations(sort: $sort, filters: $filters) {
        edges {
            node {
                id
                plan {
                    id
                    name
                }
                partInventory {
                    id
                    lotNumber
                    part {
                        partNumber
                        description
                    }
                    runs {
                        id
                    }
                    serialNumber
                }
                quantity
            }
        }
        
    }
}
```

```graphql
mutation DeletePlanReservation($id: ID!, $etag: String!) {
    deletePlanReservation(id: $id, etag: $etag) {
        id
    }
}
```

The input for the deleting the plan reservation will take the following shape:

```graphql
{
    "id": <id>,
    "etag": <etag>
}
```

{% embed url="<https://www.loom.com/share/6dba7e3bfda341fbb36535221d1b24b1?sid=698a57fb-2068-4ddb-be7c-aaacebb81259>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://manual.firstresonance.io/plans-and-autoplan/plan-reservations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
