Postman collection
General Write

pixiTagCreate

Creates a new tag of a given tag type (for items or orders), unless a tag with the same type and name already exists.

Creates a tag record in Pixi. Tags are used to label items or orders. The call returns one status row with Status and Message.

Steps:

  1. Validation. TypeID must refer to an existing tag type and Name must not be empty. If validation fails, no tag is created and Status is Error. The checks are evaluated in this order:

    • both TypeID and Name missing
    • TypeID missing
    • no tag type with this TypeID exists
    • Name empty
  2. Duplicate check. The call counts the existing tags with the same TypeID and Name. If at least one exists, nothing is inserted and Status is Information.

  3. Insert. Otherwise a new tag is inserted with:

    • the given type and name
    • Description; NULL is stored as an empty string
    • IsSystemTag = 0

    Status is then Success.

The ID of the new tag is not returned.

Notes

  • Transactions: the call runs inside its own transaction. If it is called within an existing transaction, it uses a savepoint instead. XACT_ABORT is on.
  • Error handling: on an unexpected error the transaction is rolled back and the error is logged via log.InsertError (definition not attached). A status row with Status = Error is still returned; no SQL error is raised.
  • Duplicates: the tag type and duplicate checks read with NOLOCK. Concurrent calls with the same type and name may therefore both insert a tag, unless a unique constraint on Tag prevents this; such a constraint is not visible in the code.
  • Name matching: whether names are compared case-sensitively depends on the database collation.
  • Message text: in the 'already exists' message the name is cut to 20 characters.
  • Tag ID: the call does not return the ID of the new tag. It has to be read separately.

Tables used

TagType · Read Tag · Write
SQL object:
dbo.pipiTagCreate
Updated at 2026-10-30