Web Hooks¶
This is for Web Hooks management.
Note
Ginee Open API enable you to receive notifications whenever particular changes are made to Ginee. You can subscribe to notifications for a wide variety of events, including:
- Order
- Delivery order
Get Started¶
Step 1. Determine which events to subscribe to¶
A webhook notification is sent whenever a relevant event occurs you subscribe to. Every event has a type of CREATE
, UPDATE
, or DELETE
, depending on the action it represents for its related entity. For example, the order
create event occurs when a new order is initiated on Ginee.
You can subscribe to notifications for any combination of the following entities:
Entity | Event Types | Description |
---|---|---|
order | CREATE |
An order has been created |
delivery-order | CREATE ,UPDATE ,DELETE |
An delivery order has been created |
Step 2. Provide a endpoint URL for receiving notifications¶
The URL of your server endpoint that will receive all webhook notifications.
Note
Please contact Ginee staff and provide the informations above.
Step 3. Receiving webhooks¶
When a webhook event that you’ve subscribed to occurs, Ginee Open API sends a POST request to your server endpoint with the details of the event.
Webhook notification requests have same data structure, for example:
Example
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"id": GENIE5FF31A7C5F15030001D3ED5F,
"entity": "delivery-order",
"action": "CREATE",
"createAt": "2020-12-24T06:45:29.174Z",
"payload": {
}
}'
You should always respond with a 200
status code to indicate that you received the notification.
200 OK
Response
{
"status": true
}
Request Parameters¶
Parameter | Description |
---|---|
id | string(required) Unique id for each notification |
entity | string(required) Entity value |
action | string(required) Event type (CREATE , UPDATE , DELETE ) |
createAt | UTC timestamp(optional) Timestamp that a notification created |
payload | object(required) Payload message, see details below |
Payload Messages¶
order¶
Payload Parameters
Parameter | Description |
---|---|
orderId | string Order id in Ginee |
channel | string Please refer to Ginee Channel for details |
shopId | string Shop id in Ginee |
externalShopId | string Channel shop id |
orderStatus | string Order status |
createAt | UTC timestamp Order create time |
payAt | UTC timestamp Order pay time |
lastUpdateAt | UTC timestamp Order update time |
Example
{
"id": "GENIE5FF31A7C5F15030001D3ED5E",
"userId": "1",
"entity": "order",
"action": "CREATE",
"createAt": "2020-12-24T06:45:29.174Z",
"user": {
"id": "1",
"email": "xxx@gmail.com"
},
"payload": {
"orderId": "order_1",
"channel": "LAZADA_ID",
"shopId": "shop_1",
"externalShopId": "channel_shop_1",
"orderStatus": "PAID",
"createAt": "2020-12-24T06:20:29.174Z",
"payAt": "2020-12-24T06:20:29.174Z",
"lastUpdateAt": "2020-12-24T06:20:29.174Z"
}
delivery-order¶
Need provide an url to update delivery order status instantly. The push data please refer to List Delivery Order for API response data.
Parameter | Description |
---|---|
warehouseProviderId | string Warehouse provider id in Ginee |
warehouseId | string Warehouse id in Ginee |
warehouseCode | string Warehouse id in provider |
ownerId | string Owner id in Ginee |
ownerCode | string Owner id in provider |
deliveryOrderId | string Delivery order id |
deliveryOrderSn | string Delivery order sn |
sourceOrderId | string The unique order id in Ginee |
sourceOrderSn | string The unique id in channel |
deliveryOrderType | string Delivery order type |
deliveryOrderStatus | string Delivery order status |
createAt | UTC timestamp Delivery order create time |
lastUpdateAt | UTC timestamp Delivery order create time |
channel | string Please refer to Ginee Channel for details |
waybillUrl | string Waybill url |
trackingNumber | string Tracking number |
shop | object Shop information |
shippingAddress | object Shipping address |
senderAddress | object Sender address |
orderItems | arrays Please refer to Order Item for details |
logisticsProvider | string Logistics Provider |
Shop¶
Parameter | Description |
---|---|
shopId | string Shop id in Ginee |
shopName | string Shop name |
shopUrl | string Shop url |
externalShopId | string Shop id in e-commerce platform |
OrderItem¶
Parameter | Description |
---|---|
deliveryOrderId | string Delivery order id |
deliveryOrderItemId | string Delivery order item id |
inventoryId | string Inventory id in Ginee |
inventorySku | string Inventory sku |
inventoryName | string Inventory name |
quantity | integer Quantity |
orderId | string Order id |
orderItemId | string Order item id |
UPDATE
{
"id":"GENIE5FF5D0245F150300015E5600",
"userId":"U5DDCC5369BD1160001ADD698",
"entity":"delivery-order",
"action":"UPDATE",
"createAt":"2020-10-27T15:50:19Z",
"user":{
"id":"U5DDCC5369BD1160001ADD698",
"email":""
},
"payload":{
"deliveryOrderId":"WDO600573D16B2F070001497EAF",
"deliveryOrderSn":"2100011800000021",
"sourceOrderId":"SO5FD858B7EE35880001692D67",
"sourceOrderSn":"2102261G58H1VJ",
"deliveryOrderType":"SALE_ORDER",
"deliveryOrderStatus":"NEW",
"createAt":"2020-12-24T06:20:29.174Z",
"lastUpdateAt":"2021-01-18T11:41:05.269Z",
"warehouseProviderId":"WWP6000643B6B2F070001CD0E47",
"warehouseId":"WW600064816B2F070001CD0E48",
"warehouseCode":"CS624",
"ownerId":"WO600064A26B2F070001CD0E49",
"ownerCode":"GENIE",
"channel":"TOKOPEDIA_ID",
"waybillUrl":"https://xxxx.com/13877966/2297056",
"trackingNumber":"10000972949095",
"logisticsProvider":"AnterAja",
"shop": {
"shopId": "",
"shopName": "",
"shopUrl": "",
"externalShopId": ""
},
"shippingAddress":{
"name":"fVivin",
"phoneNumber":"+62 81283278337",
"country":"Indonesia",
"province":"DKI Jakarta",
"city":"Kota Administrasi Jakarta Barat",
"district":"Grogol",
"zipCode":"11440",
"fullAddress":",Grogol,Kota Administrasi Jakarta Barat,DKI Jakarta,11440"
},
"senderAddress":{
"name":"fVivin",
"phoneNumber":"+62 11111111111",
"country":"Indonesia",
"province":"DKI Jakarta",
"city":"Kota Administrasi Jakarta Timur",
"district":"Pulo Gadung",
"zipCode":"13240",
"fullAddress":"cipinang kebembem, pulogadung Kec. Pulo GadungKota Jakarta Timur"
},
"orderItems":[
{
"deliveryOrderItemId":"WDOI600573D16B2F070001497EB0",
"inventoryId":"IN5FF02DDA52FAFF00011F73AB",
"inventorySku":"800151",
"quantity":4,
"deliveryOrderId":"WDO600573D16B2F070001497EAF",
"inventoryName":"Xiaobailong1",
"sourceOrderItemId":"OI5FD97377CFF47E0001545E3F"
}
]
}
}
DELETE
{
"id" : "GENIE606D4BF6DC0E8200015A823D",
"userId" : "MC601B800B4CEDFD0001DAD8B3",
"entity" : "delivery-order",
"action" : "DELETE",
"createAt" : "2021-04-07T06:06:46.494Z",
"user" : {
"_id" : "MC601B800B4CEDFD0001DAD8B3",
"email" : ""
},
"payload" : {
"warehouseProviderId" : "WWP60116F5C5F15030001797451",
"warehouseId" : "WW601170005F15030001797452",
"warehouseCode" : "021DCB",
"ownerId" : "WDO606D24DD46E0FB0001D87335",
"ownerCode" : "021DCB00024",
"channel" : "SHOPEE_ID",
"waybillUrl" : "https://xxxx.com/13877966/2297056",
"trackingNumber" : "JP9581135490",
"deliveryOrderId" : "WDO606D24DD46E0FB0001D87335",
"deliveryOrderSn" : "2100040700007863",
"sourceOrderId" : "SO606D095FDC0E820001973145",
"sourceOrderSn" : "210407DAAABW8C",
"deliveryOrderType" : "SALE_ORDER",
"createAt" : "2021-04-07T03:19:57.000Z",
"lastUpdateAt" : "2021-04-07T06:06:46.490Z"
}
}