メインコンテンツへスキップ

SwissQR紙幣を作成する API

このエンドポイントの機能

PDF4me SwissQR紙幣を作成する スイスを生成する QR スイスの法律に準拠した支払伝票 QR-請求書規格(スイス決済規格、 SPS単一の REST 電話します。送信 債権者および最終債務者の詳細、 IBAN金額、通貨、参照タイプ、言語、区切り文字スタイル、出力形式必要に応じてソースドキュメントを含める Base64、ブロブID、または URL 既存のスリップの上にスリップを重ねる PDF. API リターン PDF、 PNG、 JPEG、 または TIFF に応じて フォーマットタイプ。

関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →

認証 API リクエスト​

毎 PDF4me REST API 電話にはあなたの API キー Authorization ヘッダー。開発者ダッシュボードからキーを作成または選択し、秘密にしてください。

終点​

役職/api/v2/CreateSwissQrBill

見逃してはならない重要な事実​

スイスIBAN形式は厳密に検証されます
債権者 彼らは行く 始めなければならない CH 19桁の数字が続きます。 IBAN エラーを返します。
本番環境では構造化アドレスタイプ(S)を使用してください。
セット crAddressType そして udAddressType に S そのため、通り、番地、郵便番号、都市は別々に保存されます。このレイアウトは、ほとんどの自動スイス銀行照合に必要です。 K (結合)アドレスの構成要素を分割できない場合にのみ使用します。
参照タイプを照合ワークフローに一致させてください
非 構造化された参照情報のない支払いの場合。 QRR スイス国内紙幣における27桁の数字による参照番号。 スコア のために ISO 11649 債権者照会先。 参照 使用時に体内で QRR または SCOR。

REST API 終点​

方法: 役職
URL: https://api.pdf4me.com/api/v2/CreateSwissQrBill

セット 非同期 に 真実 (PascalCase) のために 202 Accepted そして世論調査 位置 URL と GET 受け取るまで 200 そしてファイルは JSON。 使用 間違い 同期式の場合 200 応答。

Postmanリクエストの設定​

設定価値
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).

パラメータ​

常に必須: 彼らは行く、 crName、 crAddressType、 crStreetOrAddressLine1、 crStreetOrAddressLine2、 cr郵便番号、 crCity、 額、 通貨、 udName、 udAddressType、 udStreetOrAddressLine1、 udStreetOrAddressLine2、 udPostalCode、 udCity、 参照タイプ、 言語タイプ、 区切り線、 フォーマットタイプ、 そして 非同期。

条件付き: ドキュメントコンテンツ そして ドキュメント名 PDFに重ね合わせる場合。 参照 いつ 参照タイプ は QRR または スコア; ページングオプション そして ページ番号 いつ フォーマットタイプ は PDF。

オプション: 非構造化メッセージ、 請求情報、 av1、 av2、 プロフィール。

パラメータ必須その機能例
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

住所タイプのオプション​

適用対象 crAddressType そして udAddressType。

S(構造化)自動照合に推奨
番地、建物番号、郵便番号、都市名をそれぞれ別のフィールドに格納します。スイスのほとんどの銀行システムで、自動照合のために必須となっています。
K(合計)自由形式の住所行が2行
住所を2行の自由形式の行として結合して保存します。入力は簡単ですが、自動照合との互換性は低くなります。

区切り線のオプション(seperatorLine)​

はさみで線を引く
ハサミの記号が付いたミシン目入りの切り取り線。スイスの印刷済み請求書のデフォルト設定です。
点線
請求書と切り取り紙の間に点線の区切り線があります。
ソリッドライン
ハサミの記号のない実線の区切り線。

参照タイプのオプション​

非構造化された参照なし
シンプルな支払いのデフォルト。 非構造化メッセージ 自由形式のメモの代わりに 参照。
QRR27桁のQRコード参照番号
スイス国内紙幣 PostFinance またはスイス銀行 IBANs送信する必要があります 参照 27桁の数字列として。
スコアISO 11649 債権者参照番号
国境を越えた SEPA-スタイルマッチング。送信 参照 で ISO 11649 フォーマット( RF)

出力形式(formatType) そして PDF ページング​

いつ フォーマットタイプ は PDF、 セット ページングオプション 制御する場所 QR スリップが配置されます。画像出力の場合は省略します。 ページングオプション または設定する ヌル。

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.

リクエスト例​

例A:スタンドアロン QR 法案(入力なし) PDF)​

省略 ドキュメントコンテンツ または空の文字列を送信して、 QR 支払伝票。

{
"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
}

例B:オーバーレイ QR 既存の PDF (Base64)​

交換する ドキュメントコンテンツ あなたの PDF として Base64 (いいえ データ: 接頭辞)。

{
"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
}

例C:コピー&ペーストは有効です 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
}

参照型ペイロード​

参照なし(NON):

{ "referenceType": "NON" }

QRコード参照(QRR):

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

債権者参照番号(SCOR、ISO 11649):

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

formatType と pagingOptions のスニペット​

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

コードサンプル​

統合例​

一般的なREST統合パターンTypical ways developers call Create SwissQR Bill.
ERP請求書エクスポート → スイスQR請求書PDF
  1. お使いのERPシステムは、請求書データとPDFファイルをエクスポートします。
  2. PDFをBase64エンコードして ドキュメントコンテンツ。
  3. POST支払いフィールド 参照タイプ QRRと27桁の 参照。
  4. デコード ドキュメントコンテンツ 回答からQRコード付きの請求書PDFを保存またはメールで送信してください。
スタンドアロンのスリップまたはウェブフックオーバーレイ
  1. 切り取り式の用紙のみの場合は、空の用紙を郵送してください。 ドキュメントコンテンツ そして フォーマットタイプ PDFまたはPNG。
  2. ウェブフックからの請求書の場合、PDFをBase64エンコードして ドキュメントコンテンツ、 セット ページングオプション に 最後 または カスタム、およびPOST支払いフィールド。
  3. 応答を解読する ドキュメントコンテンツ オブジェクトストレージにアップロードするか、メールAPIに添付します。

よくある質問​

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.

関連アクション​

他のプラットフォームでも同じタスクを実行​

ヘルプが必要な場合​