1. Home
  2. Docs
  3. TikiNOW Smart Logistics
  4. API References
  5. Fulfillment Service Group
  6. Inventory Service

Inventory Service

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

FieldTypeMandatoryDescription
sync_inventory_locationArrayYesList of Tiki warehouse code
sync_webhookObjectYesWebhook register info
sync_webhook.orderObjectYesWebhook order info
sync_webhook.order.urlStringYesURL receive order status
sync_webhook.order.secret_keyFloatYesSecret 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.stockObjectYesWebhook inventory stock info
sync_webhook.stock.urlStringYesURL receive inventory stock
sync_webhook.stock.secret_keyStringYesSecret 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_idStringNoShop 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"
    }
}

Articles

Was this article helpful to you? Yes No

How can we help?

Leave a Reply

Your email address will not be published.