As with Webhooks for Messenger, the first thing you'll need to do is enable your webhooks within Sonar.

Retail Features

For each customer interaction with your retail features (customer opt-in or opt-out to receive Messenger updates), you will receive the following webhook.

{
 'type'    => 'link',
 'action' => 'retail_webhook',
 'state' => {
   'order_id'             => 12345,
   'internal_customer_id' => 555666,
   'spend_to_date'        => 20.99
  }
 'customer' => {
   'first_name'   => 'Joe',
   'last_name'    => 'Customer',
   'phone_number' => '',
   'fb_id'    => '1234',
   'email'    => '[email protected]'
  }
}

In the above example, you would have already passed all of the "state" params when rendering the retail plugin on your webpage. You can find more information about the "flow" here.