Package com.inttegro

Class Client

java.lang.Object
com.inttegro.Client

public class Client extends Object
Main entry point for the Inttegro HTTP API.

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.
  • Field Details

  • Constructor Details

    • Client

      public Client(String apiKey)
      Create a client with the default production base URL.
      Parameters:
      apiKey - secret key from the dashboard (e.g. sk_test_... or sk_live_...)
    • Client

      public Client(String apiKey, ErrorReporter errorReporter)
      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

      public Client(String apiKey, String baseUrl, HttpClient httpClient)
      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 key
      baseUrl - 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

      public Client.OrdersClient 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

      public Client.RefundsClient refunds()
      Access canonical refund creation, cancellation, lookup, and pagination operations.
    • schedules

      public Client.SchedulesClient schedules()
      Access the Schedules resource for scheduled chime lookups and cancellations.
      Returns:
      schedules client for schedule-related operations
    • broadcasts

      public Client.BroadcastsClient broadcasts()
      Access the Broadcasts resource for broadcast lookups and cancellations.
      Returns:
      broadcasts client for broadcast-related operations
    • chimes

      public Client.ChimesClient 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

      public Client.OtpClient 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

      public Client.PaymentMethodsClient 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

      public Client.PayoutsClient 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

      public Client.BalanceTransactionsClient 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

      public Client.BalancesClient 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

      public Client.FinancialAccountsClient 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

      public Client.FilesClient files()
    • fileReferences

      public Client.FileReferencesClient fileReferences()
    • fileLinks

      public Client.FileLinksClient fileLinks()
    • uploadRequests

      public Client.UploadRequestsClient uploadRequests()
    • messageTemplates

      public Client.MessageTemplatesClient messageTemplates()
    • customers

      public Client.CustomersClient customers()
    • prices

      public Client.PricesClient prices()
    • products

      public Client.ProductsClient products()
    • purchaseIntents

      public Client.PurchaseIntentsClient purchaseIntents()
    • spec

      public Client.SpecClient 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

      public Client.AppsClient apps()
      Access application creation, lookup, and update operations.
    • keys

      public Client.KeysClient keys()