Postman collection
Returns Write

pixiCreateReturnCase

Creates a new return case with status NEW and returns its ID and return number.

Inserts one new record into RET_CASES and returns the identifiers of the new return case.

The new record is filled as follows:

  • CreateDate: current server date and time.
  • CreateEmp: the value of Employee followed by (API). If Employee is NULL, the value API is used.
  • RETURN_DATE: the value of ReturnDate. If it is NULL, the current server date and time is used.
  • STATUS: always NEW.
  • RECEIVERS_COMMENT: the value of ReceiversComment.

After the insert, the call reads the new record by its identity value (SCOPE_IDENTITY()) and returns one row with RET_ID and RET_NUMBER.

Notes

  • All three parameters have no SQL default and must be sent in the request. NULL values are accepted: Employee and ReturnDate are replaced as described; ReceiversComment is stored as NULL.
  • The call only creates the return case header. No order, items or return lines are linked; this has to be done with other calls.
  • RET_NUMBER is not set by this procedure. It is presumably generated by the database (column default, computed column or trigger on RET_CASES), which is not visible in the code.
  • The suffix (API) adds 6 characters to Employee; whether the result fits into CreateEmp depends on the column length, which is not visible in the code.
  • The result row is read with NOLOCK. The insert and the select are not wrapped in an explicit transaction.

Tables used

RET_CASES · Write
SQL object:
dbo.pipiCreateReturnCase
Updated at 2026-10-30