This error comes on some Score API calls and suggests one of two things. The first is that we haven't received an event with the $user_id value before. Common reasons for this are:
- The user's data was sent as test data to your Sandbox account, and now you're using your Production REST API key, which searches only Production data.
- The user's data was not sent as historical backfill data because their activity predates the backfill or their events were from a subset of events that received errors on the backfill and weren't re-sent.
- The user has taken actions that give them a user id in our system but not yours. For example, they have created an account but you don't send Sift a $create_account event.
The second possibility is that the Score API call comes immediately after the first event with the $user_id value and the process of scoring the user isn't quite complete. For example, if you send a $create_account or $create_order as a user's first event and then immediately after getting a response call the Score API. Solutions to this problem include:
- Wait slightly longer before making the Score API call to cover these cases (try waiting 4-800ms after the Events API event is sent, or better would be to wait until after you receive a successful response to the event you sent).
- Build in code to pause and retry once or twice on a 54 error. Beyond that, the user is unlikely to get a score at this time and there may be an integration issue such as those listed above.
- If this is your key event where you need a score for the user before proceeding, ask for a score in the response to the Events API event you're making a decision on. This way, you're guaranteed to get a score as soon as it's available.