Aller au contenu

Tools · Sales and plans

MCP tools for selling: listing plans, products and coupons, creating billing options and plans with add-ons as drafts, publishing and unpublishing, changing prices, creating, editing and deleting coupons and downsell offers, deleting products and plans and reordering plans, with confirmation for anything that touches money.

Cet article n’a pas encore été traduit. Vous lisez la version en anglais.

What the community sells: plans with their billing options and add-ons, one-off products, coupons. Everything starts as a draft and only goes on sale when you ask; changing a price, creating or editing a coupon, creating or editing a last-chance offer and deleting ask for your yes, with a summary of the amounts. Changing a plan (update_plan) runs on the first call.

Drafts before approval

You can set everything up before the business information is approved: products, options, plans, add-ons, coupons and downsell offers start as drafts and can be edited as much as you like. What waits for approval is publishing and selling:

  • publish_product in a community without approval is refused with Memberfy's message: "To publish and start selling, the community needs approved business information. Meanwhile you can create and configure everything as a draft: fill it in under Settings › Business Information and submit it for review."
  • In the composite tools (create_course, create_event and create_plan with publish), the refusal undoes nothing: the course, the event, the ticket, the plan and the options stay as drafts, the response gives the reason in publish_blocked, and the suggested next step is to fill in the business information and then publish with publish_product.
  • If the approved country doesn't have a payment provider yet (today, only Brazil sells), publish_product is refused with Memberfy's explanation ("We don't sell in PT yet: the business information's country has no active payment provider."), and the composite tools keep everything as a draft, with the reason in publish_blocked.
  • A draft's price is in the currency of the business information's country (in any status) or, without it, in reais. If the approved currency is a different one, publishing is refused ("This product is priced in …, but the approved business information uses …"): adjust the currency and the price first.

Each tool carries a badge: Read-only changes nothing, Changes creates or changes something right away, and Asks to confirm only acts after your yes to a summary. See Money and confirmation.

In short

ToolWhat it doesMinimum roleType
list_plansPlans, options and add-onsAdmin or financeRead-only
list_productsBilling options and products, with price and statusAdmin or financeRead-only
list_couponsCoupons with status and usageAdmin or financeRead-only
create_productCreates a product or billing option, as a draftAdminChanges
create_planOptions, plan and add-ons, in one goAdminChanges
publish_productPuts a product on saleAdminChanges
unpublish_productTakes a product off saleAdminChanges
update_priceChanges a price, with confirmationAdminAsks to confirm
create_couponCreates a coupon, with confirmationAdminAsks to confirm
update_planChanges a plan's name, address, visibility, options, add-ons and imagesAdminChanges
update_productChanges title, spaces, stock, installments, trial, direct link and imagesAdminChanges
update_productsChanges up to 20 products at once; the price asks for confirmationAdminChanges
update_plansChanges up to 20 plans at onceAdminChanges
update_coupon_statusPauses or reactivates a couponAdminAsks to confirm
update_couponChanges a coupon's name, discount, duration, limits, validity and productsAdminAsks to confirm
delete_couponDeletes a couponAdminAsks to confirm
get_coupon_usageWho used a couponAdmin or financeRead-only
list_downsell_offersA plan's last-chance offers, with conversionAdminRead-only
create_downsell_offerCreates a last-chance offerAdminAsks to confirm
update_downsell_offerChanges or pauses a last-chance offerAdminAsks to confirm
delete_downsell_offerDeletes a last-chance offerAdminAsks to confirm
delete_productDeletes a product or billing optionAdminAsks to confirm
delete_planDeletes a planAdminAsks to confirm
reorder_plansPuts the plans in a new order on the pricing pageAdminChanges
get_storefrontWhat a Store space showsAdminRead-only
update_storefrontChooses a Store's products and plansAdminChanges
list_storefront_productsThe products of a Store, as you see themAnyRead-only
redeem_product_with_pointsSpends your points balance on a product priced in pointsAnyAsks to confirm

Product kinds, free products and plans that include products

ToolWhat changes
list_productsAccepts kind (digital, physical, event, course, download) to filter. Each product carries kind, courseId or eventId (on course and event products), includedInPlanIds (the plans that include it) and, when limited, the availability. Course, event and download products are the ones created with each of them
create_productAccepts kind: digital (default) or physical (requires has_stock and stock_quantity, and checkout asks for the delivery address). Course, event and download products are created with the item (create_course, create_event, create_download_item); asking for those kinds here is refused. Price 0 creates a free product, also for a subscription (a free plan); installments with 0 are refused. included_in_plan_ids puts the product in the plans that give it at no extra charge
update_productcapacity sets the total seats of a course or event product (null = unlimited; lowering it below the number signed up doesn't remove anyone); included_in_plan_ids replaces the list of plans that include the product. The kind never changes
update_pricenew_price 0 makes the product free (not for installments); it still asks to confirm
publish_product and unpublish_productA free product publishes without approved Business Information
create_plan and update_planincluded_product_ids lists the products (courses, events, downloads, one-off products) the plan includes at no extra charge; in update_plan it's the whole list, [] clears it. Price 0 on an option creates a free plan

Who uses them: the owner and the admin create and delete products and build plans. Finance can now use update_product, update_price (with confirmation), publish_product and unpublish_product, and read list_products; the moderator only reads. Seats and the waitlist are in Tools · Courses.

list_plans

Read-only

List plans. The community's plans, with each one's billing options and add-ons. Minimum role: admin or finance.

Parameters: none.

Returns: the plans (id, name, address), each plan's options (id, title, price, interval, status) and the add-ons.

Ask like this: "What plans do we have, and how much does each option cost?"

list_products

Read-only

List billing options and products. All products: subscription options, one-time products, installment products and add-ons. Minimum role: admin or finance.

ParameterTypeRequiredDescription
searchtext, up to 100NoSearches the title, the address (slug) and the internal name, across every page
kinddigital, physical, event, course, downloadNoOnly products of this kind
pagenumber, from 1NoThe page (default 1)
limit1 to 50NoProducts per page (default 20)

The response carries the pagination (total and pages); when there is more, the suggested next step is the next page.

Returns: each product with id, title, type, price, interval, status (draft or published), the spaces it unlocks and, on a product with stock, availability ("40 available" or "Sold out") and sold_out. The id is what create_plan (in add_on_ids), update_price, publish_product and create_coupon need.

Ask like this: "Which products are still drafts?"

Returns each product's pricing_mode (money, points, points_or_money) and points_price.

list_coupons

Read-only

List coupons. The coupons, with status and usage. Minimum role: admin or finance.

ParameterTypeRequiredDescription
statusACTIVE, INACTIVE, EXPIREDNoOnly one status
searchtextNoPart of the code or name
page, limitnumberNoPagination

Returns: the coupons, with code, type, value, duration, validity, limit and uses.

Ask like this: "Which coupons are active, and how many times has each been used?"

create_product

Changes

Create billing option or product. Creates a product as a draft: a subscription option, a one-time product (ticket, course) or an installment product. Minimum role: admin.

ParameterTypeRequiredDescription
titletext, 3 to 255Yes
typeSUBSCRIPTION, ONE_TIME, INSTALLMENTYesSubscription option, one-time or installment
pricenumber, in the community's currencyYesFor a subscription, the amount per cycle; for annual in installments, the amount for the year
intervalMONTHLY, YEARLYNoOnly for SUBSCRIPTION: monthly or annual
max_installments1 to 12NoUp to how many card installments (one-time, or annual)
commitment_months1 to 36NoContract length; monthly only
trial_days0 to 365NoFree trial
descriptionplain text, up to 5,000NoNo formatting: Markdown marks are stripped
short_descriptionplain text, up to 140NoThe Short Description, shown on the cards. When omitted, nothing is made up
space_idslist of idsNoThe spaces the purchase unlocks
has_stockyes or noNoTurns stock control on (or, with false, off). One-off products only
stock_quantitynumber, 0 or moreWith has_stockQuantity on sale (tickets), the one available right now; 0 is sold out. stock still works as the old name
direct_linkyes or noNoThe same as Sell by direct link in the form: the product joins the /products catalog and gets a purchase link, which only sells while the product is active
highlightedyes or noNoThe same as Feature in the store: the Featured badge and, in a store that shows every product, first place. Works for one-time products and add-ons
image_url or image_base64—NoThe product's banner (16:9; 2000×1125 recommended): a public link or the file in base64 (up to 5 MB)
image_typeimage/jpeg, image/png, image/webp, image/gif, image/svg+xmlWith image_base64The file's type; optional — the server checks the content
featured_image_url or featured_image_base64—NoThe featured image (1:1; 800×800 recommended), in the same format
featured_image_typesameWith featured_image_base64

Returns: the new product, as a draft, with its id.

Ask like this: "Create the product One-off mentoring, US$ 150, unlocking the Mentoring space. Leave it as a draft."

Notes: nothing is sold until publish_product, and creating doesn't depend on approved business information (see Drafts before approval). For a plan with several options, create_plan does it all at once. Each field follows the same rules as in the dashboard: see Products and Billing options. An image that can't be used stops the tool before anything changes; if the upload fails after creating, the product is undone.

pricing_mode (money, points or points_or_money) and points_price give a points price to a one-time product (digital, physical, event, course or download). See Points in the Store.

create_plan

Changes

Create plan with options and add-ons. Billing options → plan with the options → linked add-ons. Minimum role: admin.

ParameterTypeRequiredDescription
nametext, up to 120YesThe plan name
descriptionplain textNoNo formatting: Markdown marks are stripped
slugtext, up to 60NoThe plan's address, for the /pricing/<address> link
visibilitypublic, link_onlyNoPublic (the default) or Link only: the plan disappears from listings and only opens through its address. See Plans
optionslist, 1 to 6YesThe billing options (see below)
add_on_idslist of idsNoExisting monthly products that aren't a plan option, from list_products
image_url or image_base64—NoThe banner (16:9) of every option; each option can bring its own (below)
featured_image_url or featured_image_base64—NoThe featured image (1:1) of every option
publishyes or noNoPublishes all options. Default: draft
idempotency_keytext, up to 100No

Each option:

FieldTypeDescription
titletext, 3 to 255Required. E.g. Mentoring · Monthly
pricenumber, in the community's currencyRequired. For annual, the amount for the year
intervalMONTHLY, YEARLYDefault: MONTHLY
max_installments1 to 12For annual, up to how many card installments
commitment_months1 to 36Minimum contract, for monthly
trial_days0 to 365Free trial
descriptionplain textNo formatting: Markdown marks are stripped
space_idslist of idsThe spaces the option unlocks
image_url or image_base64—This option's banner only; it overrides the top-level one
featured_image_url or featured_image_base64—This option's featured image only

Returns: the plan (id, name, address), the options (id, title, price, interval, status) and the linked add-ons.

Ask like this: "Create the Mentoring plan with a US$ 90 monthly option with a 6-month contract and a US$ 900 annual option, both unlocking the Mentoring space, and link One-on-one session as an add-on."

Notes: if a step fails, the plan is undone last, because Memberfy won't delete a plan that still has options. A plan has no image of its own: the top-level images go to every option (an option's own win for it). An image that can't be used doesn't undo the plan: the rest is created and the reason comes back in warnings. See Plans, Add-ons and Annual in installments.

publish_product

Changes

Publish product (put on sale). Puts a draft product on sale. Minimum role: admin.

ParameterTypeRequiredDescription
product_ididYesFrom list_products or from a create call

Returns: the product, published.

Ask like this: "Go ahead and publish the Excel from Scratch product."

Notes: publishing requires approved business information, and the product in the approved country's currency. Without that, Memberfy refuses and the product stays a draft, editable. See Drafts before approval.

unpublish_product

Changes

Take product off sale. Takes a product off sale. Anyone who already bought it keeps access. Minimum role: admin.

ParameterTypeRequiredDescription
product_ididYes

Returns: the product, off sale.

Ask like this: "Take the October meetup ticket off sale."

update_price

Asks to confirm

Change a product's price. Changes the price of a product or billing option. Minimum role: admin.

ParameterTypeRequiredDescription
product_ididYesFrom list_products
new_pricenumber, in reaisYes

The summary: the product, the current price, the new price and the status (draft or published).

Ask like this: "Raise Growth Monthly from US$ 25 to US$ 29."

Notes: existing subscriptions follow Memberfy's rules for price changes, the same as editing in the dashboard. See Billing options.

create_coupon

Asks to confirm

Create coupon. Creates a discount coupon, a percentage or a fixed amount, for all products or only some. Minimum role: admin.

ParameterTypeRequiredDescription
codetext, 2 to 50YesE.g. PRO20. Stored in uppercase
nametext, up to 120YesThe internal name
typePERCENTAGE, FIXEDYesPercentage or fixed amount
valuenumberYes20 = 20%, or the amount in reais
durationONCE, FOREVER, REPEATINGNoFor subscriptions: first charge only (default), always, or for some months
months1 to 36NoWith REPEATING
max_usesnumberNoEmpty: no limit
start_dateISO 8601 dateNoDefault: now
end_dateISO 8601 dateNoEmpty: no end
product_idslist of idsNoOnly these products. Empty: all

The summary: the action, the code, the discount (20% or US$ 10.00), the duration, the usage limit, the validity and the products.

Ask like this: "Create the coupon BLACK30, 30% on the first charge only, for the Growth plans, up to 100 uses, valid until 11/30."

To give a plan away for free, the coupon must be 100% with duration FOREVER: with ONCE or REPEATING, checkout refuses the plan. See 100% coupon.

See Coupons.

update_plan

Changes

Edit plan. Changes a plan's name, description, address, whether it is active, its billing options, its add-ons and its images. Minimum role: admin.

ParameterTypeRequiredDescription
planid or link (/pricing/…)Yes
name, description, slugtextNo
activeyes or noNo
visibilitypublic, link_onlyNoPublic or Link only. Hides the plan from listings; whoever has the address can still buy
option_idslist of idsNoThe plan's whole list of options
add_on_idslist of idsNoThe whole list of add-ons
image_url or image_base64—NoThe banner (16:9) sent here goes to every option of the plan
featured_image_url or featured_image_base64—NoThe featured image (1:1) of every option

Ask like this: "Remove the annual option from the Growth plan and keep only the monthly."

Notes: it changes what is sold right away, without confirmation. Prices change with update_price, which asks for your yes. A plan has no image of its own: to change the image of a single option, use update_product on it. An invalid image for the plan is checked before anything changes; an upload refused for one option comes back in warnings.

update_product

Changes

Edit product. Changes title, descriptions, the spaces it unlocks, stock, installments, free trial, direct link or images — including those of a plan's billing option. Minimum role: admin.

ParameterTypeRequiredDescription
productid or slugYes
title, description, short_descriptiontextNo
space_idslist of idsNoThe spaces the purchase unlocks
has_stock, stock_quantityyes or no, numberNoStock control and what's available right now (0 is sold out); has_stock: false turns control off. stock still works as the old name
max_installmentsnumberNo
trial_daysnumberNo
direct_linkyes or noNoTurns Sell by direct link on or off. When off, the product leaves the /products catalog and the purchase link says it is not available
highlightedyes or noNoThe same as Feature in the store: the Featured badge and, in a store that shows every product, first place. Works for one-time products and add-ons
image_url or image_base64—NoThe banner (16:9; 2000×1125 recommended): a public link or the file in base64 (up to 5 MB)
image_typeimage/jpeg, image/png, image/webp, image/gif, image/svg+xmlWith image_base64The file's type; optional — the server checks the content
featured_image_url or featured_image_base64—NoThe featured image (1:1; 800×800 recommended)
featured_image_typesameWith featured_image_base64
remove_banneryes or noNotrue removes the banner (ignored when a new banner is sent)
remove_featured_imageyes or noNotrue removes the featured image (ignored when a new one is sent)

Ask like this: "Raise the ticket's stock to 120." · "Swap the course banner for the image https://…/new-banner.png."

Notes: the price is changed with update_price, which asks for confirmation. An image that can't be used changes nothing: the tool stops first, with the reason.

Takes pricing_mode and points_price, as create_product.

update_products

Changes

Edit several products. Applies to up to 20 products, in a single call, the same changes as update_product — title, descriptions, spaces, stock, installments, trial, direct link and images — and also the price. A plan's billing option counts as a product here. Minimum role: admin.

ParameterTypeRequiredDescription
itemslist, 1 to 20YesEach item takes product (id or slug) and the fields of update_product (including has_stock and stock_quantity), plus price
confirmation_tokentextOnly on the second callThe code the first call returned

How it works: if any item changes the price, the first call changes nothing: it returns the summary (each item's current and new price, and what else changes) and a code. Show the summary, wait for your yes and repeat the call with the same arguments and the confirmation_token. With no price in the batch, it runs on the first call.

Returns: the result item by item (updated, or the error), and how many succeeded and how many failed. An item with an error doesn't stop the others. An image that can't be used fails only that item, before it changes; an upload refused afterwards comes back in the item's warning. If an item is still a draft, the suggested next step is to publish it.

Ask like this: "Swap the banner of the three one-off courses for these images." · "Raise the ticket stock to 120 and the Workshop price to US$ 180."

update_plans

Changes

Edit several plans. Applies to up to 20 plans, in a single call, the changes of update_plan: name, description, address, active, visibility (Public or Link only), the list of options, the list of add-ons and the images, which go to every option of the plan. Minimum role: admin.

ParameterTypeRequiredDescription
itemslist, 1 to 20YesEach item takes plan (id or /pricing/… link) and the fields of update_plan

Returns: the result item by item, as in update_products. It doesn't touch money (prices go through update_products or update_price), so it runs on the first call, without confirmation.

Ask like this: "Make the Invite and Partners plans Link only."

update_coupon_status

Asks to confirm

Pause or reactivate coupon. Pauses or reactivates a coupon. Minimum role: admin.

ParameterTypeRequiredDescription
couponid or codeYes
statusACTIVE, INACTIVEYesReactivate or pause

Ask like this: "Pause the BLACK30 coupon."

update_coupon

Asks to confirm

Edit coupon. Changes an existing coupon. Only what is sent changes; pausing is done with update_coupon_status. Minimum role: admin.

ParameterTypeRequiredDescription
couponid or codeYes
name, descriptiontextNo
valuenumberNoPercentage (20 = 20%) or amount, depending on the coupon's type
durationONCE, FOREVER, REPEATINGNoOnce, forever or for a few months
months1 to 36NoWith REPEATING
max_uses, max_uses_per_personnumberNoUsage limits
start_date, end_datedateNoThe validity
product_idslist of idsNoThe products the coupon applies to

Returns: on the first call, the code and what changes, and the confirmation code.

Ask like this: "Raise BLACK30 to 40% and extend it until Sunday."

See Coupons.

delete_coupon

Asks to confirm

Delete coupon. Discounts already given remain valid. Minimum role: admin.

ParameterTypeRequiredDescription
couponid or codeYes

Returns: on the first call, the code and how many times it was used, and the confirmation code.

get_coupon_usage

Read-only

View coupon usage. Who used it, when and how much discount. Minimum role: admin or finance.

ParameterTypeRequiredDescription
couponid or codeYes
pagenumberNo

Ask like this: "Who used the BLACK30 coupon?"

list_downsell_offers

Read-only

A plan's downsell offers. The discount offers on add-ons after a plan is bought, with how many times they were shown and converted. Minimum role: admin.

ParameterTypeRequiredDescription
planid or linkYes

Ask like this: "How well does the last-chance offer for the Coworking Extension convert?"

create_downsell_offer

Asks to confirm

Create downsell offer. Creates a discount offer on an add-on, shown after the plan is paid. Minimum role: admin.

ParameterTypeRequiredDescription
planid or linkYes
add_on_ididYesThe plan's add-on
discount_percentnumberNo
timingIMMEDIATE, DELAYEDNoRight away (default) or after some time
delay_minutesnumberNoWith DELAYED
price_durationFOREVER, FIRST_CHARGE, CYCLESNoDiscount forever, only on the first charge, or for a number of cycles
cyclesnumberNoWith CYCLES
ttl_minutesnumberNoHow long the offer is valid

Ask like this: "Offer 30% off the Coworking Extension to people who subscribe to Growth without it, for the first 3 charges."

See Downsell.

update_downsell_offer

Asks to confirm

Edit downsell offer. Changes a plan's last-chance offer, or pauses it. Only what is sent changes. Minimum role: admin.

ParameterTypeRequiredDescription
planid or linkYes
offer_ididYesFrom list_downsell_offers
discount_percent, timing, delay_minutes, price_duration, cycles, ttl_minutesNoThe same as in create_downsell_offer
activeyes or noNoWith no, pauses the offer

Ask like this: "Pause the Coworking Extension offer until the end of the month."

delete_downsell_offer

Asks to confirm

Delete downsell offer. Minimum role: admin.

ParameterTypeRequiredDescription
planid or linkYes
offer_ididYesFrom list_downsell_offers

delete_product

Asks to confirm

Delete product. Deletes a product or a billing option. Whoever bought it keeps access. Minimum role: admin.

ParameterTypeRequiredDescription
productid or slugYesFrom list_products

Returns: on the first call, the title, the price and the status, and the confirmation code.

Notes: to just stop selling, prefer unpublish_product. See Products.

delete_plan

Asks to confirm

Delete plan. Existing subscribers aren't canceled. Minimum role: admin.

ParameterTypeRequiredDescription
planid or link (/pricing/…)Yes

Returns: on the first call, the plan's name and its options, and the confirmation code.

reorder_plans

Changes

Reorder plans. Puts the plans in a new order on the pricing page, from first to last. Minimum role: admin.

ParameterTypeRequiredDescription
plan_idslist of idsYesFrom list_plans, in the new order

Ask like this: "On the pricing page, put Growth before Starter."

get_storefront

Read-only

View store. What a Store space shows: all products or only the chosen ones. Minimum role: admin.

ParameterTypeRequiredDescription
spaceid or linkYesThe Store space

update_storefront

Changes

Choose the store's products. Sets what a Store space sells. Minimum role: admin.

ParameterTypeRequiredDescription
spaceid or linkYes
modeall, selectedYesAll published products, or only the chosen ones
product_idslist of idsNoWith selected, the one-off products and add-ons, from list_products
plan_idslist of idsNoWith selected, the whole plans, from list_plans. A billing option is never chosen on its own: the API refuses it in product_ids

Ask like this: "Leave only the one-off courses and the Growth plan in the store."

Notes: each list replaces its own part of the selection, in the order sent; when omitted, that part stays as it is; when empty ([]), it is cleared. A Link only plan is kept, but doesn't show in the storefront.

See Store.

list_storefront_products

Read-only

Store products. The products a Store space sells, as you see them. Minimum role: any.

ParameterTypeRequiredDescription
spaceid or linkYesThe Store space (list_spaces)

Returns: the Store's three groups: the products (price, installments, billing, sold_out (sold out, without the count), highlighted and the plans they require), the plans (each one once, with the "from" price) and the add-ons, each with its state for whoever is asking (You already have it, Add, Available on the X plan or Subscribe to the X plan). The suggested next step follows the state: manage the subscription, add the add-on, ask for the plan-change quote or open the plan page.

Ask like this: "What's on sale in the Store?"

Notes: a product that requires a plan you don't have is left out, unless you manage the Store. Which products the Store sells is get_storefront and update_storefront.

Paying with points

When the community uses points as currency, a product can have a points price (pricing_mode and points_price in create_product and update_product).

redeem_product_with_points

Asks to confirm

Redeem with points. Spends your points balance on a product priced in points (pricing_mode points or points_or_money in list_products or the Store), one unit per redemption. Nothing is charged: the purchase is born completed, paid with points, and access comes at once. Refusals in the API's words: not enough balance (with how many points are missing), the balance or gamification off, sold out or already owned, a product you cannot buy. Points are never bought, turned into money or transferred. Asks to confirm, with the price and the balance before and after. Minimum role: any.

ParameterTypeRequiredDescription
product_ididYesFrom list_products, or the product of a course or event
shipping_addressaddressNoPhysical products only: name, street, number, complement, district, city, state, postal_code, country, phone

Ask like this: "Trade my points for the community T-shirt."

Notes: the shipping address is masked in the assistant's log.