Shipping service integration not showing up in checkout

ziftytoddziftytodd Member Posts: 7
edited April 30 in Development

I've successfully created an external shipping service following the docs online (https://developers.lightspeedhq.com/ecom/tutorials/create-a-shipping-integration/) and for testing whenever my API is called with the /shipment_methods it will send back a single shipping method (see below for the actual JSON returned). I can see the request and response, but on the actual Lightspeed store it just shows the customer "No shipping methods found for this country". Why is it failing?

{
 "shipment_methods": [
  {
   "price_incl": 8,
   "price_excl": 8.72,
   "is_servicepoint": false,
   "is_cash_on_delivery": false,
   "description": "Delivered within the next 90 minutes",
   "id": 1234,
   "title": "1 hour delivery",
   "is_pickup": false,
   "tax_rate": 0.09
  }
 ]
}
Post edited by Geanny on

3 comments

  • ziftytoddziftytodd Member Posts: 7

    I've also tried posting back the exact same responses as shown in the documentation examples of response for the shipment_methods request and it still does not show up. Perhaps I've missed something in my store's configuration?

  • LeahLeah Moderator, Lightspeed Staff Posts: 219 moderator

    Hi @ziftytodd ,

    Your store is currently only configured with one shipping method (actually a "pickup" method) for the US exclusively, so if you try to check out with an address that isn't in the US, you'll see the message "No shipping methods found for this country." When I went to your shop and tried to check out with a US address, I was able to see this pickup method - however I did not see your external service shipping method. Are you sure you're returning a 201 created response containing that JSON after the checkout calls your /shipment_methods endpoint? Are you able to share the payload being sent by the checkout to that endpoint - just for reference? I also noticed that the price_excl and price_incl in your JSON are reversed - the price_incl should always be greater than or equal to price_excl.

    API Support
    Lightspeed HQ
  • ziftytoddziftytodd Member Posts: 7

    Hi @Leah

    Thank you for the reply. I am sending back a 201 status code in response to the /shipment_methods call. We are only using US addresses, and I see the same thing as you did when using a US address (just the pick-up option, but nothing from my external service). The JSON currently being returned from my endpoint is:

    {
      "shipment_methods": [
        {
          "price_incl": 0,
          "price_excl": 0,
          "is_servicepoint": false,
          "is_cash_on_delivery": false,
          "description": "Delivered within the next 90 minutes",
          "id": 1234,
          "title": "1 hour delivery",
          "is_pickup": false,
          "tax_rate": 0
        }
      ]
    }
    

    I've tried lots and lots of variations, with no success, including with the un-reversed pricing from my original post (so 8.72 for inclusive and 8 for exclusive). Per the docs online, it would seem this response should work, but it doesn't display. I see the request hit my server from Lightspeed and the output returned successfully. I've dumbed down my server to just returning the same JSON response regardless of what address is provided. Any ideas? Thank you!

Sign In or Register to comment.