Shipping Webhook Erroring

We have just migrated to 3.2.1 and are having issues with the shipping web-hook

We use this to return errors, and when we return a 200 with an error (as have done previously), the snip cart javascript throws an error

See attached

Webhook Status 200
Webook Response (From the Snipcart Dashboard)

"{\"errors\":[{\"key\":\"voucher_and_promo_codes\",\"message\":\"Cannot combine voucher codes with other promo codes\"}]}"

This is the network call response from snip cart client

We have been using this with no issues previously - upgrading to 3.2.1 has caused this to fail client side.

What do we need to do to resolve

{“code”:“voucher_and_promo_codes”,“message”:“Cannot combine voucher codes with other promo codes”,“reason”:“rates-calculation”,“technicalReason”:“An error occured while fetching rates from a carrier. Review configuration in <a href=“http://app.snipcart.com/dashboard/carriers”>Store Configuration > Shipping. See developer console for more details.”,“data”:[{“key”:“voucher_and_promo_codes”,“message”:“Cannot combine voucher codes with other promo codes”,“public”:true}]}

Hi

Any news on this please

Thanks

Hi

Has this been picked up yet - we need this feature for our cart and it’s completely broken the cart

Hi there,

Sorry for the wait, we are investigating this issue. In the meantime, is it possible for you to downgrade to a version where this is working as intended for you?

Thanks

Hi @dominic ,

I stumbled upon this as I’m also having issues with this exact issue. I’m developing a new site for one of my customers and have just started using Snipcart.
I definitely need to be able to communicate errors to an end-user in case shipping costs for some reason can not be calculated (e.g. product is sold out or something).

I’m hoping there’s by now another solution as to downgrade Snipcart?

Hello @Peter,

While we wait for dominic to reply:
Are you using webhooks to calculate shipping costs?

If you are using the shipping webhooks, the documentation here explains how you can return an “errors” array to show an error message to your customers:

If you want Snipcart to show an error message to your customers, you can do so by returning us a 2XX status code with the following JSON object.

Example BODY in 2XX response

{
  "errors": [{
    "key": "invalid_postal_code",
    "message": "The postal code is invalid."
    },
    ...
  ]
}
1 Like

Hi @TorchlightPress, thanks for commenting on this issue!

I’m using a webhook to calculate shipments indeed. So far no issues.

The problem occurs when sending an error back to the client. I’ve followed the documentation, including sending the HTTP 200 status code and the error structure you mentioned above.

As one can see in browser dev tools, the error message gets catched, but is then shown as an error in the console, rather then being displayed to an end user.

@Peter mmm, I’m able to reproduce this as well by forcing my webhooks to return an error. It looks like the issue is still unresolved in the latest release by Snipcart :pensive:

Edit: note, this was on version 3.2.0

Thanks for confirming, @TorchlightPress.
Let’s hope Snipcart will respond soon.

Sorry, @Peter correction!

I was testing on v3.2.0, but it looks like they’ve released v3.3.0. I didn’t realize we had a new version out.

In 3.3.0, we still get the error in the console, but it does also render the error in a red block in the shipping checkout UI :tada:

You may need to find where you’re including the snipcart.js script and update the version manually, e.g. https://cdn.snipcart.com/themes/v3.3.0/default/snipcart.js – the manual step is what got me. I’m spoiled by using npm to manage my versions :sweat_smile:

1 Like

Ah! @TorchlightPress Thanks for checking versions. This might indeed be it, as I’m also using 3.2.2 — not 3.3.0
I’ll check asap!

And yup. It is fixed indeed :sparkles:

Thanks again @TorchlightPress :smiley:

1 Like