Getting started with the Open World platform SDK for Python

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

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 Fraud Prevention product to its scopes.

3. Set up Python development environment

Your development environment needs to have Python 3.7 or later. You can use any PyPi dependency manager to configure SDK dependencies for your projects.

requirements.txt
openworld-sdk-python-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.

fraud_prevention_client = FraudPreventionClient(
        ClientConfig(
            key="YOUR_KEY",
            secret="YOUR_SECRET"
        )
    )

(Optional) 4.1. Configure product endpoint URIs

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

client_config: ClientConfig = ClientConfig(
        key=my_key,
        secret=my_secret,
        endpoint="URI",
        request_timeout=10_000
    )

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.

request: OrderPurchaseScreenRequest =
    OrderPurchaseScreenRequest(
        ...
    )

fraud_prevention_client.screen(request)

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!