Refund Issue: Return payment as store credit, shows original tender, not giftcard

In our integration with the Square API, we go out and get the latest orders using connect.squareup.com/v2/orders/search. We then pass that information to a third party for record keeping. But we have an issue in regards to doing a refund to store credit instead of the initial tender type.

If you issue a refund and set it to return as a giftcard instead of the original tender, in the order json I’m not seeing any indication that it returned as a giftcard. It simply shows as being a refund for the original tender type. We need to be able to distinguish the difference before passing it to the third party. Any ideas would be much appreciated.

Below is a test example of the initial order JSON tenders and the following refund using giftcard as the tender type. Notice that the tender_id matches the initial tender.

Initial Order Tenders:

"tenders": [
                {
                    **"id": "vhjZJIMlu5pCxIM8z6ogUhJguaB",**
                    "location_id": "LB.....",
                    "transaction_id": "tx9VLgaXa...",
                    "created_at": "2022-05-16T19:43:57Z",
                    "amount_money": {
                        "amount": 2208,
                        "currency": "USD"
                    },
                    "processing_fee_money": {
                        "amount": 0,
                        "currency": "USD"
                    },
                    "type": "CASH",
                    "cash_details": {
                        "buyer_tendered_money": {
                            "amount": 2208,
                            "currency": "USD"
                        },
                        "change_back_money": {
                            "amount": 0,
                            "currency": "USD"
                        }
                    }
                }
            ]

Refund:

"refunds": [
                {
                    "id": "khabZAllR....",
                    "location_id": "LBWBN....",
                    "transaction_id": "tx9VLgaXaiH...",
                    **"tender_id": "vhjZJIMlu5pCxIM8z6ogUhJguaB",**
                    "created_at": "2022-05-16T19:44:59Z",
                    "reason": "Returned Goods",
                    "amount_money": {
                        "amount": 2208,
                        "currency": "USD"
                    },
                    "status": "APPROVED"
                }
            ]

:wave: At this time the team is aware that this isn’t a good experience and are working to make this better. There are a series of work arounds but none of them are ideal work arounds. For example:

If you are using SearchOrders, and you parse an order with a refund on it….if that refund_id is not returned by ListRefunds or GetRefund, then you know its a refund to a Gift Card. You can use ListGiftCardActivities and look up the refund there…the tender_id on the refunded order will match the payment_id of the UNLINKED_ACTIVITY_REFUND from Gift Card API. :slightly_smiling_face: