Webhooks
Price Updated Event

Webhook Event: Price Updated

Event Name: price_updated
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 an existing price's details are updated for a product in the store. The webhook payload includes detailed information about the updated price, reflecting the changes made.

Payload Structure

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

  • event_name (string): The name of the webhook event, in this case, price_updated.
  • is_test (boolean): Indicates if the webhook event is a test.
  • amount (number): The updated amount of the price.
  • created_at (string): The creation date and time of the price record in TIMESTAMPTZ format. Reflects the original creation date.
  • 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_updated",
  "is_test": false,
  "amount": 105.00,
  "created_at": "2023-01-02T12:30:45.123456+00",
  "id": "price124",
  "product_id": "prod456",
  "store_id": "store789",
  "wallet_address": "0x123abc456defUpdated",
  "currency": {
    "name": "Updated Currency Name",
    "symbol": "UPD",
    "address": "0x789ghi123jklUpdated",
    "chain_id": "1",
    "decimals": 18
  }
}

Handling the Event

Upon receiving a price_updated webhook, ensure to refresh the price details in your system to reflect the latest information. The is_test key helps in identifying if the webhook is triggered for testing purposes.