Generate a PSB API client in any language with OpenAPI Generator or NSwag. Download swagger.json and set up OAuth2 token management.
The PSB API is fully described as an OpenAPI 3.0 specification. If you work in a language without an official SDK (Python, Java, TypeScript, Go, Ruby, and so on), generate a typed client from swagger.json.
The current specification is available via:
swagger.json via the button at the tophttps://psb.econnect.eu/swagger/v1/swagger.jsonIn some environments a subscription key is required as a query parameter:
https://psb.econnect.eu/v1/swagger.json?subscriptionKey={your-subscription-key}
The PSB documentation on psb.econnect.eu describes this pattern in the SDK examples.
Install OpenAPI Generator CLI and choose a generator (-g) for your language:
openapi-generator-cli generate \
-i https://psb.econnect.eu/swagger/v1/swagger.json \
-g java \
-o ./psb-client-java
Other common generators:
-g)pythontypescript-axiosgorubyphpcsharpOpenAPI Generator supports more than 50 languages. See the generator list for options per language.
The PHP SDK repository shows codegen with a custom package name:
openapi-generator-cli generate \
-g php \
-i "https://psb.econnect.eu/v1/swagger.json?subscriptionKey={your-subscription}" \
-o ./psb-client-php \
--additional-properties=invokerPackage=EConnect\\Psb
For .NET projects, NSwag is an alternative alongside the official EConnect.Psb package:
nswag openapi2csclient /input:https://psb.econnect.eu/swagger/v1/swagger.json /output:PsbClient.cs
EConnect.Psb additionally provides DI registration, token management and webhook validation that a pure codegen client does not have.
Generated clients do not include OAuth2 token management by default. You implement yourself:
POST /connect/token on the Identity ServerAuthorization headerhttps://accp-identity.econnect.eu/connect/tokenhttps://identity.econnect.eu/connect/tokenSee Authentication for the Client Credentials and Resource Owner flows.
Example with curl (basis for your own token logic):
TOKEN=$(curl -s -X POST https://accp-identity.econnect.eu/connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=your-client-id" \
-d "client_secret=your-client-secret" \
-d "scope=ap" | jq -r '.access_token')
In production, cache the token and refresh it only shortly before expiry — not on every API request.
During development the Swagger UI is useful to:
For PHP and .NET, official SDKs are available with token management and examples. Codegen is the standard route for other languages, or when you want full control over the generated code.
Regenerate the client when eConnect rolls out a new API version. Compare swagger.json periodically with your current version. Breaking changes are usually communicated via release notes and the PSB documentation.