{"lexicon":1,"id":"money.atmosphere.catalog.replacePrice","defs":{"main":{"type":"procedure","description":"Mint a new immutable money.atmosphere.price and atomically repoint an app-owned Product's defaultPrice in the same repository commit. Requires app service auth, an exact current Product strongRef, and a caller-stable idempotency key.","input":{"encoding":"application/json","schema":{"type":"object","required":["environment","product","price","idempotencyKey"],"properties":{"environment":{"type":"string","knownValues":["test","live"],"maxLength":16},"product":{"type":"ref","ref":"com.atproto.repo.strongRef"},"price":{"type":"ref","ref":"money.atmosphere.catalog.defs#priceInput"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"description":"Stable identifier for one logical replacement. Reuse it only for exact retries; a divergent reuse fails closed."}}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["product","price","replayed"],"properties":{"product":{"type":"ref","ref":"com.atproto.repo.strongRef"},"price":{"type":"ref","ref":"com.atproto.repo.strongRef"},"replayed":{"type":"boolean","description":"True when this response adopted the exact result of an earlier request with the same idempotencyKey."}}}},"errors":[{"name":"AppEnvironmentNotConfigured","description":"The app environment is not configured in ATM."},{"name":"ProductOwnershipMismatch","description":"The Product is not owned by the calling app DID or does not use the Product collection."},{"name":"ProductNotFound","description":"ATM could not load the Product record."},{"name":"ProductVersionConflict","description":"The Product no longer matches the exact input strongRef."},{"name":"IdempotencyConflict","description":"The idempotency key is already bound to a different Price replacement outcome."},{"name":"InvalidAmount","description":"The new Price amount or customer-entered amount bounds are invalid."},{"name":"InvalidRecurringPrice","description":"The new recurring Price is missing valid recurring interval settings."},{"name":"InvalidTieredPrice","description":"The new tiered Price is missing a valid mode, ordered bounds, final unbounded tier, or per-tier amounts."},{"name":"RecipientNotPayable","description":"The Product owner has not completed payment setup for this environment."},{"name":"RecipientCurrencyUnavailable","description":"ATM could not verify the Product owner's primary settlement currency."},{"name":"RecipientCurrencyNotEnabled","description":"The Product owner's primary settlement currency is not enabled in this ATM environment."},{"name":"RecipientCurrencyMismatch","description":"The new paid Price currency does not match the Product owner's primary settlement currency."},{"name":"WriteOutcomeUnknown","description":"The atomic repository write response was ambiguous and ATM could not confirm the exact Product and Price pair."},{"name":"WriteFailed","description":"ATM could not atomically replace the Product's default Price."}]}}}