KSeF.Dev
integration						POST /integrations endpoint. Specify tax number and name for the integration. You can specify integration starting date (if not specified, default is current time). You can specify webhook url for notification delivery (if not specified, notifications can be obtained from POST /notifications/receive endpoint)						Exemplary call:
				
					curl -X 'POST' \
  'https://api.ksef.dev/integrations' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ' \
  -H 'Content-Type: application/json' \
  -d '{
  "taxNo": "1111111111",
  "name": "exemplary name",
  "startingDateTime": "2023-01-01T00:00:00",
  "webhook": {
    "url": "https://exemplary.delivery-endpoint.pl/tax-no/1111111111"
  }
}'  
				
			
		The call returns id of created integration.
2. Provide necessary information to complete the integration. It can be either KSeF token or signed challenge file.
Exemplary call:
				
					curl -X 'POST' \
  'https://api.ksef.dev/integrations//auth/signature/create-file-to-sign' \
  -H 'accept: application/xml' \
  -H 'Content-Type: application/json' \
  -d '{
  "environment": "Prod"
}'  
				
			
		The call returns content of XML file to sign.
b. Sign the file. You can use government official Signer application: https://moj.gov.pl/nforms/signer/upload?xFormsAppName=SIGNER&xadesPdf=true
Exemplary call:
				
					curl -X 'POST' \
  'https://api.ksef.dev/integrations//auth/signature/upload-signed-file' \
  -H 'accept: */*' \
  -H 'Content-Type: application/octet-stream' \
  --data-binary '@response_1698086003508.xml'  
				
			
		This operations completes the integration creation.
Exemplary call:
				
					curl -X 'POST' \
  'https://api.ksef.dev/integrations//auth/token' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "insertYourTokenHere",
  "environment": "Prod"
}'  
				
			
		This operation is followed up by token asynchronous token verification. After it’s completed, the integration is active. ksef.dev sends notification after verification is completed via chosen notification channel (webhook or notifications endpoint).
Alternatively users can use our widget created to guide them through the integration creation process.
1. First step is creation of the integration the same way as in the API way, since this operations requires users credentials.
Exemplary call:
				
					curl -X 'POST' \
  'https://api.ksef.dev/integrations' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ' \
  -H 'Content-Type: application/json' \
  -d '{
  "taxNo": "1111111111",
  "name": "exemplary name",
  "startingDateTime": "2023-01-01T00:00:00",
  "webhook": {
    "url": "https://exemplary.delivery-endpoint.pl/tax-no/1111111111"
  }
}'  
				
			
		The call returns id of created integration.
2. For such integration id, you can start our widget:
https://widget.ksef.dev/?integration-id=<YOUR INTEGRATION ID>
Alternatively you can also start widget without specifying the integration id and provide at the first step of the widget
3. Choose authorization option and environment:
															a. For signature option, choose either your option (profil zaufany or podpis kwalifikowany) and follow the instructions: download the file, sign it and upload again
															b. For token option follow the instructions: generate token in KSeF web application and paste the token to the widget:
															4. After submition verification process begins. The widget can be closed, the verification process runs in background
															5. After successful verification, the widget informs about the outcome
															In order to obtain user credentials contact our sales team.
1. Prepare XML payload which complies with the specified XSD schema. Refer to the KSeF documentation for the required XML structure.
Exemplary call:
				
					
	
		FA 
		2 
		2022-01-01T00:00:00Z 
		SamploFaktur 
	 
	
		
			9999999999 
			ABC AGD sp. z o. o. 
		 
		
			PL 
			ul. Kwiatowa 1 m. 2 
			00-001 Warszawa 
		 
		
			abc@abc.pl 
			667444555 
		 
	 
	
		
			1111111111 
			F.H.U. Jan Kowalski 
		 
		
			PL 
			ul. Polna 1 
			00-001 Warszawa 
		 
		
			jan@kowalski.pl 
			555777999 
		 
		fdfd778343 
	 
	
		PLN 
		2022-02-15 
		Warszawa 
		FV2022/02/150 
		2022-01-27 
		1666.66 
		383.33 
		0.95 
		0.05 
		2051 
		
			2 
			2 
			2 
			2 
			
				1 
			 
			
				1 
			 
			2 
			
				1 
			 
		 
		VAT 
		1 
		
			preferowane godziny dowozu 
			dni robocze 17:00 - 20:00 
		 
		
			1 
			aaaa111133339990 
			lodówka Zimnotech mk1 
			szt. 
			1 
			1626.01 
			1626.01 
			23 
		 
		
			2 
			aaaa111133339991 
			wniesienie sprzętu 
			szt. 
			1 
			40.65 
			40.65 
			23 
		 
		
			3 
			aaaa111133339992 
			promocja lodówka pełna mleka 
			szt. 
			1 
			0.95 
			0.95 
			5 
		 
		
			1 
			2022-01-27 
			6 
		 
		
			
				2022-01-26 
				4354343 
			 
		 
	 
	
		
			Kapiał zakładowy 5 000 000 
		 
		
			0000099999 
			999999999 
			000099999
		 
	 
  
				
			
		2. Dispatch invoice
Exemplary call:
				
					curl -X 'POST' \
  'https://api.ksef.dev/integrations/{YOUR_INTEGRATION_ID}/invoice-dispatches/single' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ' \
  -H 'Content-Type: application/xml' \
	-d '
  
      
   '  
				
			
		The call returns
				
					{
    integrationId: ,
		environment: "Demo",
    hash: "nIuRQWP6z68cpEeNzB21bBad6irm32VndruhfYDmca8="
}  
				
			
		KSeF.dev short description