Accessing and Modifying Data
When developing your WebCommander plugin, you’ll need to interact with WebCommander data to provide the desired functionalities. Here’s how to access and modify WebCommander data:
Using Configuration Endpoints
- Base URL: The base URL is the client site URL where the plugin is requested for installation.
- Authentication: To make requests to WebCommander, include the “accessToken” and “uuid” values in the request header, ensuring they are in the proper format and syntax required by WebCommander.
customer-registration-fields
To check the status of customer meta fields, you can call the following endpoint. Examples of how to use this endpoint are provided below:
curl --location 'http://5289d153.wc-stage.webcommander.com/external/app/access/customer-registration-fields' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'uuid: F8A3-A88E-C6EF-B1CB'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://5289d153.wc-stage.webcommander.com/external/app/access/customer-registration-fields',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'accessToken: 11b4ec017714ef095b8e115545467fcb',
'uuid: F8A3-A88E-C6EF-B1CB'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
import mimetypes
from codecs import encode
conn = http.client.HTTPSConnection("5289d153.wc-stage.webcommander.com")
boundary = ''
payload = ''
headers = {
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'uuid': 'F8A3-A88E-C6EF-B1CB',
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("GET", "/external/app/access/customer-registration-fields", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://5289d153.wc-stage.webcommander.com/external/app/access/customer-registration-fields")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.multiPartContent()
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://5289d153.wc-stage.webcommander.com/external/app/access/customer-registration-fields", Method.Get);
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://5289d153.wc-stage.webcommander.com/external/app/access/customer-registration-fields
- Request Method:
GET
- Request Parameter:
None
Response
{
"first_name_order": "1",
"first_name_key": "first_name",
"first_name_label": "First Name",
"first_name_active": true,
"first_name_required": true,
"last_name_order": "2",
"last_name_key": "last_name",
"last_name_label": "Last Name",
"last_name_active": true,
"last_name_required": false,
"address_line_1_order": "3",
"address_line_1_key": "address_line_1",
"address_line_1_label": "Address Line 1",
"address_line_1_active": true,
"address_line_1_required": true,
"address_line_2_order": "4",
"address_line_2_key": "address_line_2",
"address_line_2_label": "Address Line 2",
"address_line_2_active": false,
"address_line_2_required": false,
"post_code_order": "5",
"post_code_key": "post_code",
"post_code_label": "Post Code",
"post_code_active": true,
"post_code_required": true,
"city_order": "6",
"city_key": "city",
"city_label": "Suburb\u002fCity",
"city_active": true,
"city_required": true,
"phone_order": "7",
"phone_key": "phone",
"phone_label": "Phone",
"phone_active": true,
"phone_required": false,
"mobile_order": "8",
"mobile_key": "mobile",
"mobile_label": "Mobile",
"mobile_active": true,
"mobile_required": false,
"fax_order": "9",
"fax_key": "fax",
"fax_label": "Fax",
"fax_active": false,
"fax_required": false,
"email_order": "10",
"email_key": "email",
"email_label": "Email",
"email_active": true,
"email_required": true,
"confirm_email_order": "11",
"confirm_email_key": "confirm_email",
"confirm_email_label": "Confirm Email",
"confirm_email_active": false,
"confirm_email_required": false,
"password_order": "12",
"password_key": "password",
"password_label": "",
"password_active": true,
"password_required": true,
"retype_password_order": "13",
"retype_password_key": "retype_password",
"retype_password_label": "",
"retype_password_active": true,
"retype_password_required": true,
"country_order": "14",
"country_key": "country",
"country_label": "Country",
"country_active": true,
"country_required": true,
"customer_type_order": "15",
"customer_type_key": "customer_type",
"customer_type_label": "",
"customer_type_active": true,
"customer_type_required": false,
"sex_order": "16",
"sex_key": "sex",
"sex_label": "Gender",
"sex_active": true,
"sex_required": false,
"abn_order": "17",
"abn_key": "abn",
"abn_label": "ABN",
"abn_active": false,
"abn_required": false,
"abn_branch_order": "18",
"abn_branch_key": "abn_branch",
"abn_branch_label": "ABN Branch",
"abn_branch_active": false,
"abn_branch_required": false,
"company_name_order": "19",
"company_name_key": "company_name",
"company_name_label": "Company Name",
"company_name_active": true,
"company_name_required": false
}
discount-profile
WebCommander allows you to create various types of discount profiles, and you can use the following request to learn more about them and their statuses. Below are some examples of how to use this request:
curl --location 'http://5289d153.wc-stage.webcommander.com/external/app/access/discount-profile' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'uuid: F8A3-A88E-C6EF-B1CB'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://5289d153.wc-stage.webcommander.com/external/app/access/discount-profile',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'accessToken: 11b4ec017714ef095b8e115545467fcb',
'uuid: F8A3-A88E-C6EF-B1CB'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
conn = http.client.HTTPSConnection("5289d153.wc-stage.webcommander.com")
payload = ''
headers = {
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'uuid': 'F8A3-A88E-C6EF-B1CB'
}
conn.request("GET", "/external/app/access/discount-profile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://5289d153.wc-stage.webcommander.com/external/app/access/discount-profile")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.asString();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://5289d153.wc-stage.webcommander.com/external/app/access/discount-profile")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.asString();
Request Details
- Request URL:
http://5289d153.wc-stage.webcommander.com/external/app/access/discount-profile
- Request Method:
GET
Request Parameter
Name | Type | Required | Description |
---|---|---|---|
name | String | No | Name of the profile. |
type | String | No | Type of the profile. |
Response
{
"status": [
{
"displayTextCoupon": null,
"isMaximumUseTotal": false,
"usage": [
{
"itemId": null,
"amount": 5.0,
"orderId": 62,
"appliedCouponCode": null,
"customerId": null,
"discount": 2,
"id": 2
},
{
"itemId": null,
"amount": 5.0,
"orderId": 65,
"appliedCouponCode": null,
"customerId": null,
"discount": 2,
"id": 5
},
{
"itemId": null,
"amount": 5.0,
"orderId": 68,
"appliedCouponCode": null,
"customerId": 50,
"discount": 2,
"id": 8
},
{
"itemId": null,
"amount": 5.0,
"orderId": 71,
"appliedCouponCode": null,
"customerId": 50,
"discount": 2,
"id": 11
},
{
"itemId": null,
"amount": 5.0,
"orderId": 74,
"appliedCouponCode": null,
"customerId": 56,
"discount": 2,
"id": 14
}
],
"displayTextPartialDiscountCondition": null,
"isActive": true,
"type": "customer",
"isDisplayTextCoupon": false,
"isSpecifyEndDate": false,
"startTo": null,
"detailsId": 2,
"isCouponCodeAutoGenerate": true,
"isExcludeProductsOnSale": false,
"assoc": {
"isAppliedAllCustomer": true,
"isAppliedAllProduct": true,
"customerGroups": [],
"assocIds": [],
"assocType": null,
"id": 2,
"categories": [],
"customers": [],
"isAppliedAllAssoc": false,
"products": []
},
"isApplyCouponCode": false,
"isDisplayTextPartialDiscountCondition": false,
"id": 2,
"isMaximumDiscountAllowed": false,
"startFrom": null,
"coupon": null,
"defaultCouponCode": "DSCP-463C7D7845",
"created": "2023-02-19T13:42:33",
"displayTextCart": null,
"maximumDiscountAllowedAmount": null,
"isDisplayTextCart": false,
"isMaximumUseCustomer": false,
"version": null,
"discountDetailsType": "amount",
"isDisplayDiscountInformationProdDetail": true,
"isCreateUniqueCouponEachCustomer": false,
"maximumUseCount": null,
"name": "Test",
"isDiscountUsedWithOtherDiscount": false,
"maximumUseCustomerCount": null,
"updated": "2023-02-19T13:42:33",
"excludeProducts": []
}
]
}
email-enable-disable
You can enable or disable specific emails on a WebCommander site using the following request. Below are some examples of how to use this request:
curl --location 'http://5289d153.wc-stage.webcommander.com/external/app/access/email-enable-disable' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--form 'emailType ="customer-registration"' \
--form 'active="false"'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://5289d153.wc-stage.webcommander.com/external/app/access/email-enable-disable',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(,),
CURLOPT_HTTPHEADER => array(
'accessToken: 11b4ec017714ef095b8e115545467fcb',
'uuid: F8A3-A88E-C6EF-B1CB'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
import mimetypes
from codecs import encode
conn = http.client.HTTPSConnection("5289d153.wc-stage.webcommander.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=emailType;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("customer-registration"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=active;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("false"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'uuid': 'F8A3-A88E-C6EF-B1CB',
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/external/app/access/email-enable-disable", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("http://5289d153.wc-stage.webcommander.com/external/app/access/email-enable-disable")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.multiPartContent()
.field("emailType ", "customer-registration")
.field("active", "false")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://5289d153.wc-stage.webcommander.com/external/app/access/email-enable-disable", Method.Post);
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AlwaysMultipartFormData = true;
request.AddParameter("emailType ", "customer-registration");
request.AddParameter("active", "false");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://5289d153.wc-stage.webcommander.com/external/app/access/email-enable-disable
- Request Method: POST
Request Parameter
Name | Type | Required | Description |
---|---|---|---|
emailType | String | Yes | The type of email you want to enable/disable for WebCommander can be specified using the following accepted values: • payment-success • payment-pending • payment-refund • partial-payment • tell-friend • send-invoice • create-order • partial-shipment • shipment-complete • operator-reset-password • service-status • order-sync-missing-notification • customer-reset-password • customer-welcome-email • create-customer • customer-registration • create-operator • customer-restricted-registration-notification • customer-restricted-registration-approval • customer.registration.verification • store-credit-request • newsletter-subscription-notification • customer-order-comment-notification • admin-order-comment-notification • low-stock-notification • out-of-stock-notification • downloadable-product • incomplete-payment-notification • low-stock-report |
active | Boolean | yes | To enable or disable, input either “true” or “false”. |
Response
{"status":false}
email-status
You can determine the status of a specific email type (whether it is enabled or disabled) by making the following request:
curl --location 'http://5289d153.wc-stage.webcommander.com/external/app/access/email-status?emailType=customer-registration' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'uuid: F8A3-A88E-C6EF-B1CB'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://5289d153.wc-stage.webcommander.com/external/app/access/email-status?emailType=customer-registration',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'accessToken: 11b4ec017714ef095b8e115545467fcb',
'uuid: F8A3-A88E-C6EF-B1CB'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
import mimetypes
from codecs import encode
conn = http.client.HTTPSConnection("5289d153.wc-stage.webcommander.com")
boundary = ''
payload = ''
headers = {
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'uuid': 'F8A3-A88E-C6EF-B1CB',
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("GET", "/external/app/access/email-status?emailType=customer-registration", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://5289d153.wc-stage.webcommander.com/external/app/access/email-status?emailType=customer-registration")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.multiPartContent()
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://5289d153.wc-stage.webcommander.com/external/app/access/email-status?emailType=customer-registration", Method.Get);
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AlwaysMultipartFormData = true;
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://5289d153.wc-stage.webcommander.com/external/app/access/email-status
- Request Method: GET
Request Parameter
Name | Type | Required | Description |
---|---|---|---|
emailType | String | Yes | The email status type you want to check. Accepted values are given below: • payment-success • payment-pending • payment-refund • partial-payment • tell-friend • send-invoice • create-order • partial-shipment • shipment-complete • operator-reset-password • service-status • order-sync-missing-notification • customer-reset-password • customer-welcome-email • create-customer • customer-registration • create-operator • customer-restricted-registration-notification • customer-restricted-registration-approval • customer.registration.verification • store-credit-request • newsletter-subscription-notification • customer-order-comment-notification • admin-order-comment-notification • low-stock-notification • out-of-stock-notification • downloadable-product • incomplete-payment-notification • low-stock-report |
Response
{"status":false}