POST api/stocktransfer/Create

Creates a new stock transfer.

Request Information

URI Parameters

None.

Body Parameters

The stock transfer object to be created.

StockTransferRequest
NameDescriptionTypeAdditional information
Lines

Collection of StockTransferLinePostRequest

Required

Status

Status for the stock transfer

StockTransferStatus

None.

WmsStatus

The WMS status for the stock transfer

WMSStatus

None.

ReceiverBranchId

Id of receiving branch. Receiver or sending branch must be a central warehouse branch.

integer

Required

SenderBranchId

Id of sending branch. Receiver or sending branch must be a central warehouse branch.

integer

Required

OrderDate

Order date.

date

Required

Note

Stock transfer note. Maxlength 255 characters.

string

Max length: 255

Express

Indicates if the stock transfer will be sent with WMS express.

boolean

Required

PreSeason

Indicates if the stock transfer is a pre season order.

boolean

Required

CarrierId

Id of the carrier. Indicates to the WMS system which carrier to use.
Used in combination with delivery date instead of transportation schedule.
If transportation schedule is given the carrier id is ignored.
For a list of available carriers use http://localhost/api/carriers

integer

None.

DeliveryDate

Desired delivery date. Indicates to the WMS system the date of delivery.
Used in combination with carrier id instead of transportation schedule.
If transportation schedule is given the delivery date is ignored.

date

None.

TransportationScheduleId

Id of the transportation schedule to use for the order. If this is set carrier and delivery date are ignored.
For a list if transportation schedules use http://localhost/api/transportationschedules

integer

None.

CreatedByUsername

The name for individual who created the stock transfer.

string

Required

Max length: 255

Remarks


Receiver or sending branch must be a central warehouse branch.


The transporting options for the stock transfer are as follows:
If a transportation schedule is supplied it is used. A transportation schedule overrides any carrier and delivery date specified.
Carrier and delivery date are used if supplied with the stock transfer.
If no transportation scheduler and no carrier with delivery date are supplied then the default transportation schedule for receiving branch are used.


Errors are returned and the stock transfer is not saved when the following occurs:
1. The stock transfer does not contain any order lines.
2. Branch id for receiver or sender is not found.
3. Invalid stock id on an line.
4. The tranportation schedule id is not found.
5. The carrier id is not found.
6. If a required field is ignored or a string properties max length is violated.
7. If a general error should occur.

Example

None.

Request Formats

application/json, text/json

Sample:
{
  "Lines": [
    {
      "LineNumber": 1,
      "Status": 1,
      "ArticleNumber": 2,
      "SenderStockId": "566780ca-7fe2-4329-80e0-8e3a47f64aa8",
      "ReceiverStockId": "baed586c-a0f7-4647-b09d-acef0cb39fac",
      "Quantity": 5.0,
      "Description": "sample string 6",
      "Note": "sample string 7"
    },
    {
      "LineNumber": 1,
      "Status": 1,
      "ArticleNumber": 2,
      "SenderStockId": "566780ca-7fe2-4329-80e0-8e3a47f64aa8",
      "ReceiverStockId": "baed586c-a0f7-4647-b09d-acef0cb39fac",
      "Quantity": 5.0,
      "Description": "sample string 6",
      "Note": "sample string 7"
    }
  ],
  "Status": 1,
  "WmsStatus": 1,
  "ReceiverBranchId": 1,
  "SenderBranchId": 2,
  "OrderDate": "12/21/2025 1:04:33 PM",
  "Note": "sample string 4",
  "Express": true,
  "PreSeason": true,
  "CarrierId": 1,
  "DeliveryDate": "12/21/2025 1:04:33 PM",
  "TransportationScheduleId": 1,
  "CreatedByUsername": "sample string 7"
}

application/xml, text/xml

Sample:
<StockTransferRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Compilator.DDAPI.DTO.Stock">
  <CarrierId>1</CarrierId>
  <CreatedByUsername>sample string 7</CreatedByUsername>
  <DeliveryDate>2025-12-21T13:04:33.9338245+00:00</DeliveryDate>
  <Express>true</Express>
  <Note>sample string 4</Note>
  <OrderDate>2025-12-21T13:04:33.9338245+00:00</OrderDate>
  <PreSeason>true</PreSeason>
  <ReceiverBranchId>1</ReceiverBranchId>
  <SenderBranchId>2</SenderBranchId>
  <Status>Open</Status>
  <TransportationScheduleId>1</TransportationScheduleId>
  <WmsStatus>NotSent</WmsStatus>
  <Lines>
    <StockTransferLinePostRequest>
      <ArticleNumber>2</ArticleNumber>
      <Description>sample string 6</Description>
      <LineNumber>1</LineNumber>
      <Note>sample string 7</Note>
      <Quantity>5</Quantity>
      <ReceiverStockId>baed586c-a0f7-4647-b09d-acef0cb39fac</ReceiverStockId>
      <SenderStockId>566780ca-7fe2-4329-80e0-8e3a47f64aa8</SenderStockId>
      <Status>Open</Status>
    </StockTransferLinePostRequest>
    <StockTransferLinePostRequest>
      <ArticleNumber>2</ArticleNumber>
      <Description>sample string 6</Description>
      <LineNumber>1</LineNumber>
      <Note>sample string 7</Note>
      <Quantity>5</Quantity>
      <ReceiverStockId>baed586c-a0f7-4647-b09d-acef0cb39fac</ReceiverStockId>
      <SenderStockId>566780ca-7fe2-4329-80e0-8e3a47f64aa8</SenderStockId>
      <Status>Open</Status>
    </StockTransferLinePostRequest>
  </Lines>
</StockTransferRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'StockTransferRequest'.

Response Information

Resource Description

An object containing ids for WMS and the actual stock transfer. A Success property is set to false if something is wrong and a list of all the errors is supplied.

StockTransferPostResponse
NameDescriptionTypeAdditional information
Id

Id of the stock transfer.

integer

None.

Success

Indicates if the request was successfull.

boolean

None.

WmsId

Id for WMS on the stock transfer.

integer

None.

Messages

Is Success is false, then there are error codes and messages in this list
indicating what went wrong.

Collection of StockTransferMessage

None.

Response Formats

application/json, text/json

Sample:

Sample not available.