Postman collection
Payments Write

pixiCAInsertMatch

Creates a match between two customer account entries with a given match amount.

Links two customer account entries, for example a payment and an invoice, with a match amount.

  1. The call first runs the common API envelope. This checks the call frequency limit for pipiCAInsertMatch and records the time of the call. If the limit is exceeded, a row with ResultCode 502 and ResultText is returned and nothing else happens.
  2. If CAref1, CAref2 or MatchAmount is NULL, a status row with ReturnCode = ERROR and ErrorMessage is returned. No data is written.
  3. Otherwise one record is inserted into CustomerAccountMatch:
    • CAref1 and CAref2 are stored as passed.
    • AbsoluteMatchAmount is set to MatchAmount rounded to 2 decimal places.
    • Creation and update user are set to API, with the current date and time.

On success the call returns no result set.

Notes

  • The insert runs in its own transaction, or in a savepoint if a transaction is already open.
  • SQL errors during the insert are caught, rolled back and logged via log.InsertError, which is not attached. Examples are constraint violations for non-existing CAref values. The caller receives no error row in this case, so success cannot be told apart from a failed insert by the response alone.
  • The code does not check whether CAref1 and CAref2 exist, whether they belong to the same customer, or whether the amount matches the open balances. Any such checks depend on table constraints that are not visible here.
  • The ID of the new match record is only used as the internal procedure return value and is not returned to the SOAP caller.
  • CAref1, CAref2 and MatchAmount have no default. Leaving them out of the request causes a SQL error for the missing parameter. The ERROR row only appears if they are passed explicitly as NULL.
  • The error text contains a typo: it names CAref1 twice instead of CAref1 and CAref2.
  • Frequency limits are configured in API_CONTROL (MIN_BREATHING_MSEC).

Tables used

API_STATISTICS · Write API_CONTROL · Read CustomerAccountMatch · Write
SQL object:
dbo.pipiCAInsertMatch
Updated at 2026-10-30