Package com.inttegro
Class Client
java.lang.Object
com.inttegro.Client
Main entry point for the Inttegro HTTP API.
Auth:
Timeout: 30s default; supply your own HttpClient to change.
Thread safety: immutable after construction; share freely across goroutines/threads.
Usage (mirrors studio samples):
Client client = new Client(System.getenv("INTTEGRO_API_KEY"));
var created = client.orders().create(
OrderCreateParams.builder()
.customerData(CustomerData.builder().name("Akua").phoneNumber("+233...").build())
.paymentMethodData(PaymentMethodData.mobileMoney(m -> m.network(MobileMoneyNetwork.MTN).accountNumber("0544...")))
.lineItem(OrderLineItemParams.product(p -> p.name("Subscription").type(ProductType.DIGITAL).price(PriceParams.of(Currency.GHS, 5000)).quantity(1)))
.billingDetails(BillingDetails.builder().name("Akua").phoneNumber("+233...").build())
.executePayment(true)
.build()
);
Transport: JDK HttpClient (no external HTTP deps) with Jackson for JSON.Auth:
Authorization: Bearer <key> on every request.Timeout: 30s default; supply your own HttpClient to change.
Thread safety: immutable after construction; share freely across goroutines/threads.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Client.AppsClientfinal Client.BalancesClientfinal Client.BroadcastsClientfinal Client.ChimesClientfinal Client.CustomersClientfinal Client.FileLinksClientfinal Client.FilesClientfinal Client.KeysClientfinal Client.OrdersClientfinal Client.OtpClientfinal Client.PayoutsClientfinal Client.PricesClientfinal Client.ProductsClientfinal Client.RefundsClientfinal Client.SchedulesClientfinal Client.SpecClientstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionCreate a client with the default production base URL.Client(String apiKey, ErrorReporter errorReporter) Create a client that sends privacy-safe final-failure reports to an application-owned reporter.Client(String apiKey, ErrorReporter errorReporter, ErrorReportingPolicy errorReportingPolicy) Create a client with application-owned error reporting and an explicit reporting policy.Client(String apiKey, String baseUrl, HttpClient httpClient) Create a client with a custom base URL and/or HttpClient.Client(String apiKey, String baseUrl, HttpClient httpClient, io.opentelemetry.api.OpenTelemetry openTelemetry) Create a client using a specific OpenTelemetry instance.Client(String apiKey, String baseUrl, HttpClient httpClient, io.opentelemetry.api.OpenTelemetry openTelemetry, boolean telemetryEnabled) Create a fully configured client, optionally disabling Inttegro instrumentation.Client(String apiKey, String baseUrl, HttpClient httpClient, io.opentelemetry.api.OpenTelemetry openTelemetry, boolean telemetryEnabled, ErrorReporter errorReporter, ErrorReportingPolicy errorReportingPolicy) Create a fully configured client with optional application-owned error reporting. -
Method Summary
Modifier and TypeMethodDescriptionapps()Access application creation, lookup, and update operations.balances()Access the Balances resource for retrieving balance snapshots.Access the Balance Transactions resource for retrieving transaction history.Access the Broadcasts resource for broadcast lookups and cancellations.chimes()Access the Chimes resource for sending and scheduling notification messages.files()Access the Financial Accounts resource for managing bank accounts and mobile money accounts.keys()orders()Access the Orders resource for creating, paying, finalizing, and managing orders.otp()Access the OTP resource for initializing and verifying one-time passwords.Access the Payment Methods resource for tokenizing, verifying, and managing saved payment methods.payouts()Access the Payouts resource for configuring payout settings and retrieving payout history.prices()products()refunds()Access canonical refund creation, cancellation, lookup, and pagination operations.Access the Schedules resource for scheduled chime lookups and cancellations.spec()Access the Spec resource for retrieving country specifications and payment capabilities.
-
Field Details
-
VERSION
- See Also:
-
orders
-
refunds
-
chimes
-
schedules
-
broadcasts
-
otp
-
paymentMethods
-
payouts
-
balanceTransactions
-
financialAccounts
-
files
-
fileReferences
-
fileLinks
-
uploadRequests
-
messageTemplates
-
customers
-
products
-
prices
-
spec
-
apps
-
keys
-
balances
-
purchaseIntents
-
-
Constructor Details
-
Client
Create a client with the default production base URL.- Parameters:
apiKey- secret key from the dashboard (e.g. sk_test_... or sk_live_...)
-
Client
Create a client that sends privacy-safe final-failure reports to an application-owned reporter. -
Client
public Client(String apiKey, ErrorReporter errorReporter, ErrorReportingPolicy errorReportingPolicy) Create a client with application-owned error reporting and an explicit reporting policy. -
Client
Create a client with a custom base URL and/or HttpClient.Useful for pointing to a mock server in tests or a staging environment. Provide a custom HttpClient if you need proxy support, custom timeouts, or a shared connection pool.
- Parameters:
apiKey- secret keybaseUrl- override API host (e.g., https://staging-api.inttegro.com)httpClient- custom HttpClient (optional; pass null to use default)
-
Client
public Client(String apiKey, String baseUrl, HttpClient httpClient, io.opentelemetry.api.OpenTelemetry openTelemetry) Create a client using a specific OpenTelemetry instance.The SDK creates no exporter and sends no telemetry by itself. Passing an application-owned OpenTelemetry instance makes Inttegro spans use that application's provider and propagators.
-
Client
public Client(String apiKey, String baseUrl, HttpClient httpClient, io.opentelemetry.api.OpenTelemetry openTelemetry, boolean telemetryEnabled) Create a fully configured client, optionally disabling Inttegro instrumentation. -
Client
public Client(String apiKey, String baseUrl, HttpClient httpClient, io.opentelemetry.api.OpenTelemetry openTelemetry, boolean telemetryEnabled, ErrorReporter errorReporter, ErrorReportingPolicy errorReportingPolicy) Create a fully configured client with optional application-owned error reporting.
-
-
Method Details
-
orders
Access the Orders resource for creating, paying, finalizing, and managing orders. Orders represent complete customer transactions from cart to payment to fulfillment.- Returns:
- orders client for order-related operations
-
refunds
Access canonical refund creation, cancellation, lookup, and pagination operations. -
schedules
Access the Schedules resource for scheduled chime lookups and cancellations.- Returns:
- schedules client for schedule-related operations
-
broadcasts
Access the Broadcasts resource for broadcast lookups and cancellations.- Returns:
- broadcasts client for broadcast-related operations
-
chimes
Access the Chimes resource for sending and scheduling notification messages. Chimes are delivered via SMS or email and can be sent immediately or scheduled for later.- Returns:
- chimes client for notification operations
-
otp
Access the OTP resource for initializing and verifying one-time passwords. OTP sessions provide secure verification codes for authentication flows.- Returns:
- OTP client for one-time password operations
-
paymentMethods
Access the Payment Methods resource for tokenizing, verifying, and managing saved payment methods. Payment methods can be reused across orders without requiring customers to re-enter details.- Returns:
- payment methods client for payment method operations
-
payouts
Access the Payouts resource for configuring payout settings and retrieving payout history. Payouts transfer funds from your Inttegro balance to your bank accounts or mobile money.- Returns:
- payouts client for payout operations
-
balanceTransactions
Access the Balance Transactions resource for retrieving transaction history. Balance transactions show all changes to your Inttegro balance including charges, refunds, and fees.- Returns:
- balance transactions client for balance transaction operations
-
balances
Access the Balances resource for retrieving balance snapshots. Balances show available/pending/reserved/refund amounts per currency.- Returns:
- balances client for balance retrieval
-
financialAccounts
Access the Financial Accounts resource for managing bank accounts and mobile money accounts. Financial accounts serve as payout destinations for receiving funds from your balance.- Returns:
- financial accounts client for account operations
-
files
-
fileReferences
-
fileLinks
-
uploadRequests
-
messageTemplates
-
customers
-
prices
-
products
-
purchaseIntents
-
spec
Access the Spec resource for retrieving country specifications and payment capabilities. Specifications define supported payment methods, currencies, and requirements per country.- Returns:
- spec client for specification operations
-
apps
Access application creation, lookup, and update operations. -
keys
-