> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useautumn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify

> Checks a customer's Stripe subscriptions against Autumn's record of their plans and reports any drift. Read-only: it never changes Autumn or Stripe.

Use this endpoint to audit that a customer's Stripe subscriptions, items, quantities, prices, schedules and cancellation state match what Autumn expects, for example after a migration or a manual change in Stripe.

export const DynamicResponseExample = ({json, statusCode = "200"}) => {
  const toCamelCase = str => {
    return str.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
  };
  const convertKeysToCamelCase = obj => {
    if (Array.isArray(obj)) {
      return obj.map(item => convertKeysToCamelCase(item));
    }
    if (obj !== null && typeof obj === "object") {
      return Object.keys(obj).reduce((acc, key) => {
        const camelKey = toCamelCase(key);
        acc[camelKey] = convertKeysToCamelCase(obj[key]);
        return acc;
      }, {});
    }
    return obj;
  };
  const [isTypeScript, setIsTypeScript] = useState(() => {
    if (typeof window !== "undefined") {
      try {
        const lang = localStorage.getItem("code");
        return JSON.parse(lang) === "typescript";
      } catch {
        return true;
      }
    }
    return true;
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      if (event.detail?.key === "code") {
        try {
          const value = JSON.parse(event.detail.value);
          setIsTypeScript(value === "typescript");
        } catch {}
      }
    };
    const pollInterval = setInterval(() => {
      try {
        const lang = localStorage.getItem("code");
        const value = JSON.parse(lang);
        setIsTypeScript(value === "typescript");
      } catch {}
    }, 300);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, []);
  const camelCaseJson = useMemo(() => convertKeysToCamelCase(json), [json]);
  const snakeCaseString = JSON.stringify(json, null, 2);
  const camelCaseString = JSON.stringify(camelCaseJson, null, 2);
  return <ResponseExample>
			{isTypeScript ? <CodeBlock language="json" filename={statusCode}>
					{camelCaseString}
				</CodeBlock> : <CodeBlock language="json" filename={statusCode}>
					{snakeCaseString}
				</CodeBlock>}
		</ResponseExample>;
};

export const DynamicResponseField = ({children, name, ...props}) => {
  const convertToCamelCase = str => {
    if (typeof str !== "string") return str;
    return str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase());
  };
  const [lang, setLang] = useState(() => {
    if (typeof window !== "undefined") {
      const stored = localStorage.getItem("code");
      return stored || '"typescript"';
    }
    return '"typescript"';
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      const key = event.detail?.key;
      if (key === "code") {
        setLang(event.detail.value);
      }
    };
    const pollInterval = setInterval(() => {
      const current = localStorage.getItem("code");
      if (current && current !== lang) {
        setLang(current);
      }
    }, 500);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, [lang]);
  const resolvedName = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(name) : name;
    } catch {
      return name;
    }
  }, [name, lang]);
  return <ResponseField name={resolvedName} {...props}>
			{children}
		</ResponseField>;
};

export const DynamicParamField = ({children, body, path, ...props}) => {
  const convertToCamelCase = str => {
    if (typeof str !== "string") return str;
    return str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase());
  };
  const [lang, setLang] = useState(() => {
    if (typeof window !== "undefined") {
      const stored = localStorage.getItem("code");
      return stored || '"typescript"';
    }
    return '"typescript"';
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      const key = event.detail?.key;
      if (key === "code") {
        setLang(event.detail.value);
      }
    };
    const pollInterval = setInterval(() => {
      const current = localStorage.getItem("code");
      if (current && current !== lang) {
        setLang(current);
      }
    }, 500);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, [lang]);
  const resolvedBody = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(body) : body;
    } catch {
      return body;
    }
  }, [body, lang]);
  const resolvedPath = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(path) : path;
    } catch {
      return path;
    }
  }, [path, lang]);
  return <ParamField body={resolvedBody} path={resolvedPath} {...props}>
			{children}
		</ParamField>;
};

<Note>
  Verify checks a customer's Stripe subscriptions against the plans Autumn
  has on record and reports any drift, such as missing or unexpected items,
  quantity or price differences, schedule mismatches and cancellation state.
  It is read-only and never changes Autumn or Stripe.
</Note>

### Common Use Cases

<CodeGroup>
  ```typescript Verify all subscriptions theme={null}
  const response = await autumn.billing.verify({
      customerId: "cus_123",
  });

  const drifted = response.subscriptions.filter(
      (subscription) => subscription.status === "mismatched",
  );
  ```

  ```typescript Verify specific subscriptions in strict mode theme={null}
  const response = await autumn.billing.verify({
      customerId: "cus_123",
      subscriptionIds: ["sub_1234"],
      strict: true,
  });
  ```
</CodeGroup>

Each mismatch carries a `message` you can show as-is and a `severity`. Warnings,
like a Stripe subscription with no Autumn plan linked to it, can be deliberate;
errors mean Stripe will bill differently from what Autumn expects.

### Body Parameters

<DynamicParamField body="customer_id" type="string" required>
  Autumn customer whose Stripe subscriptions should be checked against Autumn's customer\_products.
</DynamicParamField>

<DynamicParamField body="subscription_ids" type="string[]">
  Optional whitelist of Stripe subscription IDs to verify. Defaults to every subscription linked to the customer's plans, plus any other active Stripe subscription on the customer, which is reported as not linked to Autumn.
</DynamicParamField>

<DynamicParamField body="strict" type="boolean">
  When true, report missing usage-based items and unexpected metered Stripe items. Defaults to false.
</DynamicParamField>

### Response

<DynamicResponseField name="customer_id" type="string" />

<DynamicResponseField name="customer_mismatches" type="object | object | object | object | object | object | object | object | object | object | object | object[]">
  <Expandable title="properties">
    <DynamicResponseField name="type" type="any" />

    <DynamicResponseField name="message" type="string">
      Human-readable one-line description of the mismatch.
    </DynamicResponseField>

    <DynamicResponseField name="severity" type="'error' | 'warning'">
      How serious the mismatch is — warnings (e.g. a Stripe-only subscription) can be deliberate.
    </DynamicResponseField>

    <DynamicResponseField name="reason" type="'missing' | 'unexpected' | 'amount_mismatch'" />

    <DynamicResponseField name="expected_price_id" type="string" />

    <DynamicResponseField name="actual_price_id" type="string">
      The Stripe price of the item this mismatch is about.
    </DynamicResponseField>

    <DynamicResponseField name="expected_amount" type="string" />

    <DynamicResponseField name="actual_amount" type="string" />

    <DynamicResponseField name="plan_name" type="string" />

    <DynamicResponseField name="plan_id" type="string">
      The Autumn plan this mismatch belongs to, when resolvable.
    </DynamicResponseField>

    <DynamicResponseField name="price_amount" type="number" />

    <DynamicResponseField name="price_interval" type="string" />

    <DynamicResponseField name="price_interval_count" type="number" />

    <DynamicResponseField name="expected_quantity" type="number" />

    <DynamicResponseField name="phase_starts_at" type="number">
      Present when the mismatch is inside a future scheduled phase rather than the current subscription.
    </DynamicResponseField>

    <DynamicResponseField name="price_type" type="'usage' | 'prepaid' | 'allocated' | 'fixed'" />

    <DynamicResponseField name="feature_id" type="string" />

    <DynamicResponseField name="actual_quantity" type="number" />

    <DynamicResponseField name="expected_unit_amount" type="string" />

    <DynamicResponseField name="actual_unit_amount" type="string" />

    <DynamicResponseField name="expected_phase_count" type="number" />

    <DynamicResponseField name="actual_phase_count" type="number" />

    <DynamicResponseField name="actual_phase_starts_at" type="number[]" />

    <DynamicResponseField name="expected_canceling" type="boolean" />

    <DynamicResponseField name="actual_canceling" type="boolean" />

    <DynamicResponseField name="missing_reward_ids" type="string[]" />

    <DynamicResponseField name="unexpected_reward_ids" type="string[]" />

    <DynamicResponseField name="ending_subscription_id" type="string" />

    <DynamicResponseField name="error" type="string" />

    <DynamicResponseField name="stripe_customer_id" type="string" />

    <DynamicResponseField name="other_customer_ids" type="string[]" />

    <DynamicResponseField name="other_customers" type="object[]">
      <Expandable title="properties">
        <DynamicResponseField name="id" type="string" />

        <DynamicResponseField name="name" type="string | null" />

        <DynamicResponseField name="email" type="string | null" />
      </Expandable>
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="subscriptions" type="object[]">
  <Expandable title="properties">
    <DynamicResponseField name="stripe_subscription_id" type="string" />

    <DynamicResponseField name="status" type="'correct' | 'mismatched'" />

    <DynamicResponseField name="mismatches" type="object | object | object | object | object | object | object | object | object | object | object | object[]">
      <Expandable title="properties">
        <DynamicResponseField name="type" type="any" />

        <DynamicResponseField name="message" type="string">
          Human-readable one-line description of the mismatch.
        </DynamicResponseField>

        <DynamicResponseField name="severity" type="'error' | 'warning'">
          How serious the mismatch is — warnings (e.g. a Stripe-only subscription) can be deliberate.
        </DynamicResponseField>

        <DynamicResponseField name="reason" type="'missing' | 'unexpected' | 'amount_mismatch'" />

        <DynamicResponseField name="expected_price_id" type="string" />

        <DynamicResponseField name="actual_price_id" type="string">
          The Stripe price of the item this mismatch is about.
        </DynamicResponseField>

        <DynamicResponseField name="expected_amount" type="string" />

        <DynamicResponseField name="actual_amount" type="string" />

        <DynamicResponseField name="plan_name" type="string" />

        <DynamicResponseField name="plan_id" type="string">
          The Autumn plan this mismatch belongs to, when resolvable.
        </DynamicResponseField>

        <DynamicResponseField name="price_amount" type="number" />

        <DynamicResponseField name="price_interval" type="string" />

        <DynamicResponseField name="price_interval_count" type="number" />

        <DynamicResponseField name="expected_quantity" type="number" />

        <DynamicResponseField name="phase_starts_at" type="number">
          Present when the mismatch is inside a future scheduled phase rather than the current subscription.
        </DynamicResponseField>

        <DynamicResponseField name="price_type" type="'usage' | 'prepaid' | 'allocated' | 'fixed'" />

        <DynamicResponseField name="feature_id" type="string" />

        <DynamicResponseField name="actual_quantity" type="number" />

        <DynamicResponseField name="expected_unit_amount" type="string" />

        <DynamicResponseField name="actual_unit_amount" type="string" />

        <DynamicResponseField name="expected_phase_count" type="number" />

        <DynamicResponseField name="actual_phase_count" type="number" />

        <DynamicResponseField name="actual_phase_starts_at" type="number[]" />

        <DynamicResponseField name="expected_canceling" type="boolean" />

        <DynamicResponseField name="actual_canceling" type="boolean" />

        <DynamicResponseField name="missing_reward_ids" type="string[]" />

        <DynamicResponseField name="unexpected_reward_ids" type="string[]" />

        <DynamicResponseField name="ending_subscription_id" type="string" />

        <DynamicResponseField name="error" type="string" />

        <DynamicResponseField name="stripe_customer_id" type="string" />

        <DynamicResponseField name="other_customer_ids" type="string[]" />

        <DynamicResponseField name="other_customers" type="object[]">
          <Expandable title="properties">
            <DynamicResponseField name="id" type="string" />

            <DynamicResponseField name="name" type="string | null" />

            <DynamicResponseField name="email" type="string | null" />
          </Expandable>
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "customer_id": "cus_123",
    "customer_mismatches": [],
    "subscriptions": [
      {
        "stripe_subscription_id": "sub_1234",
        "status": "mismatched",
        "mismatches": [
          {
            "type": "prepaid_quantity_mismatch",
            "message": "Prepaid seats quantity differs — expected 10, Stripe has 5",
            "severity": "error",
            "actual_price_id": "price_1234",
            "feature_id": "seats",
            "plan_id": "pro_plan",
            "expected_quantity": 10,
            "actual_quantity": 5
          }
        ]
      },
      {
        "stripe_subscription_id": "sub_5678",
        "status": "correct",
        "mismatches": []
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi POST /v1/billing.verify
openapi: 3.1.0
info:
  title: Autumn API
  version: 2.4.0
servers:
  - url: https://api.useautumn.com
    description: Production server
security:
  - secretKey: []
paths:
  /v1/billing.verify:
    post:
      tags:
        - billing
      description: >-
        Checks a customer's Stripe subscriptions against Autumn's record of
        their plans and reports any drift. Read-only: it never changes Autumn or
        Stripe.


        Use this endpoint to audit that a customer's Stripe subscriptions,
        items, quantities, prices, schedules and cancellation state match what
        Autumn expects, for example after a migration or a manual change in
        Stripe.
      operationId: verify
      parameters:
        - name: x-api-version
          in: header
          required: true
          schema:
            type: string
            default: 2.4.0
          x-speakeasy-globals-hidden: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: string
                  description: >-
                    Autumn customer whose Stripe subscriptions should be checked
                    against Autumn's customer_products.
                subscription_ids:
                  type: array
                  items:
                    type: string
                  description: >-
                    Optional whitelist of Stripe subscription IDs to verify.
                    Defaults to every subscription linked to the customer's
                    plans, plus any other active Stripe subscription on the
                    customer, which is reported as not linked to Autumn.
                strict:
                  type: boolean
                  description: >-
                    When true, report missing usage-based items and unexpected
                    metered Stripe items. Defaults to false.
              required:
                - customer_id
              title: VerifyParams
              examples:
                - customer_id: cus_123
            example:
              customer_id: cus_123
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  customer_id:
                    type: string
                  customer_mismatches:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            type:
                              const: base_price_mismatch
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                            reason:
                              enum:
                                - missing
                                - unexpected
                                - amount_mismatch
                              type: string
                            expected_price_id:
                              type: string
                            actual_price_id:
                              type: string
                            expected_amount:
                              type: string
                            actual_amount:
                              type: string
                            plan_name:
                              type: string
                            plan_id:
                              type: string
                              description: >-
                                The Autumn plan this mismatch belongs to, when
                                resolvable.
                            price_amount:
                              type: number
                            price_interval:
                              type: string
                            price_interval_count:
                              type: number
                            expected_quantity:
                              type: number
                            phase_starts_at:
                              type: number
                          required:
                            - type
                            - reason
                        - type: object
                          properties:
                            type:
                              const: item_mismatch
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                            reason:
                              enum:
                                - missing
                                - unexpected
                                - quantity_mismatch
                                - price_mismatch
                              type: string
                            expected_price_id:
                              type: string
                            actual_price_id:
                              type: string
                            price_type:
                              enum:
                                - usage
                                - prepaid
                                - allocated
                                - fixed
                              type: string
                            feature_id:
                              type: string
                            expected_quantity:
                              type: number
                            actual_quantity:
                              type: number
                            plan_name:
                              type: string
                            plan_id:
                              type: string
                              description: >-
                                The Autumn plan this mismatch belongs to, when
                                resolvable.
                            price_amount:
                              type: number
                            price_interval:
                              type: string
                            price_interval_count:
                              type: number
                            phase_starts_at:
                              type: number
                              description: >-
                                Present when the mismatch is inside a future
                                scheduled phase rather than the current
                                subscription.
                          required:
                            - type
                            - reason
                        - type: object
                          properties:
                            type:
                              const: prepaid_quantity_mismatch
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                            actual_price_id:
                              type: string
                              description: >-
                                The Stripe price of the item this mismatch is
                                about.
                            feature_id:
                              type: string
                            plan_id:
                              type: string
                              description: >-
                                The Autumn plan this mismatch belongs to, when
                                resolvable.
                            expected_quantity:
                              type: number
                            actual_quantity:
                              type: number
                            phase_starts_at:
                              type: number
                          required:
                            - type
                            - feature_id
                            - expected_quantity
                            - actual_quantity
                        - type: object
                          properties:
                            type:
                              const: prepaid_price_mismatch
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                            actual_price_id:
                              type: string
                              description: >-
                                The Stripe price of the item this mismatch is
                                about.
                            feature_id:
                              type: string
                            expected_unit_amount:
                              type: string
                            actual_unit_amount:
                              type: string
                            phase_starts_at:
                              type: number
                          required:
                            - type
                            - feature_id
                            - expected_unit_amount
                            - actual_unit_amount
                        - type: object
                          properties:
                            type:
                              const: schedule_mismatch
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                            reason:
                              enum:
                                - missing_schedule
                                - unexpected_schedule
                                - phase_count_mismatch
                                - phase_start_mismatch
                                - billing_cycle_anchor_mismatch
                              type: string
                            expected_phase_count:
                              type: number
                            actual_phase_count:
                              type: number
                            actual_phase_starts_at:
                              type: array
                              items:
                                type: number
                            phase_starts_at:
                              type: number
                          required:
                            - type
                            - reason
                        - type: object
                          properties:
                            type:
                              const: cancel_state_mismatch
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                            expected_canceling:
                              type: boolean
                            actual_canceling:
                              type: boolean
                          required:
                            - type
                            - expected_canceling
                            - actual_canceling
                        - type: object
                          properties:
                            type:
                              const: reward_mismatch
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                            missing_reward_ids:
                              type: array
                              items:
                                type: string
                            unexpected_reward_ids:
                              type: array
                              items:
                                type: string
                          required:
                            - type
                            - missing_reward_ids
                            - unexpected_reward_ids
                        - type: object
                          properties:
                            type:
                              const: stripe_sub_not_in_autumn
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                          required:
                            - type
                        - type: object
                          properties:
                            type:
                              const: plan_on_ending_subscription
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                            ending_subscription_id:
                              type: string
                          required:
                            - type
                            - ending_subscription_id
                        - type: object
                          properties:
                            type:
                              const: stale_subscription_link
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                          required:
                            - type
                        - type: object
                          properties:
                            type:
                              const: expected_state_error
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                            error:
                              type: string
                          required:
                            - type
                            - error
                        - type: object
                          properties:
                            type:
                              const: shared_stripe_customer
                            message:
                              type: string
                              description: >-
                                Human-readable one-line description of the
                                mismatch.
                            severity:
                              enum:
                                - error
                                - warning
                              type: string
                              description: >-
                                How serious the mismatch is — warnings (e.g. a
                                Stripe-only subscription) can be deliberate.
                            stripe_customer_id:
                              type: string
                            other_customer_ids:
                              type: array
                              items:
                                type: string
                            other_customers:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  name:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                  email:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                required:
                                  - id
                                  - name
                                  - email
                          required:
                            - type
                            - stripe_customer_id
                            - other_customer_ids
                  subscriptions:
                    type: array
                    items:
                      type: object
                      properties:
                        stripe_subscription_id:
                          type: string
                        status:
                          enum:
                            - correct
                            - mismatched
                          type: string
                        mismatches:
                          type: array
                          items:
                            anyOf:
                              - type: object
                                properties:
                                  type:
                                    const: base_price_mismatch
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                  reason:
                                    enum:
                                      - missing
                                      - unexpected
                                      - amount_mismatch
                                    type: string
                                  expected_price_id:
                                    type: string
                                  actual_price_id:
                                    type: string
                                  expected_amount:
                                    type: string
                                  actual_amount:
                                    type: string
                                  plan_name:
                                    type: string
                                  plan_id:
                                    type: string
                                    description: >-
                                      The Autumn plan this mismatch belongs to,
                                      when resolvable.
                                  price_amount:
                                    type: number
                                  price_interval:
                                    type: string
                                  price_interval_count:
                                    type: number
                                  expected_quantity:
                                    type: number
                                  phase_starts_at:
                                    type: number
                                required:
                                  - type
                                  - reason
                              - type: object
                                properties:
                                  type:
                                    const: item_mismatch
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                  reason:
                                    enum:
                                      - missing
                                      - unexpected
                                      - quantity_mismatch
                                      - price_mismatch
                                    type: string
                                  expected_price_id:
                                    type: string
                                  actual_price_id:
                                    type: string
                                  price_type:
                                    enum:
                                      - usage
                                      - prepaid
                                      - allocated
                                      - fixed
                                    type: string
                                  feature_id:
                                    type: string
                                  expected_quantity:
                                    type: number
                                  actual_quantity:
                                    type: number
                                  plan_name:
                                    type: string
                                  plan_id:
                                    type: string
                                    description: >-
                                      The Autumn plan this mismatch belongs to,
                                      when resolvable.
                                  price_amount:
                                    type: number
                                  price_interval:
                                    type: string
                                  price_interval_count:
                                    type: number
                                  phase_starts_at:
                                    type: number
                                    description: >-
                                      Present when the mismatch is inside a
                                      future scheduled phase rather than the
                                      current subscription.
                                required:
                                  - type
                                  - reason
                              - type: object
                                properties:
                                  type:
                                    const: prepaid_quantity_mismatch
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                  actual_price_id:
                                    type: string
                                    description: >-
                                      The Stripe price of the item this mismatch
                                      is about.
                                  feature_id:
                                    type: string
                                  plan_id:
                                    type: string
                                    description: >-
                                      The Autumn plan this mismatch belongs to,
                                      when resolvable.
                                  expected_quantity:
                                    type: number
                                  actual_quantity:
                                    type: number
                                  phase_starts_at:
                                    type: number
                                required:
                                  - type
                                  - feature_id
                                  - expected_quantity
                                  - actual_quantity
                              - type: object
                                properties:
                                  type:
                                    const: prepaid_price_mismatch
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                  actual_price_id:
                                    type: string
                                    description: >-
                                      The Stripe price of the item this mismatch
                                      is about.
                                  feature_id:
                                    type: string
                                  expected_unit_amount:
                                    type: string
                                  actual_unit_amount:
                                    type: string
                                  phase_starts_at:
                                    type: number
                                required:
                                  - type
                                  - feature_id
                                  - expected_unit_amount
                                  - actual_unit_amount
                              - type: object
                                properties:
                                  type:
                                    const: schedule_mismatch
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                  reason:
                                    enum:
                                      - missing_schedule
                                      - unexpected_schedule
                                      - phase_count_mismatch
                                      - phase_start_mismatch
                                      - billing_cycle_anchor_mismatch
                                    type: string
                                  expected_phase_count:
                                    type: number
                                  actual_phase_count:
                                    type: number
                                  actual_phase_starts_at:
                                    type: array
                                    items:
                                      type: number
                                  phase_starts_at:
                                    type: number
                                required:
                                  - type
                                  - reason
                              - type: object
                                properties:
                                  type:
                                    const: cancel_state_mismatch
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                  expected_canceling:
                                    type: boolean
                                  actual_canceling:
                                    type: boolean
                                required:
                                  - type
                                  - expected_canceling
                                  - actual_canceling
                              - type: object
                                properties:
                                  type:
                                    const: reward_mismatch
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                  missing_reward_ids:
                                    type: array
                                    items:
                                      type: string
                                  unexpected_reward_ids:
                                    type: array
                                    items:
                                      type: string
                                required:
                                  - type
                                  - missing_reward_ids
                                  - unexpected_reward_ids
                              - type: object
                                properties:
                                  type:
                                    const: stripe_sub_not_in_autumn
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                required:
                                  - type
                              - type: object
                                properties:
                                  type:
                                    const: plan_on_ending_subscription
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                  ending_subscription_id:
                                    type: string
                                required:
                                  - type
                                  - ending_subscription_id
                              - type: object
                                properties:
                                  type:
                                    const: stale_subscription_link
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                required:
                                  - type
                              - type: object
                                properties:
                                  type:
                                    const: expected_state_error
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                  error:
                                    type: string
                                required:
                                  - type
                                  - error
                              - type: object
                                properties:
                                  type:
                                    const: shared_stripe_customer
                                  message:
                                    type: string
                                    description: >-
                                      Human-readable one-line description of the
                                      mismatch.
                                  severity:
                                    enum:
                                      - error
                                      - warning
                                    type: string
                                    description: >-
                                      How serious the mismatch is — warnings
                                      (e.g. a Stripe-only subscription) can be
                                      deliberate.
                                  stripe_customer_id:
                                    type: string
                                  other_customer_ids:
                                    type: array
                                    items:
                                      type: string
                                  other_customers:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                        name:
                                          anyOf:
                                            - type: string
                                            - type: 'null'
                                        email:
                                          anyOf:
                                            - type: string
                                            - type: 'null'
                                      required:
                                        - id
                                        - name
                                        - email
                                required:
                                  - type
                                  - stripe_customer_id
                                  - other_customer_ids
                      required:
                        - stripe_subscription_id
                        - status
                        - mismatches
                required:
                  - customer_id
                  - customer_mismatches
                  - subscriptions
                title: VerifyResponse
                examples:
                  - customer_id: cus_123
                    customer_mismatches: []
                    subscriptions:
                      - stripe_subscription_id: sub_1234
                        status: mismatched
                        mismatches:
                          - type: prepaid_quantity_mismatch
                            message: >-
                              Prepaid seats quantity differs — expected 10,
                              Stripe has 5
                            severity: error
                            actual_price_id: price_1234
                            feature_id: seats
                            plan_id: pro_plan
                            expected_quantity: 10
                            actual_quantity: 5
                      - stripe_subscription_id: sub_5678
                        status: correct
                        mismatches: []
              example:
                customer_id: cus_123
                customer_mismatches: []
                subscriptions:
                  - stripe_subscription_id: sub_1234
                    status: mismatched
                    mismatches:
                      - type: prepaid_quantity_mismatch
                        message: >-
                          Prepaid seats quantity differs — expected 10, Stripe
                          has 5
                        severity: error
                        actual_price_id: price_1234
                        feature_id: seats
                        plan_id: pro_plan
                        expected_quantity: 10
                        actual_quantity: 5
                  - stripe_subscription_id: sub_5678
                    status: correct
                    mismatches: []
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Autumn } from 'autumn-js'

            const autumn = new Autumn()

            const result = await autumn.billing.verify({
              customerId: "cus_123",
            });
        - lang: python
          label: Python (SDK)
          source: |-
            from autumn_sdk import Autumn

            autumn = Autumn(secret_key="am_sk_test...")

            res = autumn.billing.verify(customer_id="cus_123")
components:
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````