Create and update access records for purchased product
When a customer pays for the product, their access record is created or updated in your user system so onboarding can start right away.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/create-and-update-access-records-for-purchased-product/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- IT · Identity access management
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/create-and-update-access-records-for-purchased-product
Set it up with the CLI
- Add it. Copies the folder into
zaps/create-and-update-access-records-for-purchased-product/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/create-and-update-access-records-for-purchased-product - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy create-and-update-access-records-for-purchased-product - Check it. Its recent runs, with status and errors.
npx zap-pack logs create-and-update-access-records-for-purchased-product
zaps/create-and-update-access-records-for-purchased-product/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 2 to fill in
- connections/shopify.tsThe
shopifyaccount it uses - triggers/new-paid-order.tsWhat starts it:
shopifynew_paid_order_v3 - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a paid order arrives from Shopify (
shopify,new_paid_order_v3). - Filter: the workflow continues only if one of the order's line items has the configured product ID. Otherwise it stops with
skipped. - Email check: the workflow needs an email address (customer email, then order email). Without one it stops with
skipped. - Webhooks by Zapier POST: sends the email, name,
access_status(active), and billing and shipping address summaries as JSON to your user management API. The API creates the user when no match exists, or updates the existing user with the same email.
The workflow never matches or updates users itself; the user management API must match on email.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
QUALIFYING_PRODUCT_ID |
The Shopify product whose paid orders grant access; look up its ID with the user's Shopify connection |
USER_API_URL |
The endpoint of the user management API that accepts a JSON POST |
Also review the default ACCESS_STATUS ("active") with them: it is the status sent with each record.
Before building, confirm:
- Does the user management API create or update the user when the email already exists? If it only creates, add a lookup step before the POST.
- Does the API need an authorization header? Add the token through a connection, never as a constant.
- Does the API expect the address summaries in a different shape?
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/create-and-update-access-records-for-purchased-product, replace each REPLACE_… value as this file says, then run npx zap-pack deploy create-and-update-access-records-for-purchased-product, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
shopifyto the store's Shopify connection, which the trigger uses. Webhooks by Zapier needs no connection. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/new-paid-order.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections and sample the trigger before the first test run, and fix any key in
workflow.tsthat doesn't match. In particular, confirm the trigger'scustomer,line_items,billing_addressandshipping_addressfields.
Test it
Run this sample as a draft test before publishing. It does not contain the qualifying product, so it exercises the filter and makes no external call:
{
"id": 1001,
"email": "test-buyer@example.com",
"customer": {
"first_name": "Test",
"last_name": "Buyer",
"email": "test-buyer@example.com"
},
"line_items": [{ "product_id": "0000000000" }],
"billing_address": {
"address1": "1 Test St",
"city": "New York",
"province": "NY",
"country": "US"
},
"shipping_address": {
"address1": "1 Test St",
"city": "New York",
"province": "NY",
"country": "US"
}
}
Expect { "skipped": true, "reason": "no-qualifying-product" } and no webhook call. Then run a paid order for the qualifying product on a test store. The user management API should receive one POST with email, name, access_status: "active", and the address summaries. If run-status tools aren't available, check the result in your user management API directly. The user deletes any test records, not the agent. Publish only after both checks pass, and confirm the trigger is active.
Notes
- Confirm the trigger's output fields against a real order before relying on the workflow.
- Never commit a real product ID, API URL, token, or customer data.
- To extend it, alert onboarding with an Email by Zapier or Slack step after the POST, or record the Shopify order ID on the user record for audit and reconciliation.