Skip to content

Add Global Profile API support - #101

Draft
tholovina-sift wants to merge 1 commit into
masterfrom
atlas-382-global-profile-api
Draft

Add Global Profile API support#101
tholovina-sift wants to merge 1 commit into
masterfrom
atlas-382-global-profile-api

Conversation

@tholovina-sift

Copy link
Copy Markdown

Summary

Adds client support for the new Global Profile API, which surfaces cross-tenant
identity, decision, chargeback, order, transaction, and location signals for a
user.

Two new endpoints are wired up under the existing account-scoped /v3/accounts
API surface, following the same conventions as get_user_decisions,
get_a_psp_merchant_profile, etc. (HTTP Basic auth via api_client, a
Sift::Response wrapper, account_id/api_key/timeout overrides via opts).

Changes

  • lib/sift.rb: Added global_profile_api_path(account_id, user_id) and
    global_profile_lookup_api_path(account_id) path helpers.
  • lib/sift/client.rb:
    • get_global_profile(user_id, opts = {}) — GET
      /v3/accounts/{account_id}/global_profile/users/{user_id}. Supports
      :global_only and :include_own_data optional query params. Raises if
      user_id, api_key, or account_id is empty.
    • get_global_profile_by_attributes(params = {}, opts = {}) — POST
      /v3/accounts/{account_id}/global_profile/lookup with a JSON body of
      {email, phone}. Raises "email or phone must be provided" if neither
      :email nor :phone is present in params, mirroring existing
      client-side validation patterns (e.g. properties cannot be empty).
  • spec/unit/client_global_profile_spec.rb (new): webmock-based specs for
    both endpoints — happy path, optional query params, identity_found: false
    response shape (all fields null except profile_summary), and the two
    validation error cases.
  • README.md: New "Global Profile API" usage section, in the same style
    as the existing PSP Merchant Management API section.
  • HISTORY: New 4.7.0 entry — "Global Profile API support".
  • lib/sift/version.rb: Bumped VERSION to 4.7.0.

Testing

Unit specs added in spec/unit/client_global_profile_spec.rb. All new/modified
Ruby files pass ruby -c syntax checks. I was unable to run the full RSpec
suite in this environment (no network access to install missing gems via
bundle installrspec, webmock, httparty, etc. were not preinstalled),
so please run bundle exec rspec in CI/locally to confirm before merging.

Not included

  • No changes to test_integration_app or examples/ — happy to add an example
    if desired.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant