# Error accumulating loyalty points

**URL:** <https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879>\
**Category:** Questions\
**Tags:** loyalty-api\
**Created:** [February 17, 2021, 10:58pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879 "2021-02-17T22:58:52Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [February 17, 2021, 10:58pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/1 "2021-02-17T22:58:53Z")

</div>

I’m sporadically getting an error when using the `accumulateLoyalty` endpoint. A user associated with the following order id failed to accumulate loyalty points for a newly-created account: `tFsGkRKnZXV9VN5Os7OR9SW2RCfZY`. I have since manually added a loyalty point to the account, so the current balance is 1.

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [February 20, 2021, 12:12am UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/2 "2021-02-20T00:12:05Z")

</div>

Apologies for the delay here. Do you know what the error returned was? I’m not seeing any logs for `AccumulateLoyaltyPoints` with the provided `order_id` at all, error or otherwise.

---

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [February 20, 2021, 12:30am UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/3 "2021-02-20T00:30:51Z")

</div>

Hey @sjosey. The error was `connect ECONNREFUSED 74.122.189.132:443`, which I think was related to the issue on this thread: `https://developer.squareup.com/forums/t/api-timeout-issue/1881`. I haven’t gotten it since then.

---

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [February 25, 2021, 6:11pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/4 "2021-02-25T18:11:04Z")

</div>

Hi @sjosey,

I’m having this problem again, but am now getting this error:

`{"code":"INTERNAL_SERVER_ERROR","detail":"An internal error has occurred, and the API was unable to service your request.","category":"API_ERROR"}`

This was associated with this orderId: `L2fpDkAwEpLCy02FRrKwKeSxUDEZY`

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [February 25, 2021, 11:36pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/5 "2021-02-25T23:36:47Z")

</div>

Thanks for sharing, I’ll pass this along to the team as I’m not clear on what happened. Out of curiosity, did you retry at all? It appears on our side that some service may have timed out, so wondering if retrying would’ve worked. We definitely shouldn’t be returning an `INTERNAL_SERVER_ERROR`, ever though, of course.

---

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [February 26, 2021, 12:43am UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/6 "2021-02-26T00:43:17Z")

</div>

Thanks @sjosey. I didn’t retry; maybe that would be a solution.

---

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [February 27, 2021, 5:05pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/7 "2021-02-27T17:05:54Z")

</div>

Hey @sjosey. I’m still occasionally having this problem. I had it again related to this order: `5pdfquEJ5jfhBl3NgFJOBQARiWFZY`.

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [March 2, 2021, 4:43pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/8 "2021-03-02T16:43:52Z")

</div>

Thanks for the info. I’ve escalated this to our Loyalty team and will follow up once I have updates from them.

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [March 3, 2021, 10:26pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/9 "2021-03-03T22:26:40Z")

</div>

Hey @percussionoid do you have any more information? So far myself nor the Loyalty team was able to find any errors with the `5pdfquEJ5jfhBl3NgFJOBQARiWFZY` order. As far as we can tell the above error only happened once in the last two weeks, so we’re hoping it was just a one-off timeout on our side.

---

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [March 3, 2021, 11:20pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/10 "2021-03-03T23:20:15Z")

</div>

Hey @sjosey. What other info would help? I’ve had this error a couple times in the last month, but mostly it works, so maybe you’re right about the timeout.

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [March 4, 2021, 12:31am UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/11 "2021-03-04T00:31:09Z")

</div>

I mean we definitely don’t want it to error out with a 500, but we were unable to find any errors around the last one (we did find it for the first one but it just appeared to be a one-off timeout). If you’re able to provide other orders where this 500 internal server error happened, that would definitely be useful as we haven’t been able to see this error any more.

---

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [March 4, 2021, 3:31pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/12 "2021-03-04T15:31:43Z")

</div>

Hey @sjosey, here are the orderIds I have from the past two weeks that are associated with this error:

`5pdfquEJ5jfhBl3NgFJOBQARiWFZY`  
`L2fpDkAwEpLCy02FRrKwKeSxUDEZY`

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [March 4, 2021, 5:26pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/13 "2021-03-04T17:26:46Z")

</div>

Sorry for the confusion here. So to clarify: we _did_ find the error for `L2fpDkAwEpLCy02FRrKwKeSxUDEZY`, but we _did not_ see the same error for `5pdfquEJ5jfhBl3NgFJOBQARiWFZY` (to be clear, we do not even see this order being used in the accumulate loyalty points endpoint at all) , so I was asking if you had any additional orders that could help us dig into it. We’ve been unable to find any other occurrence of this error other than the one with `L2fpDkAwEpLCy02FRrKwKeSxUDEZY` anywhere in our logs over the last few weeks, which is why the team is saying they believe it was a one-off error that shouldn’t continue happening.

---

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [March 6, 2021, 4:14pm UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/14 "2021-03-06T16:14:49Z")

</div>

Thanks @sjosey. I got the error again, this time with two different loyalty endpoints: creatLoyaltyReward and accumulateLoyaltyPoints.

Associated with this order: `VfBv6Udv34818V5DydrU1ZP6CsYZY`

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [March 9, 2021, 1:02am UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/15 "2021-03-09T01:02:30Z")

</div>

I asked the Loyalty team to check into this, and they’re not seeing any 500 errors in the past 14 days for `CreateLoyaltyReward` and not seeing any errors specifically around that order either. Do you have any more information or logs from your side about these errors?

---

<div class="post-metadata">

**Author:** ![percussionoid](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@percussionoid](https://developer.squareup.com/forums/u/percussionoid)\
**Post date:** [March 9, 2021, 3:29am UTC](https://developer.squareup.com/forums/t/error-accumulating-loyalty-points/1879/16 "2021-03-09T03:29:22Z")

</div>

Hey @sjosey. This is the full error I got:

```auto
{"errors": [{"code": "INTERNAL_SERVER_ERROR","detail": "An internal error has occurred, and the API was unable to service your request.","category": "API_ERROR"}]}

```

UPDATE: Here’s the timestamp for this error: `Thu, 04 Mar 2021 23:48:58 GMT`
