# Plan scheduled price cuts (a markdown)

Write the markdown plan — the price cuts and their dates — schedule it so the cuts fire on time, and cancel it before it fires if plans change.

Promotions & loyalty · a play in 3 steps.

## The steps

1. Write the plan — the cuts and their dates. — [createMarkdownPlan](/reference/markdown-plan/createMarkdownPlan/)
2. Schedule it — the cuts fire on their dates and change live prices. — [scheduleMarkdownPlan](/reference/pricing/scheduleMarkdownPlan/)
3. Cancel it before it fires if plans change. — [cancelMarkdownPlan](/reference/pricing/cancelMarkdownPlan/)

## The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

### createMarkdownPlan

[createMarkdownPlan](/reference/markdown-plan/createMarkdownPlan/) — mutation · Create a new markdown plan — scheduled price cuts over time at your organization.

**Example request**

```graphql
mutation ExampleCreateMarkdownPlan($input: NewMarkdownPlanInput!) {
  createMarkdownPlan(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationIds
    logicalFacilityIds
    currency
    nextDueAt
    resolvedInventoryItemIds
  }
}
```

Variables:

```json
{
  "input": {
    "caption": "Blue jeans",
    "productScope": {
      "predicate": {
        "categoryIds": [
          "01900000-0000-7000-8000-57cf15750000"
        ]
      }
    },
    "currency": "USD",
    "steps": [
      {
        "startAt": "2027-01-31T00:00:00.000Z",
        "move": {
          "kind": "percent_off",
          "percentPpm": 1
        },
        "endAt": "2027-01-31T00:00:00.000Z"
      }
    ]
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

**Example response**

```json
{
  "data": {
    "createMarkdownPlan": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "MD-EXMP-0000-000F",
      "type": "MarkdownPlan",
      "caption": "Blue jeans",
      "status": "draft",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "organizationIds": [
        "01900000-0000-7000-8000-60e064dc0000"
      ],
      "logicalFacilityIds": [
        "01900000-0000-7000-8000-2c5783bd0000"
      ],
      "currency": "USD",
      "nextDueAt": "2027-01-31T00:00:00.000Z",
      "resolvedInventoryItemIds": [
        "01900000-0000-7000-8000-0600d5020000"
      ]
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### scheduleMarkdownPlan

[scheduleMarkdownPlan](/reference/pricing/scheduleMarkdownPlan/) — mutation · Schedule a markdown plan — the price cuts will fire on their dates.

**Example request**

```graphql
mutation ExampleScheduleMarkdownPlan($input: ScheduleMarkdownPlanInput!) {
  scheduleMarkdownPlan(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationIds
    logicalFacilityIds
    currency
    nextDueAt
    resolvedInventoryItemIds
  }
}
```

Variables:

```json
{
  "input": {
    "planId": "01900000-0000-7000-8000-744bf63f0000",
    "expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
    "reason": "Correcting a miscount."
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

**Example response**

```json
{
  "data": {
    "scheduleMarkdownPlan": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "MD-EXMP-0000-000F",
      "type": "MarkdownPlan",
      "caption": "Blue jeans",
      "status": "draft",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "organizationIds": [
        "01900000-0000-7000-8000-60e064dc0000"
      ],
      "logicalFacilityIds": [
        "01900000-0000-7000-8000-2c5783bd0000"
      ],
      "currency": "USD",
      "nextDueAt": "2027-01-31T00:00:00.000Z",
      "resolvedInventoryItemIds": [
        "01900000-0000-7000-8000-0600d5020000"
      ]
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### cancelMarkdownPlan

[cancelMarkdownPlan](/reference/pricing/cancelMarkdownPlan/) — mutation · Cancel a markdown plan — scheduled price cuts over time.

**Example request**

```graphql
mutation ExampleCancelMarkdownPlan($input: CancelMarkdownPlanInput!) {
  cancelMarkdownPlan(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationIds
    logicalFacilityIds
    currency
    nextDueAt
    resolvedInventoryItemIds
  }
}
```

Variables:

```json
{
  "input": {
    "planId": "01900000-0000-7000-8000-744bf63f0000",
    "expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
    "reason": "Correcting a miscount."
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

**Example response**

```json
{
  "data": {
    "cancelMarkdownPlan": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "MD-EXMP-0000-000F",
      "type": "MarkdownPlan",
      "caption": "Blue jeans",
      "status": "draft",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "organizationIds": [
        "01900000-0000-7000-8000-60e064dc0000"
      ],
      "logicalFacilityIds": [
        "01900000-0000-7000-8000-2c5783bd0000"
      ],
      "currency": "USD",
      "nextDueAt": "2027-01-31T00:00:00.000Z",
      "resolvedInventoryItemIds": [
        "01900000-0000-7000-8000-0600d5020000"
      ]
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```
