ClassesBigCommerceWebhooksProductProduct Creator

Product_Creator

Handles the creation of a new product from BigCommerce via webhooks.

This includes fetching product data, managing channel connections, and triggering imports.

  • Full name: \BigCommerce\Webhooks\Product\Product_Creator

Methods

__construct

Product_Creator constructor.

public __construct(\BigCommerce\Api\v3\Api\CatalogApi $catalog, \BigCommerce\Api\v3\Api\ChannelsApi $channels): mixed

Initializes API clients for catalog and channel operations.

Parameters:

ParameterTypeDescription
$catalog\BigCommerce\Api\v3\Api\CatalogApiCatalog API client.
$channels\BigCommerce\Api\v3\Api\ChannelsApiChannels API client.

create

Creates a new product in BigCommerce.

public create(int $product_id): mixed

Handles the entire product creation process, including:

  • Fetching the product from the BigCommerce catalog.
  • Verifying active channels for product listing.
  • Initiating product import workflows.

Parameters:

ParameterTypeDescription
$product_idintThe ID of the product to create.


Automatically generated on 2025-01-21