{"openapi":"3.1.0","info":{"title":"Integrator API","description":"API for integrators onboarding their participants and managing OAuth2 clients\nused to send and receive documents on behalf of those participants.\n","version":"1.0.0"},"servers":[{"url":"https://test-sapisk.datahosting.sk"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Integrator Participants","description":"Integrator participant onboarding webhooks."},{"name":"Integrator Clients","description":"Integrator OAuth2 client management."},{"name":"Integrator Document Summary","description":"Monthly billing document counts per participant."}],"paths":{"/v1/integrators/{integratorId}/clients/{clientId}/secret":{"put":{"tags":["Integrator Clients"],"summary":"Rotate OAuth2 client secret","description":"Immediately replaces the client secret. Existing access tokens remain valid until expiration.","operationId":"rotateClientSecret","parameters":[{"name":"integratorId","in":"path","required":true,"schema":{"type":"string"}},{"name":"clientId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IntegratorClientSecretResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"401":{"description":"Authentication error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"403":{"description":"Authorization error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}}},"security":[{"integratorToken":[]}]}},"/v1/integrators/{integratorId}/clients/{clientId}/participants":{"put":{"tags":["Integrator Clients"],"summary":"Replace OAuth2 client participant access","description":"Replaces the complete list of participants and send/receive permissions for the client.","operationId":"replaceParticipantAccess","parameters":[{"name":"integratorId","in":"path","required":true,"schema":{"type":"string"}},{"name":"clientId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegratorClientParticipantAccessUpdateRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IntegratorClientResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"401":{"description":"Authentication error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"403":{"description":"Authorization error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"409":{"description":"Conflict with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}}},"security":[{"integratorToken":[]}]}},"/v1/integrators/{integratorId}/pds/subjects":{"post":{"tags":["Integrator Participants"],"summary":"Receive participant onboarding webhook","description":"Receives the same PDS subject payload as the FS webhook for a specific integrator.","operationId":"receiveSubjects","parameters":[{"name":"integratorId","in":"path","description":"Integrator identifier.","required":true,"schema":{"type":"string"},"example":"moneyerp"},{"name":"X-PDS-Secret","in":"header","description":"SHA-512 signature of the raw request body using the integrator webhook secret.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Array of PDS subjects to onboard for the integrator.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PdsSubjectRequest"}}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PdsSubjectResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"401":{"description":"Authentication error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"409":{"description":"Conflict with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"503":{"description":"Service temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}}},"security":[{"integratorSecretSignature":[]}]}},"/v1/integrators/{integratorId}/participants/{participantId}/activations":{"post":{"tags":["Integrator Participants"],"summary":"Request participant contract activation","operationId":"activate","parameters":[{"name":"integratorId","in":"path","required":true,"schema":{"type":"string"}},{"name":"participantId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Unique UUID key for idempotent execution.","required":true,"schema":{"type":"string","format":"uuid"},"example":"550e8400-e29b-41d4-a716-446655440000"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantActivationRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ParticipantActivationResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"401":{"description":"Authentication error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"403":{"description":"Authorization error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"409":{"description":"Conflict with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}}},"security":[{"integratorToken":[]}]}},"/v1/integrators/{integratorId}/clients":{"get":{"tags":["Integrator Clients"],"summary":"List OAuth2 clients","description":"Returns a cursor-paginated list of integrator OAuth2 clients ordered by creation time.","operationId":"listClients","parameters":[{"name":"integratorId","in":"path","description":"Integrator identifier.","required":true,"schema":{"type":"string"},"example":"moneyerp"},{"name":"pageToken","in":"query","description":"Opaque cursor token for the next page. Obtained from nextPageToken.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of records to return per page.","required":false,"schema":{"type":"integer","format":"int32"},"example":20},{"name":"status","in":"query","description":"Filter by OAuth2 client status.","required":false,"schema":{"type":"string","enum":["APPROVED","DELETED"]}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IntegratorClientListResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"401":{"description":"Authentication error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"403":{"description":"Authorization error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}}},"security":[{"integratorToken":[]}]},"post":{"tags":["Integrator Clients"],"summary":"Create OAuth2 client","description":"Creates an approved OAuth2 client with explicit send/receive access to the requested integrator participants.","operationId":"createClient","parameters":[{"name":"integratorId","in":"path","description":"Integrator identifier.","required":true,"schema":{"type":"string"},"example":"moneyerp"},{"name":"Idempotency-Key","in":"header","description":"Unique UUID key for idempotent execution.","required":true,"schema":{"type":"string","format":"uuid"},"example":"550e8400-e29b-41d4-a716-446655440000"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegratorClientCreateRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IntegratorClientCreateResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"401":{"description":"Authentication error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"403":{"description":"Authorization error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"409":{"description":"Conflict with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}}},"security":[{"integratorToken":[]}]}},"/v1/integrators/{integratorId}/participants":{"get":{"tags":["Integrator Participants"],"summary":"List participants belonging to the integrator","operationId":"list","parameters":[{"name":"integratorId","in":"path","required":true,"schema":{"type":"string"}},{"name":"pageToken","in":"query","description":"Opaque cursor token for the next page. Obtained from nextPageToken.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of records to return per page.","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IntegratorParticipantListResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"401":{"description":"Authentication error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"403":{"description":"Authorization error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}}},"security":[{"integratorToken":[]}]}},"/v1/integrators/{integratorId}/document-summary":{"get":{"tags":["Integrator Document Summary"],"summary":"Get participant billing document counts for a month","operationId":"getSummary","parameters":[{"name":"integratorId","in":"path","required":true,"schema":{"type":"string"}},{"name":"month","in":"query","description":"Billing month in yyyyMM format.","required":true,"schema":{"type":"string"},"example":202610}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IntegratorDocumentSummaryResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"401":{"description":"Authentication error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"403":{"description":"Authorization error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}}},"security":[{"integratorToken":[]}]}},"/v1/integrators/{integratorId}/clients/{clientId}":{"get":{"tags":["Integrator Clients"],"summary":"Get OAuth2 client metadata","operationId":"getClient","parameters":[{"name":"integratorId","in":"path","description":"Integrator identifier.","required":true,"schema":{"type":"string"},"example":"moneyerp"},{"name":"clientId","in":"path","description":"OAuth2 client identifier.","required":true,"schema":{"type":"string"},"example":"client_abc123"}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IntegratorClientResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"401":{"description":"Authentication error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"403":{"description":"Authorization error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}}},"security":[{"integratorToken":[]}]},"delete":{"tags":["Integrator Clients"],"summary":"Delete OAuth2 client","description":"Marks the integrator OAuth2 client as deleted.","operationId":"deleteClient","parameters":[{"name":"integratorId","in":"path","description":"Integrator identifier.","required":true,"schema":{"type":"string"},"example":"moneyerp"},{"name":"clientId","in":"path","description":"OAuth2 client identifier.","required":true,"schema":{"type":"string"},"example":"client_abc123"}],"responses":{"204":{"description":"No Content"},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"401":{"description":"Authentication error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"403":{"description":"Authorization error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SapiErrorResponseEnvelope"}}}}},"security":[{"integratorToken":[]}]}}},"components":{"schemas":{"IntegratorClientSecretResponse":{"type":"object","properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"}}},"IntegratorClientParticipantAccess":{"type":"object","properties":{"participant_id":{"type":"string"},"can_send":{"type":"boolean"},"can_receive":{"type":"boolean"}}},"IntegratorClientParticipantAccessUpdateRequest":{"type":"object","properties":{"participants":{"type":"array","items":{"$ref":"#/components/schemas/IntegratorClientParticipantAccess"}}}},"IntegratorClientResponse":{"type":"object","properties":{"client_id":{"type":"string"},"client_name":{"type":"string"},"status":{"type":"string","enum":["APPROVED","DELETED"]},"created_at":{"type":"string","format":"date-time"},"approved_at":{"type":"string","format":"date-time"},"participants":{"type":"array","items":{"$ref":"#/components/schemas/IntegratorClientParticipantAccess"}}}},"PdsSubjectRequest":{"type":"object","description":"PDS subject participant onboarding payload.","properties":{"created":{"type":"string","format":"date-time","description":"Source creation timestamp.","example":"2026-07-08T10:15:30Z"},"dic":{"type":"string","description":"Slovak tax identifier used to derive the participant ID.","example":"2022706466"},"legalName":{"type":"string","description":"Legal company name.","example":"Example Company s.r.o."},"company_email":{"type":"string","description":"Company contact email.","example":"info@example.sk"},"company_phone":{"type":"string","description":"Company contact phone number.","example":"+421900123456"},"verification_token":{"type":"string","description":"Verification token used for SMP registration.","example":"verification-token"}}},"PdsSubjectResponse":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"description":{"type":"string"}}},"ParticipantActivationRequest":{"type":"object","properties":{"mode":{"type":"string","enum":["SEND_ONLY","SEND_AND_RECEIVE"]},"requested_by_user_id":{"type":"string","format":"uuid"}},"required":["mode"]},"ParticipantActivationResponse":{"type":"object","properties":{"activation_id":{"type":"string"},"participant_id":{"type":"string"},"integrator_id":{"type":"string"},"mode":{"type":"string","enum":["SEND_ONLY","SEND_AND_RECEIVE"]},"status":{"type":"string"},"requested_at":{"type":"string","format":"date-time"}}},"IntegratorClientCreateRequest":{"type":"object","properties":{"name":{"type":"string"},"contact_email":{"type":"string"},"participants":{"type":"array","items":{"$ref":"#/components/schemas/IntegratorClientParticipantAccess"}}}},"IntegratorClientCreateResponse":{"type":"object","properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"client_name":{"type":"string"},"status":{"type":"string","enum":["APPROVED","DELETED"]},"participants":{"type":"array","items":{"$ref":"#/components/schemas/IntegratorClientParticipantAccess"}}}},"IntegratorParticipantListResponse":{"type":"object","properties":{"participants":{"type":"array","items":{"$ref":"#/components/schemas/IntegratorParticipantResponse"}},"nextPageToken":{"type":"string"}}},"IntegratorParticipantResponse":{"type":"object","properties":{"participant_id":{"type":"string"},"dic":{"type":"string"},"legal_name":{"type":"string"},"company_email":{"type":"string"},"company_phone":{"type":"string"},"source_created_at":{"type":"string","format":"date-time"},"received_at":{"type":"string","format":"date-time"},"internal_transfer_required":{"type":"boolean"},"is_owner":{"type":"boolean"},"active_contract_mode":{"type":"string","enum":["SEND_ONLY","SEND_AND_RECEIVE"]}}},"IntegratorDocumentSummaryResponse":{"type":"object","properties":{"month":{"type":"string","description":"Billing month in yyyyMM format.","example":"202610"},"participants":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantDocumentSummaryResponse"}}}},"ParticipantDocumentSummaryResponse":{"type":"object","properties":{"participant_id":{"type":"string","example":"0245:2022706466"},"sent":{"type":"integer","format":"int64","description":"Successfully sent billing documents.","example":85},"received":{"type":"integer","format":"int64","description":"Successfully received billing documents.","example":120}}},"IntegratorClientListResponse":{"type":"object","properties":{"clients":{"type":"array","items":{"$ref":"#/components/schemas/IntegratorClientResponse"}},"nextPageToken":{"type":"string"}}},"SapiError":{"description":"Structured SAPI error object for machine-readable error handling, retry behaviour, and diagnostics.","properties":{"category":{"type":"string","description":"Error category.","enum":["AUTH","VALIDATION","PROCESSING","TEMPORARY","PERMANENT"],"example":"VALIDATION"},"code":{"type":"string","description":"Stable implementation-independent error code.","example":"SAPI-VAL-001"},"message":{"type":"string","description":"Human-readable summary of the error.","example":"Document payload is invalid"},"details":{"type":"array","description":"Optional field-level or contextual information to aid diagnostics.","items":{"$ref":"#/components/schemas/SapiErrorDetail"}},"retryable":{"type":"boolean","description":"Explicit indicator whether the request may be retried without modification.","example":false},"correlation_id":{"type":"string","format":"uuid","description":"Identifier used for tracing, logging, and support.","example":"550e8400-e29b-41d4-a716-446655440000"}},"required":["category","code","correlation_id","message","retryable"]},"SapiErrorDetail":{"description":"Field-level or contextual error detail.","properties":{"field":{"type":"string","description":"Field that caused the error.","example":"document.type"},"issue":{"type":"string","description":"Description of the issue.","example":"Unsupported value"},"value":{"type":"string","description":"Invalid value that was provided."}}},"SapiErrorResponseEnvelope":{"description":"SAPI error response envelope. All API error responses use this consistent structure.","properties":{"error":{"$ref":"#/components/schemas/SapiError"}},"required":["error"]}},"securitySchemes":{"bearerAuth":{"type":"http","description":"JWT access token from /sapi/auth/token","scheme":"bearer","bearerFormat":"JWT"},"integratorToken":{"type":"apiKey","description":"Integrator API token.","name":"X-Integrator-Token","in":"header"},"integratorSecretSignature":{"type":"apiKey","description":"SHA-512 signature of the raw request body using the integrator webhook secret.","name":"X-PDS-Secret","in":"header"}}}}