BigCommerce - Validating Hash with Webhooks

195 Views Asked by At

Hello BigCommerce Team,

Can you please give an example or reference link on how to compare the hash in webhook as there is no documentation about it.

I want to compute hash of json payload with SH1 and compare it with "hash":"....."

{
"scope": "store/shipment/created",
"store_id": "1025646",
"data": {
    "type": "shipment",
    "id": 12,
    "orderId": 251
},
"hash": "8b98021cb0faa7e3a58a0e4182d3696a4bdd24ab",
"created_at": 1561482857,
"producer": "stores/{store_hash}"
}

Thanks, Kiran

1

There are 1 best solutions below

0
On

I’m not sure about your use case in needing to compare the hash, however I have found some information that may be helpful to you!

At this time the encryption/decryption mechanisms for our hash values are not public, so the hash may not be the best option when it comes to the validation you’re wanting to do. In this case, I would recommend you use a custom header to validate the payload instead! :)

This may help: https://developer.bigcommerce.com/api-docs/store-management/webhooks/overview