» Accessing and Modifying Data

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'

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'

Request Details

  • Request URL: http://5289d153.wc-stage.webcommander.com/external/app/access/discount-profile
  • Request Method: GET

Request Parameter

NameTypeRequiredDescription
nameStringNoName of the profile.
typeStringNoType 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"'

Request Details

  • Request URL: http://5289d153.wc-stage.webcommander.com/external/app/access/email-enable-disable
  • Request Method: POST
Request Parameter
NameTypeRequiredDescription
emailTypeStringYesThe 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
activeBooleanyesTo 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'

Request Details

  • Request URL: http://5289d153.wc-stage.webcommander.com/external/app/access/email-status
  • Request Method: GET
Request Parameter
NameTypeRequiredDescription
emailTypeStringYesThe 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}