Action and Filter Hook Reference
This is simply a list of action and filter hooks found within B2B Referal System For WooCommerce files. View the source to see supported parameters and usage.
Filters
Actions
API Documentation
Authentication
B2B Referal System For WooCommerce use Basic Authentication ,which accept Consumer Key as Username and Consumer Secret as Password generated by Woocommerce Rest Api (WooCommerce > Settings > Advanced > REST API).
Referral Link
Referral Link
Retrieve Referral Link of User.
HTTP Request
{{site_url}}wp-json/wc/v3/wrs/referral_link
Available Parameters
Parameter | Description |
---|---|
email |
required |
Sample Response:
{
"status": 200,
"data": "https://referralsystem.codupcloud.com?ref=hamza.codup"
}
Coupons
Coupons
Retrieve All coupons for user generated by WooCommerce Referral System Plugin.
HTTP Request
{{site_url}}wp-json/wc/v3/wrs/coupons
Available Parameters
Parameter | Description |
---|---|
email |
required |
Sample Response:
{
"data": [
{
"coupon_code": "d0l63yrx",
"date_expires": "2021-03-31",
"discount_type": "percent",
"coupon_amount": "50",
"reason": "Referee gets coupon on purchase"
},
{
"coupon_code": "7f0wvqsc",
"date_expires": "2021-03-31",
"discount_type": "percent",
"coupon_amount": "5",
"reason": "Referee gets coupon on Sign Up."
},
{
"coupon_code": "n7sjcrhy",
"date_expires": "2021-03-28",
"discount_type": "percent",
"coupon_amount": "10",
"reason": "Referrer gets coupon on purchase of its referee."
},
{
"coupon_code": "pivtsfbl",
"date_expires": "2021-03-27",
"discount_type": "percent",
"coupon_amount": "5",
"reason": "Referrer gets coupon on Sign up of its referee."
}
],
"status": 200,
"message": "4 Coupons found for this user."
}
Plugin Settings
Update Setting
Update WooCommerce Referral System Plugin settings.
HTTP Request
{{site_url}}wp-json/wc/v3/wrs/update_settings
Available Parameters
Parameter | Description |
---|---|
wcrs_integration_type_for_purchase |
minimum 1 required |
Sample Response:
{
"status": 200,
"data": {
"options": {
"wcrs_integration_type_for_purchase": [
"wcrs-integration-purchase",
"both-integration-purchase"
]
},
"current_value": {
"wcrs_integration_type_for_purchase": "wcrs-integration-purchase"
}
}
}
Get Setting
Retrieve WooCommerce Referral System plugin settings.
HTTP Request
{{site_url}}wp-json/wc/v3/wrs/get_setting
Available Parameters
Parameter | Description |
---|---|
setting_name |
optional |
Sample Response:
{
"status": 200,
"data": {
"current_value": "wcrs-integration-purchase",
"options": [
"wcrs-integration-purchase",
"both-integration-purchase"
]
}
}
Template Overriding
How To Edit
Edit files in an upgrade-safe way using overrides. Copy the template into a directory within your theme named
/woocommerce-referral-system
keeping the same file structure but removing the /templates/
subdirectory.
The copied file will now override the B2B Referal System For WooCommerce default template file.
Warning: Do not edit these files within the core plugin itself as they are overwritten during the upgrade process and any customizations will be lost.
Template list
Template files can be found within the /woocommerce-referral-system/templates/
directory:
- admin
- emails
- frontend