Getting started with the Open World plaform SDK for Java

This section provides information about how to set up and use the Open World platform SDK for Java.

1. Sign up for a partner account

Before you can access any API endpoint, you would need to sign up for a Partner account using the Console.

2. Create API credentials

In the console, API endpoints are organized into a catalog of products. In the Product Catalog, search for Fraud Prevention and add it to your partner account. You can then create an API key and add the appropriate Fraud Prevention scopes to it.

3. Set up Java development environment

Your development environment needs to have Java 8 or later. You can use Apache Maven or Gradle to configure SDK dependencies for your projects.

Maven
<project>
    <dependencies>
        <dependency>
            <groupId>com.expediagroup.openworld.sdk</groupId>
            <artifactId>openworld-java-sdk-fraudprevention</artifactId>
            <!-- version -->
        </dependency>
    </dependencies>
</project>
Gradle
dependencies {
    implementation 'com.expediagroup.openworld.sdk:openworld-java-sdk-fraudprevention'
}

4. Create a service client and configure credentials

All API requests must be authenticated using your API key and secret. Create a FraudPreventionClient and configure it with your credentials.

FraudPreventionClient fraudPreventionClient =
    FraudPreventionClient
        .builder()
        .key("KEY")
        .secret("SECRET")
        .build();

(Optional) 4.1. Configure endpoint and request timeout

The service client can also be configured with an endpoint and request timeout (in milliseconds) to override the default values.

FraudPreventionClient fraudPreventionClient =
    FraudPreventionClient
        .builder()
        .key("KEY")
        .secret("SECRET")
        .endpoint("ENDPOINT")
        .requestTimeout(10000)
        .build();

5. Build request object and make API calls

Build your request object using the classes defined in the SDK, and use the service client to make the API call using it.

OrderPurchaseScreenRequest request =
    OrderPurchaseScreenRequest
        .builder()
         /* ... */
        .build();

You can find usage examples here

Did you find this page helpful?
How can we improve this content?
Thank you for helping us improve Developer Hub!