Receipt.Credit
Adds a credit receipt.
General payment restrictions apply: when validation through the OFD is enabled, the presence of restricted products or exceeding the cash payment threshold for an ICPS code prohibits any cash amount in the entire receipt. A violation returns 701003.
Input parameters
| Name | Data type | Required | Parameter description |
|---|---|---|---|
| cashier_name | string | Optional | Full name of the cashier in the client's system. If omitted, the name of the user executing the request is used |
| code | string | Optional | Receipt number in the client's system. When a receipt is added, its code is checked for uniqueness. If a receipt with the same code was previously added to the REGOS: VCR database, the receipt is rejected. If the field is omitted (null) or contains an empty string, the check is skipped and the receipt is added with an automatically generated code. The check can be disabled in the REGOS: VCR settings: Check uniqueness by receipt code from an external system. When the check is disabled, receipts with duplicate codes can be added. |
| phone | string | Optional | Contains the phone number. If the receipt contains payments through electronic payment systems and a phone number obtained through a payment system is specified in the payment, the phone field in the Receipt.Sale model is ignored |
| pos_id | string | Optional | Cash register ID in the client's system. Defaults to VCR if omitted |
| seller_name | string | Optional | Seller's name in the client's system (an empty string is allowed) |
| session_code | string | Optional | Cash register shift number in the client's system |
| positions | Array of positions | Required | Product items: an array of positions objects. The array must contain no more than 150 objects |
| payments | Array of payments | Required | Array of payments. No more than one object with payment type type = 2 can be added |
| custom_variables | Array of custom_variables | Optional | Custom variables for receipt printing: an array of custom_variables objects |
Note: A credit receipt is not registered in the fiscal module. Payment through payment systems is unavailable for a credit receipt and results in a REGOS: VCR error.
When a product is handed over or a service is provided on an installment plan (credit), a fiscal receipt is issued using Receipt.Sale. A credit receipt is issued to the customer when part of the payment for the product or service is received.
Request example
{
"id": 1,
"auth": "a2Fzc2E6a2FzMTIzNDU2",
"method": "Receipt.Credit",
"params": {
"cashier_name": "Administrator",
"code": "1-0000782",
"phone": "998918935861",
"pos_id": "00027",
"seller_name": null,
"session_code": "1-0000086",
"positions": [
{
"amount": 900000,
"articul": "",
"barcode": "000001",
"brand_name": null,
"code": "000001",
"color_name": null,
"commission_inn": "923409418",
"country_name": null,
"department_name": null,
"discount": 0,
"group_name": "Напитки",
"icps": "02202002001010036",
"label": "",
"name": "Coca-cola",
"package_code": "1218868",
"producer_name": "Coca Cola",
"quantity": 1000,
"size_name": null,
"type_name": "Товар",
"unit_name": "шт",
"vat_value": 1500
}
],
"payments": [
{
"type": 1,
"value": 500000,
"payment_id": "4411-563-4236"
},
{
"type": 2,
"value": 400000,
"payment_id": "4341-563-4536",
"сard_type": 2,
"RRN": "847204678473"
}
],
"custom_variables": null
},
"jsonrpc": "2.0"
}
Note: Each label parameter in the positions model must be unique within a single request.
Output parameters
| Name | Data type | Parameter description |
|---|---|---|
| id | string | ID of the receipt created in REGOS: VCR |
Response example
{
"id":1,
"ok":true,
"result": { "id":"3ca29f3a-c19a-4a43-ba28-8425bf9bf383" },
"jsonrpc":"2.0"
}