DEBIT
Memberstack allows you to get the member id via script, so you can use that to build a “buy one” button.
That button would be a submit button on a hidden form, that triggers a webhook on Make, to check available credits. If there are enough, debit and return success. If there are not enough, return a failure.
- Inputs: Memberstack MemberID, number credits paying
- Outputs: Success/fail, message, and number credits remaining
You’d want to track the user credit balances somewhere, I’d recommend AirTable. Easy to report and update.
NOTE: Personally I’d build it so that you can specify the number of credits you want to debit, and default to 1. It’s just as easy, and you might have premium products later.
When a user completes a transaction, you have a success/fail response, and display the appropriate form success or failure message that Webflow lets you design.
Your fail message would invite them to buy more credits, with a link.
You can custom script that, or you can use my attributes-based tool here-
Just return a webhook response with a 200-range HTTP response code for success, or a 400+ for errors. That way you can build it like an API with different messages, e.g. member unknown, member account locked, unable to access database.
The tool will take care of displaying success / fail automatically based on the webhook response.
GETTING BALANCE
For a “you have X credits remaining” message.
You could build a second Make webhook that get that balance, or you can use the first one with a 0 credit payment request, and use the credit balance it returns.
TOP-UPS
Are you using Webflow ECommerce?
You could create some products there with credit values, and then install a webhook directly from Webflow’s API to notify a “top-up” Make automation of new orders. Here you might have to get creative to figure out how to insert the Memberstack member ID into the order data as a hidden custom field.
Pretty sure it can be done, but I haven’t tried that bit.