Create a new legal entity connected to the KSeF test environment (not available for production API)
POST/legal-entities/setup-for-testing
This endpoint provisions a new legal entity within the KSeF TEST environment. It is intended exclusively for testing and integration‑validation scenarios and has no equivalent in the production & pre-production API.
The operation may require several seconds to complete due to multiple background interactions with the KSeF TEST infrastructure.
Upon successful execution, the endpoint returns the following identifiers:
- jpgNip — a randomly generated NIP representing a sole proprietorship (jednoosobowa działalność gospodarcza) registered in the TEST KSeF environment.
- jpgPesel — a randomly generated PESEL associated with the above sole proprietorship, intended primarily for edge‑case and identity‑linking tests.
- enforcementNip — a randomly generated NIP representing a standard legal entity, configured with appropriate permissions over the entities listed above (e.g., read or supervisory access).
All generated identifiers are permanently bound to the KSeF TEST environment. Their associations, permissions, and registration metadata cannot be modified or migrated to different environment.
Request
Responses
- 201
- 204
- 400
- 403
- 404
- 422
Test legal entity with KSeF connection created.
LegalEntity resource created
Invalid input
Current user is not allowed to setup legal entity.
Cannot use this endpoint in selected environment.
Unprocessable entity