Getting refund line items via transaction ID - Recent Change?

Highlighted
New Member
4 0 0
Hey all,
Does any know why Shopify has started storing a single refund in the order json as two items in the array?
E.g When a refund is created and refund via Shopify Payments, two items are added to "order.refunds"
One of these objects has the "refund_line_items" array populated, and the other has the "transactions" array populated. The ID of the first one does not seem to be referenced from anywhere.
End goal is I need to know the line items that were refunded from the order transaction ID.
 
E.g, the below order has 2 objects in the refunds array, when only one refund took place
		"refunds": [
			{
				"id": 654465400945,
				"order_id": 2232254759025,
				"created_at": "2020-04-09T12:12:36+01:00",
				"note": null,
				"user_id": 23596040305,
				"processed_at": "2020-04-09T12:12:36+01:00",
				"restock": true,
				"refund_line_items": [
					{
						"id": 155895464049,
						"line_item_id": 4822170763377,
						"quantity": 1,
						"restock_type": "cancel",
						"location_id": 20589084785,
						"subtotal": "25.00",
						"total_tax": "5.00",
						"line_item": {
							"id": 4822170763377,
							"variant_id": 31372112298097,
							"title": "37043 \"Loch Lomond\"",
							"quantity": 2,
							"sku": "ACC230637043-Deposit",
							"variant_title": "DCC Ready \/ Pay deposit now",
							"vendor": "ShineDew",
							"fulfillment_service": "manual",
							"product_id": 4395318902897,
							"requires_shipping": false,
							"taxable": true,
							"gift_card": false,
							"name": "37043 \"Loch Lomond\" - DCC Ready \/ Pay deposit now",
							"variant_inventory_management": "shopify",
							"properties": [

							],
							"product_exists": true,
							"fulfillable_quantity": 1,
							"grams": 650,
							"price": "25.00",
							"total_discount": "0.00",
							"fulfillment_status": null,
							"price_set": {
								"shop_money": {
									"amount": "25.0",
									"currency_code": "GBP"
								},
								"presentment_money": {
									"amount": "25.0",
									"currency_code": "GBP"
								}
							},
							"total_discount_set": {
								"shop_money": {
									"amount": "0.0",
									"currency_code": "GBP"
								},
								"presentment_money": {
									"amount": "0.0",
									"currency_code": "GBP"
								}
							},
							"discount_allocations": [

							],
							"tax_lines": [
								{
									"price": "10.00",
									"rate": 0.2,
									"title": "VAT",
									"price_set": {
										"shop_money": {
											"amount": "10.0",
											"currency_code": "GBP"
										},
										"presentment_money": {
											"amount": "10.0",
											"currency_code": "GBP"
										}
									}
								}
							]
						},
						"subtotal_set": {
							"shop_money": {
								"amount": "25.0",
								"currency_code": "GBP"
							},
							"presentment_money": {
								"amount": "25.0",
								"currency_code": "GBP"
							}
						},
						"total_tax_set": {
							"shop_money": {
								"amount": "5.0",
								"currency_code": "GBP"
							},
							"presentment_money": {
								"amount": "5.0",
								"currency_code": "GBP"
							}
						}
					}
				],
				"transactions": [

				],
				"order_adjustments": [

				]
			},
			{
				"id": 654465433713,
				"order_id": 2232254759025,
				"created_at": "2020-04-09T12:12:59+01:00",
				"note": "",
				"user_id": 23596040305,
				"processed_at": "2020-04-09T12:12:59+01:00",
				"restock": false,
				"refund_line_items": [

				],
				"transactions": [
					{
						"id": 2800442278001,
						"order_id": 2232254759025,
						"kind": "refund",
						"gateway": "shopify_payments",
						"status": "success",
						"message": "Transaction approved",
						"created_at": "2020-04-09T12:12:56+01:00",
						"test": false,
						"authorization": "re_1GVY6XDD",
						"location_id": null,
						"user_id": 23596040305,
						"parent_id": 2792250638449,
						"processed_at": "2020-04-09T12:12:56+01:00",
						"device_id": null,
						"receipt": {
							"id": "re_1GVyedvY6XDD",
							"amount": 3000,
							"balance_transaction": {
								"id": "txn_1GVyJnAlhn1",
								"object": "balance_transaction",
								"exchange_rate": null
							},
							"charge": {
								"id": "ch_1GUsEkOidVVm6",
								"object": "charge",
								"amount": 6000,
								"application_fee": "fee_1GUsEFAm",
								"balance_transaction": "txn_1GU",
								"captured": true,
								"created": 1586169054,
								"currency": "gbp",
								"failure_code": null,
								"failure_message": null,
								"fraud_details": {

								},
								"livemode": true,
								"metadata": {
									"shop_id": "193801",
									"shop_name": "test",
									"transaction_fee_total_amount": "134",
									"transaction_fee_tax_amount": "0",
									"payments_charge_id": "716420710513",
									"order_transaction_id": "2792250278001",
									"manual_entry": "false",
									"order_id": "c12825689817201.1",
									"email": "blah@mac.com"
								},
								"outcome": {
									"network_status": "approved_by_network",
									"reason": null,
									"risk_level": "normal",
									"seller_message": "Payment complete.",
									"type": "authorized"
								},
								"paid": true,
								"payment_intent": "pi_1Pq3SpzrL",
								"payment_method": "pm_1GUsGRDdW",
								"payment_method_details": {
									"card": {
										"brand": "amex",
										"checks": {
											"address_line1_check": "pass",
											"address_postal_code_check": "pass",
											"cvc_check": "pass"
										},
										"country": "GB",
										"exp_month": 7,
										"exp_year": 1000,
										"fingerprint": "0",
										"funding": "credit",
										"installments": null,
										"last4": "3",
										"moto": null,
										"network": "amx",
										"three_d_secure": {
											"authenticated": true,
											"succeeded": true,
											"version": "2.1.0"
										},
										"wallet": null
									},
									"type": "card"
								},
								"refunded": false,
								"source": null,
								"status": "succeeded"
							},
							"object": "refund",
							"reason": null,
							"status": "succeeded",
							"created": 1586430777,
							"currency": "gbp",
							"metadata": {
								"transaction_fee_total_amount": "67",
								"transaction_fee_tax_amount": "0",
								"order_transaction_id": "2800442278001",
								"payments_refund_id": "38462455921"
							}
						},
						"error_code": null,
						"source_name": "1830279",
						"amount": "30.00",
						"currency": "GBP"
					}
				],
				"order_adjustments": [

				]
			}
		]
Thanks!
0 Likes
New Member
4 0 0

Just giving this a little bump up, as Ive still found no work around or anything yet, Thanks

0 Likes