Unable to update Shipping Method

Hello Lightspeed team,
I'm reaching out because I am having trouble getting the Shipping Methods to update on our POST.
I've pulled all of the shipping method IDs from https://developers.lightspeedhq.com/ecom/endpoints/shippingmethod/#get-all-shipping-methods and tried to update the order, but the shipping method is not updating.
I have a postman collection of my request, but don't feel comfortable posting it on this forum as it contains credentials for our user.
Is there anything I can provide to help troubleshoot this? Or I can send the postman collection separately?
Post edited by GenevieveFL on
11 comments
Is anyone able to help me out?
Hi @DylanS,
Thank you for contacting us.
Can you show me the response when you're doing a GET https://developers.lightspeedhq.com/ecom/endpoints/checkout/#get-shipment-methods
Hi Lucien,
Thank you for your response.
This is what we are getting in the response: http://api.shoplightspeed.com/us/shippingmethods.json
Response for Get Shipping Methods:
{
2 "shippingmethods": [
3 {
4 "id": 53637,
5 "type": "default",
6 "isBackofficeOnly": false,
7 "sortOrder": 4,
8 "freeAbove": 1000000,
9 "paymentPriceExcl": 0,
10 "paymentPriceIncl": 0,
11 "title": "Expedited Shipping *Excludes Bicycles",
12 "description": "Estimated arrival in 2-4 business days depending on carrier",
13 "tax": false,
14 "countries": {
15 "resource": {
16 "id": false,
17 "url": "shippingmethods/53637/countries",
18 "link": "https://api.shoplightspeed.com/us/shippingmethods/53637/countries.json"
19 }
20 },
21 "values": {
22 "resource": {
23 "id": false,
24 "url": "shippingmethods/53637/values",
25 "link": "https://api.shoplightspeed.com/us/shippingmethods/53637/values.json"
26 }
27 }
28 },
29 {
30 "id": 40866,
31 "type": "pickup",
32 "isBackofficeOnly": false,
33 "sortOrder": 3,
34 "freeAbove": 1000000,
35 "paymentPriceExcl": 0,
36 "paymentPriceIncl": 0,
37 "title": "Curbside Pickup ",
38 "description": "Curbside Pickup",
39 "tax": false,
40 "countries": {
41 "resource": {
42 "id": false,
43 "url": "shippingmethods/40866/countries",
44 "link": "https://api.shoplightspeed.com/us/shippingmethods/40866/countries.json"
45 }
46 },
47 "values": {
48 "resource": {
49 "id": false,
50 "url": "shippingmethods/40866/values",
51 "link": "https://api.shoplightspeed.com/us/shippingmethods/40866/values.json"
52 }
53 }
54 },
55 {
56 "id": 25544,
57 "type": "default",
58 "isBackofficeOnly": false,
59 "sortOrder": 2,
60 "freeAbove": 100000,
61 "paymentPriceExcl": 0,
62 "paymentPriceIncl": 0,
63 "title": "Flat Rate",
64 "description": "",
65 "tax": false,
66 "countries": {
67 "resource": {
68 "id": false,
69 "url": "shippingmethods/25544/countries",
70 "link": "https://api.shoplightspeed.com/us/shippingmethods/25544/countries.json"
71 }
72 },
73 "values": {
74 "resource": {
75 "id": false,
76 "url": "shippingmethods/25544/values",
77 "link": "https://api.shoplightspeed.com/us/shippingmethods/25544/values.json"
78 }
79 }
80 },
81 {
82 "id": 24970,
83 "type": "pickup",
84 "isBackofficeOnly": false,
85 "sortOrder": 1,
86 "freeAbove": 0,
87 "paymentPriceExcl": 0,
88 "paymentPriceIncl": 0,
89 "title": "In Store Pick Up",
90 "description": "In Store Pick Up",
91 "tax": false,
92 "countries": {
93 "resource": {
94 "id": false,
95 "url": "shippingmethods/24970/countries",
96 "link": "https://api.shoplightspeed.com/us/shippingmethods/24970/countries.json"
97 }
98 },
99 "values": {
100 "resource": {
101 "id": false,
102 "url": "shippingmethods/24970/values",
103 "link": "https://api.shoplightspeed.com/us/shippingmethods/24970/values.json"
104 }
105 }
106 }
107 ]
108}
___
Here is the response of checkout id: 15613303
1{
2 "id": 15613303,
3 "created_at": "2021-07-15T12:19:27+00:00",
4 "updated_at": "2021-07-15T12:20:12+00:00",
5 "order_id": null,
6 "theme": null,
7 "step": "shipment",
8 "mode": "guest",
9 "info": {
10 "remote_ip": "35.221.29.100",
11 "user_agent": "WebshopappApi",
12 "referral_id": null
13 },
14 "customer": {
15 "gender": null,
16 "birthdate": null,
17 "phone": "+1 555-5555555",
18 "mobile": "0612345678",
19 "national_id": null,
20 "email": "[email protected]",
21 "password": null,
22 "firstname": "Test Customer-m",
23 "middlename": null,
24 "lastname": "Test",
25 "type": null,
26 "company": null,
27 "vatnumber": null,
28 "cocnumber": null,
29 "sameaddress": false
30 },
31 "billing_address": {
32 "name": "Test - billing",
33 "company": null,
34 "address1": "123 Test",
35 "address2": null,
36 "number": 1234,
37 "extension": null,
38 "zipcode": 123456,
39 "city": "Montreal",
40 "region": null,
41 "region_id": null,
42 "country": "us"
43 },
44 "shipping_address": {
45 "name": "Test Shipping",
46 "company": "LightspeedHQ",
47 "address1": "12334 Viger",
48 "address2": null,
49 "number": null,
50 "extension": null,
51 "zipcode": 1234,
52 "city": "Montreal",
53 "region": null,
54 "region_id": null,
55 "country": "us"
56 },
57 "quote": {
58 "id": 72758687,
59 "price_incl": 10,
60 "price_excl": 10,
61 "additional_cost": false,
62 "totals": {
63 "sub_total": 10,
64 "taxes": false,
65 "grand_total": 10,
66 "giftcard_total": {
67 "incl": 0,
68 "excl": 0
69 },
70 "combined_taxes": false
71 },
72 "tax_override": false,
73 "vat_shifted": false,
74 "local_taxes_may_apply": false,
75 "weight": 907,
76 "volume": 0,
77 "colli": 0,
78 "products": [
79 {
80 "id": 114924568,
81 "cart_id": 72758687,
82 "created_at": "2021-07-15T12:20:11+00:00",
83 "updated_at": "2021-07-22T10:51:16+00:00",
84 "product_id": 23345608,
85 "variant_id": 38898340,
86 "is_custom": false,
87 "custom_checksum": 0,
88 "custom_data": [],
89 "quantity": 1,
90 "has_discount": false,
91 "discount_percentage": 0,
92 "tax_rate": 0,
93 "base_weight": 907,
94 "base_volume": 0,
95 "base_colli": 0,
96 "base_price_excl": 10,
97 "base_price_incl": 10,
98 "base_price_cost": 5,
99 "special_price_excl": null,
100 "special_price_incl": null,
101 "special_discount_value": null,
102 "special_discount_type": null,
103 "custom_excl": 0,
104 "custom_incl": 0,
105 "unit_price": null,
106 "unit_unit": null,
107 "weight": 907,
108 "volume": 0,
109 "colli": 0,
110 "price_tax": 0,
111 "price_excl": 10,
112 "price_incl": 10,
113 "price_cost": 5,
114 "discount_excl": 0,
115 "discount_incl": 0,
116 "additional_cost_base_incl": null,
117 "additional_cost_base_excl": null,
118 "additional_cost_price_incl": null,
119 "additional_cost_price_excl": null,
120 "title": "Hestra Leather Balm",
121 "fulltitle": "Hestra Hestra Leather Balm",
122 "variant": "Size : OS",
123 "brand_name": "Hestra",
124 "description": "The all-natural Hestra Leather Balm is formulated to protect your sport gloves and is a great way to prevent leather from drying out. Prolongs the life, suppleness and water repellant properties of the leather.",
125 "article_code": null,
126 "ean": 7332540723600,
127 "sku": 91700,
128 "size_x": 0,
129 "size_y": 0,
130 "size_z": 0,
131 "image_id": 16356438,
132 "image_thumb": "https://cdn.shoplightspeed.com/shops/622531/files/16356438/50x50x2/hestra-hestra-leather-balm.jpg",
133 "image_src": "https://cdn.shoplightspeed.com/shops/622531/files/16356438/hestra-hestra-leather-balm.jpg",
134 "url": "hestra-leather-balm-my20.html",
135 "stock_available": true,
136 "stock_on_stock": true,
137 "stock_track": true,
138 "stock_level": 5,
139 "stock_minimum": 1,
140 "stock_maximum": 5,
141 "quantity_discount_messages": false
142 }
143 ],
144 "created_at": "2021-07-15T12:19:27+00:00",
145 "updated_at": "2021-07-22T10:51:16+00:00"
146 },
147 "gift_cards": {
148 "is_active": false,
149 "cards": []
150 },
151 "shipment_method": null,
152 "payment_method": null,
153 "discount": false,
154 "comment": "Testing Order",
155 "newsletter": null,
156 "terms": null,
157 "notifications": true,
158 "memo": null,
159 "products": [
160 {
161 "id": 114924568,
162 "cart_id": 72758687,
163 "created_at": "2021-07-15T12:20:11+00:00",
164 "updated_at": "2021-07-22T10:51:16+00:00",
165 "product_id": 23345608,
166 "variant_id": 38898340,
167 "is_custom": false,
168 "custom_checksum": 0,
169 "custom_data": [],
170 "quantity": 1,
171 "has_discount": false,
172 "discount_percentage": 0,
173 "tax_rate": 0,
174 "base_weight": 907,
175 "base_volume": 0,
176 "base_colli": 0,
177 "base_price_excl": 10,
178 "base_price_incl": 10,
179 "base_price_cost": 5,
180 "special_price_excl": null,
181 "special_price_incl": null,
182 "special_discount_value": null,
183 "special_discount_type": null,
184 "custom_excl": 0,
185 "custom_incl": 0,
186 "unit_price": null,
187 "unit_unit": null,
188 "weight": 907,
189 "volume": 0,
190 "colli": 0,
191 "price_tax": 0,
192 "price_excl": 10,
193 "price_incl": 10,
194 "price_cost": 5,
195 "discount_excl": 0,
196 "discount_incl": 0,
197 "additional_cost_base_incl": null,
198 "additional_cost_base_excl": null,
199 "additional_cost_price_incl": null,
200 "additional_cost_price_excl": null,
201 "title": "Hestra Leather Balm",
202 "fulltitle": "Hestra Hestra Leather Balm",
203 "variant": "Size : OS",
204 "brand_name": "Hestra",
205 "description": "The all-natural Hestra Leather Balm is formulated to protect your sport gloves and is a great way to prevent leather from drying out. Prolongs the life, suppleness and water repellant properties of the leather.",
206 "article_code": null,
207 "ean": 7332540723600,
208 "sku": 91700,
209 "size_x": 0,
210 "size_y": 0,
211 "size_z": 0,
212 "image_id": 16356438,
213 "image_thumb": "https://cdn.shoplightspeed.com/shops/622531/files/16356438/50x50x2/hestra-hestra-leather-balm.jpg",
214 "image_src": "https://cdn.shoplightspeed.com/shops/622531/files/16356438/hestra-hestra-leather-balm.jpg",
215 "url": "hestra-leather-balm-my20.html",
216 "stock_available": true,
217 "stock_on_stock": true,
218 "stock_track": true,
219 "stock_level": 5,
220 "stock_minimum": 1,
221 "stock_maximum": 5
222 }
223 ],
224 "discount_code": null
225}
____
Please check my endpoint and yours. There is a difference between them.
Your endpoint is fetching all shipping methods that are created in the back office. My endpoint is checking all available shipping methods that you can use in the checkout.
All calls to create a proper checkout are here https://developers.lightspeedhq.com/ecom/endpoints/checkout/
I hope this helps.
Thank you Lucien,
We will give this a try.
Hi Lucien,
We tried two different methods here but they aren't returning any results.
The document you referenced has this:
But when this is called we receive this response:
When we change "en" to "US" we get a different response, but still nothing we can use.
Is there a generic "give all valid methods for checkout" option available? Or do we need to delineate them by country?
Hi again Lucien,
I spoke with our client and they said that they only ship to the lower 48, would that be a different code? (non "US") to use to call for those specific checkout methods?
Hi Lucien,
Just wanted to reach back out again. Is there a direct support line for developers? I would feel more comfortable passing postman collections in a non-forum environment.
I'm struggling to understand how our user doesn't have any methods set up for the US, and we can't associate the methods we are receiving to the checkout.
Any assistance would be appreciated.
Best,
Dylan
Hi @DylanS,
The error inactive language means that the language you're using isn't active in the back office of the merchant. But I've seen you've managed to get that solved by using US instead of EN.
The error "no shipping method for this country" mean that there is no shipment method set for this country in the back office. The merchant need to set this up in the back office, more info here https://ecom-support.lightspeedhq.com/hc/en-us/articles/360012313234-Getting-started-with-shipping
I spoke with our client and they said that they only ship to the lower 48, would that be a different code? (non "US") to use to call for those specific checkout methods? What is the lower 48? This has nothing to do with the language code in the API, but the shipping address in your payload.
Our community is meant for developers who got questions about the API.
Hi Lucien,
I can see shipping methods configured in the user's back office for the country we're searching for.
But even with this information we're not able to get these methods in the response.
It can't be that the methods are not populating because they're hidden, correct?
Are we not calling the correct place to get these methods? It seems like we are.
I removed the customer credentials from this call, but this should be what we're using, correct?
@api.shoplightspeed.com/US/checkouts/15613303/shipment_methods.json
Thank you.
Hi @DylanS,
I checked your checkoutID and was able to find the issue. You didn't mention any region in your checkout, this is mandatory for creating order from US.
I've added a region and I was able to fetch the shipping methods