expected_version.
All routes require an authenticated Medusa Admin user. Unauthenticated requests return
401.Field reference
| Field | Type | Description |
|---|---|---|
settings_key | string | Always global in MVP. |
default_trial_days | number | Default trial length in days. Must be >= 0. |
dunning_retry_intervals | number[] | Retry schedule in minutes. Must be strictly increasing positive integers. |
max_dunning_attempts | number | Maximum retry attempts. Must equal the number of intervals. |
default_renewal_behavior | string | process_immediately or require_review_for_pending_changes. |
default_cancellation_behavior | string | recommend_retention_first or allow_direct_cancellation. |
version | number | Monotonic version for optimistic locking. |
is_persisted | boolean | false when the response uses fallback defaults; true when a stored record exists. |
GET /admin/subscription-settings
Returns the effective settings payload. When no record has been saved yet the response uses hardcoded fallback defaults andis_persisted is false. This route never returns 404.
Response
Fallback response example
Persisted response example
POST /admin/subscription-settings
Persists a new or updated settings singleton through the dedicated workflow. The first successful POST creates the record. Omitted fields retain their current effective value.Body parameters
Default trial length in days. Must be
>= 0.Retry intervals in minutes. Must be strictly increasing positive integers. Length must equal
max_dunning_attempts.Maximum retry attempts. Must be a positive integer equal to the number of intervals.
Global renewal policy. One of
process_immediately or require_review_for_pending_changes.Global cancellation policy. One of
recommend_retention_first or allow_direct_cancellation.Current version for optimistic locking. Use
0 on the first write.Optional reason for the update, recorded in the audit log.
Request example
Response
Returns the updatedsubscription_settings object. The metadata.audit_log and metadata.last_update fields record the change summary.
Response example
Errors
| Code | Error | Meaning |
|---|---|---|
400 | invalid_data | Invalid scalar ranges, invalid enum values, invalid retry interval list, or mismatched max_dunning_attempts |
409 | conflict | Stale expected_version — optimistic locking mismatch |
500 | unexpected_state | Unexpected workflow or persistence failure |