How to identify refunded items vs removed item with in a Shopify order?

Highlighted
Excursionist
18 1 5
Hi all,
We created order id: on shopify 
We ordered multiple items with in it. 
We cancelled an item BETHANY HAMILTON STOKED HOTTIE and We removed one item !!!!!!!!!!66
 
We are not able to identify from Json response that which item is removed and which is refunded. 
 
Annotation 2020-02-21 123857.jpg
{"order":{"id":2115492511806,"email":"","closed_at":null,"created_at":"2020-02-19T18:07:43+05:30","updated_at":"2020-02-19T18:55:05+05:30","number":6591,"note":"","token":"0a131ae62a8c83198c043cf0768f20bc","gateway":"Bank Deposit","test":false,"total_price":"192.75","subtotal_price":"192.75","total_weight":40,"total_tax":"0.00","taxes_included":false,"currency":"INR","financial_status":"paid","confirmed":true,"total_discounts":"0.00","total_line_items_price":"192.75","cart_token":null,"buyer_accepts_marketing":false,"name":"#7591","referring_site":null,"landing_site":null,"cancelled_at":"2020-02-19T18:55:05+05:30","cancel_reason":"other","total_price_usd":"2.69","checkout_token":null,"reference":null,"user_id":3115855,"location_id":35178002,"source_identifier":null,"source_url":null,"processed_at":"2020-02-19T18:07:43+05:30","device_id":null,"phone":null,"customer_locale":null,"app_id":1354745,"browser_ip":null,"landing_site_ref":null,"order_number":7591,"discount_applications":[],"discount_codes":[],"note_attributes":[],"payment_gateway_names":["Bank Deposit"],"processing_method":"manual","checkout_id":null,"source_name":"shopify_draft_order","fulfillment_status":null,"tax_lines":[],"tags":"","contact_email":null,"order_status_url":"https:\/\/mewebg.myshopify.com\/2418101\/orders\/0a131ae62a8c83198c043cf0768f20bc\/authenticate?key=cda41f39506dfb1772188091997193f6","presentment_currency":"INR","total_line_items_price_set":{"shop_money":{"amount":"192.75","currency_code":"INR"},"presentment_money":{"amount":"192.75","currency_code":"INR"}},"total_discounts_set":{"shop_money":{"amount":"0.00","currency_code":"INR"},"presentment_money":{"amount":"0.00","currency_code":"INR"}},"total_shipping_price_set":{"shop_money":{"amount":"0.00","currency_code":"INR"},"presentment_money":{"amount":"0.00","currency_code":"INR"}},"subtotal_price_set":{"shop_money":{"amount":"192.75","currency_code":"INR"},"presentment_money":{"amount":"192.75","currency_code":"INR"}},"total_price_set":{"shop_money":{"amount":"192.75","currency_code":"INR"},"presentment_money":{"amount":"192.75","currency_code":"INR"}},"total_tax_set":{"shop_money":{"amount":"0.00","currency_code":"INR"},"presentment_money":{"amount":"0.00","currency_code":"INR"}},"line_items":[{"id":4606069375038,"variant_id":20133719867454,"title":"!!!!!!!!!!66","quantity":2,"sku":"Test Item COde20","variant_title":"Test","vendor":"Mewebg","fulfillment_service":"manual","product_id":2186138222654,"requires_shipping":true,"taxable":false,"gift_card":false,"name":"!!!!!!!!!!66 - Test","variant_inventory_management":"shopify","properties":[],"product_exists":true,"fulfillable_quantity":1,"grams":20,"price":"12.25","total_discount":"0.00","fulfillment_status":null,"price_set":{"shop_money":{"amount":"12.25","currency_code":"INR"},"presentment_money":{"amount":"12.25","currency_code":"INR"}},"total_discount_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}},"discount_allocations":[],"tax_lines":[{"price":"0.00","rate":0.2,"title":"State Tax","price_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}}},{"price":"0.00","rate":0.2,"title":"State Tax","price_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}}}]},{"id":4606069407806,"variant_id":19795494731838,"title":"\"BETHANY HAMILTON STOKED HOTTIE","quantity":1,"sku":"\"BETHANY HAMILTON STOKED HOTTIE","variant_title":"\"BETHANY HAMILTON STOKED HOTTIE","vendor":"Fun","fulfillment_service":"manual","product_id":2164580974654,"requires_shipping":true,"taxable":false,"gift_card":false,"name":"\"BETHANY HAMILTON STOKED HOTTIE - \"BETHANY HAMILTON STOKED HOTTIE","variant_inventory_management":"shopify","properties":[],"product_exists":true,"fulfillable_quantity":0,"grams":0,"price":"63.25","total_discount":"0.00","fulfillment_status":null,"price_set":{"shop_money":{"amount":"63.25","currency_code":"INR"},"presentment_money":{"amount":"63.25","currency_code":"INR"}},"total_discount_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}},"discount_allocations":[],"tax_lines":[{"price":"0.00","rate":0.2,"title":"State Tax","price_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}}}]},{"id":4606069440574,"variant_id":18641516560446,"title":"#123 test update credentials","quantity":1,"sku":"#123 test update credentials","variant_title":"#123 test update credentials","vendor":"Shiv","fulfillment_service":"manual","product_id":2026133127230,"requires_shipping":true,"taxable":false,"gift_card":false,"name":"#123 test update credentials - #123 test update credentials","variant_inventory_management":"shopify","properties":[],"product_exists":true,"fulfillable_quantity":1,"grams":0,"price":"105.00","total_discount":"0.00","fulfillment_status":null,"price_set":{"shop_money":{"amount":"105.0","currency_code":"INR"},"presentment_money":{"amount":"105.0","currency_code":"INR"}},"total_discount_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}},"discount_allocations":[],"tax_lines":[{"price":"0.00","rate":0.2,"title":"State Tax","price_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}}}]}],"fulfillments":[],"refunds":[{"id":646510149694,"order_id":2115492511806,"created_at":"2020-02-19T18:11:33+05:30","note":null,"user_id":3115855,"processed_at":"2020-02-19T18:11:33+05:30","restock":true,"refund_line_items":[{"id":146772721726,"line_item_id":4606069407806,"quantity":1,"restock_type":"cancel","location_id":5542248510,"subtotal":"63.25","total_tax":"0.00","line_item":{"id":4606069407806,"variant_id":19795494731838,"title":"\"BETHANY HAMILTON STOKED HOTTIE","quantity":1,"sku":"\"BETHANY HAMILTON STOKED HOTTIE","variant_title":"\"BETHANY HAMILTON STOKED HOTTIE","vendor":"Fun","fulfillment_service":"manual","product_id":2164580974654,"requires_shipping":true,"taxable":false,"gift_card":false,"name":"\"BETHANY HAMILTON STOKED HOTTIE - \"BETHANY HAMILTON STOKED HOTTIE","variant_inventory_management":"shopify","properties":[],"product_exists":true,"fulfillable_quantity":0,"grams":0,"price":"63.25","total_discount":"0.00","fulfillment_status":null,"price_set":{"shop_money":{"amount":"63.25","currency_code":"INR"},"presentment_money":{"amount":"63.25","currency_code":"INR"}},"total_discount_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}},"discount_allocations":[],"tax_lines":[{"price":"0.00","rate":0.2,"title":"State Tax","price_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}}}]},"subtotal_set":{"shop_money":{"amount":"63.25","currency_code":"INR"},"presentment_money":{"amount":"63.25","currency_code":"INR"}},"total_tax_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}}}],"transactions":[],"order_adjustments":[]},{"id":646510182462,"order_id":2115492511806,"created_at":"2020-02-19T18:12:10+05:30","note":"","user_id":3115855,"processed_at":"2020-02-19T18:12:10+05:30","restock":true,"refund_line_items":[{"id":146772754494,"line_item_id":4606069375038,"quantity":1,"restock_type":"cancel","location_id":35178002,"subtotal":"12.25","total_tax":"0.00","line_item":{"id":4606069375038,"variant_id":20133719867454,"title":"!!!!!!!!!!66","quantity":2,"sku":"Test Item COde20","variant_title":"Test","vendor":"Mewebg","fulfillment_service":"manual","product_id":2186138222654,"requires_shipping":true,"taxable":false,"gift_card":false,"name":"!!!!!!!!!!66 - Test","variant_inventory_management":"shopify","properties":[],"product_exists":true,"fulfillable_quantity":1,"grams":20,"price":"12.25","total_discount":"0.00","fulfillment_status":null,"price_set":{"shop_money":{"amount":"12.25","currency_code":"INR"},"presentment_money":{"amount":"12.25","currency_code":"INR"}},"total_discount_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}},"discount_allocations":[],"tax_lines":[{"price":"0.00","rate":0.2,"title":"State Tax","price_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}}},{"price":"0.00","rate":0.2,"title":"State Tax","price_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}}}]},"subtotal_set":{"shop_money":{"amount":"12.25","currency_code":"INR"},"presentment_money":{"amount":"12.25","currency_code":"INR"}},"total_tax_set":{"shop_money":{"amount":"0.0","currency_code":"INR"},"presentment_money":{"amount":"0.0","currency_code":"INR"}}}],"transactions":[{"id":2692110909502,"order_id":2115492511806,"kind":"refund","gateway":"Bank Deposit","status":"success","message":"Refunded 12.25 from manual gateway","created_at":"2020-02-19T18:12:09+05:30","test":false,"authorization":null,"location_id":null,"user_id":3115855,"parent_id":2692109860926,"processed_at":"2020-02-19T18:12:09+05:30","device_id":null,"receipt":{},"error_code":null,"source_name":"1830279","amount":"12.25","currency":"INR"}],"order_adjustments":[]}],"total_tip_received":"0.0","shipping_lines":[]}}
0 Likes
Highlighted
Excursionist
18 1 5

Can some provide an update on this?

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @Webgility1 ,

 

In your orders.json object, you will see an array of objects called "refunds". This "refunds" array within the main "orders" object should contain two elements, one element corresponding for each item that was refunded/removed from the original order.

 

You should see that the first element in the "refunds" array corresponds to the "Bethany Hamilton Stoked Hottie" product, and also that this refund element has an empty "transactions" field. "Transactions" is the field where information about money being transferred from Shopify to the customer will be stored. Since "transactions" is empty, it means that no money was transferred from Shopify to the customer for this refunded element. This means that this item was your """removed""" item.

 

You should see that the second element of "refunds" array corresponds to the "!!!!!!!!!66" product, and that this refund element has a populated "transactions" field. This means that money was transferred from Shopify to the customer for this refunded element (specifically 12.25). This means that this item was your """refunded""" item. 

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes