Lewati ke konten utama

Buat Tagihan SwissQR API

Fungsi dari endpoint ini

PDF4me Buat Tagihan SwissQR menghasilkan Swiss QR slip pembayaran yang sesuai dengan peraturan Swiss QR-standar tagihan (Standar Pembayaran Swiss, SPS) melalui satu REST Telepon. Kirim rincian kreditur dan debitur akhir, IBAN, jumlah, mata uang, jenis referensi, bahasa, gaya pemisah, dan format keluaran.Secara opsional, sertakan dokumen sumber sebagai Base64, ID blob, atau URL untuk menempatkan selip di atas yang sudah ada. PDF. Itu API pengembalian PDF, PNG, JPEG, atau TIFF tergantung pada formatType.

Postingan Blog Terkait
Belum ada postingan blog untuk fitur ini — akan segera hadir.
Sementara itu, jelajahi blog PDF4me untuk menemukan tutorial dan alur kerja di berbagai platform.
Kunjungi blog ini →

Memverifikasi Identitas Anda API Meminta​

Setiap PDF4me REST API panggilan harus menyertakan Anda API kunci di Authorization Header. Buat atau pilih kunci dari dasbor pengembang dan rahasiakan.

Titik akhir​

POS/api/v2/CreateSwissQrBill

Fakta Penting yang Tidak Boleh Anda Lewatkan​

Format IBAN Swiss divalidasi secara ketat.
Kreditur mereka akan pergi harus dimulai dengan CH diikuti oleh 19 digit. Tidak valid IBAN Mengembalikan kesalahan.
Gunakan tipe alamat terstruktur (S) untuk produksi
Mengatur crAddressType Dan udAddressType ke S Jadi, jalan, nomor rumah, kode pos, dan kota disimpan secara terpisah. Tata letak ini diperlukan untuk sebagian besar rekonsiliasi bank Swiss otomatis. Gunakan K (Gabungan) hanya jika Anda tidak dapat memisahkan komponen alamat.
Cocokkan referenceType dengan alur kerja rekonsiliasi Anda.
NON untuk pembayaran tanpa referensi terstruktur. QRR untuk referensi numerik 27 digit pada uang kertas domestik Swiss. SKOR untuk ISO 11649 Referensi kreditur. Sertakan referensi di dalam tubuh saat digunakan QRR atau SCOR.

REST API titik akhir​

Metode: POS
URL: https://api.pdf4me.com/api/v2/CreateSwissQrBill

Mengatur IsAsync ke BENAR (PascalCase) untuk 202 Accepted dan jajak pendapat Lokasi URL dengan GET sampai Anda menerima 200 dan berkas di JSON. Menggunakan PALSU untuk sinkron 200 tanggapan.

Pengaturan permintaan Postman​

PengaturanNilai
MethodPOST
URLhttps://api.pdf4me.com/api/v2/CreateSwissQrBill
HeadersContent-Type: application/json
AuthorizationBasic Auth with your API key, or header Authorization: Basic YOUR_API_KEY
AsyncIf the response is 202, poll the URL in the Location header (GET) until you get 200 and the file bytes (or JSON with document fields, depending on API version).

Parameter​

Selalu diperlukan: mereka akan pergi, crName, crAddressType, crJalanAtauAlamatBaris1, crJalanAtauAlamatBaris2, Kode Pos cr, Kota cr, jumlah, mata uang, udName, udAddressType, udStreetOrAddressLine1, udStreetOrAddressLine2, Kode Pos ud, Kota ud, tipe referensi, Jenis bahasa, garis pemisah, formatType, Dan IsAsync.

Bersyarat: Konten dokumen Dan Nama dokumen saat ditambahkan di atas PDF; referensi Kapan tipe referensi adalah QRR atau SKOR; Opsi penomoran halaman Dan Nomor halaman Kapan formatType adalah PDF.

Opsional: pesan tidak terstruktur, Informasi penagihan, av1, av2, profil.

ParameterDiperlukanApa fungsinya?Contoh
jobIdExtOptionalYour own reference for this call. It is stored with the API call log so you can correlate calls with your jobs. Type: string.
integrationsOptionalIntegration identifiers, forwarded unchanged with the job's notification settings. Type: array.
isAsyncOptionalSet to `true` to process the action asynchronously and get a job to poll at `/api/v2/GetActionStatus`. Only honoured by actions that support asynchronous processing. Type: boolean.true
docNameOptionalSource file name including its extension. Several actions dispatch on the extension, so it should always be set; when omitted a per-action default is used. Type: string.invoice.pdf
docContentRequiredThe source file. Accepts the base64-encoded file content, a `pdf4meblobid://<id>` reference to a previously uploaded blob, or an `https` URL to the source document. Required: an empty value fails with `File is empty`. Type: string.""
docContentBytesOptionalAlternative raw byte payload for the source file. Type: string.
callBackUrlOptionalOptional URL notified when an asynchronous job completes. Type: string.
ibanOptionalIBAN or QR-IBAN of the creditor. Spaces and hyphens are removed. Type: string.CH0200700110003765824
crNameOptionalName of the creditor (payee). Type: string.Test AG
crAddressTypeOptionalMatched case-insensitively; an unrecognised value falls back to the first entry. Type: string.S
crStreetOrAddressLine1OptionalCreditor street (address type `S`) or first address line (address type `K`). Type: string.Test Strasse
crStreetOrAddressLine2OptionalCreditor building number (address type `S`) or second address line with postal code and town (address type `K`). Type: string.1
crPostalCodeOptionalCreditor postal code. Used with address type `S`. Type: string.8000
crCityOptionalCreditor town. Used with address type `S`. Type: string.Zurich
amountOptionalAmount to pay, e.g. `199.95`. Type: string.1000
currencyOptionalMatched case-insensitively; an unrecognised value falls back to the first entry. Type: string.CHF
udNameOptionalName of the ultimate debtor (payer). Type: string.Test Debt AG
udAddressTypeOptionalMatched case-insensitively; an unrecognised value falls back to the first entry. Type: string.S
udStreetOrAddressLine1OptionalDebtor street (address type `S`) or first address line (address type `K`). Type: string.Test Deb Strasse
udStreetOrAddressLine2OptionalDebtor building number (address type `S`) or second address line with postal code and town (address type `K`). Type: string.2
udPostalCodeOptionalDebtor postal code. Used with address type `S`. Type: string.8000
udCityOptionalDebtor town. Used with address type `S`. Type: string.Zurich
referenceTypeOptionalMatched case-insensitively; an unrecognised value falls back to the first entry. Type: string.NON
referenceOptionalPayment reference matching `referenceType`. Spaces and hyphens are removed. Type: string.21000000000313947143000017
unstructuredMessageOptionalFree-text message to the creditor. Type: string.Thank you for your business
billingInfoOptionalStructured billing information for the creditor. Type: string.Invoice for services rendered
av1ParametersOptionalFirst alternative procedure parameter. Type: string.
av2ParametersOptionalSecond alternative procedure parameter. Type: string.
languageTypeOptionalMatched case-insensitively; an unrecognised value falls back to the first entry. Type: string.English
seperatorLineOptionalMatched case-insensitively; an unrecognised value falls back to the first entry. Type: string.LineWithScissor
pageNumberOptionalPage of the input PDF that receives the QR bill. Overridden when `pagingOptions` is `last` or `AddPageAtEnd`. Setting it without `docContent` fails with `File is empty`. Type: integer.1
formatTypeOptionalOutput format: `PDF`, `PNG`, `JPEG`, `Tiff`, `SVG` or `AddPageAtEnd` (adds a new last page to the input PDF for the bill). Defaults to `PDF`. With `PDF` and a `docContent`, the bill is placed on the input PDF; without one, a standalone bill is produced. Type: string.pdf
pagingOptionsOptionalMatched case-insensitively; an unrecognised value falls back to the first entry. Type: string.first

Opsi jenis alamat​

Berlaku untuk crAddressType Dan udAddressType.

S (Terstruktur)Direkomendasikan untuk rekonsiliasi otomatis
Menyimpan alamat jalan, nomor rumah, kode pos, dan kota dalam kolom terpisah. Diperlukan oleh sebagian besar sistem perbankan Swiss untuk rekonsiliasi otomatis.
K (Gabungan)Dua baris alamat bebas bentuk
Menyimpan alamat sebagai dua baris bebas yang digabungkan. Lebih mudah diisi tetapi kurang kompatibel dengan rekonsiliasi otomatis.

Opsi garis pemisah (seperatorLine)​

GarisDenganGunting
Garis potong berlubang dengan simbol gunting. Standar untuk faktur Swiss yang dicetak.
Garis Putus-putus
Garis pemisah putus-putus antara faktur dan slip yang dapat disobek.
Garis Padat
Garis pemisah solid tanpa simbol gunting.

Opsi tipe referensi​

NONTidak ada referensi terstruktur
Pengaturan default untuk pembayaran sederhana. Gunakan pesan tidak terstruktur untuk catatan bentuk bebas sebagai gantinya referensi.
QRRReferensi QR 27 digit
Uang kertas domestik Swiss dengan PostFinance atau bank Swiss IBANsAnda harus mengirim referensi sebagai string numerik 27 digit.
SKORReferensi kreditor ISO 11649
Lintas batas SEPAPencocokan gaya. Kirim referensi di dalam ISO 11649 format (dimulai dengan RF).

Format keluaran (formatType) Dan PDF panggilan​

Kapan formatType adalah PDF, mengatur Opsi penomoran halaman untuk mengontrol di mana QR slip ditempatkan. Untuk keluaran gambar, hilangkan Opsi penomoran halaman atau atur ke batal.

formatType: pdfpagingOptions: first
Place QR slip on the first page.
formatType: pdfpagingOptions: last
Place QR slip on the last page.
formatType: pdfpagingOptions: AddPageAtEnd
Append a new page with the QR slip at the end.
formatType: pdfpagingOptions: custom + pageNumber
Place on a specific page (e.g. pageNumber: 1).
formatType: png | jpeg | tiffpagingOptions: null
No paging; returns image bytes.

Minta contoh​

Contoh A: Mandiri QR tagihan (tanpa masukan) PDF)​

Hilangkan Konten dokumen atau kirim string kosong untuk hanya menghasilkan QR slip pembayaran.

{
"docContent": "",
"docName": "",
"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",
"formatType": "pdf",
"pagingOptions": "first",
"IsAsync": true
}

Contoh B: Hamparan QR pada yang sudah ada PDF (Base64)​

Mengganti Konten dokumen dengan milikmu PDF sebagai Base64 (TIDAK data: awalan).

{
"docContent": "JVBERi0xLjQKJeLjz9MKMy...",
"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",
"formatType": "pdf",
"pagingOptions": "custom",
"pageNumber": 1,
"IsAsync": true
}

Contoh C: Salin-tempel valid JSON​

{
"docContent": "",
"docName": "",
"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",
"formatType": "pdf",
"pagingOptions": "first",
"IsAsync": true
}

Muatan tipe referensi​

Tidak ada referensi (NON):

{ "referenceType": "NON" }

Referensi QR (QRR):

{
"referenceType": "QRR",
"reference": "21000000000313947143000017"
}

Referensi kreditur (SCOR, ISO 11649):

{
"referenceType": "SCOR",
"reference": "RF18539007547034"
}

Cuplikan formatType dan pagingOptions​

{ "formatType": "png", "pagingOptions": null }
{ "formatType": "pdf", "pagingOptions": "last" }
{ "formatType": "pdf", "pagingOptions": "AddPageAtEnd" }
{ "formatType": "pdf", "pagingOptions": "custom", "pageNumber": 1 }

Contoh kode​

Contoh integrasi​

Pola integrasi REST umumTypical ways developers call Create SwissQR Bill.
Ekspor faktur ERP → PDF faktur QR Swiss
  1. Sistem ERP Anda mengekspor data faktur dan file PDF.
  2. Encode PDF ke dalam Base64 Konten dokumen.
  3. Kolom pembayaran POST dengan tipe referensi QRR dan 27 digit referensi.
  4. Dekode Konten dokumen dari respons tersebut dan simpan atau kirim email PDF tagihan QR.
Lapisan slip atau webhook mandiri
  1. Untuk slip yang bisa disobek saja, POST dengan kosong Konten dokumen Dan formatType pdf atau png.
  2. Untuk faktur dari webhook, encode PDF ke dalam format Base64. Konten dokumen, mengatur Opsi penomoran halaman ke terakhir atau kebiasaan, dan kolom pembayaran POST.
  3. Uraikan responsnya Konten dokumen dan mengunggah ke penyimpanan objek atau melampirkannya ke API email.

Pertanyaan yang Sering Diajukan​

Which currencies does the API accept?+
Set currency to CHF for domestic Swiss payments or EUR for cross-border transactions. The amount and currency must match what you print on the slip.
What is the difference between NON, QRR, and SCOR?+
They are values for the referenceType field. NON means no structured reference is encoded in the QR code; you can still add unstructuredMessage such as an invoice number. QRR is for domestic Swiss QR-bills: send reference as a 27-digit numeric string when referenceType is QRR. SCOR follows ISO 11649 (starts with RF); send reference when referenceType is SCOR.
Should I use Structured (S) or Combined (K) addresses?+
Use S (Structured) for almost all production integrations. Set crAddressType to S, put the street in crStreetOrAddressLine1, the house number in crStreetOrAddressLine2, and fill crPostalCode and crCity. Use the same pattern for the ultimate debtor with udAddressType and udStreetOrAddressLine fields. Use K (Combined) only when you cannot split the address into separate fields.
Is docContent required?+
No. Omit docContent or send an empty string to generate a standalone QR payment slip. To embed the slip on an invoice, send docContent as Base64 PDF bytes, a blob id from UploadBlob, or a direct HTTPS URL, and set docName when needed for context.
What do formatType and pagingOptions control?+
formatType sets the output: pdf, png, jpeg, or tiff. When formatType is pdf, pagingOptions chooses where the slip is placed: first page, last page, AddPageAtEnd, or custom with pageNumber. For image formats, omit pagingOptions or set it to null.
What does IsAsync do?+
IsAsync controls how the response is delivered. When IsAsync is false (or omitted in samples that use synchronous mode), a successful call returns HTTP 200 with docName and docContent in one JSON body. When IsAsync is true, the API returns HTTP 202 Accepted and a Location header with a poll URL. Send GET requests to that URL until you receive 200 with the same docName and docContent fields. Use async for large batches or slow networks; use sync for simple request-response scripts.
How do I test the API without writing code?+
Open the Create SwissQR Bill API Tester, paste your API key, then fill payment, creditor, and debtor fields, referenceType, languageType, seperatorLine, and IsAsync. Add docContent only when overlaying on a PDF. Use the parameter table on this page as a checklist.
Is the response binary or Base64?+
The response is always JSON, never a raw application/pdf stream. On success the body contains docName (output filename) and docContent (the full PDF encoded as a Base64 string). Decode docContent in your language (for example Buffer.from in Node.js, base64.b64decode in Python, Convert.FromBase64String in C#) before writing the file. Invalid IBAN, missing required fields, or malformed Base64 in docContent typically produce HTTP 400 with an error message in JSON.
What IBAN format is required?+
The iban field must be a valid Swiss creditor IBAN: CH followed by 19 digits (21 characters total), linked to a PostFinance or Swiss bank account. Invalid IBANs cause the request to fail.

Tindakan terkait​

Tugas yang sama di platform lain​

Dapatkan Bantuan​