# contracts.resolve_usage_review

Record the business's decision and reason for selected contract usage attention items, amendment price checks or unmatched vendor lines. Changes no bill or posting.

## What it does

Read the contract through subjects get, then select attention.usageReview.items by reason, activityKey, periodKey and sourceFactId. Or read usage_estimates and select pending unmatchedLines by reconciliationId and lineKey. For an amendment price check, select priceDifferences by activityKey, basis (amendment_credit or amendment_charge), latest, billed, bills and the full standing list from attention.priceDiffers. A change to any selected snapshot value requires reading attention again.

This acknowledges every unresolved amount in that selected check, including older standing bills, without changing money or matching tolerance. Select 1 to 50 items, checks and lines in total. Record the business's decision and reason; only selected items and price checks leave attention and selected lines leave the pending unmatched report. Reuse the same selections in a later command to supersede an earlier decision, retaining every decision and caller in event history with predecessor CIDs.

An unmatched-line selection may give accountedBy: { cid } referencing the event that recorded its accounting; a replacement supplies its own optional reference. Record or correct bills separately with contracts.record or contracts.reconcile_usage.

## Before you send it

An authorized OAuth connection may call it, including a headless client. Effective membership, application grant and token permissions still apply. Describe `contracts.resolve_usage_review` through `GET /v1/catalog/commands/{name}` before acting.

This command does not accept `source_document_id` in its envelope. Any input evidence requirements remain as documented below.

## Inputs

Put these fields inside the envelope's `input` object. The outer envelope names the command, a stable `idempotency_key` and `effective_at`; [request and recovery rules](/docs/api/) explain those separately. Use exact minor-unit integer strings for monetary fields. Take existing IDs from prior reads or command results; choose a new identity only where the command asks for one.

Required means required within its containing object; an optional parent can be omitted.

| Field | Type | Required | Meaning and accepted values |
|---|---|---|---|
| `contractId` | string | Yes |  Minimum length: `1`. Maximum length: `4096`. Example: `"ctr_example"`. |
| `effectiveAt` | string | Yes |  Format: date-time. Example: `"2026-11-01T00:00:00Z"`. |
| `decision` | string | Yes |  Minimum length: `1`. Maximum length: `1000`. Example: `"Accept the vendor's credit"`. |
| `reason` | string | Yes |  Minimum length: `1`. Maximum length: `1000`. Example: `"Confirmed with support"`. |
| `items` | array | No |  Items: object. Minimum items: `1`. Maximum items: `50`. |
| `items[].reason` | string | Yes |  Choose `"proration_basis_differs"`, `"amendment_bill_reversed"`, `"amendment_service_overlap"`, `"invoice_overlap"`, `"accrual_overlap"`, `"tax_differs"`, `"tax_amount_unconfirmed"`, `"credit_expired"`, `"credit_unfunded"`, `"billed_twice"`, `"seat_count_differs"`, `"recognized_after_end"`, `"unit_differs"`. Example: `"credit_unfunded"`. |
| `items[].activityKey` | string | Yes |  Minimum length: `1`. Maximum length: `4096`. Example: `"actions"`. |
| `items[].periodKey` | string | Yes |  Minimum length: `1`. Maximum length: `4096`. Example: `"2026-09-01T00:00:00.000Z/2026-10-01T00:00:00.000Z"`. |
| `items[].sourceFactId` | string | Yes |  Minimum length: `1`. Maximum length: `4096`. Example: `"invoice:1"`. |
| `priceDifferences` | array | No |  Items: object. Minimum items: `1`. Maximum items: `50`. |
| `priceDifferences[].activityKey` | string | Yes |  Minimum length: `1`. Maximum length: `4096`. |
| `priceDifferences[].basis` | string | Yes |  Choose `"amendment_credit"`, `"amendment_charge"`. |
| `priceDifferences[].latest` | string | Yes |  Format: date-time. |
| `priceDifferences[].billed` | string | Yes |  Pattern: `"^[0-9]+$"`. |
| `priceDifferences[].bills` | integer | Yes |  Minimum: `1`. |
| `priceDifferences[].standing` | array | Yes |  Items: object. Maximum items: `10`. |
| `priceDifferences[].standing[].effectiveAt` | string | Yes |  Format: date-time. |
| `priceDifferences[].standing[].computed` | string | Yes |   |
| `priceDifferences[].standing[].billed` | string | Yes |   |
| `priceDifferences[].standing[].facts` | object | Yes |   |
| `priceDifferences[].standing[].occurrenceId` | string | No |  Minimum length: `1`. Maximum length: `4096`. |
| `unmatchedLines` | array | No |  Items: object. Minimum items: `1`. Maximum items: `50`. |
| `unmatchedLines[].reconciliationId` | string | Yes |  Minimum length: `1`. Maximum length: `4096`. |
| `unmatchedLines[].lineKey` | string | Yes |  Minimum length: `1`. Maximum length: `4096`. |
| `unmatchedLines[].accountedBy` | object | No |   |
| `unmatchedLines[].accountedBy.cid` | string | Yes |  Minimum length: `1`. Maximum length: `4096`. |

## After acceptance

When the command emits events, its documented effects and receipt are recorded in the command transaction. The response returns `commandId`, `replayed`, the command-specific `result` below and emitted `events` with their IDs and CIDs. A command is not automatically a cash movement or revenue recognition: use the behavior above to determine what this command records.

Inspect `result` and the affected records or reports before continuing. Save returned identifiers for later calls. Fetch `GET /v1/commands/{id}` with `commandId` to recover the accepted receipt; retry the same intent with the same idempotency key if the response was lost. Some commands can succeed with `events: []` and return a transient result and `commandId` without persisting a receipt. A lookup of that ID can return null; retain the returned result and verify the affected record. Retrying can re-evaluate the current state rather than replay a stored result. A domain `no_change` is a separate success outcome with no persisted receipt.

### Result fields

Required means required within its containing object; an optional parent can be omitted.

| Field | Type | Required | Meaning and accepted values |
|---|---|---|---|
| `resolved` | integer | Yes |  Minimum: `1`. Maximum: `50`. |


[All commands](/docs/command-reference/) · [Operation and errors](/docs/api-reference/operations/commands-execute/) · [Reusable schemas](/docs/api-reference/components/)

Keep credentials out of prompts; rehearse writes only in a disposable sandbox.

## Exact request schema


```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "const": "contracts.resolve_usage_review"
    },
    "input": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "contractId",
        "effectiveAt",
        "decision",
        "reason"
      ],
      "properties": {
        "contractId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "effectiveAt": {
          "type": "string",
          "format": "date-time"
        },
        "decision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        },
        "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        },
        "items": {
          "type": "array",
          "minItems": 1,
          "maxItems": 50,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "reason",
              "activityKey",
              "periodKey",
              "sourceFactId"
            ],
            "properties": {
              "reason": {
                "enum": [
                  "proration_basis_differs",
                  "amendment_bill_reversed",
                  "amendment_service_overlap",
                  "invoice_overlap",
                  "accrual_overlap",
                  "tax_differs",
                  "tax_amount_unconfirmed",
                  "credit_expired",
                  "credit_unfunded",
                  "billed_twice",
                  "seat_count_differs",
                  "recognized_after_end",
                  "unit_differs"
                ]
              },
              "activityKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "periodKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "sourceFactId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              }
            }
          }
        },
        "priceDifferences": {
          "type": "array",
          "minItems": 1,
          "maxItems": 50,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "activityKey",
              "basis",
              "latest",
              "billed",
              "bills",
              "standing"
            ],
            "properties": {
              "activityKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "basis": {
                "enum": [
                  "amendment_credit",
                  "amendment_charge"
                ]
              },
              "latest": {
                "type": "string",
                "format": "date-time"
              },
              "billed": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "bills": {
                "type": "integer",
                "minimum": 1
              },
              "standing": {
                "type": "array",
                "maxItems": 10,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "effectiveAt",
                    "computed",
                    "billed",
                    "facts"
                  ],
                  "properties": {
                    "effectiveAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "computed": {
                      "type": "string"
                    },
                    "billed": {
                      "type": "string"
                    },
                    "facts": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "occurrenceId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4096
                    }
                  }
                }
              }
            }
          }
        },
        "unmatchedLines": {
          "type": "array",
          "minItems": 1,
          "maxItems": 50,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "reconciliationId",
              "lineKey"
            ],
            "properties": {
              "reconciliationId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "lineKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "accountedBy": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cid"
                ],
                "properties": {
                  "cid": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  }
                }
              }
            }
          }
        }
      }
    },
    "idempotency_key": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "effective_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    }
  },
  "required": [
    "name",
    "input",
    "idempotency_key",
    "effective_at"
  ],
  "additionalProperties": false
}
```

## Accepted command receipt


```json
{
  "type": "object",
  "required": [
    "commandId",
    "replayed",
    "result",
    "events"
  ],
  "properties": {
    "commandId": {
      "type": "string"
    },
    "replayed": {
      "type": "boolean"
    },
    "imported": {
      "const": true,
      "description": "The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."
    },
    "result": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "resolved"
      ],
      "properties": {
        "resolved": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50
        }
      }
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "cid": {
            "type": "string"
          }
        }
      }
    }
  }
}
```

## Example request


```json
{
  "name": "contracts.resolve_usage_review",
  "input": {
    "contractId": "ctr_example",
    "effectiveAt": "2026-11-01T00:00:00Z",
    "decision": "Accept the vendor's credit",
    "reason": "Confirmed with support",
    "items": [
      {
        "reason": "credit_unfunded",
        "activityKey": "actions",
        "periodKey": "2026-09-01T00:00:00.000Z/2026-10-01T00:00:00.000Z",
        "sourceFactId": "invoice:1"
      }
    ]
  },
  "effective_at": "2026-09-01T00:00:00Z",
  "idempotency_key": "contracts.resolve_usage_review-example-0"
}
```


