Get invoice fields and the products included in it crm.invoice.fields

Scope: crm

Who can execute the method: any user

Warning

The method is deprecated. It is recommended to use Universal methods for invoices

The method returns a description of the fields of the invoice, including custom fields.

No parameters.

Code examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.invoice.fields
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/crm.invoice.fields
        
try
        {
        	const response = await $b24.callMethod(
        		'crm.invoice.fields',
        		{}
        	);
        	
        	const result = response.getData().result;
        	if (result.error())
        	{
        		console.error(result.error());
        	}
        	else
        	{
        		console.dir(result);
        	}
        }
        catch(error)
        {
        	console.error('Error:', error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'crm.invoice.fields',
                    []
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            if ($result->error()) {
                error_log($result->error());
            } else {
                echo 'Success: ' . print_r($result->data(), true);
            }
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error fetching invoice fields: ' . $e->getMessage();
        }
        
BX24.callMethod(
            "crm.invoice.fields",
            {},
            function(result)
            {
                if(result.error())
                    console.error(result.error());
                else
                    console.dir(result.data());
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'crm.invoice.fields',
            []
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        

Returned data

Required parameters are marked with *

Name
type

Description

Note

ID
integer

Identifier

Read-only

ACCOUNT_NUMBER*
string

Number

COMMENTS
text

Manager's comment

CREATED_BY
integer

Created by user

Read-only

CURRENCY
crm_currency

Currency identifier

Read-only

DATE_BILL
date

Invoice date

DATE_INSERT
datetime

Creation date

DATE_MARKED
datetime

Rejection date

Specified if the invoice is rejected

DATE_PAY_BEFORE
date

Payment due date

DATE_PAYED
datetime

Date changed to paid status

Read-only

DATE_STATUS
datetime

Date of status change

Read-only

DATE_UPDATE
datetime

Date of modification

Read-only

EMP_PAYED_ID
integer

Identifier of the user who last marked the invoice as "paid"

Read-only

EMP_STATUS_ID
integer

Identifier of the user who last changed the invoice status

Read-only

LID
integer

Site identifier

Read-only

XML_ID
string

External code

ORDER_TOPIC*
string

Subject

PAY_SYSTEM_ID*
integer

Identifier of the printed form

PAY_VOUCHER_DATE
date

Payment date

Specified if the invoice is paid

PAY_VOUCHER_NUM
string

Payment document number

Specified if the invoice is paid

PAYED
char

Payment status

Read-only

PERSON_TYPE_ID*
integer

Payer type identifier

PRICE
double

Amount

Read-only

REASON_MARKED
string

Status comment

Specified if the invoice is paid or rejected

RESPONSIBLE_EMAIL
string

Responsible person's e-mail

Read-only

RESPONSIBLE_ID
integer

Identifier of the responsible person

RESPONSIBLE_LAST_NAME
string

Last name of the responsible person

Read-only

RESPONSIBLE_LOGIN
string

Login of the responsible person

Read-only

RESPONSIBLE_NAME
string

First name of the responsible person

Read-only

RESPONSIBLE_PERSONAL_PHOTO
integer

Identifier of the responsible person's photo

Read-only

RESPONSIBLE_SECOND_NAME
string

Middle name of the responsible person

Read-only

RESPONSIBLE_WORK_POSITION
string

Position of the responsible person

Read-only

STATUS_ID
crm_status

Status identifier

Identifier of the "INVOICE_STATUS" reference

TAX_VALUE
double

Tax amount

Read-only

UF_COMPANY_ID
integer

Company identifier

Specified if the payer is a "Legal entity"

UF_CONTACT_ID
integer

Contact identifier

Specified if the payer is an "Individual", or as a contact person for the company

UF_MYCOMPANY_ID
integer

Identifier of your company

Specified as the company with the invoice details (link to the details is set separately)

UF_DEAL_ID
integer

Identifier of the related deal

USER_DESCRIPTION
string

Comment

PR_LOCATION
integer

Location identifier

Required if using tax mode on the document

INVOICE_PROPERTIES
array

List of properties

If the client is a company, the following keys can be specified (all values are of type string):

  • COMPANY - Company name;
  • COMPANY_ADR - Address;
  • CONTACT_PERSON - Contact person;
  • EMAIL - E-mail;
  • PHONE - Phone;
  • INN - Tax ID;
  • KPP - Tax Registration Reason Code.

If the client is a contact:

  • FIO - Full name;
  • ADDRESS - Address;
  • EMAIL - E-mail;
  • PHONE - Phone.

PRODUCT_ROWS
array

List of product items

Fields of the product item:

  • ID - Identifier (integer), specify 0 for a new record;
  • PRICE - Price (double);
  • DISCOUNT_PRICE - Discount per product unit (double);
  • PRODUCT_ID - Identifier of the product in the catalog (integer), 0 if not from the catalog;
  • PRODUCT_NAME - Name of the product item (string);
  • VAT_RATE - VAT rate coefficient (double);
  • VAT_INCLUDED - VAT included in the price ('Y' or 'N') (char);
  • MEASURE_CODE - Measurement unit code (integer);
  • MEASURE_NAME - Measurement unit designation (string);
  • CATALOG_XML_ID - External catalog code (string), read-only;
  • PRODUCT_XML_ID - External product item code (string), matches the external product code if it is from the catalog. Read-only.
  • QUANTITY - Quantity.