Skip to main content

Create SwissQR Bill - Payment Generator API

PDF4me Create SwissQR Bill enables you to generate fully compliant SwissQR Bill PDF documents with embedded QR codes, payment information, and professional formatting. The Swiss QR-bill is the official digital payment standard for Switzerland, introduced in June 2020. This API service creates SwissQR Bill documents that comply with the official Swiss QR-bill standard for digital payment processing in Switzerland. The API receives PDF content and payment information through REST API calls, utilizing Base64 encoding for secure PDF transmission. This solution is ideal for Swiss businesses, financial institutions, payment processors, and accounting systems.

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

  • Full SwissQR Bill Compliance: Complete adherence to Swiss QR-bill digital payment standard (June 2020) with validation of all required fields and formatting requirements
  • Automated PDF Generation: Generate comprehensive SwissQR Bill PDF documents with embedded QR codes, payment information, and professional formatting
  • Swiss Banking Standards: Full compliance with Swiss financial regulations, payment processing requirements, and banking infrastructure standards
  • Multi-language Support: Support for English, German, French, and Italian languages
  • Complete Payment Information: Include payment amount, currency, IBAN, creditor details, debtor information, payment references, and billing information
  • Professional Document Formatting: Generate properly formatted SwissQR Bill documents with correct layout, typography, and visual elements ready for digital payment processing

SwissQR Bill Standards

The API generates SwissQR Bill documents that comply with the official Swiss QR-bill standard. SwissQR Bills include structured payment information, creditor details, and embedded QR codes for automated payment processing in Switzerland.

REST API Endpoint

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

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

REST API Parameters

Complete list of parameters for the Create SwissQR Bill 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 Base64JVBERi...
docName*StringPDF file name with .pdf extensioninvoice.pdf
iban*StringSwiss IBAN for the creditorCH0200700110003765824
crName*StringCreditor name or companyTest AG
crAddressType*StringCreditor address type: S (Structured) or K (Combined)S
crStreetOrAddressLine1*StringCreditor street or address line 1Test Strasse
crStreetOrAddressLine2*StringCreditor street number or address line 21
crPostalCode*StringCreditor postal code8000
crCity*StringCreditor cityZurich
amount*StringPayment amount (without leading zeroes)1000
currency*StringCurrency: CHF, EUR, or USDCHF
udName*StringUltimate debtor name or companyTest Debt AG
udAddressType*StringUltimate debtor address type: S (Structured) or K (Combined)S
udStreetOrAddressLine1*StringUltimate debtor street or address line 1Test Deb Strasse
udStreetOrAddressLine2*StringUltimate debtor street number or address line 22
udPostalCode*StringUltimate debtor postal code8000
udCity*StringUltimate debtor cityZurich
referenceType*StringReference type: QRR (QR reference), NON (No reference), or SCOR (Creditor reference)NON
languageType*StringLanguage for the QR bill: English, German, French, or ItalianEnglish
seperatorLine*StringSeparator line style: LineWithScissor, DashedLineWithScissor, or SolidLineLineWithScissor
async*BooleanEnable asynchronous processing. When true, the API returns a 202 status and provides a polling URL in the Location headertrue

Output

The PDF4me Create SwissQR Bill REST API returns different responses based on the processing mode. The API returns the PDF as a Base64-encoded string in JSON format, not as binary data.

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:

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

Response Fields:

  • docName (string): The output PDF file name
  • docContent (string): The SwissQR Bill PDF file, encoded as Base64 string

How to Use:

  1. Extract the docContent field from the JSON response
  2. Decode the Base64 string to get the binary PDF data
  3. Save or process the PDF file as needed

Example (JavaScript):

const response = await fetch(url, options);
const data = await response.json();
const pdfBytes = atob(data.docContent); // Decode Base64
// Save or process pdfBytes

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",
"iban": "CH0200700110003765824",
"crName": "Test AG",
"crAddressType": "S",
"crStreetOrAddressLine1": "Test Strasse",
"crStreetOrAddressLine2": "1",
"crPostalCode": "8000",
"crCity": "Zurich",
"amount": "1000",
"currency": "CHF",
"udName": "Test Debt AG",
"udAddressType": "S",
"udStreetOrAddressLine1": "Test Deb Strasse",
"udStreetOrAddressLine2": "2",
"udPostalCode": "8000",
"udCity": "Zurich",
"referenceType": "NON",
"languageType": "English",
"seperatorLine": "LineWithScissor",
"async": true
}

Code Samples

The PDF4me Create SwissQR Bill 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 creating SwissQR Bill documents:

Industry Use Cases & Applications

Finance & Banking Use Cases

  • Invoice Processing: Generate SwissQR Bill documents for automated invoice processing and payment collection
  • Swiss Banking Integration: Generate compliant SwissQR Bills for integration with Swiss banking systems
  • Banking Applications: Generate SwissQR Bills for Swiss banking applications and payment systems
  • Payment Automation: Create SwissQR Bills for streamlined payment workflows and digital payment processing
  • Payment Reconciliation: Generate SwissQR Bills for automated payment matching and reconciliation
  • Financial Reporting: Create SwissQR Bills for financial reporting and payment tracking

SwissQR Bill Standards

The API generates SwissQR Bill documents that comply with the official Swiss QR-bill standard (June 2020). SwissQR Bills include:

  • Structured Payment Information: Payment amount, currency, IBAN, and payment references
  • Creditor Details: Complete creditor information including name, address, and postal code
  • Debtor Information: Ultimate debtor details for payment processing
  • Embedded QR Codes: Automated QR codes for digital payment processing
  • Professional Formatting: Proper layout, typography, and visual elements ready for banking

Get Help