Webhooks for 3PL

Hey Guys!
So I have setup my first webhook to be used with SH and tested it internally with good success. I was about to register it but going through the docs, I came across:

If you are using a 3PL account, webhooks need to be registered on the Customer account and not the 3PL account to trigger correctly.

Really? We are a 3PL, and lets say I wanted to set up all 12 kinds of webhooks SH supports, and have 70+ clients - will I seriously have to create and maintain 840+ webhooks?! Surely that canā€™t be trueā€¦ right?? I mean isnā€™t it super simpler to just ā€œwebhook_typeā€ and ā€œclient_idā€ (or name) in the data sent to us with a single webhook?
Or at the very least have a single registered webhook per update type, and it contains the client id/name of whichever client the update belongs to?

Thank you!

Hey @Raj,

Thanks for reaching out! Going to look into this and get back to you.
Let me know if thereā€™s anyway I can assist in the meantime.

Best,
RayanP

1 Like

Hey @sh-agent, Donā€™t mean to pressure you - just wondering if you got a chance to look into it and found something?

Hey @Raj,

Thanks for hanging in there and sorry for the delay.

It turns out that the only webhook that works strictly in the child account is the Return Update webhook. All of the rest can be registered through your 3PL account and should work just fine.

Iā€™ll go ahead and update that section of our webhooks documentation.

Let me know if thereā€™s anything I can do to assist!

Best,
RayanP

1 Like

Hey @sh-agent, Thank you for the update, thatā€™s really helpful to know!
But bummer, seriously - ā€˜Return Updateā€™ is the first webhook my boss asked me to create - not kidding!!

Soā€¦ whatā€™s so special about the Return Update webhook - is it possible to remove this exception maybe? Itā€™ll be a big help - Thank you again!

Hey @Raj,

Thanks for hanging in there!

Unfortunately, I donā€™t think there is a workaround for this. Iā€™m not 100% sure on the logic of it but the Returns Webhook just doesnā€™t work in the 3PL.

Let me know if thereā€™s anything I can do to assist.

Best,
RayanP

1 Like

Hey @sh-agent, Sorry about the delayed reply - could you pls walk me through how would I go about setting those Returns webhooks?
I started by creating a Developer account under the Client account, but get this error when I use my existing accountā€™s email:
image

I surely canā€™t be using a different email per client account.

Hey @Raj,

You should be able to register the return webhooks without having to create dev users in each child account. A mutation like this should work:

mutation {
  webhook_create(data: { name: "Return Update", url: "string", customer_account_id:"string" }) {
    request_id
    complexity
    webhook {
      id
      legacy_id
      account_id
      shop_name
      name
      url
      source
      shared_signature_secret
    }
  }
}

Let me know if this works for you!

Best,
RayanP

1 Like

Thank you @sh-agent , but I keep getting {"message": "Token is expired"} error each time I try.
Earlier I was trying it without the customer_account_id value, and after reading your reply here (saying Returns webhook is per client) so thought maybe that was the problem - but even after putting it there, Iā€™m getting the same result.
I even just used my refresh token to retrieve another bearer token and got the same error using that.

These are my headers:

And hereā€™s the body:

Do you see something glaringly wrong that I may be missing?

Hey @Raj,

Thatā€™s a bit peculiar, thanks for the extra details.
Looking into this now, Iā€™ll update you as soon as I can.

Best,
RayanP

1 Like

Hey @sh-agent ā€¦ any updates?
Thank you!

Hey @Raj,

Sorry for the delay.
Would you mind sending me your token privately? Iā€™d like to impersonate your account. If Iā€™m able to reproduce the issue, this might have to be escalated to our Engineering Team.

Let me know if thereā€™s anything I can do to assist.

Best,
RayanP

1 Like

Yes sure, sending right now

Sent - Let me know if you meant to get the refresh token

1 Like

Hey @sh-agent, I figured it out, and while Iā€™d like to blame Postman, I canā€™t help admitting itā€™s my fault for not figuring it out sooner - but your affirmation that the webhook registration worked using my token confirmed something was wrong on my end.
And here it is - hovering mouse on the auth header field showed me this tooltip:
image
(facepalm)
I disabled it, put the same token in the Authorization tab and it worked - Iā€™m really sorry I wasted more of your time here than was warranted.
Thank you (once again) for all the help!

Hey @Raj,

No worries at all!
This was helpful for me too, in the future I can suggest checking that out if someone runs into a similar issue.

Glad everything is working now, let me know if thereā€™s anything I can do to assist at all.

Best,
RayanP

1 Like

@sh-agent I can only find the following in the documentation:

If you are using a 3PL account, webhooks need to be registered on the Customer account and not the 3PL account to trigger correctly.

Can I register all the webhooks from my 3PL account as mentioned in this community comment?

Hey @hansdaigle,

Thanks for reaching out!

Yep, you can register all webhooks to the 3PL except the Return Update. This one has to be done through the Customer Account.

Let me know if you have any questions or concerns.

Best,
RayanP

1 Like