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.
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
/api/v2/CreateSwissQrBillFakta Penting yang Tidak Boleh Anda Lewatkan
mereka akan pergi harus dimulai dengan CH diikuti oleh 19 digit. Tidak valid IBAN Mengembalikan kesalahan.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.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
| Pengaturan | Nilai |
|---|---|
| Method | POST |
| URL | https://api.pdf4me.com/api/v2/CreateSwissQrBill |
| Headers | Content-Type: application/json |
| Authorization | Basic Auth with your API key, or header Authorization: Basic YOUR_API_KEY |
| Async | If 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.
| Parameter | Diperlukan | Apa fungsinya? | Contoh |
|---|---|---|---|
| jobIdExt | Optional | Your own reference for this call. It is stored with the API call log so you can correlate calls with your jobs. Type: string. | |
| integrations | Optional | Integration identifiers, forwarded unchanged with the job's notification settings. Type: array. | |
| isAsync | Optional | Set 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 |
| docName | Optional | Source 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 |
| docContent | Required | The 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. | "" |
| docContentBytes | Optional | Alternative raw byte payload for the source file. Type: string. | |
| callBackUrl | Optional | Optional URL notified when an asynchronous job completes. Type: string. | |
| iban | Optional | IBAN or QR-IBAN of the creditor. Spaces and hyphens are removed. Type: string. | CH0200700110003765824 |
| crName | Optional | Name of the creditor (payee). Type: string. | Test AG |
| crAddressType | Optional | Matched case-insensitively; an unrecognised value falls back to the first entry. Type: string. | S |
| crStreetOrAddressLine1 | Optional | Creditor street (address type `S`) or first address line (address type `K`). Type: string. | Test Strasse |
| crStreetOrAddressLine2 | Optional | Creditor building number (address type `S`) or second address line with postal code and town (address type `K`). Type: string. | 1 |
| crPostalCode | Optional | Creditor postal code. Used with address type `S`. Type: string. | 8000 |
| crCity | Optional | Creditor town. Used with address type `S`. Type: string. | Zurich |
| amount | Optional | Amount to pay, e.g. `199.95`. Type: string. | 1000 |
| currency | Optional | Matched case-insensitively; an unrecognised value falls back to the first entry. Type: string. | CHF |
| udName | Optional | Name of the ultimate debtor (payer). Type: string. | Test Debt AG |
| udAddressType | Optional | Matched case-insensitively; an unrecognised value falls back to the first entry. Type: string. | S |
| udStreetOrAddressLine1 | Optional | Debtor street (address type `S`) or first address line (address type `K`). Type: string. | Test Deb Strasse |
| udStreetOrAddressLine2 | Optional | Debtor building number (address type `S`) or second address line with postal code and town (address type `K`). Type: string. | 2 |
| udPostalCode | Optional | Debtor postal code. Used with address type `S`. Type: string. | 8000 |
| udCity | Optional | Debtor town. Used with address type `S`. Type: string. | Zurich |
| referenceType | Optional | Matched case-insensitively; an unrecognised value falls back to the first entry. Type: string. | NON |
| reference | Optional | Payment reference matching `referenceType`. Spaces and hyphens are removed. Type: string. | 21000000000313947143000017 |
| unstructuredMessage | Optional | Free-text message to the creditor. Type: string. | Thank you for your business |
| billingInfo | Optional | Structured billing information for the creditor. Type: string. | Invoice for services rendered |
| av1Parameters | Optional | First alternative procedure parameter. Type: string. | |
| av2Parameters | Optional | Second alternative procedure parameter. Type: string. | |
| languageType | Optional | Matched case-insensitively; an unrecognised value falls back to the first entry. Type: string. | English |
| seperatorLine | Optional | Matched case-insensitively; an unrecognised value falls back to the first entry. Type: string. | LineWithScissor |
| pageNumber | Optional | Page 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 |
| formatType | Optional | Output 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 |
| pagingOptions | Optional | Matched 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 otomatisK (Gabungan)Dua baris alamat bebas bentukOpsi garis pemisah (seperatorLine)
GarisDenganGuntingGaris Putus-putusGaris PadatOpsi tipe referensi
NONTidak ada referensi terstrukturpesan tidak terstruktur untuk catatan bentuk bebas sebagai gantinya referensi.QRRReferensi QR 27 digitreferensi sebagai string numerik 27 digit.SKORReferensi kreditor ISO 11649referensi 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: firstformatType: pdfpagingOptions: lastformatType: pdfpagingOptions: AddPageAtEndformatType: pdfpagingOptions: custom + pageNumberformatType: png | jpeg | tiffpagingOptions: nullMinta 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.
- Sistem ERP Anda mengekspor data faktur dan file PDF.
- Encode PDF ke dalam Base64
Konten dokumen. - Kolom pembayaran POST dengan
tipe referensiQRR dan 27 digitreferensi. - Dekode
Konten dokumendari respons tersebut dan simpan atau kirim email PDF tagihan QR.
- Untuk slip yang bisa disobek saja, POST dengan kosong
Konten dokumenDanformatTypepdf atau png. - Untuk faktur dari webhook, encode PDF ke dalam format Base64.
Konten dokumen, mengaturOpsi penomoran halamanketerakhirataukebiasaan, dan kolom pembayaran POST. - Uraikan responsnya
Konten dokumendan mengunggah ke penyimpanan objek atau melampirkannya ke API email.