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 or inventory stock or aftersale status (FD/CR) when it changes

1. API endpoint

https://api.tikinow.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

3. CURL Example

curl --location 'https://api.tikinow.vn/business/v1/register-webhooks' \
--header 'Authorization: Bearer xxx' \
--header 'Content-Type: application/json' \
--data '{
    "sync_inventory_location": [
        "sgn3",
        "tbn1",
        "tbn2",
        "tbn3",
        "tiger1",
        "tiger2"
    ],
    "sync_webhook": {
        "order": {
            "url": "https://your_domain/webhooks/order",
            "secret_key": "sjYKaAFXDaS4qxeykux4WL1qMI0gzAc0"
        },
        "stock": {
            "url": "https://your_domain/webhooks/stock",
            "secret_key": "sjYKaAFXDaS4qxeykux4WL1qMI0gzAc0"
        }
        "aftersale": {
            "url": "https://your_domain/webhooks/aftersale",
            "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.stockObjectNoWebhook inventory stock info, If you don’t want to receive the data, you don’t need to declare it.
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.
sync_webhook.aftersaleObjectNoWebhook CR/FD. If you don’t want to receive the data, you don’t need to declare it.
sync_webhook.aftersale.urlStringYes URL receive FD/CR
sync_webhook.aftersale.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 1 No

How can we help?

Leave a Reply

Your email address will not be published.