Internal server error when Create loyalty reward

We are getting this error when calling createLoyaltyReward:

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

Request:

POST /v2/loyalty/rewards
 {
  "reward": {
    "loyalty_account_id": "527a8855-c4de-44f1-ac40-6eb7469503e3",
    "reward_tier_id": "e1705c33-c7a4-46fa-8786-14b87013b0fe",
    "order_id": "WRWI6Xke8w09mz3jwB7yVxm9g18YY"
  },
  "idempotency_key": "6dcbf5b2-0cc8-4d83-ab8e-2ecde703521d"
}

It seems the reward is attaching to the order success, but we are getting the above error.

What’s your application ID? :slightly_smiling_face:

sq0idp-7zihwF_PCBpkuMdTCS2jrw

@Bryan-Square any update on this?

I’m still waiting on an update from the team. Once I have more information I’ll let you know. :slightly_smiling_face:

@Bryan-Square any update on this?

It appears your using the same idempotency_key for different request. If requests uses the same idempotency_key, then it is expected that the responses will be the same. The 500 is a bug on our part that we’ll need to fix. In the mean time, you can change to using a different idempotency_key so that the request will successfully go through. :slightly_smiling_face:

We also tried using a unique UUID as idempotency_key, but the response is still the same. Check the request below. Also, we have verified that we are calling the createLoyaltyReward API only once.

{
  "reward": {
    "loyalty_account_id": "527a8855-c4de-44f1-ac40-6eb7469503e3",
    "reward_tier_id": "2d360a0d-462f-4b8b-8180-3e09638f2a59",
    "order_id": "MgyRaNipCfrCmcDJQ4x96RFIgvZZY"
  },
  "idempotency_key": "30913029-b5d2-4291-905a-e66a929d814e"
}

Response:

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

Any insights or suggestions on fixing this issue would be greatly appreciated.

@Bryan-Square any update on this?

Was this by chance the same UUID that was used to create the order? :slightly_smiling_face:

No, this is a newly generated unique UUID

Okay, thanks for confirming. I’m checking with the team. :slightly_smiling_face:

@Bryan-Square any update on this?

The team is still looking into this. Is this the only account that your getting this error with and are you getting it every time when you create the reward? :slightly_smiling_face:

yeah we are getting this error for all the createLoyaltyReward calls