Create Delivery Draft

Creates a delivery.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Creates a delivery in a draft state. Also creates an aggregated delivery related to the same purchase order if it doesn't exist yet. A delivery can only be created for a purchase order in the ORDERED state, or in the DELIVERED state if it is still accepting deliveries.

Check the guide page on receiving purchase orders for more information.

Returnable packages

Returnable packages, such as crates, kegs and pallets, go in returnable_packages, one line per item and direction. Without the Returnables module, a request with returnable lines is refused with 400.

  • The sign gives the direction. A line coming in has a positive quantity, and a line going back to the supplier has a negative one. deposit_value has the same sign as quantity or is 0, and a deposit with the opposite sign is refused with 400. direction can be left out, and when it is sent it must agree with the sign of quantity.
  • Each line's supplier package must be from the order's supplier, and its stock item must be marked as returnable. In delivered_packages, such an item is refused with 400 unless it is on the order.
  • An item can be listed once in each direction. A second line for the same item and direction is refused with 400, and so is a quantity of 0.
  • returnables_in and returnables_out follow the lines. In a direction that has lines, the total is the sum of their deposits, as a positive amount. Sending a different value is refused with 400.
Body Params
string
required

A purchase order ID.

string

Any optional remarks.

delivered_packages
array of objects

A list of packages delivered.

delivered_packages
boolean
Defaults to true

If false, will not update stock when the delivery is submitted.

float

A total discount value applied to the delivery.

string

Any optional remarks about discounts.

float

Total deposit of the returnable packages coming in. When the delivery has lines coming in, this total comes from their deposits, and a different value is refused.

float

Total deposit of the returnable packages going back to the supplier, as a positive amount. When the delivery has lines going out, this total comes from their deposits, and a different value is refused.

string

Any optional remarks about returnables.

returnable_packages
array of objects

Returnable packages on the delivery, such as crates, kegs and pallets, one line per item and direction. Needs the Returnables module.

returnable_packages
Response

Language
Credentials
OAuth2
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json