Using Middle to automate rewards
Middle can automatically fulfill a reward when a customer redeems it in Perkville. Perkville sends a synchronous webhook request to the reward’s selected Middle workflow, waits for its response, and uses the result to determine the voucher status and whether an ordinary points redemption is completed. Work with a Perkville representative to complete the steps below.
Webhook reference
For workflow builders and troubleshooting:
Real-time redemption requests covers the endpoint, authentication, transaction and member fields, and an example request.
Real-time redemption responses covers the required response, point deductions, voucher statuses, and uncertain outcomes.
Set up Middle redemption
Create a Middle API key for your account
Open the account in Middle.
Select API keys in the account navigation.
Select Add API key.
Enter a descriptive name for the calling system, such as
Perkville Redemptions.Leave Active on and select Save.
Copy the secret immediately (you will enter it in Perkville)
The secret is shown only once. Middle cannot display it again after you leave or refresh the page. If it is lost, rotate the key or create a new key.
Enter the Middle API key in Perkville
Go to the reward program's advanced settings
Scroll down to Middle
Toggle Use Middle on
Paste the Middle API key you just created
Scroll to the bottom and click Save

Create a real-time workflow API endpoint
Go back to the business's Middle account and click on Workflow Triggers in the left-hand menu
Scroll to Real-time workflow API endpoints from modules
Click Connect real-time workflow API endpoint from module
Select the relevant module connection, workflow, and API key(s)
Click Create
The API key, endpoint, and workflow’s real-time API trigger must be active, and the workflow must have a live version eligible for the API. Its Return step must define boolean success and string success_message and error_message fields. See the response contract for examples.
Map the reward(s) to Middle
Go to the relevant reward perks you want to automatically credit through Middle.
Toggle Use Middle to automate redemption to Yes
Select the workflow this perk should map to
Click Save
Repeat these steps for each reward you want to set up.
Perkville loads the workflow choices from Middle using the business’s API key and filters them for the required output schema. If a workflow is missing, check that its endpoint is active, linked to the key, and configured with the required output fields.
Last updated
Was this helpful?

