connected_product.added
event)POST /v1/connected_products/:id/status
with the status “connected” or “failed”.connected_product.variant.updated
event every time the product is updatedFirst we need to setup a webhook to be notified anytime a new product is to be connected. Start by setting up a webhook for the connected_product.added
event (more info here) like so:
{
"description": "New connected product",
"enabledEvents": ["connected_product.added"],
"url": "<https://your-domain.com/webhook-dummy-route>"
}
When that is setup you’re ready to receive these events, and handle them. This can be by creating the product in your own system, or by simply just registering it with an already existing product.
Afterwards you have to notify Stedger how it went by sending a “connected” status back, if it was a success:
{
"status": "connected"
}
If an error happened, because the product is missing something, or for some other reason you can let Stedger know there was an error - a good idea here is to include an error message, that the user can use to fix the problem:
{
"status": "failed",
"errorMessage": "SKU already exists"
}
Now that a product has been connected you can query all the connected products by requesting /v1/connected_products
. Your app will also receive webhook events every time the product has changed if you’ve subscribed to the connected_product.variant.updated
topic.