Skip to main content

SDKs

Four official clients, generated from the same OpenAPI contract this portal is built from. They cover the whole Data Plane and handle X-API-Key authentication for you.

LanguagePackageMinimum version
Pythonapproute-public-api-sdkPython 3.10+
JavaScript / TypeScript@approute/public-api-sdkNode.js 18+
PHPapproute/public-api-sdkPHP 8.1+
Goapproute/public-api-sdk-goGo 1.21+

All four follow the same shape: method names and models are derived from the operation ids you see in the API Reference, so a snippet translates between languages almost mechanically.

Install

pip install approute-public-api-sdk
npm install @approute/public-api-sdk
composer require approute/public-api-sdk
go get github.com/approute/public-api-sdk-go

Configure

Two things to set: your key, and the regional base URL.

from approute_public_api_sdk import Client

client = Client(
api_key=os.environ["APPROUTE_API_KEY"],
base_url="https://approute.io/api/v1", # or https://approute.ru/api/v1
)

The SDKs default to the international endpoint. Russian clients should pass the .ru base URL explicitly.

:::tip Keep the key server-side The SDKs are backend clients. Do not ship one to a browser bundle — see Authentication. :::

What the SDKs do not decide for you

They send the request and parse the envelope. Everything the Response envelope page warns about still applies:

  • A returned object with status: CANCELLED is a successful call with a failed order. No SDK raises on it.
  • statusCode is for retry/idempotency logic; data[...].status is for business logic.
  • You still choose the referenceId, and reusing it is still what makes a retry safe — see Idempotency.

Version drift

The contract in this portal is generated from the running API and guarded by contract tests on every release, so what you read here matches what the server answers. If an SDK method is missing an endpoint you can see documented, the SDK is behind — upgrade it before working around it.