{"publisher":"WESWOO","id":"return-by-sku-refund","scope":{"zh":"独立演练数据，商家原帖用于说明问题","en":"Independent illustrative records. The forum post supplies the question."},"inputs":{"currency":"USD","units":"cents","return_columns":["return_line_id","order","sku","received_on","received_at"],"returns":[["L1","A","RED","2026-05-07","West"],["L2","A","BLUE","2026-05-08","East"],["L3","B","RED","2026-05-09","East"]],"credit_columns":["order","return_line_id","component","amount"],"credits":[["A","L1","item",3000],["A",null,"shipping",500],["B",null,"order",1500]]},"checks":[{"condition":"known item amounts; null means unallocated or unknown","expected":[3000,null,null],"observed":[3000,null,null]},{"condition":"amounts kept outside SKU allocation","expected":[500,1500],"observed":[500,1500]},{"condition":"same SKU on a different order retains its own line","expected":null,"observed":null},{"condition":"wrong order reference cannot allocate to L1","expected":null,"observed":null}]}