import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.billing.verify({
customerId: "cus_123",
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.billing.verify(customer_id="cus_123")curl --request POST \
--url https://api.useautumn.com/v1/billing.verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"customer_id": "cus_123"
}
'{
"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": []
}
]
}
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.
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.billing.verify({
customerId: "cus_123",
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.billing.verify(customer_id="cus_123")curl --request POST \
--url https://api.useautumn.com/v1/billing.verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"customer_id": "cus_123"
}
'{
"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": []
}
]
}
Common Use Cases
const response = await autumn.billing.verify({
customerId: "cus_123",
});
const drifted = response.subscriptions.filter(
(subscription) => subscription.status === "mismatched",
);
const response = await autumn.billing.verify({
customerId: "cus_123",
subscriptionIds: ["sub_1234"],
strict: true,
});
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
Response
{
"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": []
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
Autumn customer whose Stripe subscriptions should be checked against Autumn's customer_products.
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.
When true, report missing usage-based items and unexpected metered Stripe items. Defaults to false.