GoBuildWP

Site operationsPro

Paid Memberships Pro MCP for levels, discount codes and member access

Membership changes touch money and access at once, so the Paid Memberships Pro MCP abilities in GoBuildWP Pro lean on previews and confirmations. Level and discount-code writes accept a dry run that shows the planned prices, cuts below a level's normal price are refused until confirmed, and granting or cancelling a member's level is always confirmed. None of it can be rolled back afterwards, which shapes how an agent should work.

These calls require GoBuildWP Pro. Check each Paid Memberships Pro feature’s own edition separately.

AI clientyour-site.comVerify site policy

Create a code SPRING that takes the first Gold payment down to 5, valid until the end of April.

  1. wppilot/paid-memberships-pro-list-levelsRead

    Finds the Gold level id and its normal initial and recurring prices.

  2. wppilot/paid-memberships-pro-list-discount-codesRead

    Checks SPRING does not exist; a code's text cannot be renamed later.

  3. wppilot/paid-memberships-pro-create-discount-codeWrite

    With dry_run: true and expires set to the last day of April (starts defaults to today), lists Gold under price_cuts: initial payment down to 5, recurring price unchanged because it was left out.

  4. wppilot/paid-memberships-pro-create-discount-codeWrite

    Repeated with confirm: true after the owner approves; PMPro saves the code and its level price.

Proposed sequence from source declarations; not a recorded task or proof of client compatibility. Inspect saved state and browser or provider results separately.
Edition
Pro
Abilities
13
Requires
WordPress 6.9+, PHP 8.0+, Paid Memberships Pro 3.2.0+

Limits

Money and access boundaries

  • Use a synthetic member and test level with reviewed target IDs. Cancellation can invoke gateway hooks; check the gateway independently. No refund or ledger rollback is implied.
  • Granting a level is an administrative change: no checkout, payment, order, tax or gateway subscription. A paid level granted this way has not been paid for.
  • Cancelling a level ends local access and asks the gateway to cancel its subscription unless pmpro_cancel_previous_subscriptions suppresses the request. A failed or suppressed request can leave billing active; verify cancellation at the gateway. No refund is issued.
  • New level prices apply to future checkouts only; existing members keep being billed their old terms at the gateway, and the update reports how many are affected.
  • Deleting a level with active members is refused until member_policy says whether to cancel them or move them to another level, at most 100 members per call.
  • A new level with no price and open signups, and any discount below a level's normal price, need confirm: true. Nothing here can be rolled back from the change log.

Data model

PMPro's own tables

Levels are rows in pmpro_membership_levels, with separate link tables tying them to post categories, level groups and discount codes. A member's levels are rows in pmpro_memberships_users, which PMPro's documentation describes as tracking memberships separately from orders, with statuses such as cancelled, admin_cancelled and expired. Discount codes and their per-level prices sit in pmpro_discount_codes and pmpro_discount_codes_levels.

Every write goes through PMPro's own classes and functions (PMPro_Membership_Level::save(), PMPro_Discount_Code::save(), pmpro_changeMembershipLevel(), pmpro_cancelMembershipLevel()), so PMPro's hooks run. Because the data is in PMPro's tables, the GoBuildWP change log records each write without a before-image; the ability returns the previous values instead.

Orders are read through MemberOrder::get_orders() with totals, level, gateway and status. Card details, billing addresses, transaction ids and order notes are never returned.

Worked example

A first-payment discount, previewed

Expected outcome to verify on the installed stack; this sequence has not been recorded as a runtime test.

SPRING is live at checkout from its start date until the end of April and lowers only the first Gold payment. It cannot be undone from the change log; deleting the code later leaves any past uses in order history.

Use the store currency and an explicit ISO expiry date for the illustrative discount. Synthetic dry-run example: initial payment 5, recurring price unchanged, expiry 2026-12-31; inspect the actual price_cuts result before approval. Test checkout without processing a payment.

  1. paid-memberships-pro-list-levels

    Finds the Gold level id and its normal initial and recurring prices.

  2. paid-memberships-pro-list-discount-codes

    Checks SPRING does not exist; a code's text cannot be renamed later.

  3. paid-memberships-pro-create-discount-code

    With dry_run: true and expires set to the last day of April (starts defaults to today), lists Gold under price_cuts: initial payment down to 5, recurring price unchanged because it was left out.

  4. paid-memberships-pro-create-discount-code

    Repeated with confirm: true after the owner approves; PMPro saves the code and its level price.

Level groups, gateway outcomes and member support

Moving a member between levels in a one-level group

The request that catches most owners is an upgrade. paid-memberships-pro-assign-user-level grants Gold through pmpro_changeMembershipLevel() without starting Gold billing or verifying payment. In a group allowing one level per member, PMPro also ends the member's Silver access and requests cancellation of its subscription through pmpro_cancelMembershipLevel(). That request may be suppressed by a site filter or fail at the gateway, so Silver billing can continue after Gold access is granted. Verify the gateway outcome before describing the member as no longer being charged.

That is right for a complimentary upgrade and wrong for a paid one. For a paid move, send the member through checkout and use the agent only to confirm the result afterwards. The assign call reports before and after lists of active level ids, and returns changed false when the member already holds the level, so a repeated request does not re-run PMPro's hooks.

Reading a cancellation result when the gateway call fails

paid-memberships-pro-cancel-user-level verifies one thing: that the level is no longer in the member's active memberships. It does not report what the gateway did. PMPro's own behaviour when the gateway refuses or times out is to mark the subscription cancelled locally and email the site administrator, which means billing can continue at Stripe, PayPal or whichever gateway check-setup names until someone cancels it there. Treat that admin email as part of the result, and check the gateway dashboard after any cancellation that matters.

Sites that keep gateway subscriptions running on purpose, through the pmpro_cancel_previous_subscriptions filter, get the access change with no gateway call at all. The agent cannot see that filter, so tell it if your site uses one.

Answering a member's billing question from paid-memberships-pro-list-orders

Support questions such as "was I charged twice?" can be answered without opening wp-admin. paid-memberships-pro-list-orders filters by user, level, gateway, status (success, pending, refunded, review, token, error, or a status a gateway add-on uses) and a UTC date range, and returns up to a hundred orders per call. PMPro's order query has no offset, so the agent narrows by dates rather than paging through history.

Each order carries gateway_environment, which records whether that order was taken in sandbox or live mode when it was placed. It is history, not configuration: an old sandbox order says nothing about where the next checkout will go, because the gateway setting can have changed since. paid-memberships-pro-check-setup returns only the gateway's name, not its mode or keys. Before anyone demonstrates a checkout on a staging copy, a person should open PMPro's payment settings and confirm the gateway environment is sandbox, then confirm in the gateway's own dashboard that the keys saved there are test keys. Use the gateway's published test card details only, never a real card, and stop if either check is unclear. No card details, addresses, transaction ids or order notes come back, so matching an order against a gateway receipt still happens in the gateway's own dashboard.

The same staging copy is where a new level gets tested. paid-memberships-pro-create-level can set the trial, the expiration, the confirmation text and the post categories the level restricts in one call. The result confirms what PMPro saved, not what a visitor sees, so open one restricted post logged out and once as a test member holding the new level before the level goes on sale.

Roles, the multiple-memberships constant and confirmations

PMPro gives its screens their own capabilities, such as pmpro_membershiplevels, pmpro_discountcodes and pmpro_orders, but GoBuildWP checks its own capability first: the user behind the connection must be able to manage options, or be a super admin on multisite. A membership manager role that holds only the PMPro capabilities cannot run these abilities. paid-memberships-pro-check-setup reports both, together with whether PMPRO_MULTIPLE_MEMBERSHIPS_PER_USER is defined, which changes how many levels a member can hold at once.

Under the Read Only safety profile the inspection abilities run and everything else is refused. On Production Safe the destructive abilities, assigning, cancelling and the two deletes, are held until the call carries confirm, and the price-cutting discount and free open-signup cases ask for confirm on their own. How safety profiles work covers the rest.

  • "Read only: list orders for user 412 in the last 60 days with status and gateway environment."
  • "Give user 87 a complimentary Gold level. First tell me which level of theirs it will end and what that does to their billing."
  • "Cancel Silver for user 233, then tell me exactly what you verified and what I still need to check at the gateway."

Questions

Paid Memberships Pro questions

Does giving a member a level through MCP charge them?

No. It changes access only. No order is created and no payment is taken, so do not treat it as a sale.

Does cancelling a membership refund the member?

No. Local access ends and PMPro normally requests gateway subscription cancellation. Confirm that the gateway stopped charging; a failed or suppressed request can leave billing active. A refund is a separate action at the gateway or in PMPro's order screen.

If the agent raises a level's price, do current members pay more?

No. Existing gateway subscriptions keep their old amount; the new price applies to people who check out after the change.

Can the AI see members' card or address details?

No. Order and membership reads leave out card data, billing addresses, transaction ids, payment tokens and gateway credentials.

Where these facts come from

GoBuildWP behaviour is taken from the plugin source and the ability reference; third-party details from the vendor documentation below, checked by the GoBuildWP team.

Paid Memberships Pro is a separate product; no partnership or endorsement is implied.

Try it on Paid Memberships Pro in Read Only first