Link a ProAbono Subscription Workflow, and the way back (In-Site step 2)
link_subscription_workflowGenerates server-side integration code for ProAbono workflows, reading the encrypted query from object links and routing the customer back after sign-up, plan change, restart, registration, or invoice payment.
Instructions
Generates the round trip of In-Site step 2: the server-side code that fetches a ProAbono object and reads the encrypted workflow query out of its Links by rel, both ways of opening it -- ProAbonoPortal.open({ query }) in the application and a ?pa_query= link for e-mails -- and the single return route the customer comes back to, which re-reads the session user's rights first and then branches on from x outcome for all five outcomes. Reads the account's real offers. Also returns the BackOffice action no API can perform: the redirect URL to configure. Use it for sign-up, plan change, restart, registering a payment method or paying an invoice. Writes the installation state unless record_state is false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stack | Yes | The host project's stack. Detect it from the open project (package.json, composer.json, requirements.txt, Gemfile, .csproj) and confirm with the developer. Use "generic" when none fits. | |
| workflow | Yes | Which workflow this entry point opens. subscribe: a named plan. choose_offer: the catalogue, post sign-up. upgrade: change of plan. restart: a suspended subscription. register: contact details and a payment method. pay_invoice: one due invoice. | |
| offer_ref | No | The offer the workflow opens on, for subscribe and upgrade. Checked against the account's catalogue, because a workflow on an unknown offer fails at the end of a sign-up rather than at the start. | |
| project_root | No | Root of the developer's project, where `.proabono/installation.json` is written. Defaults to the directory this server was launched in, which is the project for every MCP client that starts the server inside it. Pass it when that is not the case. | |
| record_state | No | Record this step in `.proabono/installation.json`. Default true. Set false to generate code without touching the developer's filesystem at all. | |
| return_route | No | Path the customer comes back to when a workflow ends, e.g. "/billing/return". Defaults to that. One route serves every workflow. |