When trying to automate the payout reconciliation process using the Payout transaction endpoint of the Admin Rest API I noticed that some Shop Cash adjustments actually represent two or more shop cash transactions. This is a problem because the data body returned for the payout adjustment line only contains one order_id and there are no identifiers on the payout adjustment line to link it to the other order/s that may be reflected with that adjustment. Does anyone know of any way to tie the shop cash adjustment lines to the orders they should be applied to?
I am looking at the endpoint https://shopify.dev/docs/api/admin-rest/2024-01/resources/transactions. This is the documentation for the 2024-01 release candidate, and it looks like a new field called adjustment_order_transactions was added. This field seems to be exactly what you are looking for, it's an array of objects containing an order id, and an amount.