import splitit

username, password, api_key = (
    "username",
    "password",
    "api_key",
)

api_client = splitit.ApiClient(splitit.Configuration(username, password, api_key, sandbox=True))


def update_installment_plan(ipn):
    resp = api_client.InstallmentPlanApi.installment_plan_update(
        splitit.UpdateInstallmentPlanRequest(
            installment_plan_number=ipn,
            plan_data=splitit.PlanData(
                ref_order_number="abc123",
                extended_params={
                    "key1": "value1",
                    "key2": "value2",
                }
            )
        )
    )
    return resp
import splitit

username, password, api_key = (
    "username",
    "password",
    "api_key",
)

api_client = splitit.ApiClient(
    splitit.Configuration(username, password, api_key, sandbox=True))

# Example of login request. Ususally SDK performs it automatically
# when needed (if SessionID is missing or expired)


def login():
    resp = api_client.LoginApi.login_post(
        splitit.LoginRequest(
            user_name=username,
            password=password,
        ))
    return resp