Introduction

Recording commands are only supported on the reference server.

Below are the minimum allowable object attribute sets. For a list of all object attributes, read the corresponding reference.

Record logic — insert or update.
GUIDString is considered to be the key attribute.
Relationships with parent objects are defined by the MainParentGUID attribute.
If some attributes are not filled, they are ignored.
If you need to specify an empty value for an attribute, specify «».
The records are deleted by setting the rsDeleted status, while records in the database are not actually deleted.

Getting the menu

<?xml version="1.0" encoding="utf-8"?>
<RK7Query>
    <RK7CMD CMD="GetRefData" RefName="MenuItems"/>
</RK7Query>

Inserting Goods

<?xml version="1.0" encoding="utf-8"?>
<RK7Query>
    <RK7Command CMD="SetRefData" RefName="MenuItems">
        <Items>
            <Item GUIDString="{5B3537CE-ECF0-4D6A-B0AE-F095FC4F0522}" MainParentIdent="{a70ab9c0-934b-49e4-91a8-cb2e85f1cbf2}" Code="3" Name="Green Tea" AltName="" Status="rsActive" TaxDishType="1" ExtCode="3" PRICETYPES-0="1000"/>
<Item GUIDString="{5a76323c-3a58-4bd8-8a91-478ca2568ecc}" MainParentIdent="{85A6B558-D59B-44F2-A103-031E473D6843}" Code="33" Name="Salmon" AltName="" Status="rsActive" TaxDishType="1" ExtCode="33" PRICETYPES-0="5000" CLASSIFICATORGROUPS-2560="27"/>
<Item GUIDString="{5e787f73-da50-438c-96f9-70926422ef45}" MainParentIdent="{85A6B558-D59B-44F2-A103-031E473D6843}" Code="32" Name="Meat ball" AltName="" Status="rsActive" TaxDishType="1" ExtCode="32" PRICETYPES-0="19040" CLASSIFICATORGROUPS-2560="27"/>
<Item GUIDString="{d9fd4966-478a-48ef-b6af-1f5f9d998d43}" MainParentIdent="{d85701de-d4c2-4843-9d49-55228e506738}" Code="31" Name="Cinnamon bun" AltName="" Status="rsActive" TaxDishType="1" ExtCode="31" PRICETYPES-0="8000" CLASSIFICATORGROUPS-2560="27"/>
<Item GUIDString="{feeabc44-673c-4898-aa08-c199fc1174c5}" MainParentIdent="{5e5d99e1-3c3a-49f3-8036-85c15f15ca0d}" Code="30" Name="Black Tea" AltName="" Status="rsActive" TaxDishType="1" ExtCode="30" PRICETYPES-0="9000" CLASSIFICATORGROUPS-2560="27"/>
        </Items>
    </RK7Command>
</RK7Query>
AttributeValue type
GUIDStringGUIDThe object guid
MainParentIdentGUID/IdentThe reference to the parent. The parent must exist or have existed in xml before
CodeIntegerThe object code (unique, for quick access)
ExtCodeIntegerThe external object code (unique, for external systems)
NamestringThe goods name
StatusrsActive, rsInactive, rsDeletedThe object status (active (available), inaccessible, deleted)
PRICETYPES-0integerThe price (in kopecks) for the price type (0 by default)
TaxDishTypeintegerThe tax type
CLASSIFICATORGROUPS-2560GUID/IdentThe reference to the category, where 2560 is the ID of the classification

You can immediately list several prices and the belonging of a dish to several categories.

Result:

<?xml version="1.0" encoding="utf-8"?>
<RK7QueryResult ServerVersion="7.5.3.1" XmlVersion="88" Status="Ok" Processed="1">
    <CommandResult CMD="SetRefData" Status="Ok" ErrorText="" DateTime="2013-05-16T18:16:18" WorkTime="16"/>
</RK7QueryResult>

Inserting Extended Properties

<RK7Query>
        <RK7Command CMD="SetRefData" RefName="MenuItems">
                <Items>
                        <Item GUIDString="{DA3434A6-AEC3-4D4B-B982-9AE2BD9BA83F}" genBGU="test" Status="rsActive"/>
                </Items>
        </RK7Command>
</RK7Query>

Where the extended property is called BGU, but you need to specify genBGU.
In version 7.5.4, to make changes to the extended property via the XML interface, in addition to the main type, you need to add 1 more type to the extended property, with identifier 2560. In the list of types without a name, the label is a white sheet.

Creating Goods Groups

<?xml version="1.0" encoding="utf-8"?>
<RK7Query>
    <RK7Command CMD="SetRefData" RefName="CATEGLIST">
        <Items>
  <Item GUIDString="{85A6B558-D59B-44F2-A103-031E473D6843}" Code="20" Name="Kitchen" AltName="" Status="rsActive" ExtCode="12" />
  <Item GUIDString="{a70ab9c0-934b-49e4-91a8-cb2e85f1cbf2}" MainParentIdent="{85A6B558-D59B-44F2-A103-031E473D6843}"  Code="13" Name="Main course" AltName="" Status="rsActive" ExtCode="14" />
  <Item GUIDString="{5e5d99e1-3c3a-49f3-8036-85c15f15ca0d}" Code="21" Name="Bar" AltName="" Status="rsActive" ExtCode="16" />
  <Item GUIDString="{d85701de-d4c2-4843-9d49-55228e506738}" Code="22" Name="Other" AltName="" Status="rsActive" ExtCode="19" />
        </Items>
    </RK7Command>
</RK7Query>

Required fields:

AttributeValue type
GUIDStringGUIDThe object guid
MainParentIdentGUIDThe reference to the parent. The parent must exist or have existed in xml before
NamestringThe goods name

Additional fields:

AttributeValue type
CodeIntegerThe object code (unique, for quick access)
AltNamestringThe alternative name
ExtCodeIntegerThe external object code (unique, for external systems)
StatusrsActive, rsInactive, rsDeletedThe object status (active (available), inaccessible, deleted)

The success result:

<?xml version="1.0" encoding="utf-8"?>
<RK7QueryResult ServerVersion="7.5.3.1" XmlVersion="88" Status="Ok" Processed="1">
    <CommandResult CMD="SetRefData" Status="Ok" ErrorText="" DateTime="2013-05-16T18:49:12" WorkTime="0"/>
</RK7QueryResult>

Creating Classifications

There is a limit on the number of classifications. When the limit is reached, the server will return an error.

<?xml version="1.0" encoding="utf-8" ?>  
  <RK7Query UserGUID="{39537C9D-E05D-401F-A50E-87EDBED475D7}" UserID="1000233" UserPass="123">
     <RK7Command CMD="SetRefData" RefName="classificatorgroups">
      <Items>
        <Item Status="3" Name="New classification" AltName="New Classification" Ident="1024" GUIDString="{72DEC7B5-C57E-4A96-ACEB-881ABB35F06A}" />
      </Items>
    </RK7Command>
  </RK7Query>

When generating a new classification, Ident must be specified manually, it must be a multiple of 256. Anything that is not a multiple of 256 will be considered a category.

Required fields:

AttributeValue type
UserGUIDGUIDThe user guid
UserIDIntegerThe user identifier
UserPassIntegerThe user password
GUIDStringGUIDThe unique object identifier
IdentIntegerThe object identifier
NamestringThe goods name

Creating Categories

<?xml version="1.0" encoding="utf-8" ?>
<RK7Query>
  <RK7Command CMD="SetRefData" RefName="classificatorgroups">
    <Items>
      <Item Status="3" Name="new category" AltName="new category" MainParentIdent="768" Ident="773" GUIDString="{5C6C9489-9B22-4248-ABB4-85498686E4CE}" />
    </Items>
  </RK7Command>
</RK7Query>

Ident must also be set manually during generation, its value must be greater than MainParentIdent and less than MainParentIdent + 256.

Required fields:

AttributeValue type
GUIDStringGUIDThe object guid
MainParentIdentGUIDThe reference to the parent. The parent must exist or have existed in xml before
IdentIntegerThe unique object identifier
NamestringThe goods name

Creating Modifiers

<?xml version="1.0" encoding="utf-8"?>
<RK7Query>
  <RK7Command CMD="SetRefData" RefName="modifiers">
    <Items>
      <Item GUIDString="{6E998743-E7FD-47F8-B501-B7B97F20EA83}"
            Code="31"
            Name="Tomato sauce"
            AltName="ketchup"
            MainParentIdent="1000070"
            Status="rsActive"
            SalesTerms_StartSale="3625400821882"
            SalesTerms_StopSale="3625400821882"
            UseStartSale="0"
            UseStopSale="0"
            ExtCode="7"
            ShortName=""
            AltShortName=""
            MaxOneDish="1"
            Comment="This is tomato sauce"
            Weight="1"
            Kurs="0"
            SaveInCheck="1"
            AddToName="0"
            ReplaceName="0"
            InputName="0"
            AddMenuItemPrice="0"
            UseLimitedQnt="1"
            UseFormatInput="0"
            UseKurs="0"
            PRICETYPES-1000231="4500"
            PRICETYPES-3="5000"
            PRICETYPES-4="9223372036854775807"
            TRADEGROUPS-1000132="3"
            TRADEGROUPS-1000271="3"
            TRADEGROUPS-7="3" />
    </Items>
  </RK7Command>
</RK7Query>

Required fields:

AttributeValue type
GUIDStringGUIDThe object guid
MainParentIdentGUIDThe reference to the parent. The parent must exist or have existed in xml before
NamestringThe goods name

Where:

  • SalesTerms_StartSale — sales start date
  • SalesTerms_StopSale — sales end date
  • PRICETYPES-1000231 — specifying the price in kopecks for the price type with Ident = 1000231
  • TRADEGROUPS-1000132="3" — specifying the value for the trade group with Ident = 1000132

Creating Modifier Schemes

<?xml version="1.0" encoding="utf-8"?>
<RK7Query>
  <RK7Command CMD="SetRefData" RefName="modischemes">
    <Items>
      <Item GUIDString="{644BDCC5-9211-4B45-B114-3C73722E9117}"
            Code="3"
            Name="Scheme for sauces"
            AltName="Schéma pour les sauces"
            MainParentIdent="0"
            Status="3"
            ModiSchemeType="1"
            AutoOpen="0"
            IgnoreDefaultForKitchen="0" 
            />
    </Items>
  </RK7Command>
</RK7Query>

Where:

  • MainParentIdent —  the parent set
  • ModiSchemeType (if any) — the scheme type
  • AutoOpen — the auto-open flag
  • IgnoreDefaultForKitchen — the flag to ignore "by default"

Assigning Modifier Scheme to Dish

<?xml version="1.0" encoding="utf-8"?>
<RK7Query>
  <RK7Command CMD="SetRefData" RefName="menuitems">
    <Items>
      <Item GUIDString="{A94581EE-E6F7-4063-8275-0E35E4E9726F}"
            ModiScheme="100013" />
    </Items>
  </RK7Command>
</RK7Query>

Where ModiScheme is the Ident of the modifier scheme.

  • No labels