Get Webhook
Notice
Please contact SHOPLINE Merchant Success team to enable this function.
請向SHOPLINE Merchant Success團隊申請開啟此功能。
Function
To retrieve a specific subscribed webhook by id
以id獲取一個已訂閱的webhook
URL
GET <<api_domain>>/v1/webhooks/:id
Request parameters
Parameter | Type | Description | Example |
---|---|---|---|
:id *required | String | Webhook ID | 5f8e5dc08a8bb70a5c9cd93c |
Response fields
Field | Type | Description | Example |
---|---|---|---|
id | String | Webhook ID | 5f8e5dc08a8bb70a5c9cd93c |
format | String | Webhook format Webhook格式 --- Currently support "json" only 現只支援"json" | json |
address | String | URL to receive the webhook 接收Webhook的URL | http://abc.com/webhooks |
status | String | Webhook status Webhook狀態 --- - active - removed | active |
merchant_id | String | Merchant ID 商户ID | 5e840cae77cb07003243f7c7 |
created_at | DateTime | Webhook created time Webhook創建日期 | 2020-10-20T03:50:00.323+00:00 |
updated_at | DateTime | Webhook Updated Time Webhook更新時間 | 2020-10-23T08:43:00.369+00:00 |
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 - order_payment/complete - order_payment/refund - user_credit/create order_delivery/update | order/create |
Response example
{
"id": "5f8e5dc08a8bb70a5c9cd93c",
"format": "json",
"address": "http://abc.com/webhooks",
"status": "active",
"merchant_id": "5e840cae77cb07003243f7c7",
"created_at": "2020-10-20T03:50:00.323+00:00",
"updated_at": "2020-10-23T08:43:00.369+00:00",
"topics": [
"order/create"
]
}
Payload example
user/update:
{
"topic": "user/update",
"event": "User",
"merchant_id": "5fc5ea00c43d7f001003999d",
"merchant_handle": "jimmytest2",
"resource": {
"_id": "5ffc0024d9e64e00153da059",
"created_at": "2021-01-11T07:38:21.806Z",
"status": "active",
"delivery_addresses": [],
"name": "tester001",
"phones": [],
"mobile_phone": "0931077193",
"gender": "male",
"birthday": null,
"email": "[email protected]",
"owner_id": "5fc5ea00c43d7f001003999d",
"membership_tier_id": null,
"credit_balance": 0,
"custom_data": {},
"order_count": 0,
"orders_total_sum": null
}
}
user/create:
{
"topic": "user/create",
"event": "User",
"merchant_id": "5fc5ea00c43d7f001003999d",
"merchant_handle": "jimmytest2",
"resource": {
"_id": "5ffd2270958c6c001672f3f8",
"created_at": "2021-01-12T04:18:54.177Z",
"status": "active",
"delivery_addresses": [],
"name": "綠景",
"phones": [],
"mobile_phone": "0931077193",
"gender": null,
"birthday": null,
"email": null,
"owner_id": "5fc5ea00c43d7f001003999d",
"membership_tier_id": null,
"credit_balance": 0,
"custom_data": {},
"order_count": 0,
"orders_total_sum": null
}
}
user/remove:
{
"topic": "user/remove",
"event": "User",
"merchant_id": "5fc5ea00c43d7f001003999d",
"merchant_handle": "jimmytest2",
"resource": {
"_id": "600fce080211e2000c1cdacd",
"created_at": "2021-01-26T08:08:40.651Z",
"status": "removed",
"delivery_addresses": [],
"name": "JM",
"phones": [],
"mobile_phone": null,
"gender": "male",
"birthday": null,
"email": "[email protected]",
"owner_id": "5fc5ea00c43d7f001003999d",
"membership_tier_id": null,
"credit_balance": 0,
"custom_data": {
"5fc76b7d21f58e0026dfd596": ""
},
"order_count": 1,
"orders_total_sum": {
"cents": 260,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "NT$260",
"dollars": 260
}
}
}
user/sign_in:
{
"topic": "user/sign_in",
"event": "User",
"merchant_id": "5fc5ea00c43d7f001003999d",
"merchant_handle": "jimmytest2",
"resource": {
"_id": "5ffd2270958c6c001672f3f8",
"created_at": "2021-01-12T04:18:54.177Z",
"status": "active",
"delivery_addresses": [],
"name": "綠景",
"phones": [],
"mobile_phone": "0931077193",
"gender": null,
"birthday": null,
"email": null,
"owner_id": "5fc5ea00c43d7f001003999d",
"membership_tier_id": null,
"credit_balance": 0,
"custom_data": {},
"order_count": 0,
"orders_total_sum": null
}
}
user/mobile_sign_in:
{
"topic": "user/mobile_sign_in",
"event": "User",
"merchant_id": "5fc5ea00c43d7f001003999d",
"merchant_handle": "jimmytest2",
"resource": {
"_id": "5ffd2270958c6c001672f3f8",
"created_at": "2021-01-12T04:18:54.177Z",
"status": "active",
"delivery_addresses": [],
"name": "綠景",
"phones": [
"0931077193"
],
"mobile_phone": "0931077193",
"gender": null,
"birthday": null,
"email": "[email protected]",
"owner_id": "5fc5ea00c43d7f001003999d",
"membership_tier_id": null,
"credit_balance": 0,
"custom_data": {},
"order_count": 0,
"orders_total_sum": null
}
}
user/mobile_sign_up:
{
"topic": "user/mobile_sign_up",
"event": "User",
"merchant_id": "5fc5ea00c43d7f001003999d",
"merchant_handle": "jimmytest2",
"resource": {
"_id": "5ffd2270958c6c001672f3f8",
"created_at": "2021-01-12T04:18:54.177Z",
"status": "active",
"delivery_addresses": [],
"name": "綠景",
"phones": [],
"mobile_phone": "0931077193",
"gender": null,
"birthday": null,
"email": null,
"owner_id": "5fc5ea00c43d7f001003999d",
"membership_tier_id": null,
"credit_balance": 0,
"custom_data": {},
"order_count": 0,
"orders_total_sum": null
}
}
order/cancel:
{
"topic": "order/cancel",
"event": "Order",
"merchant_id": "5fc5ea00c43d7f001003999d",
"merchant_handle": "jimmytest2",
"resource": {
"_id": "600fce09aa1e7900174b9ba2",
"created_at": "2021-01-26T08:08:41.042Z",
"seller_id": "5fc5ea00c43d7f001003999d",
"status": "cancelled",
"delivery_option_id": "5fc602ca43e255002022fb85",
"subtotal": {
"cents": 50,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "NT$50",
"dollars": 50
},
"total": {
"cents": 260,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "NT$260",
"dollars": 260
},
"currency_iso": "TWD"
}
}
order_payment/complete:
{
"topic": "order_payment/complete",
"event": "OrderPayment",
"merchant_id": "5fc5ea00c43d7f001003999d",
"merchant_handle": "jimmytest2",
"resource": {
"_id": "600fce09aa1e7900174b9ba7",
"created_at": "2021-01-26T08:08:41.143Z",
"status": "completed",
"payment_method_id": "5fc601833218a900350c7110",
"payment_gateway": "bank_transfer",
"payment_status": "pending",
"processed_at": null,
"ref_payment_id": null,
"paid_at": "2021-01-26T08:10:58.448+00:00",
"order_id": "600fce09aa1e7900174b9ba2"
}
}
order/create:
{
"topic": "order/create",
"event": "Order",
"merchant_id": "5fc5ea00c43d7f001003999d",
"merchant_handle": "jimmytest2",
"resource": {
"_id": "600fce09aa1e7900174b9ba2",
"created_at": "2021-01-26T08:08:41.042Z",
"seller_id": "5fc5ea00c43d7f001003999d",
"status": "pending",
"delivery_option_id": "5fc602ca43e255002022fb85",
"subtotal": {
"cents": 50,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "NT$50",
"dollars": 50
},
"total": {
"cents": 260,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "NT$260",
"dollars": 260
},
"currency_iso": "TWD"
}
}
Updated about 3 years ago