Webhooks
Price Created Event

Webhook Event: Price Created

Event Name: price_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 price is created and associated with a product in the store. The webhook payload includes detailed information about the newly created price, adhering to the corrected price schema.

Payload Structure

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

  • event_name (string): The name of the webhook event, in this case, price_created.
  • is_test (boolean): Indicates if the webhook event is a test.
  • amount (number): The amount of the price.
  • created_at (string): The creation date and time of the price record in TIMESTAMPTZ format.
  • id (string): The unique identifier for the price.
  • product_id (string): The identifier of the product this price is associated with.
  • store_id (string): The identifier of the store this price belongs to.
  • wallet_address (string): The wallet address associated with the store currency.
  • currency (object): Detailed information about the currency, including:
    • name (string): The name of the currency.
    • symbol (string): The symbol of the currency.
    • address (string): The blockchain address of the currency.
    • chain_id (string): The blockchain chain ID the currency is on.
    • decimals (number): The number of decimals the currency uses.

Example Payload

{
  "event_name": "price_created",
  "is_test": false,
  "amount": 100.00,
  "created_at": "2023-01-01T16:48:32.007852+00",
  "id": "price123",
  "product_id": "prod456",
  "store_id": "store789",
  "wallet_address": "0x123abc456def",
  "currency": {
    "name": "Example Currency Name",
    "symbol": "EXM",
    "address": "0x789ghi123jkl",
    "chain_id": "1",
    "decimals": 18
  }
}

Handling the Event

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