Postman collection
Payments Write

pixiCACreateManualBooking

Creates a manual booking event in a customer's account and optionally matches it to an existing account entry or invoice.

Adds a manual booking (for example a manual payment or a correction) to the customer account of the customer CustKey.

Steps:

  1. EventDate defaults to the current date and time if it is not passed.
  2. If MatchToInvoiceNr is set, the call looks up the newest customer account entry (MAX(CustomerAccountKey)) that refers to this invoice. The invoice must belong to CustKey. The key found replaces any value passed in MatchKey. If no entry is found, an error is returned.
  3. EventID must exist in the customer account event definitions and must be flagged as manual (IsManual = 1).
  4. EventDate must not be in the future.
  5. If CurrencyId is not passed, the base currency of the shop the customer belongs to is used.
  6. The booking is inserted with the user name API. The exchange rate is determined automatically for the shop, currency and EventDate.
  7. If a match key is known (from MatchToInvoiceNr or MatchKey), the new entry is matched with that entry. The match is only created if both entries still have an open amount, the signs of the two entries are opposite, Amount is not 0 and the amount of the target entry is not 0. The matched amount is the smaller of the two open amounts.

The whole call runs in one transaction. It returns a single row with ReturnCode = OK on success or ERROR with the error text.

Notes

  • Validation errors and errors from the exchange rate lookup roll back the transaction and return an ERROR row.
  • Errors during the insert or the match inside the internal booking procedure are caught there and not passed on. In that case the call can still return OK although no booking was created. Check the customer account afterwards if this matters.
  • The customer account entry for the new booking is read back via ManualBookingRef. It is probably created by logic on the manual booking table that is not visible here.
  • The exchange rate lookup (pixi.GetExchRateID) and the match procedure (Pixi_CA_InsertMatch) are not attached; their exact behaviour is unknown.
  • MatchKey is not checked for belonging to the customer. Prefer MatchToInvoiceNr, which is checked.
  • CustKey is not validated explicitly. For an unknown customer, CurrencyId stays NULL if it is not passed.
  • The error text for a future date mentions a "paid date"; it refers to EventDate.
  • Lookups use NOLOCK.

Tables used

CustomerAccount · Read Invoices · Read CustomerAccountEvents · Read Shops · Read Customers · Read CustomerAccountManualBookings · Write
SQL object:
dbo.pipiCACreateManualBooking
Updated at 2026-10-30