# Receipt of a Sales Transaction

Endpoint: GET /company/{location_id}/sale/{document_id}
Version: 1.0.0
Security: BearerPartnerUser

## Security:

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

## Path parameters:

  - `document_id` (integer, required)
    Sales Document ID

  - `location_id` (number, required)
    Location ID

## Header parameters:

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

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

  - `Authorization` (string, required)
    Bearer partner_token, User user_token

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `success` (boolean)
    Execution success status (true)

  - `data` (object)
    Object with data

  - `data.state` (object)

  - `data.state.items` (array)

  - `data.state.items.id` (number)
    Selling unit ID

  - `data.state.items.type` (string)
    Type (service/product)

  - `data.state.items.title` (string)
    Name

  - `data.state.items.amount` (number)
    Quantity

  - `data.state.items.default_cost_per_unit` (number)
    Unit price

  - `data.state.items.default_cost_total` (number)
    Total default price

  - `data.state.items.client_discount_percent` (number)
    Discount percentage

  - `data.state.items.cost_to_pay_total` (number)
    Payable price

  - `data.state.loyalty_transactions` (array)
    Loyalty Payment Transaction

  - `data.state.loyalty_transactions.id` (integer)
    Loyalty transaction ID

  - `data.state.loyalty_transactions.document_id` (integer)
    Document ID

  - `data.state.loyalty_transactions.sale_item_id` (integer)
    Sold unit ID

  - `data.state.loyalty_transactions.sale_item_type` (string)
    Unit sold type

  - `data.state.loyalty_transactions.amount` (number)
    Transaction amount

  - `data.state.loyalty_transactions.type_id` (integer)
    Transaction type identifier

  - `data.state.loyalty_transactions.created_at` (string)
    date of creation

  - `data.state.loyalty_transactions.deposit_transaction_id` (integer)
    Transaction ID (depends on type)

  - `data.state.loyalty_transactions.chain` (object)
    Location chain

  - `data.state.loyalty_transactions.chain.id` (integer)
    Location chain ID

  - `data.state.loyalty_transactions.chain.title` (string)
    Location chain name

  - `data.state.loyalty_transactions.type` (object)
    Transaction type

  - `data.state.loyalty_transactions.type.id` (integer)
    Transaction type ID

  - `data.state.loyalty_transactions.type.title` (string)
    Transaction type name

  - `data.state.loyalty_transactions.deposit` (object)
    Withdrawal from personal account

  - `data.state.loyalty_transactions.deposit.id` (integer)
    Personal account ID

  - `data.state.loyalty_transactions.deposit.balance` (number)
    Available personal account balance

  - `data.state.loyalty_transactions.deposit.reserved_balance` (number)
    Amount currently reserved by active holds

  - `data.state.loyalty_transactions.deposit.type` (object)
    Client account type

  - `data.state.loyalty_transactions.deposit.type.id` (integer)
    Client account type identifier

  - `data.state.loyalty_transactions.deposit.type.title` (string)
    Name of the client account

  - `data.state.payment_transactions` (array)
    Cashier payment transaction

  - `data.state.payment_transactions.id` (integer)
    Payment transaction ID

  - `data.state.payment_transactions.document_id` (integer)
    Document ID

  - `data.state.payment_transactions.sale_item_id` (integer)
    Sold unit ID

  - `data.state.payment_transactions.sale_item_type` (string)
    Unit sold type

  - `data.state.payment_transactions.expense_id` (integer)
    Payment Item ID

  - `data.state.payment_transactions.account_id` (integer)
    Checkout ID

  - `data.state.payment_transactions.created_at` (string)
    date of creation

  - `data.state.payment_transactions.account` (object)
    Location account

  - `data.state.payment_transactions.account.id` (integer)
    Checkout ID

  - `data.state.payment_transactions.account.title` (string)
    Location account name

  - `data.state.payment_transactions.account.is_cash` (boolean)
    Is the payment in cash

  - `data.state.payment_transactions.account.is_default` (boolean)
    Is the checkout by default

  - `data.state.payment_transactions.expense` (object)
    Payment Article

  - `data.state.payment_transactions.expense.id` (integer)
    Payment Item ID

  - `data.state.payment_transactions.expense.title` (string)
    Name of payment item

  - `data.kkm_state` (object)

  - `data.kkm_state.last_operation_type` (integer)
    Type of last KKM operation

  - `data.kkm_state.transactions` (array)
    KKM transaction

  - `data.kkm_state.transactions.id` (integer)
    KKM transaction ID

  - `data.kkm_state.transactions.document_id` (integer)
    Document ID

  - `data.kkm_state.transactions.print_date` (string)
    Check printing date

  - `data.kkm_state.transactions.printed_count` (integer)

  - `data.kkm_state.transactions.sum` (integer)

  - `data.kkm_state.transactions.type` (object)

  - `data.kkm_state.transactions.type.id` (integer)

  - `data.kkm_state.transactions.type.title` (string)

  - `data.kkm_state.transactions.status` (object)
    Receipt printing status

  - `data.kkm_state.transactions.status.id` (integer)
    Status ID

  - `data.kkm_state.transactions.status.title` (string)
    Status name

  - `data.kkm_state.transactions.document` (object)

  - `data.kkm_state.transactions.document.id` (integer)
    Document ID

  - `data.kkm_state.transactions.document.type` (integer)
    Document Type

  - `data.kkm_state.transactions.document.type_title` (string)
    Document type name

  - `data.kkm_state.transactions.cashier` (object)
    Cashier

  - `data.kkm_state.transactions.cashier.id` (integer)
    team member ID

  - `data.kkm_state.transactions.cashier.name` (string)
    team member name

  - `data.payment_methods` (array)

  - `data.payment_methods.slug` (string)
    Payment method type

  - `data.payment_methods.is_applicable` (boolean)
    Is it possible to use this method

  - `data.payment_methods.applicable_amount` (number)
    Possible amount accepted for payment

  - `data.payment_methods.applicable_count` (integer)
    Possible number of visits (in case of membership)

  - `data.payment_methods.applicable_value` (number)
    Applicable bonus (in the case of a loyalty program)

  - `data.payment_methods.account_id` (integer)
    Checkout ID (depends on slug)

  - `data.payment_methods.account` (object)
    Location account

  - `data.payment_methods.account.id` (integer)
    Checkout ID

  - `data.payment_methods.account.title` (string)
    Location account name

  - `data.payment_methods.account.is_cash` (boolean)
    Is the location account cash

  - `meta` (array)
    Metadata (empty array)

## 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: {}

