Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/useautumn/autumn/llms.txt

Use this file to discover all available pages before exploring further.

Error Response Format

All Autumn API errors follow a consistent JSON structure:
{
  "message": "Human-readable error description",
  "code": "machine_readable_error_code",
  "env": "sandbox"
}

Response Fields

FieldTypeDescription
messagestringHuman-readable error description
codestringMachine-readable error code for programmatic handling
envstringEnvironment where the error occurred (sandbox or live)

HTTP Status Codes

Autumn uses standard HTTP status codes to indicate the success or failure of requests:
Status CodeMeaningDescription
200OKRequest succeeded
400Bad RequestInvalid request parameters or validation error
401UnauthorizedAuthentication failed or missing
403ForbiddenAuthenticated but not authorized
404Not FoundResource doesn’t exist
500Internal Server ErrorSomething went wrong on Autumn’s servers

Error Categories

Authentication Errors (401)

Errors related to API authentication and authorization.
CodeDescription
no_secret_keyAuthorization header missing
invalid_secret_keyAPI key is invalid or malformed
no_auth_headerNo authentication header provided
invalid_auth_headerAuthorization header format is incorrect
failed_to_verify_secret_keyCould not verify the secret key
failed_to_fetch_key_from_autumnFailed to retrieve key data
no_publishable_keyPublishable key missing
invalid_publishable_keyPublishable key is invalid
get_org_from_publishable_key_failedCould not fetch organization from publishable key
endpoint_not_publicEndpoint not accessible with publishable key
failed_to_verify_publishable_keyCould not verify the publishable key
invalid_api_versionAPI version header is invalid
{
  "message": "Secret key not found in Authorization header",
  "code": "no_secret_key",
  "env": "sandbox"
}

Validation Errors (400)

Errors related to invalid input parameters or request validation.
CodeDescription
invalid_inputsRequest parameters failed validation
invalid_requestMalformed request
invalid_expandInvalid expand parameter
invalid_optionsInvalid request options
Example: Validation Error
{
  "message": "email: must be a valid email address",
  "code": "invalid_inputs",
  "env": "sandbox"
}

Idempotency Errors (400/409)

Errors related to idempotent request handling.
CodeDescription
idempotency_key_already_existsIdempotency key already used with different parameters
idempotency_key_not_foundIdempotency key not found
duplicate_idempotency_keyDuplicate idempotency key

Organization Errors (404/400)

Errors related to organization operations.
CodeDescription
org_not_foundOrganization not found
org_has_customersCannot delete organization with existing customers

Customer Errors (400/404)

Errors related to customer operations.
CodeDescription
customer_not_foundCustomer not found
customers_not_foundNo customers found
invalid_customerInvalid customer data
create_customer_failedFailed to create customer
duplicate_customer_idCustomer ID already exists
duplicate_customer_emailCustomer email already exists
customer_already_has_productCustomer already subscribed to this product
customer_has_no_payment_methodCustomer has no payment method on file
customer_has_no_base_productCustomer has no base product
attach_product_to_customer_failedFailed to attach product to customer
customer_entitlement_not_foundCustomer entitlement not found
multiple_customers_foundMultiple customers found with same identifier
invalid_update_customer_paramsInvalid parameters for customer update

Product Errors (404/400)

Errors related to product and pricing operations.
CodeDescription
product_not_foundProduct not found
price_not_foundPrice not found
create_price_failedFailed to create price
invalid_priceInvalid price data
invalid_price_idInvalid price ID
invalid_price_optionsInvalid price options
invalid_price_configInvalid price configuration
cus_price_not_foundCustomer price not found
cus_product_not_foundCustomer product not found
no_active_cus_productsNo active customer products
get_cus_products_failedFailed to retrieve customer products
get_cus_price_failedFailed to retrieve customer price
duplicate_subscription_idSubscription ID already exists

Feature Errors (400/404)

Errors related to feature flag and entitlement operations.
CodeDescription
feature_not_foundFeature not found
invalid_featureInvalid feature data
duplicate_feature_idFeature ID already exists
invalid_event_nameInvalid event name
feature_limit_reachedFeature limit reached
invalid_entitlementInvalid entitlement data
create_entitlement_failedFailed to create entitlement
delete_entitlement_failedFailed to delete entitlement
insufficient_balanceInsufficient balance for operation

Stripe Errors (400/500)

Errors related to Stripe payment processing.
CodeDescription
stripe_errorGeneral Stripe error
stripe_key_invalidStripe API key is invalid
stripe_key_not_foundStripe key not configured
stripe_config_not_foundStripe configuration not found
stripe_delete_customer_failedFailed to delete Stripe customer
stripe_create_customer_failedFailed to create Stripe customer
stripe_create_product_failedFailed to create Stripe product
stripe_cancel_subscription_failedFailed to cancel Stripe subscription
stripe_get_payment_method_failedFailed to retrieve payment method
stripe_card_declinedCard was declined
stripe_update_subscription_failedFailed to update subscription
stripe_cancel_subscription_schedule_failedFailed to cancel subscription schedule
stripe_create_subscription_failedFailed to create subscription
create_stripe_product_failedFailed to create Stripe product
delete_stripe_product_failedFailed to delete Stripe product
create_stripe_subscription_failedFailed to create Stripe subscription
Example: Stripe Error
{
  "message": "(Stripe Error) Your card was declined.",
  "code": "stripe_error",
  "env": "live"
}

Invoice Errors (400/500)

Errors related to invoice operations.
CodeDescription
create_invoice_failedFailed to create invoice
invoice_payment_failedFailed to process invoice payment

Event Errors (400/409)

Errors related to event tracking.
CodeDescription
invalid_eventInvalid event data
create_event_failedFailed to create event
duplicate_eventDuplicate event

Rewards & Referral Errors (400/404)

Errors related to rewards and referral programs.
CodeDescription
invalid_rewardInvalid reward data
reward_not_foundReward not found
reward_program_not_foundReward program not found
promo_code_already_exists_in_stripePromo code already exists in Stripe
referral_code_max_redemptions_reachedReferral code max redemptions reached
referral_not_foundReferral not found
referral_code_not_foundReferral code not found
customer_already_redeemed_referral_codeCustomer already redeemed this referral code
customer_cannot_redeem_own_codeCustomer cannot redeem their own referral code
insert_reward_program_failedFailed to insert reward program
insert_referral_code_failedFailed to insert referral code
update_reward_redemption_failedFailed to update reward redemption
reward_redemption_not_foundReward redemption not found
insert_reward_redemption_failedFailed to insert reward redemption

Entity Errors (400/404)

Errors related to entity operations.
CodeDescription
entity_not_foundEntity not found
entity_already_deletedEntity already deleted
entity_id_requiredEntity ID is required
entity_balance_not_foundEntity balance not found
invalid_product_itemInvalid product item

Internal Errors (500)

Errors indicating server-side issues.
CodeDescription
internal_errorInternal server error
supabase_not_foundSupabase configuration not found
tinybird_disabledTinybird analytics disabled
payment_method_not_foundPayment method not found
Example: Internal Error
{
  "message": "An unexpected error occurred",
  "code": "internal_error",
  "env": "sandbox"
}

Vercel Integration Errors (400/404)

Errors related to Vercel marketplace integration.
CodeDescription
vercel_subscription_already_existsVercel subscription already exists
vercel_subscription_not_foundVercel subscription not found
vercel_resource_not_foundVercel resource not found

Migration Errors (400/409)

Errors related to data migration operations.
CodeDescription
insert_migration_job_failedFailed to create migration job
insert_migration_error_failedFailed to log migration error
migration_job_not_foundMigration job not found
migration_already_in_progressMigration already in progress

Error Handling Best Practices

Always check the HTTP status code before parsing the error response. This gives you a quick indication of the error category:
  • 4xx - Client errors (fix your request)
  • 5xx - Server errors (retry or contact support)
Use the code field for programmatic error handling, not the message field. Error messages may change, but codes remain stable:
if (error.code === 'customer_not_found') {
  // Handle missing customer
} else if (error.code === 'stripe_card_declined') {
  // Handle payment failure
}
For 5xx errors and certain 4xx errors (like rate limiting), implement exponential backoff retry logic:
async function makeRequestWithRetry(url, options, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      const response = await fetch(url, options);
      if (response.ok) return response;
      
      if (response.status >= 500 && i < maxRetries - 1) {
        await new Promise(resolve => 
          setTimeout(resolve, Math.pow(2, i) * 1000)
        );
        continue;
      }
      
      throw new Error(await response.json());
    } catch (error) {
      if (i === maxRetries - 1) throw error;
    }
  }
}
Always log error responses (including the full response body) for debugging purposes, but ensure you don’t log sensitive data like full API keys.
For validation errors (invalid_inputs), parse the error message to provide specific feedback to users:
if (error.code === 'invalid_inputs') {
  // Parse error.message to show field-specific errors
  // e.g., "email: must be a valid email address"
  const field = error.message.split(':')[0];
  const issue = error.message.split(':')[1];
  showFieldError(field, issue);
}
Never expose detailed error messages to end users. Error messages may contain sensitive information. Instead, show user-friendly messages and log the full error details for debugging.

Contact Support

If you encounter persistent errors or need help:
  • Check the Autumn documentation
  • Contact support with the error code and request ID
  • Include relevant logs (without sensitive data)

Build docs developers (and LLMs) love