BIY

Only synthetic (non-real) data is used in this environment. Do not enter real customer data.

ERP and SAP integration

API client, tokens, webhooks, file routes; the SAP add-on, SM59, STRUST, FF_5 and FLB2.

Data reaches the ERP in four ways. For one bank account, only one route should post to the bank GL account; otherwise entries are posted twice.

  1. A. API pull + ackthe ERP pulls ready entries, ack/reject
  2. B. Webhook + pullan event arrives, details from the API
  3. C. FileMT940, camt, BAI2, Excel…
  4. D. SAP add-onFF_5, FLB2, FB05
An API client for the ERP

API client

  1. On ERP › Developer (API) (owner or administrator) enter a client name, the allowed companies and scopes, and press Create client.
  2. The client ID and secret are shown only once; store them in the ERP's secret settings. The secret can be rotated and the client revoked.
  3. Scopes: transactions:read, journal:read, journal:write, clearings:read/write, invoices:read/write, counterparties:write, payments:read/write, exports:read/write, reports:read, webhooks:manage. Grant only what is needed.
  4. The contract (OpenAPI) can be downloaded from the same page; sample requests are on the page.
POST /oauth/token   (HTTP Basic: client ID / secret)
grant_type=client_credentials

GET  /api/v1/journal-entries?status=ready&company_id=<company>
POST /api/v1/journal-entries/<id>/ack   Idempotency-Key: <unique>
{"erp_document_number": "1900001234"}
Developer page: clients and sample requests
Developer page: clients and sample requests

A token is valid for 1 hour. Idempotency-Key is required on every POST: a repeated request with the same key creates no second record. The rate limit is 600 requests per minute per client (default).

Webhooks

  • Events: transaction.created, collection.created, journal_entry.ready, export.completed, export.failed, consent.expiring (others come with their modules).
  • The URL must be HTTPS; the body carries only IDs, fetch the details from the API. Signature: BIY-Signature: t=<time>,v1=<HMAC-SHA256(secret, t + "." + body)>. A non-2xx response is retried for 24 hours.

SAP add-on

  1. abapGitpull into a Z package, activate
  2. SM59 ZBIY_TOKEN/oauth/token, Basic, SSL
  3. SM59 ZBIY_API/api/v1, SSL
  4. STRUSTBIY certificate chain
  5. SM36schedule with a variant
  • Requirements: SAP_BASIS 7.02 or later and the /UI2/CL_JSON class.
  • ZBIY_FILE_PULL: fetches an MT940, camt.053, BAI2 or lockbox file from BIY, verifies its SHA-256 digest, writes it to the server and runs FF_5 or FLB2 with a variant.
  • ZBIY_CLEARING_POST: pulls clearings from the API, posts them with FB05 (or FB01) and reports the result per invoice as ack/reject; the ZBIY_POSTLOG table prevents double posting. Clearings come from matches confirmed in the portal (see Invoices and matching); the program must be installed and tested in the customer system.
  • For FF_5 with interpretation algorithm 020/021 the invoice number is placed as "REF …" at the start of the transaction text. For FLB2 lockbox the template must be validated against an RFEBLBT2 sample.
  • Authorizations: F_BKPF_BUK (ACTVT 01) and S_DATASET for writing files.

There is no SAP system in this environment; the ABAP code was checked statically (abaplint) and ABAP Unit tests were delivered. The SAP test scenarios (SAP-01…SAP-15) are in sap/README.md in the repository.