HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Update Webhook

❗️

Notice

Please contact SHOPLINE Merchant Success team to enable this function.
請向SHOPLINE Merchant Success團隊申請開啟此功能。

Function

To update a specific subscribed webhook by id
以id更新一個已訂閱的webhook

URL

PUT <<api_domain>>/v1/webhooks/:id

Request parameters

ParameterTypeDescriptionExample
addressStringURL to receive the webhook
接收Webhook的URL
"address": "http://abc.com/webhooks"
topicsString[]Events that trigger the webhook
誘發webhook的事件
---
- user/create
- user/update
- user/remove
- user/sign_in
- user/mobile_sign_in
- user/mobile_sign_up
- order/cancel
- order/create
- order/update

- member_point/create
- user_credit/create

- order_payment/complete
- order_payment/refund
- invoice/create

- merchant/update
"topics": [ "order/create" ]
curl --location --request PUT 'https://open.shoplineapp.com/v1/webhooks/5fcf3c84d9454d0038be2f43' \
--header 'Authorization: Bearer d5537cf89992206433b38766fde925567390b56b79fc301da6393c2116e6a3b3' \
--header 'Content-Type: application/json' \
--data-raw '{
    "topics": [
        "user/remove"
    ]
}'

Response example

{
    "id": "5fcf3c84d9454d0038be2f43",
    "format": "json",
    "address": "http://abc1.com/webhooks",
    "status": "active",
    "merchant_id": "5e840cae77cb07003243f7c7",
    "created_at": "2020-12-08T08:42:44.034+00:00",
    "updated_at": "2020-12-08T08:47:29.094+00:00",
    "topics": [
        "user/remove"
    ]
}