Documentation

sale.cashbox.handler.add

Scope: catalog Permissions to execute: for all

Description and example

Method adds a cash register REST handler.

Example

BX.rest.callMethod(
    "sale.cashbox.handler.add",
    {
        "CODE": "restcashbox01",
        "NAME": "REST cash register 01",
        "SORT": 100,
        "SETTINGS":
        {
            "PRINT_URL": "http:\/\/example.com\/rest_print.php",
            "CHECK_URL": "http:\/\/example.com\/rest_check.php",
            "CONFIG":
            {
                "AUTH": {
                    "LABEL": "Login",
                    "ITEMS": {
                        "KEYWORD": {
                            "TYPE": "STRING",
                            "LABEL": "Password"
                        },
                        "PREFERENCE": {
                            "TYPE": "ENUM",
                            "LABEL": "Multiple selection",
                            "REQUIRED": "Y",
                            "OPTIONS": {
                                "FIRST": "First",
                                "SECOND": "Second",
                                "THIRD": "Third",
                            }
                        }
                    }
                },
                "INTERACTION": {
                    "LABEL": "Cash register interaction settings",
                    "ITEMS": {
                        "MODE": {
                            "TYPE": "ENUM",
                            "LABEL": "Cash register handling mode",
                            "OPTIONS": {
                                "ACTIVE": "active",
                                "TEST": "test"
                            }
                        }
                    }
                }
            }
        }
    },
    function(result)
    {
        if(result.error())
            console.error(result.error());
        else
            console.dir(result.data());
    }
);

Parameters

Parameter Description Available from version
CODE Required. REST handler code. Can be unique among all handlers.
NAME Required. REST handler name.
SORT Sorting (100 by default).
SUPPORTS_FFD105 Cash register support for fiscal data format version 1.05 (N by default).
SETTINGS Required. Handler settings (all parameters are required):
  • PRINT_URL - address to send data for a receipt printing;
  • CHECK_URL - address for checking receipt status;
  • HTTP_VERSION - HTTP protocol version for queries. Possible values: 1.0, 1.1. When empty, uses HTTP 1.0 for queries. Parameter is available from version sale 22.0.100;
  • CONFIG - settings structure which a user can set and edit at the cash register edit page. Each key in this parameter specifies a single section at the settings page:
    • LABEL - section title;
    • ITEMS - list of section settings:
      • TYPE - settings type;
      • LABEL - settings name;
      • REQUIRED - required settings.


© «Bitrix24», 2001-2024