{"lexicon":1,"id":"money.atmosphere.catalog.registerAppLink","defs":{"main":{"type":"procedure","description":"Private app callback that links a creator-owned ATM product record to the app surface responsible for selling or fulfillment. Requires a service-auth JWT signed by the app DID.","input":{"encoding":"application/json","schema":{"type":"object","required":["creatorDid","product"],"properties":{"creatorDid":{"type":"string","format":"did"},"product":{"type":"ref","ref":"com.atproto.repo.strongRef"},"appProductRef":{"type":"object","properties":{"type":{"type":"string","knownValues":["shop","commission","membership","membership-tier","custom"],"maxLength":32},"id":{"type":"string","maxLength":512},"uri":{"type":"string","format":"at-uri"},"cid":{"type":"string","format":"cid"}}},"fulfillmentUrl":{"type":"string","format":"uri"},"appLabel":{"type":"string","maxGraphemes":80,"maxLength":800},"appUrl":{"type":"string","format":"uri"},"appIconUrl":{"type":"string","format":"uri"},"environment":{"type":"string","description":"ATM app environment for this private fulfillment link. Defaults to live.","knownValues":["test","live"],"maxLength":16},"role":{"type":"string","knownValues":["fulfillment","storefront","analytics"],"maxLength":32},"status":{"type":"string","knownValues":["active","archived"],"maxLength":32},"createOnly":{"type":"boolean","description":"When true, atomically insert only if no link exists for this product, app, and environment. A concurrent or pre-existing link is preserved unchanged."}}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"},"created":{"type":"boolean","description":"True when this call inserted a new link. False when createOnly preserved an existing row."}}}},"errors":[{"name":"CreatorProductMismatch","description":"Product URI authority must match creatorDid."},{"name":"ProductUnavailable","description":"The supplied product strongRef is not the exact current creator-owned record."},{"name":"RecipientAppApprovalRequired","description":"The creator has not approved this app for the linked payment type."},{"name":"RecipientAppApprovalBlocked","description":"The creator blocked this app."},{"name":"RecipientAppReapprovalRequired","description":"The app's approval terms changed and need creator re-approval."},{"name":"AppEnvironmentNotConfigured","description":"This app environment is not configured in ATM."},{"name":"InvalidUrl","description":"A supplied URL is not an acceptable http(s) URL."},{"name":"RegistrationFailed","description":"The product app link could not be registered."}]}}}