» List of Webhooks

List of Webhooks

added-to-cart

{
    "hook_name": "added-to-cart",
    "hook_Data": {
        "email": "johndoe@gmail.com",
        "eventId": "3938532C-5622-40C1-9178-F6F53FBD7048",
        "firstName": "John",
        "lastName": "Doe",
        "totalCartValue": 104.5,
        "totalCartTax": 9.5,
        "items": [
            {
                "productID": "8097",
                "sKU": "PRODUCT-800EAEB67DAD",
                "productName": "Blouse",
                "productType": "physical",
                "productCatagory": null,
                "quantity": 1,
                "itemPrice": 27.5,
                "rowTotal": 27.5,
                "variations": null,
                "productURL": "https://cm27.mywebcommander.com/product/blouse",
                "imageURL": "https://cm27.mywebcommander.com/https://template5.mywebcommander.com/resources/4351c511/product/product-1/blouse.jpg/blouse.jpg"
            }
        ]
    }
}

Let’s break down the JSON payload:

  • email: This field contains the email address of the user who added items to their cart. It identifies the user associated with this action.
  • eventId: This is a unique identifier for the event. It’s often used to ensure the event is processed only once and can be used for tracking and auditing purposes.
  • totalCartValue: This field represents the total value of the items in the user’s cart. In this case, it’s set to 76, indicating that the total cost of the items in the cart is $76.
  • items: This is an array of items that were added to the cart. Each item is represented as an object with various properties:
    • productID: A unique identifier for the product being added to the cart.
    • sKU: The SKU (Stock Keeping Unit) for the product. It’s a unique identifier for tracking inventory.
    • productName: The name or title of the product.
    • quantity: The quantity of this specific product added to the cart.
    • itemPrice: The price per unit of the product.
    • rowTotal: The total cost for this specific product (quantity * itemPrice).
    • productURL: A URL pointing to the product’s page on the website. This can be useful for providing a link to the product details.
    • imageURL: A URL pointing to an image of the product. This can be used to display the product image in the cart or during checkout.

This JSON payload provides detailed information about the items added to a user’s cart, allowing the receiving system to update the cart, calculate totals, and potentially trigger further actions like sending a confirmation email or updating inventory.

abandoned-cart-created

{
    "email": "johndoe@mailinator.com",
    "eventId": "A45AB3CC-34D8-4ABC-B314-2FD63534FD9E",
    "add_to_cart_url": "https://instance6.webcommander.com/abandonedCart/abandonedAddToCartByUrl?key=A45AB3CC-34D8-4ABC-B314-2FD63534FD9E",
    "items": [
        {
            "productName": "SSD test",
            "itemPrice": "$250.0",
            "prductUrl": "https://instance6.webcommander.com/product/printer-test",
            "imageUrl": "https://instance6.webcommander.com/resources/00000000/product/product-86/150-s-l500.jpg"
        }
    ]
}

When a cart is abandoned by a customer (after 30 minutes of inactivity), a webhook can trigger an action. The body parameters associated with this event are explained below:

  • email: This field contains the email address of the user who triggered the event. It identifies the user associated with this action.
  • eventId: This is a unique identifier for the event. It’s often used for tracking and auditing purposes. In this case, it’s “A45AB3CC-34D8-4ABC-B314-2FD63534FD9E.”
  • add_to_cart_url: This URL appears to be a specific URL that allows you to add an item to the cart for the user associated with this event. It includes a key or token in the URL (“key=A45AB3CC-34D8-4ABC-B314-2FD63534FD9E”) that likely helps identify and authenticate the user or session.
  • items: This is an array containing information about the item that was added to the cart. In this case, there’s one item:
    • productName: The name or title of the product. It’s “SSD test” in this example.
    • itemPrice: The price of the item. It’s “$250.0” in this example.
    • productUrl: A URL pointing to the product’s page on the website. This URL is https://instance6.webcommander.com/product/printer-test.
    • imageUrl: A URL pointing to an image of the product. It can be used to display the product image in the cart or during checkout. This URL is https://instance6.webcommander.com/resources/00000000/product/product-86/150-s-l500.jpg.

Your webhook endpoint can utilize these parameters to trigger the desired action or process the data according to your application’s requirements when a cart is abandoned by a customer.

abandoned-cart-converted

{
    "email": "johndoe@mailinator.com"
    "eventId": "A45AB3CC-34D8-4ABC-B314-2FD63534FD9E", // uuid of the abandoned the cart. We use them to recover the cart in future.
    "add_to_cart_url": "https:\u002f\u002finstance6.webcommander.com\u002fabandonedCart\u002fabandonedAddToCartByUrl?key=A45AB3CC-34D8-4ABC-B314-2FD63534FD9E",
    "convertedQty": 3,
    "convertedValue": 231 //$ total
}

When an abandoned cart becomes active again (when a customer or guest interacts with it), a webhook can trigger an action. The body parameters associated with this event are explained below:

  • email: This field contains the email address of the user associated with this event. In this case, it’s johndoe@mailinator.com.
  • eventId: This is a unique identifier (UUID) for the event, and it’s used to identify an abandoned cart. The comment indicates that it’s used for future cart recovery. In this case, it’s “A45AB3CC-34D8-4ABC-B314-2FD63534FD9E.”
  • add_to_cart_url: This URL appears to be a special link that could be used to recover or restore the abandoned cart associated with this event. It includes a key or token (“key=A45AB3CC-34D8-4ABC-B314-2FD63534FD9E”) that helps identify the specific cart.
  • convertedQty: This field represents the number of items that were converted or purchased by the user. In this example, the user converted 3 items.
  • convertedValue: This field indicates the total value of the converted items, likely in dollars. In this case, it’s $231.

customer-create

{
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@0040gmail.com",
    "mobile": 014785214,
    "phone": 8956231,
    "addressLine1": "Dhaka",
    "addressLine2": "",
    "postCode": 1230,
    "state": "Dhaka",
    "fax": null,
    "country": "Bangladesh",
    "city": "Dhaka",
    "companyName": null
}

When a customer is created, a webhook can trigger an action. The body parameters associated with this event are explained below:

  • firstName: John’s first name is “John.”
  • lastName: His last name is “Doe.”
  • email: John’s email address is “john@0040gmail.com.”
  • mobile: The mobile number provided appears to be “014785214.”
  • phone: There’s another phone number provided as “8956231.”
  • addressLine1: John’s address is listed as “Dhaka,” which is typically the city or locality.
  • addressLine2: This field is empty, suggesting that John did not provide a second line of address details.
  • postCode: The postal code or ZIP code for John’s address is “1230.”
  • state: The state or region is also listed as “Dhaka.”
  • fax: The fax field is set to null, indicating that no fax number is provided.
  • country: John is located in the country “Bangladesh.”
  • city: His city is “Dhaka,” which corresponds with the state and address details.

By utilizing these parameters in your webhook endpoint, you can trigger the desired action or process the data according to your application’s requirements when a customer is created. This can include sending a welcome email, updating customer records, or performing any other necessary operations.

customer-billing-address-update

{
    "first_name": "First",
    "last_name": "Test",
    "address_line1": "au,bd",
    "address_line2": "012948594594",
    "post_code": "3211",
    "phone": "+7723232323",
    "mobile": "+7723232323",
    "fax": "+77232323",
    "email": "test4320942@mailinator.com",
    "state": "melboune",
    "city": "+7723232323"
}

When the customer billing address is updated, the webhook will trigger an action.

customer-shipping-address-update

{
    "first_name": "First",
    "last_name": "Test",
    "address_line1": "au,bd",
    "address_line2": "012948594594",
    "post_code": "3211",
    "phone": "+7723232323",
    "mobile": "+7723232323",
    "fax": "+77232323",
    "email": "test4320942@mailinator.com",
    "state": "melboune",
    "city": "+7723232323"
}

When a customer’s shipping address is updated, the webhook will trigger an action.

customer-store-credit-update

{
    "store_credit": 100, // Credit amount
    "email": "johndoe@gmail.com", // Customer email address
    "mobile": "019888333388",
    "first_name": "John",
    "last_name": "Doe",
}

Triggers an action when the store credit of a customer is updated.

order-create

{
    "OrderDetails": {
        "email": "johndoe@mailinator.com", // Billing email address
        "eventId": "WC000000-3", 
        "orderId": "WC000000-3",
        "value": 7.7, //Grand total price of this order
        "items": [
            {
                "ProductID": "8",
                "SKU": "PRODUCT-08E28E395DD5",
                "ProductName": "Orange Juice",
                "Quantity": 1,
                "ItemPrice": 13.2,
                "RowTotal": 13.2,
                "ProductURL": "http://localhost:1301/product/orange-juice",
                "ImageURL": "http://localhost:8080resources/00000000/product/product-8//images(1).jpg"
            }
        ]
    },
    "BillingAddress": {
        "FirstName": "John",
        "LastName": "Doe",
        "Company": null,
        "Address1": "melbourne",
        "Address2": null,
        "City": "Carrum Downs",
        "Country": "Australia",
        "CountryCode": "AU",
        "Zip": "3201",
        "Phone": ""
    },
    "ShippingAddress": {
        "FirstName": "test",
        "LastName": "",
        "Company": null,
        "Address1": "melbourne",
        "Address2": null,
        "City": "Carrum Downs",
        "Country": "Australia",
        "CountryCode": "AU",
        "Zip": "3201",
        "Phone": ""
    }
}

When an order is created, a webhook can trigger an action. The body parameters associated with this event are explained below:

  • email: The billing email address associated with the order.
  • eventId: A unique identifier for the order event.
  • orderId: A unique identifier for the order itself.
  • items: This parameter represents an object and contains a list of products that were added to this order.
  • billingAddress: This parameter represents an object and contains the customer’s billing address information.
  • shippingAddress: This parameter represents an object and contains the customer’s shipping address information.

By utilizing these parameters in your webhook endpoint, you can trigger the desired action or process the data according to your application’s requirements when an order is created. This can include updating inventory, sending order confirmation emails, generating invoices, or performing any other necessary operations related to order management.

order-status-change

{
   "orderId": "WCP00000-4353",
   "order_status": "completed",
}

Triggers an action when the status of an order changes. Types of available status – payment awaiting, shipment awaiting, cancelled, completed

order-complete

{
   "orderId": "WCP00000-4353",
   "order_status": "completed",
}

Triggers an action when the shipment of an order is confirmed.

order-payment-success

{
    "orderId": "2550", // Id of the order
    "amount": 500, // Order amount
    "surcharge": 10, // Payment gateway surcharge. Depens on the payment gateway. 
    "trackInfo": "4YS8449025641163E", // Payment tracking info
    "payerInfo": "Customer# 2", // Customers data
    "gatewayCode": "PIS", // Short form of payment gateway
    "gatewayResponse": "Completed", //Response after payment
    "gatewayName": "Secure Pay", // Name of the payment gateway
    "status": "success",
    "payingDate": "2022-04-02 16:19:59"
}

Triggers an action when a payment of an order is successful.

order-payment-failed

{
    "orderId": "2550", // Id of the order
    "amount": 500, // Order amount
    "surcharge": 10, // Payment gateway surcharge. Depens on the payment gateway. 
    "trackInfo": "4YS8449025641163E", // Payment tracking info
    "payerInfo": "Customer# 2", // Customers data
    "gatewayCode": "CRD", // Short form of payment gateway
    "gatewayResponse": "Code 51 - Insufficient Funds", //Response after payment
    "refundId": "ca644b7c-00422-493",
    "gatewayName": "Secure Pay", // Name of the payment gateway
    "status": "failed",
    "payingDate": "2022-04-02 16:19:59"
}

Triggers an action when a payment is failed for an order.

product-create

{
    "id": "wc00012",
    "parent": null,
    "calculatedRestrictPurchaseFor": "none",
    "codeToProtect": "",
    "isAvailableOnWeekdays": false,
    "restrictPurchaseExceptCustomerGroups": [],
    "relatedProducts": [],
    "soldOutLabel": null,
    "calculatedRestrictPriceExceptCustomers": [],
    "productCondition": "new",
    "availableFromDate": null,
    "restrictPriceFor": "none",
    "metaTags": [],
    "globalTradeItemNumber": null,
    "model": null,
    "productFile": null,
    "isFeatured": false,
    "sku": "PRODUCT-9911C0FB075D",
    "multipleOfOrderQuantity": 1,
    "supplierIds": [],
    "basePrice": 500.0,
    "height": 0.0,
    "images": [],
    "availableStock": 0,
    "weight": 0.0,
    "hidePrice": false,
    "isParentInTrash": false,
    "calculatedRestrictPriceExceptCustomerGroups": [],
    "availableToCustomers": [],
    "availableToCustomerGroups": [],
    "name": "Bicycle123",
    "isSoldOut": false,
    "availableToDate": null,
    "minOrderQuantity": 1,
    "isMultipleOrderQuantity": false,
    "isVirtual": false,
    "idx": 1,
    "isAvailable": true,
    "isAvailableOnDateRange": false,
    "calculatedRestrictPurchaseExceptCustomers": [],
    "description": "<p><i>Put a detailed description of your product. You can insert a link, table, image, video or other cool stuff in here.<\/i><\/p>",
    "title": null,
    "isCallForPriceEnabled": false,
    "isCombinationQuantityFlexible": false,
    "isDisposable": false,
    "restrictPriceExceptCustomers": [],
    "inventoryAdjustments": [],
    "isCodeProtected": false,
    "isOnSale": false,
    "seoConfigs": [],
    "availableDays": [],
    "productType": "physical",
    "summary": "Put a short one or two line of your product to briefly explain what it is about.",
}

Triggers an action when a product is created.

product-update

{
    "id": "wc00012",
    "parent": null,
    "calculatedRestrictPurchaseFor": "none",
    "codeToProtect": "",
    "isAvailableOnWeekdays": false,
    "restrictPurchaseExceptCustomerGroups": [],
    "relatedProducts": [],
    "soldOutLabel": null,
    "calculatedRestrictPriceExceptCustomers": [],
    "productCondition": "new",
    "availableFromDate": null,
    "restrictPriceFor": "none",
    "metaTags": [],
    "globalTradeItemNumber": null,
    "model": null,
    "productFile": null,
    "isFeatured": false,
    "sku": "PRODUCT-9911C0FB075D",
    "multipleOfOrderQuantity": 1,
    "supplierIds": [],
    "basePrice": 500.0,
    "height": 0.0,
    "images": [],
    "availableStock": 0,
    "weight": 0.0,
    "hidePrice": false,
    "isParentInTrash": false,
    "calculatedRestrictPriceExceptCustomerGroups": [],
    "availableToCustomers": [],
    "availableToCustomerGroups": [],
    "name": "Bicycle123",
    "isSoldOut": false,
    "availableToDate": null,
    "minOrderQuantity": 1,
    "isMultipleOrderQuantity": false,
    "isVirtual": false,
    "idx": 1,
    "isAvailable": true,
    "isAvailableOnDateRange": false,
    "calculatedRestrictPurchaseExceptCustomers": [],
    "description": "<p><i>Put a detailed description of your product. You can insert a link, table, image, video or other cool stuff in here.<\/i><\/p>",
    "title": null,
    "isCallForPriceEnabled": false,
    "isCombinationQuantityFlexible": false,
    "isDisposable": false,
    "restrictPriceExceptCustomers": [],
    "inventoryAdjustments": [],
    "isCodeProtected": false,
    "isOnSale": false,
    "seoConfigs": [],
    "availableDays": [],
    "productType": "physical",
    "summary": "Put a short one or two line of your product to briefly explain what it is about.",
}

Triggers an action when a product is updated.

product-stock-update

{
   "id": "WCP00000-4353",
    "available_stock": 10,
}

Triggers an action when stock quantity is updated for a product.

product-delete

{
   "id": "WCP00000-4353", // Id of the product
}

Triggers an action when a product is deleted.