Skip to main content
Docs navigation

Recipes

Copy-paste runnable flows for the most common membership operations.

Each recipe below is copy-paste runnable. Set your WORDPRESS_* environment first — see Authentication — and note the capability each recipe needs; a missing capability returns 403 rest_forbidden (Troubleshooting maps every code to a fix).

Recipes

1. Find members

$ nwp members list --search lovelace --per-page 20 --output json

Capability: nwp_manage_members.

2. Bulk-import NFC cards, then assign one

$ nwp nfc-cards bulk-import --uids '["04A1","04B2"]' --output json$ nwp nfc-cards update 12 --member-id 42 --output json$ nwp nfc-cards lookup 04A1 --output json

Capability: nwp_manage_members. Import the stock, bind a card to a member, then verify the UID resolves.

3. Process a check-in / redemption

$ nwp redemptions eligibility --member-id 42 --benefit-id 7 --output json$ nwp redemptions create --member-id 42 --benefit-id 7 --output json

Capability: nwp_process_checkins. Always check eligibility first so you fail fast before recording usage.

4. Approve a pending redemption

$ nwp redemptions list --status pending --output json$ nwp redemptions approve 88 --output json

Capability: nwp_approve_redemptions specifically — recording a redemption and approving one are separate grants.

5. Renew a member

$ nwp members update 42 --status active --output json

Capability: nwp_manage_members. A tier with duration_months: 0 is lifetime, so the renewed member's expires_at comes back null.

6. Create a tier and attach a benefit

$ nwp tiers create --name Gold --duration-months 12 --price 199 --output json$ nwp tiers attach-benefit 5 --benefit-id 7 --custom-limit -1 --period-type lifetime --output json

Capability: nwp_manage_settings. A --custom-limit -1 means unlimited, and --period-type lifetime means the limit never resets.

7. Run an emcee experience

$ nwp emcee take-control --output json$ nwp emcee set-state --phase live --output json$ nwp emcee get-state --output json$ nwp emcee clear-state --output json

Capability: nwp_manage_settings. Take control of the live display, push state, read it back, then clear it when the segment ends.

8. Drive it from an agent (MCP)

Every flow above is also exposed as an MCP tool call, so an agent can run the same loop without shelling out: members_list redemptions_eligibilityredemptions_create. The bundled skill teaches the agent that loop — check eligibility, branch on the result, then record. See MCP server for tool wiring and Agents for the skill.