Skip to content

Organizational transfer ​

Stock transfers between organizations

INFO

Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.

POST /organizational-transfer/create ​

Create a new organizational transfer (cross-organization stock movement) in DRAFT or NEW state.

So‘rov tanasi

MaydonTurMajburiyTavsif
codestringYo‘qOptional custom transfer code / reference number
source_organization_idstringHaSending organization ObjectId
destination_organization_idstringHaReceiving organization ObjectId
statestringHaInitial state — draft (held) or new (ready to process). Mumkin qiymatlar: draft, new
invoice_createdbooleanYo‘qWhether a supplier invoice was created for this transfer. Standart: false
with_pricebooleanYo‘qWhether product prices are included in the transfer. Standart: false
datestring (date-time)HaTransfer document date (ISO 8601)
shipping_datestring (date-time)HaExpected shipment date (ISO 8601)
sender_warehouse_idstringHaSource warehouse ObjectId
sender_employee_idstringHaEmployee responsible for sending ObjectId
reason_idstringHaTransfer reason ObjectId
price_idstringYo‘qPrice-list ObjectId (optional)
notestringYo‘qOptional free-text note (max 500 characters)
currencyobjectYo‘qCurrency snapshot at transfer time (optional)
currency._idstringYo‘qCurrency ObjectId
currency.namestringHa
currency.valuenumberHaExchange rate value
currency.symbolstringYo‘q
requestsobject[]HaOne or more transfer request lines (each may reference a transfer-request document)
requests[].request_idstringYo‘qLinked transfer-request ObjectId (optional)
requests[].productsobject[]HaProducts included in this request line
requests[].products[].product_idstringHaProduct ObjectId
requests[].products[].amountnumberHaQuantity to transfer (must be positive)
requests[].products[].pricenumberYo‘qUnit price (optional; required when with_price=true)
requests[].products[].box_countnumberYo‘qNumber of boxes (integer ≥ 0). Standart: 0
requests[].products[].box_itemnumberYo‘qItems per box
requests[].products[].marksstring[]Yo‘qMark/serial codes for marked goods. Standart: []
requests[].products[].expiration_datestring (date-time)Yo‘qExpiration date (ISO 8601) for perishable goods
requests[].products[].extra_costsobject[]Yo‘qPer-product additional costs. Standart: []
additional_costsobject[]Yo‘qTransfer-level additional costs. Standart: []
additional_costs[].extra_cost_idstringYo‘q
additional_costs[].amountnumberYo‘q
attachmentsobject[]Yo‘qAttached files (documents, scans). Standart: []
attachments[].namestringYo‘q
attachments[].urlstringYo‘q
json
{
  "code": "string",
  "source_organization_id": "string",
  "destination_organization_id": "string",
  "state": "draft",
  "invoice_created": false,
  "with_price": false,
  "date": "2025-05-01T12:00:00Z",
  "shipping_date": "2025-05-01T12:00:00Z",
  "sender_warehouse_id": "string",
  "sender_employee_id": "string",
  "reason_id": "string",
  "price_id": "string",
  "note": "string",
  "currency": {
    "_id": "string",
    "name": "string",
    "value": 0,
    "symbol": "string"
  },
  "requests": [
    {
      "request_id": "string",
      "products": []
    }
  ],
  "additional_costs": [
    {
      "extra_cost_id": "string",
      "amount": 0
    }
  ],
  "attachments": [
    {
      "name": "string",
      "url": "string"
    }
  ]
}

Javob

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "string",
  "time": "2025-05-01T12:00:00Z"
}

GET /organizational-transfer/get-by-id/{id} ​

Fetch a single organizational transfer by ObjectId (aggregated detail view with products and requests).

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaOrganizational transfer ObjectId

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

MaydonTurTavsif
_idstringTransfer ObjectId
numberstringAuto-generated transfer document number
codestringCustom reference code
statestringMumkin qiymatlar: draft, new, accepted, in_progress, done, canceled
typestringTransfer type (o2o for organizational transfers)
source_organization_idstring
destination_organization_idstring
sender_warehouse_idstring
receiver_warehouse_idstringSet after receive; null until received
sender_employee_idstring
reason_idstring
price_idstring
datestring (date-time)
shipping_datestring (date-time)
invoice_createdboolean
with_priceboolean
notestring
total_amountnumberTotal quantity across all products
total_costnumber
total_pricenumber
total_extra_costnumber
requestsobject[]Transfer request lines with their product details
requests[].request_idstring
requests[].productsobject[]
requests[].products[].product_idstring
requests[].products[].amountnumber
requests[].products[].pricenumber
requests[].products[].box_countnumber
requests[].products[].marksstring[]
requests[].products[].expiration_datestring (date-time)
requests[].products[].sender_stock_beforenumberSender warehouse stock before outflow
requests[].products[].sender_stock_afternumberDerived: sender_stock_before − amount
requests[].products[].receiver_stock_beforenumberReceiver warehouse stock before inflow (set after receive)
requests[].products[].receiver_stock_afternumberDerived: receiver_stock_before + amount (set after receive)
additional_costsobject[]
attachmentsobject[]
created_atstring (date-time)
updated_atstring (date-time)
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "number": "string",
    "code": "string",
    "state": "draft",
    "type": "string",
    "source_organization_id": "string",
    "destination_organization_id": "string",
    "sender_warehouse_id": "string",
    "receiver_warehouse_id": "string",
    "sender_employee_id": "string",
    "reason_id": "string",
    "price_id": "string",
    "date": "2025-05-01T12:00:00Z",
    "shipping_date": "2025-05-01T12:00:00Z",
    "invoice_created": false,
    "with_price": false,
    "note": "string",
    "total_amount": 0,
    "total_cost": 0,
    "total_price": 0,
    "total_extra_cost": 0,
    "requests": [
      {
        "request_id": "string",
        "products": []
      }
    ],
    "additional_costs": [
      {}
    ],
    "attachments": [
      {}
    ],
    "created_at": "2025-05-01T12:00:00Z",
    "updated_at": "2025-05-01T12:00:00Z"
  },
  "time": "2025-05-01T12:00:00Z"
}

POST /organizational-transfer/get-paging ​

Paginated list of organizational transfers, filterable by organization, warehouse, state, and reason.

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumberHaStandart: 1
limitnumberHaStandart: 20
source_organization_idstringYo‘qFilter by sending organization ObjectId
destination_organization_idstringYo‘qFilter by receiving organization ObjectId
sender_warehouse_idstringYo‘qFilter by sender warehouse ObjectId
receiver_warehouse_idstringYo‘qFilter by receiver warehouse ObjectId
statesstring[]Yo‘qFilter by one or more transfer states
reason_idstringYo‘qFilter by transfer reason ObjectId
json
{
  "page": 1,
  "limit": 20,
  "source_organization_id": "string",
  "destination_organization_id": "string",
  "sender_warehouse_id": "string",
  "receiver_warehouse_id": "string",
  "states": [
    "draft"
  ],
  "reason_id": "string"
}

Javob

MaydonTurTavsif
totalnumber
listany[]
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "list": []
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /organizational-transfer/update/{id} ​

Update an existing organizational transfer. Only allowed in DRAFT or NEW state.

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaOrganizational transfer ObjectId

So‘rov tanasi

MaydonTurMajburiyTavsif
codestringYo‘qOptional custom transfer code / reference number
source_organization_idstringHaSending organization ObjectId
destination_organization_idstringHaReceiving organization ObjectId
statestringHaInitial state — draft (held) or new (ready to process). Mumkin qiymatlar: draft, new
invoice_createdbooleanYo‘qWhether a supplier invoice was created for this transfer. Standart: false
with_pricebooleanYo‘qWhether product prices are included in the transfer. Standart: false
datestring (date-time)HaTransfer document date (ISO 8601)
shipping_datestring (date-time)HaExpected shipment date (ISO 8601)
sender_warehouse_idstringHaSource warehouse ObjectId
sender_employee_idstringHaEmployee responsible for sending ObjectId
reason_idstringHaTransfer reason ObjectId
price_idstringYo‘qPrice-list ObjectId (optional)
notestringYo‘qOptional free-text note (max 500 characters)
currencyobjectYo‘qCurrency snapshot at transfer time (optional)
currency._idstringYo‘qCurrency ObjectId
currency.namestringHa
currency.valuenumberHaExchange rate value
currency.symbolstringYo‘q
requestsobject[]HaOne or more transfer request lines (each may reference a transfer-request document)
requests[].request_idstringYo‘qLinked transfer-request ObjectId (optional)
requests[].productsobject[]HaProducts included in this request line
requests[].products[].product_idstringHaProduct ObjectId
requests[].products[].amountnumberHaQuantity to transfer (must be positive)
requests[].products[].pricenumberYo‘qUnit price (optional; required when with_price=true)
requests[].products[].box_countnumberYo‘qNumber of boxes (integer ≥ 0). Standart: 0
requests[].products[].box_itemnumberYo‘qItems per box
requests[].products[].marksstring[]Yo‘qMark/serial codes for marked goods. Standart: []
requests[].products[].expiration_datestring (date-time)Yo‘qExpiration date (ISO 8601) for perishable goods
requests[].products[].extra_costsobject[]Yo‘qPer-product additional costs. Standart: []
additional_costsobject[]Yo‘qTransfer-level additional costs. Standart: []
additional_costs[].extra_cost_idstringYo‘q
additional_costs[].amountnumberYo‘q
attachmentsobject[]Yo‘qAttached files (documents, scans). Standart: []
attachments[].namestringYo‘q
attachments[].urlstringYo‘q
json
{
  "code": "string",
  "source_organization_id": "string",
  "destination_organization_id": "string",
  "state": "draft",
  "invoice_created": false,
  "with_price": false,
  "date": "2025-05-01T12:00:00Z",
  "shipping_date": "2025-05-01T12:00:00Z",
  "sender_warehouse_id": "string",
  "sender_employee_id": "string",
  "reason_id": "string",
  "price_id": "string",
  "note": "string",
  "currency": {
    "_id": "string",
    "name": "string",
    "value": 0,
    "symbol": "string"
  },
  "requests": [
    {
      "request_id": "string",
      "products": []
    }
  ],
  "additional_costs": [
    {
      "extra_cost_id": "string",
      "amount": 0
    }
  ],
  "attachments": [
    {
      "name": "string",
      "url": "string"
    }
  ]
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /organizational-transfer/create.

PUT /organizational-transfer/set-status/{id} ​

Transition the transfer through the state machine. Valid transitions: NEW→DRAFT|CANCELED|ACCEPTED; DRAFT→NEW; ACCEPTED→IN_PROGRESS|CANCELED; IN_PROGRESS→CANCELED; DONE→CANCELED. Use receive for the ACCEPTED/IN_PROGRESS→DONE transition.

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaOrganizational transfer ObjectId

So‘rov tanasi

MaydonTurMajburiyTavsif
statestringHaTarget state. Valid transitions: NEW→DRAFT|CANCELED|ACCEPTED; DRAFT→NEW; ACCEPTED→IN_PROGRESS|CANCELED; IN_PROGRESS→CANCELED; DONE→CANCELED. Use the receive endpoint to transition to DONE.. Mumkin qiymatlar: draft, new, accepted, in_progress, canceled
json
{
  "state": "draft"
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /organizational-transfer/create.

PUT /organizational-transfer/receive/{id} ​

Receive an accepted organizational transfer: transitions ACCEPTED or IN_PROGRESS → DONE and applies stock movement into the receiver warehouse.

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaOrganizational transfer ObjectId

So‘rov tanasi

MaydonTurMajburiyTavsif
receiver_warehouse_idstringHaDestination warehouse ObjectId where stock will be received
json
{
  "receiver_warehouse_id": "string"
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /organizational-transfer/create.


Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.

Bito 2.0 Integration API