Skip to main content

Read SwissQR Code - Payment Data Extractor API

PDF4me Read SwissQR Code enables you to extract and read SwissQR codes from PDF documents using advanced OCR and barcode recognition technology. This API service processes PDF files and extracts structured payment information including amounts, currency, IBAN, creditor details, and payment references for seamless digital payment processing. The API receives PDF content through REST API calls, utilizing Base64 encoding for secure transmission. This solution is ideal for invoice processing, banking integration, payment automation, and financial reporting.

Authenticating Your API Request

To access the PDF4me REST API, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user of the REST API.

Key Features

  • SwissQR Code Recognition: Extract and read SwissQR codes from PDF documents using advanced OCR and barcode recognition technology
  • Structured Payment Data: Extract structured payment information including amounts, currency, IBAN, creditor details, and payment references
  • Swiss Payment Standard: Support for Swiss QR-bill digital payment standard (June 2020)
  • Asynchronous Processing: Support for async processing with polling for long-running operations

SwissQR Code Support

The API supports reading SwissQR codes from PDF documents. SwissQR codes contain structured payment information including amount, currency, IBAN, creditor details, and payment references. The extracted data is returned in a standardized format for integration with payment processing systems.

REST API Endpoint

The PDF4me REST API uses standard HTTP methods to interact with resources. All SwissQR code reading operations are performed through a single endpoint:

  • Method: POST
  • Endpoint: /api/v2/ReadSwissQRBill

REST API Parameters

Complete list of parameters for the Read SwissQR Code REST API. Parameters are organized by category for better understanding and implementation.

Important: Parameters marked with an asterisk (*) are required and must be provided for the API to function correctly.

Required Parameters

ParameterTypeDescriptionExample
docContent*Base64PDF file content encoded in Base64 containing SwissQR codesJVBERi...
docName*StringPDF file name with .pdf extensioninvoice.pdf
async*BooleanEnable asynchronous processing. When true, the API returns a 202 status and provides a polling URL in the Location headertrue

Output

The PDF4me Read SwissQR Code REST API returns different responses based on the processing mode. The API returns structured JSON data with SwissQR code information.

Synchronous Processing (Default)

When async is not set or set to false, the API processes the request immediately:

Status Code: 200 OK

Content-Type: application/json

Response Body:

{
"fileName": "invoice.pdf",
"mimeType": "application/pdf",
"fileSize": 2456789,
"success": true,
"swissQrCodeData": {
"amount": "100.00",
"currency": "CHF",
"iban": "CH9300762011623852957",
"creditorName": "Swiss Company AG",
"paymentReference": "INV-2024-001",
"dueDate": "2024-12-31",
"purpose": "Invoice payment"
}
}

Response Fields:

  • fileName (string): The PDF file name
  • mimeType (string): MIME type of the file (application/pdf)
  • fileSize (number): Size of the PDF file in bytes
  • success (boolean): Indicates if SwissQR code was successfully read
  • swissQrCodeData (object): Extracted SwissQR code payment information
    • amount (string): Payment amount
    • currency (string): Currency code (CHF, EUR, USD)
    • iban (string): IBAN of the creditor
    • creditorName (string): Creditor name or company
    • paymentReference (string): Payment reference number
    • dueDate (string): Payment due date (if available)
    • purpose (string): Payment purpose or description

Example (JavaScript):

const response = await fetch(url, options);
const data = await response.json();
if (data.success) {
console.log(`Amount: ${data.swissQrCodeData.amount} ${data.swissQrCodeData.currency}`);
console.log(`IBAN: ${data.swissQrCodeData.iban}`);
}

Request Example

Content-Type: application/json
Authorization: Basic YOUR_BASE64_ENCODED_API_KEY

Note:

  • Get your API key from the PDF4me Dashboard
  • The API key must be Base64 encoded and prefixed with "Basic " in the Authorization header
  • Example: If your API key is abc123, encode it to Base64 and use Authorization: Basic YWJjMTIz

Payload

Example:

{
"docContent": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovUGFnZXMgMiAwIFIKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL1BhZ2VzCi9LaWRzIFszIDAgUl0KL0NvdW50IDEKPD4KZW5kb2JqCjMgMCBvYmoKPDwKL1R5cGUgL1BhZ2UKL1BhcmVudCAyIDAgUgovTWVkaWFCb3ggWzAgMCA2MTIgNzkyXQovUmVzb3VyY2VzIDw8Ci9Gb250IDw8Ci9GMSA0IDAgUgo+Pgo+PgovQ29udGVudHMgNSAwIFIKPj4KZW5kb2JqCjQgMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvSGVsdmV0aWNhCj4+CmVuZG9iago1IDAgb2JqCjw8Ci9MZW5ndGggNDQKPj4Kc3RyZWFtCkJUCi9GMSAxMiBUZgoxMDAgNzAwIFRkCihIZWxsbyBXb3JsZCkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iagp4cmVmCjAgNgowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDkgMDAwMDAgbiAKMDAwMDAwMDA1NCAwMDAwMCBuIAowMDAwMDAwMTAxIDAwMDAwIG4gCjAwMDAwMDAxNzAgMDAwMDAgbiAKMDAwMDAwMDI0NCAwMDAwMCBuIAp0cmFpbGVyCjw8Ci9TaXplIDYKL1Jvb3QgMSAwIFIKPj4Kc3RhcnR4cmVmCjM0MQolJUVPRg==",
"docName": "invoice.pdf",
"async": true
}

Code Samples

The PDF4me Read SwissQR Code REST API provides code samples in multiple programming languages. Choose the language that best fits your development environment:

C# (CSharp) Sample

Complete C# implementation for reading SwissQR codes from PDF documents:

Industry Use Cases & Applications

Finance & Banking Use Cases

  • Invoice Processing: Extract payment information from Swiss QR invoices for automated payment processing
  • Banking Integration: Integrate SwissQR code reading into banking applications and payment systems
  • Payment Automation: Streamline payment workflows and reduce manual data entry
  • Bill Processing: Automate Swiss QR bill processing and payment verification
  • Payment Reconciliation: Automate payment matching and reconciliation processes
  • Financial Reporting: Extract payment data from Swiss QR codes for financial reporting and analysis

Get Help