Title: Create member programatically after payment
Last modified: October 29, 2019

---

# Create member programatically after payment

 *  Resolved [dexdeckers](https://wordpress.org/support/users/dexdeckersgmailcom/)
 * (@dexdeckersgmailcom)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/create-member-programatically-after-payment/)
 * Hi, I am running a membership website with PMP using KlikAndPay for accepting
   payments. For diverse reasons, I’m not using Woocommerce at the time. KlikAndPay
   has hosted pages which will handle the payment and afterwards I can redirect 
   users to a specific URL. Since I have no connection between KlikAndPay and PMP,
   I am wondering if there is a way I can create a membership programatically for
   a user who just bought a month’s access to the website. I saw there are action-
   and filter hooks available, but couldn’t find one that would serve this purpose.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/create-member-programatically-after-payment/#post-12075236)
 * Hi [@dexdeckersgmailcom](https://wordpress.org/support/users/dexdeckersgmailcom/)
 * Thank you for using Paid Memberships Pro.
 * You should be able to create a custom function that hooks on ‘init’ and then 
   pass data through query parameters to a specific URL (similar to how a webhook
   handler page could operate) and then programmatically create the user and assign
   a membership level.
 * You may be able to use Zapier as well to create a user and assign a membership
   level with the Paid Memberships Pro Zapier Integration – [https://www.paidmembershipspro.com/add-ons/pmpro-zapier/](https://www.paidmembershipspro.com/add-ons/pmpro-zapier/)
 * I hope this helps get you started.
 *  Thread Starter [dexdeckers](https://wordpress.org/support/users/dexdeckersgmailcom/)
 * (@dexdeckersgmailcom)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/create-member-programatically-after-payment/#post-12075307)
 * Hi Andrew, thank you for your quick reply.
 * I want to try option one first, as I’m already maintaining quite a few plugins
   on this website.
 * So if I understand correctly, I can set up a function that gets called when a
   certain URL is visited (this will be the return URL after payment). With the 
   query params passed to that URL (name, email etc), I should be able to programmatically
   create the user and assign a membership level. That sounds exactly like what 
   I’m looking for.
 * Where can I find the docs that explain how to create this user and assign a membership
   level? I only found this blog article concerning API usage:
    [https://www.paidmembershipspro.com/interacting-with-paid-memberships-pro-through-apis/](https://www.paidmembershipspro.com/interacting-with-paid-memberships-pro-through-apis/)
 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/create-member-programatically-after-payment/#post-12075319)
 * You would need to use the default WordPress functions to create the user and 
   then add the user to the membership level.
 * You can use the function `pmpro_changeMembershipLevel` to assign a membership
   level to a user.
 * Here’s an example from hookr.io – [http://hookr.io/functions/pmpro_change_membership_level/](http://hookr.io/functions/pmpro_change_membership_level/)
 * I hope this helps get you started. You may also look at the Zapier Add On as 
   we do something similar with webhooks between Zapier.
 *  Thread Starter [dexdeckers](https://wordpress.org/support/users/dexdeckersgmailcom/)
 * (@dexdeckersgmailcom)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/create-member-programatically-after-payment/#post-12075335)
 * Ah thanks, that is interesting! I can dig into this.
    I read the Zapier add on
   docs, looks awesome too, thank you for helping out.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Create member programatically after payment’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/paid-memberships-pro_f1dacb.svg)
 * [Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions](https://wordpress.org/plugins/paid-memberships-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-memberships-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-memberships-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-memberships-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-memberships-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-memberships-pro/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [hook](https://wordpress.org/support/topic-tag/hook/)

 * 4 replies
 * 2 participants
 * Last reply from: [dexdeckers](https://wordpress.org/support/users/dexdeckersgmailcom/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/create-member-programatically-after-payment/#post-12075335)
 * Status: resolved