Documentation

sale.cashbox.list

Scope: catalog Permissions to execute: for all

Description and example

Method returns list of configured cash registers.

Example

// selecting all fields for cash registers
BX.rest.callMethod(
    "sale.cashbox.list",
    {
        
    },
    function(result)
    {
        if(result.error())
            console.error(result.error());
        else
            console.dir(result.data());
    }
);
 
// selecting specific fields
BX.rest.callMethod(
    "sale.cashbox.list",
    {
        "SELECT": ["ID", "NAME"]
    },
    function(result)
    {
        if(result.error())
            console.error(result.error());
        else
            console.dir(result.data());
    }
);
 
// filtering elements
BX.rest.callMethod(
    "sale.cashbox.list",
    {
        "SELECT": ["ID", "NAME"],
        "FILTER": {">ID": 9}
    },
    function(result)
    {
        if(result.error())
            console.error(result.error());
        else
            console.dir(result.data());
    }
);
 
BX.rest.callMethod(
    "sale.cashbox.list",
    {
        "SELECT": ["ID", "NAME"],
        "FILTER": {"=NAME": "My Rest cash register"}
    },
    function(result)
    {
        if(result.error())
            console.error(result.error());
        else
            console.dir(result.data());
    }
);
 
// sorting elements
BX.rest.callMethod(
    "sale.cashbox.list",
    {
        "SELECT": ["ID", "NAME"],
        "ORDER": {"ID": "DESC"},
    },
    function(result)
    {
        if(result.error())
            console.error(result.error());
        else
            console.dir(result.data());
    }
);

Parameters

ParameterDescriptionVersion
SELECT List of selected fields. Fields, available for selection:
  • ID - cash register ID;
  • NAME - cash register name;
  • HANDLER - handler;
  • OFD - fiscal data operator handler code;
  • OFD_SETTINGS - fiscal data operator settings;
  • EMAIL - email to receive notifications in case of errors when printing receipts;
  • DATE_CREATE - data when created;
  • DATE_LAST_CHECK - date of last check;
  • NUMBER_KKM - cash register external ID;
  • KKM_ID - Cash register ID;
  • ACTIVE - Cash register activity;
  • SORT - sorting;
  • USE_OFFLINE - use offline cash;
  • ENABLED - availability;
  • SETTINGS - cash register settings according to settings structure.
FILTER List of filters. Format is the same as ORM filters (for example, in getList For the new API to be more convenient and more familiar for developers, we have preserved the name of the most popular method: getList. However, if previously each getList had its own standalone set of parameters and non-transparent behaviour, now this method is uniform for all entities and is subject to the same laws. It means that all attempts by developers to create a "band-aid" solution in getList will have no effect.

Learn more...
).
ORDER Sorting parameters. Format: {field: direction (ASC, DESC)}.


© «Bitrix24», 2001-2024
Up