Add support for the Global Profile API - #164
Open
tholovina-sift wants to merge 3 commits into
Open
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
- Add validate() to GlobalProfileFieldSet throwing MissingFieldException when userId is null/empty (P1) - Type GlobalProfileRequest constructor parameter as GlobalProfileFieldSet instead of raw FieldSet (P2) - Add @Expose/@SerializedName to GlobalProfileFieldSet fields so fromJson() deserializes correctly (P3) - Capture return value and add is_ok()/identity_found assertions to testGlobalProfileLookupByPhone (P4) - Add testLookupIdentityNotFound covering the identity_found=false Lookup response path (P5) - Add assertNull assertions for chargebacks/orders/transactions/locations/lookbackMonths in testIdentityNotFound (P6) - Add Authorization header assertion to testGetGlobalProfileWithoutOptionalParams (P7) - Fix pre-existing test failures: remove null-valued fields from JSONAssert comparison bodies so they match toJson() output (Gson omits nulls by default) Co-Authored-By: Claude <noreply@anthropic.com>
Server returns city, region, and country in location_connected_accounts entries. The region field was absent, causing it to be silently dropped on deserialization. Confirmed live via API test. Co-Authored-By: Claude <noreply@anthropic.com>
tholovina-sift
marked this pull request as ready for review
August 20, 2026 15:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose:
GET /v3/accounts/{accountId}/global_profile/users/{userId}(lookup by Sift user ID) andPOST /v3/accounts/{accountId}/global_profile/lookup(lookup by email and/or phone)Technical overview:
GlobalProfileFieldSet/GlobalProfileRequest/GlobalProfileResponse— GET endpoint following theGetDecisionsRequestquery-parameter pattern; optionalglobalOnlyandincludeOwnDataparams are only sent when explicitly setGlobalProfileLookupFieldSet/GlobalProfileLookupRequest/GlobalProfileLookupResponse— POST endpoint; overridesvalidate()(same pattern asApplyDecisionFieldSet) to throwMissingFieldExceptionclient-side when neitheremailnorphoneis providedGlobalProfileResponseBodyshared between both endpoints, with nested model classes for all response fields (GlobalProfileSummary,GlobalProfileIdentityAge,GlobalProfileUserDecisions,GlobalProfileChargebacks,GlobalProfileOrders,GlobalProfileTransactions,GlobalProfileLocations,GlobalProfileLocationAccount); all fields use@Expose/@SerializedNameGson conventionSiftClientgains two newbuildRequest(...)overloads, matching the existing dispatch-by-type conventionprofile_summary.identity_foundisfalse, all fields exceptprofile_summaryarenull, as documented onGlobalProfileResponseBodyTesting plan:
This PR contains all required labels and reviewers as per our Change Management Procedure
Live tested against the Sift API with a real account: both GET and POST returned
status=0, error_message=OKwithidentity_found=true,link_count=31, and fully populated location entries includingcity,region, andcountryDeployment plan:
Related documentation is updated
README.md: new "Global Profile API" section with usage examples for both endpointsCHANGES.MD: new3.23.0entrybuild.gradle: version bumped to3.23.0Merge when Global Profile API is publicly available
Merge before https://github.com/SiftScience/sift-docs/pull/92
Rollback plan:
Customer Impact Assessment: