# Webhook

This is for you to integrate it with your system like ERP etc.

The webhook have to be using secure connection, there for only **HTTPS** address is accepted.

## Setup

Webhook can be setup in the App Admin (Shopify Admin > Apps > My Product Registration) > Settings > Advance Settings

![](https://2605251963-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4QrrpvYMMeRETHntuX%2F-M4Qrs94bOy-O-mW79wQ%2F-M4Qrx78xKVPzs7mC0f_%2FScreen%20Shot%202018-05-28%20at%2011.45.04.png?generation=1586384341516414\&alt=media)

Once webhook is setup, every time there is registration, the app will send a **HTTP POST** request to the webhook address with the following payload.

```
{
  "type": "product-registration",
  "items": [
    {
      "product": {
        "id": 11651617295,
        "title": "Short sleeve t shirt",
        "handle": "short-sleeve-t-shirt",
        "imageUrl": "https://cdn.shopify.com/s/files/1/1893/1973/products/mens-dark-grey-long-sleeve-basketball-t-shirt-p18984-15470_image.jpg?v=1498345705"
      },
      "purchaseDate": "2018-05-28T10:58:17.597Z",
      "serialNumbers": [
        "123"
      ],
      "extraFields": [
        {
          "name": "Title",
          "type": "text",
          "value": "Mr"
        },
        {
          "name": "where did you buy it?",
          "type": "selection",
          "value": "Ebay"
        },
        {
          "name": "Upload Image (Receipt)",
          "type": "image",
          "value": "https://www.example.com/test.jpg"
        },
      ]
    }
  ],
  "customer": {
    "name": "James Hunt",
    "firstName": "James",
    "surname": "Hunt",
    "email": "james@hunt.com",
    "address1": "1 Highstreet",
    "address2": "Haham",
    "city": "New York",
    "country": "US",
    "state": "NY",
    "postCode": "1234567",
    "phone": "1234567",
  }
}
```
