# Online Payment Link for Open Invoices and Customer Balance with Virtual POS Collection Posted to SAP

> A solution that emails customers an online payment link for an invoice number or their open balance, and posts the collection from the virtual POS in SAP automatically and clears the related invoice. The customer logs in on a simple payment page, sees the open items and pays by card; card data never enters SAP.

- Type: Program, Custom development, Interface
- Module: FI
- Estimated effort: L (15–25 working days)
- Last updated: 2026-11-19
- URL: https://nekuhub.com/en/programs/online-payment-link-and-virtual-pos-collection-for-open-invoices/


## Why is the standard not enough?

SAP manages open items, dunning and account statements, but it does not generate a payment link that works with virtual POS providers for an open invoice and does not post card collections automatically. When the collection is looked up in the virtual POS report and entered manually with F-28, which payment belongs to which invoice and the bank commission are matched afterwards.

### Closest standard alternatives

- F-28: Posts incoming payments manually; does not generate a payment link or read the virtual POS notification.
- FBL5N: Shows customer open items; does not give the customer a way to pay.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| BSID | Customer open items (ECC); compatibility view in S/4HANA | Read | - | ECC only |
| ACDOCA | Customer open items and clearing information (S/4HANA) | Read | - | S/4HANA only |
| BKPF | Collection document header and provider reference | Write | BKPF-BUKRS = BSID-BUKRS AND BKPF-BELNR = BSID-BELNR AND BKPF-GJAHR = BSID-GJAHR | ECC + S/4 |
| BSEG | Collection and clearing line items | Write | BSEG-BELNR = BKPF-BELNR AND BSEG-BUKRS = BKPF-BUKRS AND BSEG-GJAHR = BKPF-GJAHR | ECC + S/4 |
| KNA1 | Customer name and address number | Read | KNA1-KUNNR = BSID-KUNNR | ECC + S/4 |
| ADR6 | Email address the link is sent to | Read | ADR6-ADDRNUMBER = KNA1-ADRNR | ECC + S/4 |
| T012K | Bank sub-account used as the virtual POS clearing account | Read | - | ECC + S/4 |

## BAPIs and functions used

- BAPI_AR_ACC_GETOPENITEMS: Reads the open items covered by the link
- BAPI_AR_ACC_GETKEYDATEBALANCE: Returns the key-date balance for a balance-based link
- BAPI_ACC_DOCUMENT_POST: Posts the virtual POS collection
- POSTING_INTERFACE_CLEARING: Clears the paid invoices
- SO_NEW_DOCUMENT_ATT_SEND_API1: Emails the payment link and the collection receipt

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_BUKRS | Company code | Range / multiple | BSID-BUKRS | Yes |
| S_KUNNR | Customer | Range / multiple | BSID-KUNNR | No |
| S_XBLNR | Invoice reference | Range / multiple | BSID-XBLNR | No |
| P_KEYDT | Balance key date | Single value | BSID-ZFBDT | No |
| P_BAL | Create the link for the total balance instead of invoices | Checkbox | - | No |
| P_DAYS | Link validity (days) | Single value | - | No |

## Result list columns

| Column | Source |
|---|---|
| Link number | Calculated: Unique number assigned in the link table |
| Customer | BSID-KUNNR |
| Customer name | KNA1-NAME1 |
| Invoice reference | BSID-XBLNR |
| Link amount | BSID-WRBTR |
| Currency | BSID-WAERS |
| Link status | Calculated: Sent, opened, paid, partially paid or expired |
| Paid amount | Calculated: Approved amount in the provider notification |
| Collection document | BKPF-BELNR |
| Message | Calculated: Posting or clearing return message |

## How does the program work?

1. The sending screen reads open items by company code, customer and invoice reference (BAPI_AR_ACC_GETOPENITEMS; BSID in ECC, ACDOCA in S/4HANA). The user creates a link for one invoice, selected invoices or the total balance at a key date (BAPI_AR_ACC_GETKEYDATEBALANCE).
2. For each link a unique record with an expiry is kept in a custom link table: customer, items, amount, currency, expiry date. The link is sent to the customer's email address (ADR6) with SO_NEW_DOCUMENT_ATT_SEND_API1.
3. When the customer opens the link, the payment page asks for the customer number and a one-time code sent by email, then reads the open items covered by the link from SAP in real time. If an item has been cleared in the meantime, the page shows it as paid.
4. Payment is made on the virtual POS provider's hosted payment page; card data reaches neither SAP nor the payment page's server. The provider's result notification is received after its signature is verified.
5. On a successful payment BAPI_ACC_DOCUMENT_POST posts a debit to the virtual POS clearing account (bank sub-account, T012K) and a credit to the customer; the paid invoices are cleared with POSTING_INTERFACE_CLEARING. In a partial payment the rest stays open. The provider reference is written to the reference fields of the document.
6. When the bank credits the virtual POS collection with its value date, the clearing account is cleared by the bank statement (FF_5/FEBAN); the commission is posted to an expense account by a statement rule. The monitor shows sent, opened, paid and expired links and posting errors.

## Authorization objects

- F_BKPF_BUK: Collection posting authorization by company code (interface user)
- F_BKPF_KOA: Account type authorization for customer and G/L postings
- S_OC_SEND: Sending external email from SAP
- S_RFC: Services called by the payment page

## Frequently asked questions

### Is card data stored in SAP?

No. Card data is entered only on the virtual POS provider's hosted payment page. Only the payment result, amount, instalment information and the provider reference reach SAP, so card data security obligations stay with the provider.

### How are instalment payments and bank commission accounted for?

The customer debt is cleared fully at the time of payment and the amount waits on the virtual POS clearing account. When the bank credits the money with its value date, a statement rule clears the clearing account and posts the commission difference to an expense account. Commission rates are not coded in the program; they come from the bank statement.

### Can several virtual POS providers be used?

Yes. The provider connection is kept in a separate connector class; each provider is defined with its own clearing account and is chosen by company code or currency.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=fi-online-payment-link-collection
