[Updated Deadline] Breaking changes to Product/Variant, Fulfillment, and Refund APIs

Shopify Partner
6 0 2

Hi Jordan,

the order of fulfilment is this

{
            "id": 552308015217,
            "email": "phurtado@icloud.com",
            "closed_at": null,
            "created_at": "2018-07-23T15:34:48-04:00",
            "updated_at": "2018-07-23T15:34:48-04:00",
            "number": 5,
            "note": null,
            "token": "a49e02712b7ba30bf7f6d46db5be5b70",
            "gateway": "Bank Deposit",
            "test": false,
            "total_price": "101.20",
            "subtotal_price": "70.00",
            "total_weight": 17500,
            "total_tax": "11.20",
            "taxes_included": false,
            "currency": "MXN",
            "financial_status": "pending",
            "confirmed": true,
            "total_discounts": "0.00",
            "total_line_items_price": "70.00",
            "cart_token": "b3bbc3d1afcbf061c2accd2d33e092ad",
            "buyer_accepts_marketing": false,
            "name": "#1005",
            "referring_site": "https://partners.shopify.com/",
            "landing_site": "/admin",
            "cancelled_at": null,
            "cancel_reason": null,
            "total_price_usd": "5.32",
            "checkout_token": "d40677002c9487778a4bca10a4154252",
            "reference": null,
            "user_id": null,
            "location_id": null,
            "source_identifier": null,
            "source_url": null,
            "processed_at": "2018-07-23T15:34:48-04:00",
            "device_id": null,
            "phone": null,
            "customer_locale": "en",
            "app_id": 580111,
            "browser_ip": null,
            "landing_site_ref": null,
            "order_number": 1005,
            "discount_applications": [],
            "discount_codes": [],
            "note_attributes": [],
            "payment_gateway_names": [
                "Bank Deposit"
            ],
            "processing_method": "manual",
            "checkout_id": 4990028120177,
            "source_name": "web",
            "fulfillment_status": null,
            "tax_lines": [
                {
                    "price": "11.20",
                    "rate": 0.16,
                    "title": "VAT"
                }
            ],
            "tags": "",
            "contact_email": "phurtado@icloud.com",
            "order_status_url": "https://enviosya.myshopify.com/1488420977/orders/a49e02712b7ba30bf7f6d46db5be5b70/authenticate?key=6...,
            "admin_graphql_api_id": "gid://shopify/Order/552308015217",
            "line_items": [
                {
                    "id": 1356647596145,
                    "variant_id": 12403731202161,
                    "title": "Producto1",
                    "quantity": 7,
                    "price": "10.00",
                    "sku": "",
                    "variant_title": "",
                    "vendor": "enviosya",
                    "fulfillment_service": "manual",
                    "product_id": 1370356318321,
                    "requires_shipping": true,
                    "taxable": true,
                    "gift_card": false,
                    "name": "Producto1",
                    "variant_inventory_management": "shopify",
                    "properties": [],
                    "product_exists": true,
                    "fulfillable_quantity": 7,
                    "grams": 2500,
                    "total_discount": "0.00",
                    "fulfillment_status": null,
                    "discount_allocations": [],
                    "admin_graphql_api_id": "gid://shopify/LineItem/1356647596145",
                    "tax_lines": [
                        {
                            "title": "VAT",
                            "price": "11.20",
                            "rate": 0.16
                        }
                    ],
                    "origin_location": {
                        "id": 516876140657,
                        "country_code": "MX",
                        "province_code": "DF",
                        "name": "enviosya",
                        "address1": "Arequipa #691",
                        "address2": "Colonia Lindavista",
                        "city": "Ciudad de Mexico",
                        "zip": "07300"
                    }
                }
            ],
            "shipping_lines": [
                {
                    "id": 461303054449,
                    "title": "Heavy Goods Shipping",
                    "price": "20.00",
                    "code": "Heavy Goods Shipping",
                    "source": "shopify",
                    "phone": null,
                    "requested_fulfillment_service_id": null,
                    "delivery_category": null,
                    "carrier_identifier": null,
                    "discounted_price": "20.00",
                    "discount_allocations": [],
                    "tax_lines": []
                }
            ],
            "billing_address": {
                "first_name": "Pedro",
                "address1": "Arequipa 691",
                "phone": null,
                "city": "Ciudad De Mexico",
                "zip": "07300",
                "province": "Ciudad de México",
                "country": "Mexico",
                "last_name": "Hurtado",
                "address2": "Lindavista",
                "company": null,
                "latitude": 19.4864748,
                "longitude": -99.1259733,
                "name": "Pedro Hurtado",
                "country_code": "MX",
                "province_code": "DF"
            },
            "shipping_address": {
                "first_name": "Pedro",
                "address1": "Arequipa 691",
                "phone": null,
                "city": "Ciudad De Mexico",
                "zip": "07300",
                "province": "Ciudad de México",
                "country": "Mexico",
                "last_name": "Hurtado",
                "address2": "Lindavista",
                "company": null,
                "latitude": 19.4864748,
                "longitude": -99.1259733,
                "name": "Pedro Hurtado",
                "country_code": "MX",
                "province_code": "DF"
            },
            "fulfillments": [],
            "client_details": {
                "browser_ip": "187.189.240.171",
                "accept_language": "es-419,es;q=0.9",
                "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
                "session_hash": null,
                "browser_width": 1920,
                "browser_height": 1006
            },
            "refunds": [],
            "customer": {
                "id": 653383368817,
                "email": "phurtado@icloud.com",
                "accepts_marketing": false,
                "created_at": "2018-07-20T13:21:03-04:00",
                "updated_at": "2018-07-23T15:34:48-04:00",
                "first_name": "Pedro",
                "last_name": "Hurtado",
                "orders_count": 5,
                "state": "disabled",
                "total_spent": "0.00",
                "last_order_id": 552308015217,
                "note": null,
                "verified_email": true,
                "multipass_identifier": null,
                "tax_exempt": false,
                "phone": null,
                "tags": "",
                "last_order_name": "#1005",
                "admin_graphql_api_id": "gid://shopify/Customer/653383368817",
                "default_address": {
                    "id": 742473957489,
                    "customer_id": 653383368817,
                    "first_name": "Pedro",
                    "last_name": "Hurtado",
                    "company": null,
                    "address1": "Arequipa 691",
                    "address2": "Lindavista",
                    "city": "Ciudad De Mexico",
                    "province": "Ciudad de México",
                    "country": "Mexico",
                    "zip": "07300",
                    "phone": null,
                    "name": "Pedro Hurtado",
                    "province_code": "DF",
                    "country_code": "MX",
                    "country_name": "Mexico",
                    "default": true
                }
            }
        },

0 Likes
Shopify Partner
5 0 2

Can inventory of all variants of a product be updated at a time as we could update them via ~/admin/products/#.json, or we need to update them one by one through ~/admin/inventory_levels/adjust.json?

0 Likes
Shopify Staff
Shopify Staff
277 1 52

Peter, the orgin_location.id is not the same as the fulfillment.location_idTo determine the available locations on a shop and their relevant IDs, use the Locations API.  

0 Likes
Shopify Staff
Shopify Staff
277 1 52

How is updating stock done for non-multi-location shops?

@N-EWH on non-multi-location shops you can only use the SET endpoint for updating inventory at the single location that the item is currently stocked. You're trying to SET the inventory at a different location than where it is currently stocked, but you can't use SET to move it from one location to another - that would be a multi-location feature, hence the error message. 

0 Likes
Shopify Partner
36 0 26

 

1. When InventoryLevel quantity is changed,  the total inventory_quantity field in ProductVariant is also updated. My question : since the inventory_quantity has changed, will it trigger a "products/update" webhook?

2. Also, since inventory_quantity field was changed as a result of the underlying InventoryLevel quantity change, will the "updated_at" field on the  ProductVariant api  show the timestamp of the change since technically the inventory_quantity was updated even if indirectly.

 

0 Likes
Shopify Partner
36 0 26

@Ryan @Jordan

Can you provide an answer to my 2 questions above posted 4 days ago?

It will help us code based on Shopify's official policy and not just how the logic works as of the moment.

Thx!

0 Likes
Shopify Partner
9 0 3

I would test this, I think that would be the quickest. Install the producs/update webhook and perform a change on an InventoryItem. Same for the updated_at value.

I would expect that an InventoryItem change will not trigger any product webhooks since it is now separated. Same for the updated_at column. The product variant itself is not updated. But as I suggested, I would perform a small test on this.

Developer at CODE Internet Applications | Delft | The Netherlands
0 Likes
Shopify Partner
4 0 0

Can you confirm that we will NOT have to update app scope to include read_locations for existing installations? Meaning triggering a re-authorization on our end that allows our users to re-authorize the new scope.

In our initial testing it looked like this was required. However, as of yesterday afternoon, it looks like we can access the location data for stores that have not approved that scope.

0 Likes
New Member
6 0 0

Hello. is the feature released already?

if the answer yes, how can I enable it, please? Thanks. I also sent a couple of emails but received no response. 

0 Likes
New Member
10 0 0

@Matt

Don't know if you've received a reponse yet (or probably found out for yourself already), but based on my own experience at least, it looks like Shopify did kindly update scopes for exsiting installations somepoint in July, but new app installations after that point did not (the app is required to request the relevant scopes, as it should).

This info might be too late to be of use to you, but I figured i may as well post my experience in here if any others had a similar question.

Cheers,

Aleks.

 

0 Likes