SAP Document incoming_payment

Incoming Payment

A customer payment received and allocated against open A/R invoices โ€” cash rises, the customer's receivable clears, and the applied invoices close.

An Incoming Payment records money received from a customer and applies it against the invoices that customer owes. It is the document that turns “the customer owes us” into “the customer has paid us”: cash goes up, accounts receivable goes down, and the specific invoices the payment covers are marked closed.

In the Service Layer this is the IncomingPayments service, object code oIncomingPayments (24), created at /b1s/v1/IncomingPayments.

Unlike the inventory documents, an Incoming Payment does carry a business partner: its CardCode is the customer who paid. The other half of the document is the allocation โ€” the list of open A/R invoices the payment is applied to, so the money is matched to the debts it settles rather than left sitting unapplied.

When it is used

An Incoming Payment is created whenever a customer settles what they owe:

  • Bank transfer received against one or more open A/R invoices.
  • Cash or cheque takings from a customer, banked and recorded.
  • Card / online payment clearing into the company account.
  • Partial payment โ€” a customer pays part of a large invoice; the invoice stays partly open for the remainder.
  • Payment on account โ€” money received before any invoice exists, held against the customer’s balance until invoices arrive to apply it to.

The mirror document for paying a vendor is the Outgoing Payment (oVendorPayments, 46). The Incoming Payment is always the receipt side โ€” money coming in from a customer.

Key fields

The document has a header identifying the customer and the money received, plus a PaymentInvoices collection that allocates the money across specific invoices.

FieldTypeNotes
DocEntryEdm.Int32Internal primary key (system-assigned)
DocNumEdm.Int32User-visible document number
DocObjectCodeSAPB1.BoObjectTypesAlways oIncomingPayments (24)
DocTypeโ€”rCustomer โ€” receipt from a customer (vs. supplier / account)
CardCodeEdm.StringThe customer who paid โ€” required
CardNameEdm.StringCustomer name
DocDateEdm.StringPosting date โ€” YYYYMMDD string
DocCurrencyEdm.StringCurrency of the payment
CashSumEdm.DoubleAmount received as cash (posts to a cash account)
CashAccountEdm.StringG/L cash account the CashSum lands in
TransferSumEdm.DoubleAmount received by bank transfer
TransferAccountEdm.StringG/L bank account the transfer lands in
TransferDateEdm.StringValue date of the transfer
JournalRemarksEdm.StringMemo written onto the generated journal entry

The money can arrive by more than one means at once โ€” a CashSum, a TransferSum, a cheque total โ€” each routed to its own G/L account. The sum of these means must equal the sum applied across the invoices (plus any amount left on account).

Allocation (PaymentInvoices)

FieldTypeNotes
LineNumEdm.Int32Line index (0-based)
DocEntryEdm.Int32DocEntry of the A/R invoice being paid
InvoiceTypeSAPB1.BoRcptInvTypesWhich document โ€” e.g. it_Invoice for an A/R invoice
SumAppliedEdm.DoubleHow much of the payment is applied to this invoice
AppliedFC / AppliedSysEdm.DoubleApplied amount in foreign / system currency

Each PaymentInvoices row points at one open invoice by its DocEntry and says how much of the received money to put against it. This is the allocation that distinguishes a real payment from an untracked cash deposit.

GL and stock effect

Stock: none. A payment moves money, not goods.

Accounting: the payment debits the cash/bank account it landed in and credits the customer’s accounts-receivable control account, clearing the debt:

DR  Bank / Cash account          (amount received)
CR      Accounts Receivable              (amount applied โ€” customer balance cleared)

The debit account is the TransferAccount or CashAccount from the header; the credit is the A/R control account tied to the customer’s CardCode. Each invoice in PaymentInvoices is reduced by its SumApplied; an invoice covered in full flips to Closed (bost_Close / paid), while a partial application leaves it open for the remainder.

If the customer paid more than they owe, or paid with no invoice named, the surplus is recorded on account โ€” a credit sitting against the customer’s balance, available to apply to future invoices. Bank charges, if any, post to a separate charge account so the net cash matches the bank statement at reconciliation time.

Service Layer

PropertyValue
Service (entity)IncomingPayments
Object codeoIncomingPayments (24)
Create pathPOST /b1s/v1/IncomingPayments
Read oneGET /b1s/v1/IncomingPayments(<DocEntry>)
Sub-collectionPaymentInvoices (the invoice allocation)

A create payload names the customer, the bank account and amount received, and the invoices it settles:

POST /b1s/v1/IncomingPayments
{
  "CardCode": "C20000",
  "DocType": "rCustomer",
  "TransferSum": 1170.0,
  "TransferAccount": "111000",
  "PaymentInvoices": [
    { "DocEntry": 42, "InvoiceType": "it_Invoice", "SumApplied": 1170.0 }
  ]
}

Norma’s connector and mock use the /b1s/v1/ paths shown here; a live SAP B1 on Feature Pack 2405 or later exposes the same entity under /b1s/v2/ with identical shape.

The response returns the assigned DocEntry and DocNum, and the applied invoices reflect their reduced open balance immediately.