Webhooks
Product Created Event

Webhook Event: Product Created

Event Name: product_created
HTTP Method: POST
Webhook URL: Your specified endpoint URL
Test Key: is_test (boolean): Indicates whether the webhook event is a test (true) or a real event (false).

Description

This event is triggered when a new product is created and added to the store. The webhook payload includes detailed information about the newly created product, following the corrected product schema.

Payload Structure

The webhook payload for the product_created event includes the following fields:

  • event_name (string): The name of the webhook event, in this case, product_created.
  • is_test (boolean): Indicates if the webhook event is a test.
  • created_at (string): The creation date and time of the product record in TIMESTAMPTZ format.
  • description (string | null): A brief description of the product.
  • id (string): The unique identifier for the product.
  • name (string): The name of the product.
  • store_id (string | null): The identifier of the store this product belongs to.
  • image_url (string | null): The URL to the product's image.
  • status (string): The status of the product (active, archived, or hidden).
  • quantity_available (number | null): The quantity of the product available for sale.
  • seller_note (string | null): A note from the seller regarding the product.

Example Payload

{
  "event_name": "product_created",
  "is_test": false,
  "created_at": "2023-01-01T16:48:32.007852+00",
  "description": "An example product description.",
  "id": "prod456",
  "name": "Example Product Name",
  "store_id": "store789",
  "image_url": "https://example.com/product.png",
  "status": "active",
  "quantity_available": 100,
  "seller_note": "This is a seller note."
}

Handling the Event

Upon receiving a product_created webhook, update your system to reflect the new product in your inventory or on your website. Utilize the is_test key for differentiating between real and test data during development.