Sumtracker
Sumtracker Public API v2025-03

Purchase Order Line Items API.

The purchase orders API and stock transfer API are common.

The URL param document_type is used to determine the type of document.

  • orders for purchase orders
  • stock-transfers for stock transfers

A Stock Transfer (ST) is used for moving stock from one warehouse to another.

A Purchase Order (PO) is used for purchasing products from suppliers.

Against each PO/ST,

  • You can make changes in relevant data only when PO status is DRAFT or INCOMING.
  • You can make 1 or more Receive Notes (GRNs) to receive the goods.

Conditions applicable to Purchase Order Line Items

  • A maximum of 10000 Line items are allowed in a document.
  • A document cannot have duplicate products in its line items.
  • A line item cannot have negative quantity.

List PO Lines

GET
https://inventory-api.sumtracker.com/api/version/2025-03
/purchases/{document_type}/{po_id}/lines/
Authorization (header)

Lists PO Lines for a given PO.

List PO Lines › path Parameters

document_type
​string · pattern: ^orders|stock-transf… · required
po_id
​integer · required

List PO Lines › query Parameters

error__isnull
​boolean

Set to false to filter lines that have an error.

is_due
​boolean

Set to true to filter lines that have a due quantity.

limit
​integer

Number of results to return per page.

notes
​string
o
​string[] · style: form

Ordering

  • id - Id
  • -id - Id (descending)
Enum values:
-id
id
offset
​integer

The initial index from which to return the results.

ordering
​string

Which field to use when ordering the results.

product
​number
quantity__isnull
​boolean
supplier_sku
​string
uom
​string

List PO Lines › Responses

200
count
​integer · required
​PoLine[] · required
next
​string | null · uri
previous
​string | null · uri

Create PO Line

POST
https://inventory-api.sumtracker.com/api/version/2025-03
/purchases/{document_type}/{po_id}/lines/
Authorization (header)

Creates a purchase order line.

The pack_size data is added at the time of creation, so quantity cannot be added at the time of creation. This is becuase quantity should be a multiple of the pack size value. Use the line update API to add the quantity.

Raises:

  • ValidationError if the PO is not in DRAFT status.
  • ValidationError if the product is already added in the PO.
  • ValidationError if the product is archived.
  • ValidationError if the product is a bundle product.
  • ValidationError if the PO already has 10000 lines.

Create PO Line › path Parameters

document_type
​string · pattern: ^orders|stock-transf… · required
po_id
​integer · required

Create PO Line › Request Body

Serializer used for CRUD operations of POLine.
id
​integer · readOnly · required
created
​string · date-time · readOnly · required
product_id
​integer · required
​object · readOnly · required

Product object.

quantity
​integer | null · readOnly · required
purchase_order_id
​integer · readOnly · required
is_stock_transfer
​boolean · readOnly · required
tax_id
​integer | null · readOnly · required
delivered_quantity
​integer · readOnly · required
uom
​string · readOnly · required
pack_size
​integer · readOnly · required
supplier_sku
​string · readOnly · required
notes
​string · readOnly · required
tax_rate
​string · decimal · readOnly · pattern: ^-?\d{0,8}(?:\.\d{0,… · required
cost
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
shipping_cost
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
moq
​integer · readOnly · required
line_subtotal
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
line_tax
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
line_total
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
error
​string | null · readOnly · required

Reason the line is not ready yet. Null when the line is fine. Blocks all document actions.

Create PO Line › Responses

Serializer used for CRUD operations of POLine.
id
​integer · readOnly · required
created
​string · date-time · readOnly · required
product_id
​integer · required
​object · readOnly · required

Product object.

quantity
​integer | null · readOnly · required
purchase_order_id
​integer · readOnly · required
is_stock_transfer
​boolean · readOnly · required
tax_id
​integer | null · readOnly · required
delivered_quantity
​integer · readOnly · required
uom
​string · readOnly · required
pack_size
​integer · readOnly · required
supplier_sku
​string · readOnly · required
notes
​string · readOnly · required
tax_rate
​string · decimal · readOnly · pattern: ^-?\d{0,8}(?:\.\d{0,… · required
cost
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
shipping_cost
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
moq
​integer · readOnly · required
line_subtotal
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
line_tax
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
line_total
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
error
​string | null · readOnly · required

Reason the line is not ready yet. Null when the line is fine. Blocks all document actions.


Update PO Line

PUT
https://inventory-api.sumtracker.com/api/version/2025-03
/purchases/{document_type}/{po_id}/lines/{id}/
Authorization (header)

Update a purchase order line.

Raises:

  • ValidationError if the PO is not in DRAFT status.

Update PO Line › path Parameters

document_type
​string · pattern: ^orders|stock-transf… · required
id
​integer · required
po_id
​integer · required

Update PO Line › Request Body

Serializer for updating the POLine Instance.
id
​integer · readOnly · required
created
​string · date-time · readOnly · required
product_id
​integer · readOnly · required
​object · readOnly · required

Product object.

quantity
​integer · required

quantity in multiple of pack_size.

purchase_order_id
​integer · readOnly · required
is_stock_transfer
​boolean · readOnly · required
tax_id
​integer | null · readOnly · required
delivered_quantity
​integer · readOnly · required
uom
​string · readOnly · required
pack_size
​integer · readOnly · required
supplier_sku
​string · readOnly · required
tax_rate
​string · decimal · readOnly · pattern: ^-?\d{0,8}(?:\.\d{0,… · required
moq
​integer · readOnly · required
line_subtotal
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
line_tax
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
line_total
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
error
​string | null · readOnly · required

Reason the line is not ready yet. Null when the line is fine. Blocks all document actions.

notes
​string · maxLength: 200
cost
​string · decimal · pattern: ^-?\d{0,10}(?:\.\d{0…
shipping_cost
​string · decimal · pattern: ^-?\d{0,10}(?:\.\d{0…

Update PO Line › Responses

200
Serializer for updating the POLine Instance.
id
​integer · readOnly · required
created
​string · date-time · readOnly · required
product_id
​integer · readOnly · required
​object · readOnly · required

Product object.

quantity
​integer · required

quantity in multiple of pack_size.

purchase_order_id
​integer · readOnly · required
is_stock_transfer
​boolean · readOnly · required
tax_id
​integer | null · readOnly · required
delivered_quantity
​integer · readOnly · required
uom
​string · readOnly · required
pack_size
​integer · readOnly · required
supplier_sku
​string · readOnly · required
tax_rate
​string · decimal · readOnly · pattern: ^-?\d{0,8}(?:\.\d{0,… · required
moq
​integer · readOnly · required
line_subtotal
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
line_tax
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
line_total
​string · decimal · readOnly · pattern: ^-?\d{0,10}(?:\.\d{0… · required
error
​string | null · readOnly · required

Reason the line is not ready yet. Null when the line is fine. Blocks all document actions.

notes
​string · maxLength: 200
cost
​string · decimal · pattern: ^-?\d{0,10}(?:\.\d{0…
shipping_cost
​string · decimal · pattern: ^-?\d{0,10}(?:\.\d{0…

Delete PO Line

DELETE
https://inventory-api.sumtracker.com/api/version/2025-03
/purchases/{document_type}/{po_id}/lines/{id}/
Authorization (header)

Delete a purchase order line.

Raises:

  • ValidationError if the PO is not in DRAFT status.

Delete PO Line › path Parameters

document_type
​string · pattern: ^orders|stock-transf… · required
id
​integer · required
po_id
​integer · required

Delete PO Line › Responses

No response body

No data returned