# Create an inventory operation

An inventory operation is created by submitting a document along with multiple product transactions in a single API request. If a payment type is specified, the corresponding financial transactions will be generated automatically.

Endpoint: POST /storage_operations/operation/{location_id}
Version: 1.0.0
Security: BearerPartnerUser

## Security:

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

## Path parameters:

  - `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

## Request fields (*/*):

  - `type_id` (number, required)
    Document type (Sale 1, Usage / Material Consumption 2, Product Receipt / Incoming 3, Inventory Write-off / Product Disposal 4, Internal Transfer 5)

  - `comment` (string)
    A comment

  - `create_date` (string, required)
    Document creation date

  - `team_member_id` (number)
    Team Member ID

  - `storage_id` (number, required)
    Inventory ID

  - `goods_transactions` (array, required)
    An array of objects containing transaction parameters, similar to a request to create a product transaction

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

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

  - `data` (object)
    Object with data

  - `data.document` (object)
    Document

  - `data.document.id` (number)
    Document ID

  - `data.document.type_id` (number)
    Document type identifier

  - `data.document.type` (object)
    Document Type

  - `data.document.type.id` (number)
    Document type identifier

  - `data.document.type.title` (string)
    Document type name

  - `data.document.storage_id` (number)
    Inventory ID

  - `data.document.user_id` (number)
    User ID

  - `data.document.company_id` (number)
    location ID

  - `data.document.number` (number)
    Document Number

  - `data.document.comment` (string)
    A comment

  - `data.document.create_date` (string)
    date of creation

  - `data.document.storage` (object)
    Inventory

  - `data.document.storage.id` (number)
    Inventory ID

  - `data.document.storage.title` (string)
    Inventory name

  - `data.document.company` (object)
    location

  - `data.document.company.id` (number)
    location ID

  - `data.document.company.title` (string)
    location name

  - `data.document.company.country_id` (number)
    Country ID

  - `data.document.company.city_id` (number)
    City ID

  - `data.document.company.timezone` (string)
    time zone

  - `data.document.company.address` (string)
    location address

  - `data.document.company.coordinate_lat` (string)
    Latitude

  - `data.document.company.coordinate_lon` (string)
    Longitude

  - `data.document.company.logo` (string)
    Let, on which the location logo is located

  - `data.document.company.zip` (string)
    Postcode

  - `data.document.company.phones` (array)
    location phone

  - `data.document.company.site` (string)
    The site of the location

  - `data.document.user` (object)
    User

  - `data.document.user.id` (number)
    User ID

  - `data.document.user.name` (string)
    Username

  - `data.document.user.phone` (string)
    User phone number

  - `data.transactions` (array)
    transaction

  - `data.transactions.id` (number)
    Transaction ID

  - `data.transactions.document_id` (number)
    Document ID

  - `data.transactions.type_id` (number)
    Document type identifier

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

  - `data.transactions.type.id` (number)
    Document type identifier

  - `data.transactions.type.title` (string)
    Document type name

  - `data.transactions.company_id` (number)
    location ID

  - `data.transactions.good_id` (number)
    Product ID

  - `data.transactions.amount` (number)
    Quantity

  - `data.transactions.cost_per_unit` (number)
    Price per unit

  - `data.transactions.discount` (number)
    Skdika

  - `data.transactions.cost` (number)
    total price

  - `data.transactions.unit_id` (number)
    Unit ID

  - `data.transactions.storage_id` (number)
    Inventory ID

  - `data.transactions.supplier_id` (number)
    Vendor ID

  - `data.transactions.client_id` (number)
    Client ID

  - `data.transactions.master_id` (number)
    team member ID

  - `data.transactions.create_date` (string)
    date of creation

  - `data.transactions.comment` (string)
    A comment

  - `data.transactions.deleted` (boolean)
    Has the transaction been deleted?

  - `data.transactions.good` (object)
    Product

  - `data.transactions.good.id` (number)
    Product ID

  - `data.transactions.good.title` (string)
    Product Name

  - `data.transactions.storage` (object)
    Inventory

  - `data.transactions.storage.id` (number)
    Inventory ID

  - `data.transactions.storage.title` (string)
    Inventory name

  - `data.transactions.supplier` (array)
    The supplier

  - `data.transactions.client` (array)
    Customer

  - `data.transactions.master` (array)
    Team Member

  - `data.transactions.unit` (object)
    Units

  - `data.transactions.unit.id` (number)
    Unit ID

  - `data.transactions.unit.title` (string)
    Unit name

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

