SwissQR紙幣を作成する API
このエンドポイントの機能
PDF4me SwissQR紙幣を作成する スイスを生成する QR スイスの法律に準拠した支払伝票 QR-請求書規格(スイス決済規格、 SPS単一の REST 電話します。送信 債権者および最終債務者の詳細、 IBAN金額、通貨、参照タイプ、言語、区切り文字スタイル、出力形式必要に応じてソースドキュメントを含める Base64、ブロブID、または URL 既存のスリップの上にスリップを重ねる PDF. API リターン PDF、 PNG、 JPEG、 または TIFF に応じて フォーマットタイプ。
認証 API リクエスト
毎 PDF4me REST API 電話にはあなたの API キー Authorization ヘッダー。開発者ダッシュボードからキーを作成または選択し、秘密にしてください。
終点
/api/v2/CreateSwissQrBill見逃してはならない重要な事実
彼らは行く 始めなければならない CH 19桁の数字が続きます。 IBAN エラーを返します。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リクエストの設定
| 設定 | 価値 |
|---|---|
| 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). |
パラメータ
常に必須: 彼らは行く、 crName、 crAddressType、 crStreetOrAddressLine1、 crStreetOrAddressLine2、 cr郵便番号、 crCity、 額、 通貨、 udName、 udAddressType、 udStreetOrAddressLine1、 udStreetOrAddressLine2、 udPostalCode、 udCity、 参照タイプ、 言語タイプ、 区切り線、 フォーマットタイプ、 そして 非同期。
条件付き: ドキュメントコンテンツ そして ドキュメント名 PDFに重ね合わせる場合。 参照 いつ 参照タイプ は QRR または スコア; ページングオプション そして ページ番号 いつ フォーマットタイプ は PDF。
オプション: 非構造化メッセージ、 請求情報、 av1、 av2、 プロフィール。
| パラメータ | 必須 | その機能 | 例 |
|---|---|---|---|
| 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 |
住所タイプのオプション
適用対象 crAddressType そして udAddressType。
S(構造化)自動照合に推奨K(合計)自由形式の住所行が2行区切り線のオプション(seperatorLine)
はさみで線を引く点線ソリッドライン参照タイプのオプション
非構造化された参照なし非構造化メッセージ 自由形式のメモの代わりに 参照。QRR27桁のQRコード参照番号参照 27桁の数字列として。スコアISO 11649 債権者参照番号参照 で ISO 11649 フォーマット( RF)出力形式(formatType) そして PDF ページング
いつ フォーマットタイプ は PDF、 セット ページングオプション 制御する場所 QR スリップが配置されます。画像出力の場合は省略します。 ページングオプション または設定する ヌル。
formatType: pdfpagingOptions: firstformatType: pdfpagingOptions: lastformatType: pdfpagingOptions: AddPageAtEndformatType: pdfpagingOptions: custom + pageNumberformatType: png | jpeg | tiffpagingOptions: nullリクエスト例
例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システムは、請求書データとPDFファイルをエクスポートします。
- PDFをBase64エンコードして
ドキュメントコンテンツ。 - POST支払いフィールド
参照タイプQRRと27桁の参照。 - デコード
ドキュメントコンテンツ回答からQRコード付きの請求書PDFを保存またはメールで送信してください。
- 切り取り式の用紙のみの場合は、空の用紙を郵送してください。
ドキュメントコンテンツそしてフォーマットタイプPDFまたはPNG。 - ウェブフックからの請求書の場合、PDFをBase64エンコードして
ドキュメントコンテンツ、 セットページングオプションに最後またはカスタム、およびPOST支払いフィールド。 - 応答を解読する
ドキュメントコンテンツオブジェクトストレージにアップロードするか、メールAPIに添付します。