Create Webhook
Notice
Please contact SHOPLINE Merchant Success team to enable this function.
請向SHOPLINE Merchant Success團隊申請開啟此功能。
Function
To create a webhook
創建一個webhook
URL
POST <<api_domain>>/v1/webhooks
Request parameters
Parameter | Type | Description | Example |
---|---|---|---|
address | String | URL to receive the webhook 接收Webhook的URL | "address": "http://abc.com/webhooks" |
topics | String[] | 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 - order_delivery/update - product/create - product/update - product/remove - merchant/update | "topics": [ "order/create" ] |
curl --location --request POST 'https://open.shoplineapp.com/v1/webhooks' \
--header 'Authorization: Bearer d5537cf89992206433b38766fde925567390b56b79fc301da6393c2116e6a3b3' \
--header 'Content-Type: application/json' \
--data-raw '{
"address": "http://abc.com/webhooks",
"topics": [
"order/create"
]
}'
Response example
{
"id": "5fcf3c84d9454d0038be2f43",
"format": "json",
"address": "http://abc.com/webhooks",
"status": "active",
"merchant_id": "5e840cae77cb07003243f7c7",
"created_at": "2020-12-08T08:42:44.034+00:00",
"updated_at": "2020-12-08T08:42:44.034+00:00",
"topics": [
"order/create"
]
}
Updated almost 3 years ago