I am integrating Shopify with ERP system using REST API.
Is there a way to identify whether a refund created is against a return of product or is it a miscellaneous refund like Customer Loyalty, Late delivery or any other refund etc from API data.
Based on refund type we need to generate accounting entries. If refund is for return of any item we need to generate separate entries and if it any kind of discount or something entries will be different.
Any help is appreciated.
Under the refund endpoint we do provide a "kind" and "reason" field which should give you the information you are requesting. See here for details.