AlogramPayRisk - the Ruby gem for the Alogram PayRisk Engine
Alogram PayRisk is an AI-native decision engine built for the speed and complexity of the modern commerce era. In a high-velocity world where AI-driven threats evolve in milliseconds, Alogram provides the real-time adaptability and forensic transparency needed to protect your ecosystem with total confidence. We solve the challenge of balancing frictionless growth with regulatory explainability, delivering instant, intelligent risk orchestration at enterprise scale.
Our client libraries and API specifications are open-source under the Apache License 2.0 to ensure seamless integration into your tech stack.
Use of the Alogram PayRisk API service is proprietary and governed by our Terms of Service and your specific Enterprise Agreement, if applicable.
To access the service, you must have:
- A valid Alogram API Key.
- An active subscription or signed Master Service Agreement.
Unauthorized use, including automated scraping or reverse engineering of the scoring engine, is strictly prohibited.
Every Alogram API response includes a unique x-trace-id header.
Please include this ID when contacting packages@alogram.ai
regarding specific transactions or errors.
The authoritative OpenAPI specification for this version is available for download: Download openapi.yaml | Download openapi.json
The Alogram Ruby SDK is built for enterprise-scale workloads:
- Async-Ready: Built on
httpxwith native support for Fibers and Event Loops. - Modern Protocols: Native support for HTTP/2 multiplexing and TLS 1.3.
- Connection Pooling: Persistent session management for sub-millisecond connection reuse.
- Traceable: Full support for
x-trace-idandx-idempotency-keyfor forensic audit compliance.
To build the Ruby code into a gem:
gem build alogram_payrisk.gemspecThen either install the gem locally:
gem install ./alogram_payrisk-0.2.9.gem(for development, run gem install --dev ./alogram_payrisk-0.2.9.gem to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'alogram_payrisk', '~> 0.2.9'
If the Ruby gem is hosted at a git repository: https://github.com/alogram/alogram-ruby, then add the following in the Gemfile:
gem 'alogram_payrisk', :git => 'https://github.com/alogram/alogram-ruby.git'
Include the Ruby code directly using -I as follows:
ruby -Ilib script.rbPlease follow the installation procedure and then run the following code:
# Load the gem
require 'alogram_payrisk'
# Setup authorization
AlogramPayRisk.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['x-api-key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['x-api-key'] = 'Bearer'
# Configure httpx session
config.configure_session { |session| 'YOUR CONNECTION CONFIG PROC' }
# Configure OAuth2 access token for authorization: oAuth2
config.access_token = 'YOUR ACCESS TOKEN'
# Configure a proc to get access tokens in lieu of the static access_token configuration
config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' }
# Configure httpx session
config.configure_session { |session| 'YOUR CONNECTION CONFIG PROC' }
end
api_instance = AlogramPayRisk::ForensicDataApi.new
tenant_id = 'tenant_id_example' # String |
opts = {
x_trace_id: 'x_trace_id_example', # String | Echoed or generated trace ID for tracking requests.
x_idempotency_key: 'x_idempotency_key_example', # String | Unique Idempotency-Key sent in the GET request etc.
start_time: 'start_time_example', # String |
end_time: 'end_time_example', # String |
page_size: 56, # Integer |
page_token: 'page_token_example' # String |
}
begin
#Query Historical Assessments
result = api_instance.get_fraud_scores(tenant_id, opts)
p result
rescue AlogramPayRisk::ApiError => e
puts "Exception when calling ForensicDataApi->get_fraud_scores: #{e}"
endAll URIs are relative to https://api.alogram.ai
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AlogramPayRisk::ForensicDataApi | get_fraud_scores | GET /v1/scores/{tenantId} | Query Historical Assessments |
| AlogramPayRisk::RiskScoringApi | risk_check | POST /v1/risk/check | Assess Transaction Risk |
| AlogramPayRisk::RoadmapPreviewApi | account_risk_check | POST /v1/risk/account/check | Synchronous fraud decision for account/session events |
| AlogramPayRisk::RoadmapPreviewApi | kyc_risk_check | POST /v1/risk/kyc/check | Synchronous decision for KYC/identity verification |
| AlogramPayRisk::SignalIntelligenceApi | ingest_payment_event | POST /v1/events | Ingest Lifecycle Signals |
| AlogramPayRisk::SignalIntelligenceApi | ingest_signals | POST /v1/signals | Submit Behavioral Intelligence |
| AlogramPayRisk::SystemApi | health_check | GET /v1/health | Health check for the service |
- AlogramPayRisk::Account
- AlogramPayRisk::AccountCheckRequest
- AlogramPayRisk::AvsResultEnum
- AlogramPayRisk::BankTransfer
- AlogramPayRisk::Card
- AlogramPayRisk::CardNetworkEnum
- AlogramPayRisk::CategorySignal
- AlogramPayRisk::ChannelEnum
- AlogramPayRisk::CheckRequest
- AlogramPayRisk::ConfidenceEnum
- AlogramPayRisk::Crypto
- AlogramPayRisk::CvvResultEnum
- AlogramPayRisk::DecisionResponse
- AlogramPayRisk::DeviceInfo
- AlogramPayRisk::DiscountCode
- AlogramPayRisk::EntityIds
- AlogramPayRisk::EntryMethodEnum
- AlogramPayRisk::ExternalAssessment
- AlogramPayRisk::FraudScore
- AlogramPayRisk::Identity
- AlogramPayRisk::Integrity
- AlogramPayRisk::Interaction
- AlogramPayRisk::InteractionTypeEnum
- AlogramPayRisk::Invoice
- AlogramPayRisk::IpInfo
- AlogramPayRisk::KycCheckRequest
- AlogramPayRisk::KycPayload
- AlogramPayRisk::MerchantContext
- AlogramPayRisk::OrderContext
- AlogramPayRisk::PayerTypeEnum
- AlogramPayRisk::PaymentAuthorizationOutcome
- AlogramPayRisk::PaymentCaptureOutcome
- AlogramPayRisk::PaymentCardTypeEnum
- AlogramPayRisk::PaymentChargeback
- AlogramPayRisk::PaymentChargebackOutcome
- AlogramPayRisk::PaymentDisputeOutcome
- AlogramPayRisk::PaymentEvent
- AlogramPayRisk::PaymentEventType
- AlogramPayRisk::PaymentMethod
- AlogramPayRisk::PaymentOutcome
- AlogramPayRisk::PaymentRealtimeTypeEnum
- AlogramPayRisk::PaymentRefundOutcome
- AlogramPayRisk::PaymentWalletTypeEnum
- AlogramPayRisk::PostalAddress
- AlogramPayRisk::Problem
- AlogramPayRisk::Purchase
- AlogramPayRisk::PurchaseInitiatorEnum
- AlogramPayRisk::PurchaseSequenceEnum
- AlogramPayRisk::PurchaseUsageEnum
- AlogramPayRisk::Realtime
- AlogramPayRisk::ReasonDetail
- AlogramPayRisk::RiskBreakdown
- AlogramPayRisk::RiskCategoryEnum
- AlogramPayRisk::RiskLevelEnum
- AlogramPayRisk::ScaMethodEnum
- AlogramPayRisk::ScoreRecord
- AlogramPayRisk::ScoresSuccessResponse
- AlogramPayRisk::SignalsAccountVariant
- AlogramPayRisk::SignalsInteractionVariant
- AlogramPayRisk::SignalsRequest
- AlogramPayRisk::StoredCredentialContext
- AlogramPayRisk::ThreeDSData
- AlogramPayRisk::Wallet
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: x-api-key
- Location: HTTP header
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://api.alogram.ai/oauth2/authorize
- Scopes:
- payrisk.read: Read fraud scores and decisions.
- payrisk.write: Submit fraud checks, events, and signals.