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"
}
]