05-12-2022 03:34 AM
I am trying to implement webhook payloads. I want to know more details of fields for following data.
Sample data for webhook payloads is given in the following URL:
On Orders Shipped (SHIP_NOTIFY):
{"resource_url":"https://ssapiX.shipstation.com/shipments?storeID=123456&batchId=12345678","resource_type":"SHIP_NOTIFY"}
1. What is use of resource_url?
2. What is batchId which pass in query string?
3. Where I can get that batchId?
4. Is storeId is optional?
05-12-2022 11:21 AM
Once a webhook is executed, it'll post that JSON data to whatever endpoint URL you specify. So say, your endpoint is mydomain.com/api/order-shipped-notify... When an order is shipped (for SHIP_NOTIFY), ShipStation will POST {"resource_url":"https://ssapiX.shipstation.com/shipments?storeID=123456&batchId=12345678","resource_type":"SHIP_NOTIFY"} to mydomain.com/api/order-shipped-notify.
On your end, once the request comes in, you decode the JSON and do a GET request on the resource_url given (which is unique to that webhook notification). You'll have to include the Authentication header as with other API calls. Once you made that call to the resource_url, you'll receive in return the details of the order shipped that triggered the webhook.