Question About Missing Order ID in Refund Loyalty Events

Hi Square Team,

I noticed that Loyalty Events generated from Square Order refunds do not include the associated order_id. Could you please clarify why the order_id is not included in refund-related Loyalty Events?


This makes it difficult for us to trace the source order when processing point reversals.
Is there an alternative way to reliably link a refund Loyalty Event back to the original order?

Thanks in advance for your help!

Best regards,

:waving_hand: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Loyalty API
Refunds API Webhooks
Manage Loyalty Points

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

The LoyaltyEvent object does not include the order_id field because the Loyalty API is designed to track changes to a buyer’s loyalty account balance, not to track individual orders or transactions. When a refund occurs, the Loyalty API records a balance-changing event, but it does not directly link this event to the specific order that was refunded. :slight_smile:

Thanks Bryan,

I’ve noticed that when a refund occurs, the corresponding loyalty event for the refunded points does not include the associated order_id. However, having a reliable link between the refunded loyalty event and the original order is very important for our system.

Is there any recommended way to retrieve or infer the related order_id from a loyalty event that was triggered by a refund?

Any guidance or workaround would be greatly appreciated.

Thank you!
Best regards,
Murphy

In the refunded order there will be the source_order_id which is the ID for the original order. you can use that to map to the original order. :slight_smile:

Hi Bryan,

I’m working with the Loyalty API and would like to track the origin of each loyalty event. Specifically, for events triggered by refunds, is there a way to retrieve the associated refund_id or the original order_id?

This linkage is important for our reconciliation and audit process. I’ve reviewed the event data returned by the API, but these identifiers don’t appear to be included.

Is there any recommended approach or workaround to associate a loyalty event—especially those caused by refunds—with the related refund or order?

Thank you for your support!

Best regards,
Murphy

Hi Bryan, hope you’re doing well!

If there’s any way to link a Loyalty Event to its related Payment or Refund, I’d really appreciate it if you could share the method or best practice.

Thanks in advance for your help!

Best regards,
Murphy

How are you searching for events? Is it with an order_id? :slight_smile:

Hi Bryan,

Thank you for your continued support.

I use the /v2/loyalty/events/search API to search for Loyalty Events of type OTHER, the returned events do not include the order_id field.
Request Body

{
    "query": {
        "filter": {
            "type_filter": {
                "types": [
                    "OTHER"
                ]
            }
        }
    },
    "limit": 30
}

Response Body

{
            "id": "c33bca16-a8bc-3734-9c91-51780fdcba78",
            "type": "OTHER",
            "created_at": "2025-06-09T15:23:04Z",
            "loyalty_account_id": "11b95ab2-a3a7-4eb2-b15e-62250d506579",
            "location_id": "******",
            "source": "SQUARE",
            "other_event": {
                "loyalty_program_id": "*******",
                "points": -14
            }
        }

Is there a recommended way to associate these events with their corresponding orders, if applicable?I

I’d appreciate any guidance you can provide.

Best regards,

Is that the id that we are returning? In my test I have drefund_i93YUOGIMsL2s9GJTBzSenleV in the body. But that was a test from a long time ago. :slight_smile:

Thank you for your response.
Yes, I would like to retrieve the order_id, payment_id, or refund_id from the Loyalty Event generated by an order refund.
However, I noticed that the latest Loyalty Event API response does not include these fields.
Is there any way to access or link these identifiers when processing refund-related Loyalty Events?

Sorry to bother you again, but the order_id/refund_id of the Loyalty Event is really important to our team. If you could kindly clarify this when you have a moment, we would greatly appreciate it.