main.js: set path irrelevant to merchant_id and return doc after saving.