API Services
API Services will available if you activate API Services module from Add-ons page.
After activating this module, you will able to use API to get membership plans, membership plan details, member details, member’s purchase plan/post, member’s plan/post payment transactions, check coupon code, add transaction, cancel member’s plan, and check members plan.
API Services Settings
You can check API services and details from ARMember
-> General Settings
-> API Services Settings
page.
Security Key
API security key is useful to secure the API Services and API will be return the data successfully only if the correct “Security Key” is used for the API Calls. Security key is required parameter for all API call.
Get Membership Plans List
This API get all membership plans. Return JSON array with if success then status 1 and response with all plans id, name, and description.
Get Membership Plan Details
Get membership plan details with a given plan id, plan id is required. Return JSON array with if success then status 1 and response plan details plan id, plan name, subscription type, plan amount, trial, etc.
arm_plan_id
(Required) Get Member Details
Get member details with a given user id and for get custom field value pass fields metakeys parameter arm_metakeys
, user id is required parameter and fields metakeys is optional parameter and multiple Metakeys with comma separated. Return JSON array with if success then status 1 and response member details username, email, display name, first name, last name, status, and registretion date.
arm_user_id
(Required) arm_metakeys
(Optional) Get Member’s Membership Plans
Get member’s purchased membership plans and details with a given user id. User id is required parameter, Per Page record is default 5 and optional, and page number is default 1 and optional. Return JSON array with response member’s plans detail plan id, plan name, start date, renew date, end date, and etc.
arm_user_id
(Required) arm_perpage
(Optional) (Default: 5)arm_page
(Optional) (Default: 1)Get Member’s Paid Posts
Get member’s purachased pay per posts and details with a given user id. User id is required parameter, Per Page record is default 5 and optional, and page number is default 1 and optional. Return JSON array with response member’s paid posts details post name, start date, renew date, end date, and etc.
arm_user_id
(Required) arm_perpage
(Optional) (Default: 5)arm_page
(Optional) (Default: 1)Get Member’s Plan Payment Transactions
Get member’s purchased plan payment transaction details with a given user id. User id is required parameter, Per Page record is default 5 and optional, and page number is default 1 and optional. Return JSON array with response member’s transactions detail log id, transaction id, plan name, payment gateway name, payment type, status, plan amount, paid amount, tax, discount, and etc.
arm_user_id
(Required) arm_perpage
(Optional) (Default: 5)arm_page
(Optional) (Default: 1)Get Member’s Paid Post Payment Transactions
Get member’s purchased pay per post payment transaction details with a given user id. User id is required parameter, Per Page record is default 5 and optional, and page number is default 1 and optional. Return JSON array with response member’s transactions detail log id, transaction id, plan name, payment gateway name, payment type, status, plan amount, paid amount, tax, discount, and etc.
arm_user_id
(Required) arm_perpage
(Optional) (Default: 5)arm_page
(Optional) (Default: 1)Verify/Check Coupon Code
Check the coupon code is available for plan and discount amount of plan. Return JSON array with response discount amount, total plan amount after discount, type of discount, discount, and coupon apply for each subscriptions.
coupon_code
(Required) plan_id
(Required) gateway
(Optional) Assign/Add Plan to Member
Add plan to member with given user id and plan id. User id is require parameter, and plan id is require parameter. Return 1 if successfully add plan to member.
arm_user_id
(Required) arm_plan_id
(Required) Add Payment Transaction
Add membership plan and pay par post purchase transaction with given user id. User id is require parameter, plan id is require parameter, and other parameter as per below. Status parameter default is pending or allows status success, canceled, and failed. Amount paramter pass value without tax amount. Total parameter pass value with tax amount.
arm_user_id
(Required) plan_id
(Required) arm_trans_id
(Optional) gateway
(Optional) (Default: manual)arm_status
(Optional) (Default: pending) arm_amount
(Optional) (Default: 0)arm_total
(Optional) (Default: 0)arm_tax_amount
(Optional) (Default: 0)coupon_code
(Optional) is_post_payment
(Optional) (Default: 0)is_post_id
(Optional) (Default: 0)Cancel Member’s Membership plan
Cancel membership plan for member with given user id and plan id. User id is require parameter, and plan_id is require parameter. Return 1 if successfully cancel plan to member.
arm_user_id
(Required) arm_plan_id
(Required) Check Member’s Membership
Check member’s membership plan is Active/Suspend with given user id and plan id. User id is require parameter, and plan id is require parameter. Return status 1 if there was plan found with member id and response is_plan is 1 and if suspended then is_suspended is 1.
arm_user_id
(Required) arm_plan_id
(Required)