Order Refund Receipt Segment Discrepancy

SmeadDev
Excursionist
17 1 6

I have a weird issue that I need some insight into. We had a refund webhook fire for a partial refund and the Receipt segment under the Transactions Segment shows a datetime value in the "created" field - this field should normally contain an int value.

 

Example from the raw JSON:

 

 

 

"receipt": {
                        "created": "2021-11-10T17:57:18Z",
                        "fee_refunded": 165,
                        "currency": "USD",
                        "amount": 2795,
                        "reference_id": "3176434",
                        "type": "refund",
                        "id": "UUIZ0UC7SKEGO0UP"

 

 

  Here is the JSON from another order refund that has the correct (at least I think it's the correct format seeing as several refunds that have been parsed into our systems have this format) format:

 

 

"receipt": {
                        "created": 1636567176,
                        "fee_refunded": 333,
                        "currency": "USD",
                        "amount": 2795,
                        "reference_id": "311234",
                        "type": "refund",
                        "id": "UUIZHSK7SKEGO0UP"
                    },

 

 

 

Any ideas as to why there is a difference in data types? Our custom parsing logic looks for an int value in this field and seeing as this is the first time I've seen this, I'd rather not rewrite our code to parse this into a string field.

Reply 1 (1)
marcusradica
Shopify Staff
50 6 8

Hi SmeadDev,

The receipt field can vary depending on the payment processor, as the docs say: A transaction receipt attached to the transaction by the gateway. The value of this field depends on which gateway the shop is using. https://shopify.dev/api/admin-rest/2021-10/resources/transaction#resource_object

The info you're looking for should be available on the transaction itself (processed_at, created_at). Hope that helps 

marcusradica | Developer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog