# Example of a request for fiscalization of a document

Altegio sends this request to the fiscalization URL configured by your KKM integration; it is not an Altegio API endpoint.

Endpoint: POST FiscalizeDocument
Version: 1.0.0
Security: BearerPartnerUser

## Security:

  - `BearerPartnerUser` (unknown)
    http bearer Bearer {PartnerToken}, User {UserToken}

## Header parameters:

  - `Accept` (string, required)
    application/vnd.api.v2+json

  - `Content-Type` (string, required)
    application/json

  - `Authorization` (string, required)
    Bearer partner_token

## Request fields (application/json):

  - `id` (string)
    Unique ID of the sales document

  - `date` (string)
    Date and time the document was sent for printing (in ISO-8601 format)

  - `document_id` (integer)
    Internal document identifier in the Altegio system

  - `type` (string)
    Document type (list of possible values)
    Enum: "sale", "return"

  - `print_receipt` (boolean)
    Whether to print a paper check at the checkout during fiscalization

  - `customer` (object)
    Client entity

  - `customer.email` (string)
    Client Email

  - `customer.phone` (string)
    Customer phone

  - `positions` (array)
    List of positions in the check

  - `positions.type` (string)
    Position type ("service" - service / "commodity" - product / "payment" - payment)

  - `positions.title` (string)
    Position name

  - `positions.price` (number)
    Position price with an accuracy of 2 decimal places

  - `positions.quantity` (integer)
    Quantity

  - `positions.discount_amount` (number)
    Discount applied to a position with an accuracy of 2 decimal places

  - `positions.vat` (string)
    Type of VAT (slug from VAT list)

  - `positions.payment_method` (string)
    Settlement sign ("payment" - payment / "prepayment" - prepayment)

  - `positions.barcode` (string)
    Product barcode

  - `positions.staff_id` (integer | null)
    ID of the team member who provided the service or sold the product. null if the position is issued on behalf of the location

  - `payments` (array)
    List of fees applied per check

  - `payments.type` (string)
    Type of payment ("card" - non-cash payment / "cash" - cash payment / "prepaid" - advance payment)

  - `payments.sum` (number)
    Payment amount with an accuracy of 2 decimal places

  - `tax` (string)
    Type of taxation system (slug from the list of taxation systems)

  - `cashier` (object)
    The Essence of a Cashier

  - `cashier.uid` (string)
    Cashier ID

  - `cashier.name` (string)
    Cashier's name

  - `cashier.position` (string)
    Cashier position (maximum line length - 64 characters)

  - `pos` (object)
    Options for the connected POS terminal

  - `pos.enabled` (boolean)
    Is it necessary to accept a card through a POS-terminal before fiscalization?

  - `pos.slip_count` (integer)
    Number of receipts to be printed after a successful POS transaction

  - `callback_url` (string)
    Link to update fiscal status

  - `custom_text` (string)
    Arbitrary text for printing on a receipt

## Response 200:

  - `200` (unknown)
    OK

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Authentication needed.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Access denied.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

