Python SDK
A typed Python client for the EPR API. One method per operation, API-key sign-in, safe retries and a sandbox mode.
Install and sign in
The package is called instica-epr. It needs Python 3.10 or later and the requests library, nothing else. Create an API key in the app with only the scopes you need, then pass it to the client or set INSTICA_EPR_API_KEY.
Keys that start with ik_test_ are for the sandbox, which uses the same address as production with separate data. Create the client with sandbox=True to make it refuse any other key, so a test script cannot touch live data by mistake.
Calling operations
Every operation in the OpenAPI document is a method named after its operation id. Path parameters are positional, query parameters go in params, and request bodies go in json (or data and files for uploads). The package ships its type hints.
client.paginate(client.get_skus) walks cursor pages for you. client.upload_csv(path, preset="volumes") uploads a file as an import job and waits for it to finish.
- Every POST carries an Idempotency-Key, reused on retries, so a retry after a network error never repeats the write. Pass idempotency_key to choose your own.
- Pass if_match with a previous response (or an ETag string) to PATCH, PUT and DELETE. A stale tag raises PreconditionFailedError.
- A 429 is retried after the Retry-After wait. When the limit still holds after the retries, RateLimitError carries the wait.
- Errors map to classes such as AuthenticationError, PermissionDeniedError, ValidationError (with the field list) and ServerError. Each keeps the request id for support.
Keeping it current
The methods are generated from the published OpenAPI document, and a test fails when the two drift apart. When the API gains an operation, a new release of the package adds the method.
Instica measures, estimates and prepares. You review, sign and submit. Nothing here replaces advice from your counsel.