# Introduction div div ⏱ 5 min div 👤 Onboarding Developer Team (Alexandre S.) The Ratepay Java SDK provides a single-typed client for integrating with Ratepay's [Payment API 2.0](https://docs.ratepay.com/docs/developer/api_integration/payment_2.0/payment_api_2.0) using Java or Kotlin. Use the SDK to authorize, capture, cancel, and refund payments without manually handling HTTP requests, OAuth authentication, or JSON serialization. The SDK is available on Maven as `com.ratepay.sdk:ratepay-sdk-core`. All code examples are provided in both Java and Kotlin. ## Key features * **Simplified API integration:** Use a single, thread-safe `RatepayClient` to interact with Ratepay's [Payment API 2.0](https://docs.ratepay.com/docs/developer/api_integration/payment_2.0/payment_api_2.0). See [Client configuration](/docs/developer/sdk/client/client-configuration). * **Automatic authentication:** The SDK manages OAuth2 access tokens, including retrieval and renewal. See [Authentication](/docs/developer/sdk/client/authentication). * **Type-safe responses:** Handle payment outcomes such as `Accepted`, `Declined`, and `OtpRequired` without relying on exceptions for expected business outcomes. * **Structured error handling:** Identify and handle authentication, validation, network, and other API errors using dedicated exception subtypes. See [Exception hierarchy](/docs/developer/sdk/errors-and-resilience/exception-hierarchy). * **Idempotency support:** Use idempotency keys to safely retry supported payment operations. See [Idempotency and retries](/docs/developer/sdk/errors-and-resilience/idempotency-and-retries). * **Testable design:** Mock or extend the client interface to support unit testing, logging, and monitoring. See [Testing overview](/docs/developer/sdk/testing/testing-overview). ## Payment lifecycle | Operation | Description | | --- | --- | | `authorize` | Authorize a payment for a customer's order. | | `capture` | Capture an authorized payment, typically when an order is shipped or confirmed. | | `incrementalAuthorize` | Increase the authorized amount before capture. | | `cancel` | Cancel an authorization that has not been captured. | | `refund` | Refund a previously captured payment. | | `sendShippingInformation` | Add shipping and tracking details to a capture. | ## Before you start To use the SDK, you'll need: - **Runtime:** Java 17 or later, built with Maven 3.9+ or Gradle. See [Compatibility](/docs/developer/sdk/getting-started/compatibility). - **Credentials:** an OAuth client ID and secret per environment. - **Environments:** use `Environment.INTEGRATION` for testing and `Environment.PRODUCTION` for live transactions. They use separate credentials. div div Credentials div Individual credentials will be provided by your Ratepay representative. div select option Test option Live div div div Client ID Client Secret div div div p strong Client ID: span You will receive this via your Ratepay representative. p strong Client Secret: span You will receive this via your Ratepay representative. script document.getElementById('env').addEventListener('change', function() { const isTest = this.value === 'test'; document.getElementById('block-test').style.display = isTest ? 'block' : 'none'; document.getElementById('block-live').style.display = isTest ? 'none' : 'block'; }); ## Get started Ready to integrate Ratepay into your application? Follow the [Getting started](/docs/developer/sdk/getting-started/installation) guide to install the SDK, configure your client, and process your first test payment.