{"success":true,"name":"brimind-pay-offers","description":"Every way to put an offer, devis, invoice or payment link in front of a client on pay.brimind.pro, with the exact command for each, where the data lives, how to verify the live link, and what to do when the public site answers 502. Fires whenever the owner says \"offer\", \"devis\", \"facture\", \"lien de paiement\", \"choix\", or asks to see something on pay.brimind.pro.","category":"unitary","path":"unitary/brimind-pay-offers/SKILL.md","file":"SKILL.md","content":"---\nname: brimind-pay-offers\ndescription: Every way to put an offer, devis, invoice or payment link in front of a client on pay.brimind.pro, with the exact command for each, where the data lives, how to verify the live link, and what to do when the public site answers 502. Fires whenever the owner says \"offer\", \"devis\", \"facture\", \"lien de paiement\", \"choix\", or asks to see something on pay.brimind.pro.\n---\n> Imported from [PRIVATE_HOST] `~/unitary/agents/skills/brimind-pay-offers`. Paths are relative to `[PRIVATE_HOST]:[PATH]`; run commands there via `ssh [PRIVATE_HOST] 'cd ~/unitary && ...'`. Owner send rules from skill i7-remote-ops still apply.\n\n\n# Offers on pay.brimind.pro — the whole menu, and how each one is made\n\n## Where the data lives (read this first)\n\n`pay-invoicer` runs **on this laptop** on `http://[PRIVATE_HOST]`, and every\ninvoice, devis, site offer, custom payment, counter, setting and referral it\nwrites lands in the shared MongoDB Atlas cluster (`brimind` db) — not in a\nper-machine file. Any process pointed at the same `MONGODB_URI` sees the same\nrecords instantly, laptop or otherwise.\n\n**But `https://pay.brimind.pro` is not guaranteed to be that laptop process.**\nSee [`brimind-pay-vps-split`](../brimind-pay-vps-split/SKILL.md) — as of\n2026-09-03 the public domain was traced to a **separate `pay-invoicer` running\non the [PRIVATE_HOST] itself**, under its own build, and neither the tunnel account nor\nroot is reachable from here to fix it. Read that skill before sending any\npublic link; it also has the working stand-in (`pay.offer.brimind.pro`) for\nwhile the two are split.\n\n`SITE_URL=https://pay.brimind.pro` in `pay-invoicer/.env` makes the CLI print the\npublic URL directly — that URL still has to be verified live before it goes to\na client (see the check below).\n\n## Guard: is pay.brimind.pro really this laptop? (owner, 2026-09-03 — still check every time)\n\nOn 2026-09-03 the public domain was silently served by a **second** pay-invoicer on\nthe [PRIVATE_HOST] with its own store, so every devis written here was a 404 for clients.\nThis is not a one-off that got fixed — the two builds can drift apart again\nwithout warning, so this check is routine, not a fallback for when something\nalready looks broken. Before trusting any public link, prove both are the same\ninstance:\n\n```bash\ncurl -s https://pay.brimind.pro/ | grep -o 'main-app-[a-z0-9]*\\.js' | head -1\ncurl -s http://[PRIVATE_HOST]/    | grep -o 'main-app-[a-z0-9]*\\.js' | head -1\n```\n\nSame chunk name → one instance, the rule above holds. **Different chunk names →\ntwo instances**: stop, report it in one line with both names, keep the offer id,\nand do not tell anyone the link works. A 404 on prod for an id that is 200 here\nis the same symptom.\n\n## `/offre/<id>` is the method (owner, 2026-09-03)\n\n**Default to `/offre/<id>` for every prospect.** It is the page that argues the\nsale: what we found wrong on their listing, what we propose, how it goes, the\nrepayment table in their own trade's numbers, what we have already delivered,\nthe devis itself, and one button that pays the deposit by card. No form, no\nfield, nothing between them and paying.\n\n`/choix/<id>` is the **exception**, used only when the owner asks for a menu of\noptions. Do not open with it.\n\n## The menu\n\n| The client needs | Route | How you make it |\n|---|---|---|\n| **The proposal — the default for everyone** | `/offre/<id>` | dealflow `invoice` + `brochure` — see 2 |\n| To choose between several priced options — **only if the owner asks** | `/choix/<id>` | `npm run offer` — see 1 |\n| An invoice whose **wording matters** (custom lines, phase two, free items) | `/i/<id>`, `/i/<id>/pdf`, `/pay/<id>` | `POST /api/invoices` — see 3 |\n| To **pay an agreed amount** with no devis | `/custom` | send the link — see 4 |\n| To buy a **catalogue service** on the spot | `/services/<slug>` | `node agents/links.mjs --service <slug>` — see 4 |\n| \"The same as that one\" (a reference, −15 %) | `/references/<slug>` | send the link — see 4 |\n| To pay a **deposit / balance** on an existing invoice | `/pay/<id>` | printed with the invoice — see 3 |\n\nThe link that goes to a client is `/choix`, `/offre`, `/pay`, `/custom`,\n`/services`, `/references`. The bare `/i/<id>` is the accounting view, not\noutreach.\n\n### 1. Choice page — `/choix/<id>` (exception: only on the owner's request)\n\n```bash\ncd pay-invoicer && npm run offer -- \\\n  --name \"Bonépi Sousse\" --city Sousse --country TN --lang fr --currency TND \\\n  --niche \"boulangerie\" --phone \"+216…\" --maps \"<google maps url>\" \\\n  --only go-live,retouch,vitrine --price go-live=300 --price retouch=600 \\\n  --recommended retouch --headline \"Trois adresses, un seul site\" \\\n  --sender SoloBro\n# prints:  https://pay.brimind.pro/choix/<id>  + each option in TND / EUR / USD\n```\n\n- Options: `go-live`, `retouch`, `landing`, `vitrine`, `ecommerce`. Unpriced ones\n  take the catalogue price of that market. `--price key=120EUR` names a currency.\n- `--country TN` adds 19 % TVA + timbre; any other country does not, and the page\n  says the invoice settles in TND. Currency follows the country (`quotation\n  currency by country`): never TND abroad.\n- `--demo <url>` when a speculative site is live; `--note key=text` adds a line\n  to one option; `--deposit 30` is the default. `npm run offer -- --help` lists\n  everything.\n- The price is frozen server-side; a browser cannot change it.\n\n### 2. The proposal — `/offre/<id>` — **this is the default**\n\n**From a bare prospect to the link, in four commands.** Nothing else is needed —\nnot a client-finder run, not an import file. A prospect who exists only as a name\nand a phone still gets an `/offre/<id>`:\n\n```bash\ncd dealflow\nnode cli.js add --name \"Bonépi\" --city Sousse --niche \"boulangerie\" \\\n                --phone \"+216…\" --maps-url \"<google maps url>\"   # → prints cl_xxxx\nnode cli.js offer   --client cl_xxxx                              # fits the tier to the findings\nnode cli.js invoice --client cl_xxxx [--price 2201]               # real numbered devis\nnode cli.js brochure --client cl_xxxx                             # → https://pay.brimind.pro/offre/<id>\n```\n\n`add` with no `--website` records `no_website` as the finding, which is what the\nconstat is written from. `--price` is the negotiated amount (TND, reason recorded);\nwithout it the catalogue price of that market applies.\n\n\"A prospect who is not in dealflow\" is **never** a reason to fall back on\n`/choix/<id>`. `add` takes one line. Falling back is the defect, not the fix.\n\n`--price` needs `--client`: a price agreed with one business is not a new catalogue. Floor without the owner: 20 % under the catalogue tier.\n\n**What makes the page argue.** The brochure is only as good as the client record\nbehind it: the `proposal` block (constat, service slug, tier) is what turns a\nbare devis into the page above — a devis without it redirects to `/i/<id>`, which\nis an accounting document and does not sell. So before showing anything:\n\n- The client's **niche** must be set — it picks the repayment model (basket,\n  visits per year) for the table. A missing niche costs you the table.\n- The **findings** must be this business's own (no site, dead listing, one photo,\n  a `.com` held by someone else), because they are printed as the constat.\n- Open the page and read it: the table's assumptions, the amount, the deposit,\n  the footer. Then show the owner the URL, not a description of it.\n\n### 3. Custom invoice — `/i/<id>`, PDF, `/pay/<id>`\n\n```bash\nsource dealflow/.env   # PAY_INVOICER_ADMIN_KEY\ncurl -s -X POST https://pay.brimind.pro/api/invoices \\\n  -H \"content-type: application/json\" -H \"x-admin-key: $PAY_INVOICER_ADMIN_KEY\" \\\n  -d '{\"client\":{\"name\":\"Bonépi\",\"address\":\"Sousse\"},\n       \"items\":[{\"description\":\"Site vitrine 3 adresses, formulaire, Google Maps\",\"qty\":1,\"unit_price\":2201,\"tva\":0.19}],\n       \"timbre\":true,\"deposit_pct\":30,\"due_days\":30,\"notes\":\"Rien n'\\''est dû avant votre accord.\"}'\n# → {id, url: /i/<id>, pay_url: /pay/<id>}\n```\n\n`unit_price` is TVA comprise. Outside Tunisia: `\"tva\":0, \"timbre\":false`. A `0`\nline is dropped — put free things in `notes`. If prod is 502, post to\n`http://[PRIVATE_HOST]/api/invoices` with the same body: same database.\n\n### 4. No devis at all\n\n```bash\nnode agents/links.mjs                    # every public link, sendable without approval\nnode agents/links.mjs --service site-web # the tiers + real price of one service\n```\n\n`/custom` for an agreed amount (TND or USD, motif, file upload), `/services/<slug>`\nfor a catalogue buy, `/references/<slug>` for \"créer comme celui-ci\". Never send\nthe root domain to answer a price question.\n\n## Before it reaches the owner (step G)\n\n1. **Open the link yourself** — public URL first:\n   `curl -s -o /dev/null -w '%{http_code}' https://pay.brimind.pro/choix/<id>` must be `200`.\n   If it is `502`, check `http://[PRIVATE_HOST]/choix/<id>` — a `200` there proves\n   the offer exists and the public link is right; then run the diagnostic below.\n2. Read the page: amount, market, currency, TVA line, the trade's own words, zero\n   internal slugs or ids — footer included.\n3. `brimind-sales-specificity-check` on the message that carries the link.\n4. Show the owner: amount, the reason in one line, the URL. Wait for the go.\n5. Send in the client's conversation: `node agents/reply.mjs --channel … --to … --text-file … --agent solobro --client cl_xxxx`, report time + provider ack id.\n6. Record it on the client in dealflow so nobody quotes a second number.\n\n## When pay.brimind.pro answers 502\n\nThe app is up if `curl -s -o /dev/null -w '%{http_code}' http://[PRIVATE_HOST]/` is `200`.\nThen the fault is between the [PRIVATE_HOST] and this laptop:\n\n```bash\ncd brimind-tunnel && npm run status                       # every forward should read [up ]\ntail -20 ~/Library/Logs/brimind-tunnel.log                # look for \"port 3010\"\nlaunchctl kickstart -k gui/$(id -u)/com.brimind.tunnel    # restart the tunnel agent, then re-curl\n```\n\nIf still 502 after the restart while `:3010` reads `[up ]` and the log never\nmentions 3010, Caddy on the [PRIVATE_HOST] is not reaching the tunnel listener. That needs a\nroot shell on the [PRIVATE_HOST] (the tunnel user is sftp-only): report exactly that to the\nowner, with the three results above, and hand him the offer id and the public\nURL — it will open the moment the tunnel is back. Do not stop the sale on it.\n\n## Gates that never move\n\nThe owner approves every amount and every link before a client sees it.\nCurrency by country; the TND-settlement sentence abroad. Ireland is Hamza's.\nDo-not-contact refuses at the root. Nothing internal on the page.\n","linked_files":[],"origin":"brimind","owner_id":null,"source":"router"}