Register webhooks
Register url to receive order status and inventory status when it changes
1. API endpoint
https://tikinowapi.tiki.vn/business/v1/register-webhooks
2. Header request
Content-Type: application/json
Authorization: Bearer + token: token get from API get token or login into public app, in-house app or token from Seller Center.
3. CURL Example
curl --location 'https://tikinowapi.tiki.vn/business/v1/register-webhooks' \
--header 'Authorization: Bearer xxx' \
--header 'Content-Type: application/json' \
--data '{
"sync_inventory_location": [
"sgn",
"sgn3",
"hn5",
"tbn1"
],
"sync_webhook": {
"order": {
"url": "https://your_domain/webhooks/order",
"secret_key": "sjYKaAFXDaS4qxeykux4WL1qMI0gzAc0"
},
"stock": {
"url": "https://your_domain/webhooks/stock",
"secret_key": "sjYKaAFXDaS4qxeykux4WL1qMI0gzAc0"
}
},
"external_partner_id": "41235121321"
}'
4. Payload
Field | Type | Mandatory | Description |
---|---|---|---|
sync_inventory_location | Array | Yes | List of Tiki warehouse code |
sync_webhook | Object | Yes | Webhook register info |
sync_webhook.order | Object | Yes | Webhook order info |
sync_webhook.order.url | String | Yes | URL receive order status |
sync_webhook.order.secret_key | Float | Yes | Secret key to hash payload data, must string length 32 characters, ref: https://randomkeygen.com/ get key in CodeIgniter Encryption Keys – Can be used for any other 256-bit key requirement. |
sync_webhook.stock | Object | Yes | Webhook inventory stock info |
sync_webhook.stock.url | String | Yes | URL receive inventory stock |
sync_webhook.stock.secret_key | String | Yes | Secret key to hash payload data, must string length 32 characters, ref: https://randomkeygen.com/ get key in CodeIgniter Encryption Keys – Can be used for any other 256-bit key requirement. |
external_partner_id | String | No | Shop ID or Shop code |
5. Response
Error
{
"success": false,
"error": {
"status_code": 401,
"message": "Unauthorized",
"message_code": "INVALID_TOKEN"
},
"meta_data": {
"request_id": "97b2702c775f57c565b5a3c6f01052a1"
}
}
Success
{
"success": true,
"meta_data": {
"request_id": "97b2702c775f57c565b5a3c6f01052a1"
}
}