SAP B1 ← Expense Reports (Purchase Invoice Draft + Receipt)

Approved expense report (Concur/Expensify) → SAP B1 Purchase Invoice posted to /Drafts first for human review, splitting recoverable vs non-recoverable VAT lines and carrying project/cost-center coding. The receipt image is attached via Attachments2 and linked through AttachmentEntry. Idempotent on the expense report id.

Steps in this flow

  1. Approved Expense Report Webhook
  2. Guard: Expense Report
  3. SL Login (B1SESSION)
  4. Split VAT: Recoverable vs Non-Recoverable
  5. Map Lines → DocumentLines (+ CostingCode)
  6. POST /Attachments2 (Receipt)
  7. POST /Drafts (oPurchaseInvoices)
  8. Retry on 401 (re-login)
  9. Notify AP: Draft Ready for Review

All templates