Trouble Getting Shipping Webhooks Working

Anybody have xp with the shipping webhook?

Finally got a lambda handing business logic to return

{
  "statusCode": 200,
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "rates": [
      {
        "cost": "3.99",
        "description": "Flat Rate (Estimated delivery: Oct  4⁠– 6) "
      }
    ]
  }
}

when the shipping webhook is called but continually get

code: "snipcart.errors.shipping.no_rates_found"
message: "No shipping method available for your order."
reason: "no-rates-found"

as a response on snipcarts side. Have been bashing my head against this all day.

Nevermind, I’m an idiot. Was returning the full object of content-type, header, and body from my lambda when I just needed to return the JSON for rates. If anyone else is integrating via aws api gateway and lambda just return the JSON from your lambda function.

checked webhook responses and saw

"{\"statusCode\":200,\"headers\":{\"Content-Type\":\"application/json\"},\"body\":{\"Content\":{\"rates\":[{\"cost\":\"3.99\",\"description\":\"Flat Rate (Estimated delivery: Oct  4⁠– 6) \"}]}}}"

as response content. DERP.