For the complete documentation index, see llms.txt. This page is also available as Markdown.

Save a Packing Slip Against a Sale Order

Creates a packing slip against a sale order that is already in Logic ERP. A packing slip records which goods were packed in which box for an order: it takes the packed quantity off the order's pending quantity and sets the stock aside in the godown, so it is no longer free to sell. The packed goods are then billed or transferred from the packing slip – with Save a Sale Invoice Against a Delivery Order or Save a Stock Transfer Out Against a Delivery Order, using the packing slip's LastSavedCode.

You send the sale order, the godown you packed from, and for each item the boxes and the quantity in each box. Logic ERP picks the lots, links every unit to an open line of the order and saves the packing slip.

Endpoint

Name
Detail

Address

https://your-server/api/PackingSlipAgainstSO

Method

POST

Authorization

Basic Auth

A second address, PackingSlipDeliveryOrder, saves the same packing slip with a looser item check – see Save a Packing Slip Allowing Items Outside the Sale Order.

The response envelope, branches, dates, queueing and the common messages are explained in How Every API Call Works.

Before you start

Your Logic ERP team must choose, in your API site's settings for this endpoint, a packing slip configuration (and may set a packing slip prefix). The configuration decides several things described below: how ItemCode is read, whether bins are used, whether negative stock or more than the order's pending quantity is allowed, and how lots are chosen. Without a configuration every request is refused.

Request fields

Field names are matched without regard to upper/lower case; fields not listed are ignored.

Field
Type
Required
Default
Meaning

SaleOrderVouchCode

number

Yes, or PartyOrderNo

0

Logic ERP's internal number of the sale order – the LastSavedCode from Save a Sale Order, or the order's internal number in Get Sale Orders.

PartyOrderNo

text

Yes, if SaleOrderVouchCode is 0

empty

The order's party order number (the Party_Order_No sent with Save a Sale Order). Used only when SaleOrderVouchCode is 0: Logic ERP looks for an order of the branch with exactly this party order number.

BranchCode

number

Recommended (or BranchShortName)

0

The branch the packing slip is saved in and packed from, by Logic ERP's branch number (Branch_Code in Get Branch Info). Send the sale order's branch. When neither this nor BranchShortName is sent, the default branch is used (see How Every API Call Works).

BranchShortName

text

No

empty

The branch by its short name; used only when BranchCode is 0.

GodownName

text

Yes

–

The godown the goods were packed from, by its name exactly as in Logic ERP. All stock is taken from this godown.

PS_Prefix

text

Yes, unless your API site sets a prefix

empty

Prefix of the packing slip number, for example "PS". A prefix set in your API site's settings replaces it.

PS_Number

number

No

–

Ignored – the packing slip always gets the next number for its prefix.

Remarks

text

No

empty

Remarks saved on the packing slip.

Box_No_Prefix

text

No

empty

Prefix of the box numbers, saved on the packing slip.

ListItems

list

Yes

empty

The items packed – see below.

DisplayError

text

No

""

"1" = full technical error text in Message when something fails.

GodownCode

number

No

–

Ignored – the godown is found from GodownName.

ListItems – one entry per item

Field
Type
Required
Default
Meaning

ItemCode

text

Yes

–

The item. By default the item code shown in Logic ERP (UserCode in Get Item Master), matched exactly (spaces around it are trimmed). The packing slip configuration can tell Logic ERP to read it as an additional item code / barcode, a lot code or lot number, a carton number, a serial number or a set code instead. The item must be on the sale order.

Quantity

number

No

0

Ignored – the box quantities are used.

ListBoxs

list

Yes

empty

The boxes this item was packed in – see below.

ListBoxs – one entry per box

Field
Type
Required
Default
Meaning

PackingBoxNo

text

Yes

–

The box number, for example "B01". Must not be empty.

Quantity

number

Yes

0

Quantity of the item in this box, in whole units (see the known issue).

BoxWeight

number

No

0

Weight of the box; used only when the packing slip configuration takes box weights from the request.

BinName

text

When bins are used

empty

The bin the box was picked from, by name. Required (or BinCode) only when the packing slip configuration uses bins and asks for them.

BinCode

number

No

0

The bin by Logic ERP's number; used instead of BinName when above 0.

Rules Logic ERP applies

Order, branch and party

  • The packing slip is made out to the sale order's customer, in the branch you send, and dated today (the server's date) in the current financial year.

  • Only order lines that still have a pending quantity and are not cancelled line by line are used.

  • Logic ERP does not check that the sale order belongs to the branch you send, that it is approved, or that the order as a whole has not been cancelled – see the known issues.

Items, lots and quantities

  • Each box quantity is packed one unit at a time: for every unit Logic ERP picks a lot of the item with stock in GodownName at the branch (largest stock first, or by purchase date, as the packing slip configuration says; expired or damaged lots, and lots tracked piece by piece, are not used), and links the unit to an order line of that item that still has something pending.

  • An item that is not on the order is refused. When everything pending for an item has been packed, a further unit is refused – unless the packing slip configuration allows packing more than the order's pending quantity; the extra units are then linked to the item's first order line, whose pending quantity goes below zero.

  • When no lot of the item has stock in GodownName, the request is refused. If the packing slip configuration allows negative stock, a lot without stock can be used, but the item must still have a lot in that godown for the current year.

  • Several boxes of the same item, and several items in one box, are fine. One packing slip line is saved for each combination of lot, godown, box, bin and order line.

After saving

  • The packed quantity is taken off the order lines' pending quantity and set aside in the lot's stock in that godown.

  • The packing slip number is the prefix and the next number after the highest number used with that prefix in any branch, for example PS-118.

  • If Logic ERP's approval rules require it, the packing slip is saved as waiting for approval; it cannot then be billed or transferred until it is approved.

  • Everything is saved in one step; if anything fails, nothing is saved.

  • Duplicates. There is no duplicate check on the request. Sending the same request again saves a second packing slip as long as the order still has enough pending; otherwise it is refused. Check Status before you resend.

  • Requests to this endpoint are queued together for all branches when your API site queues requests.

  • Your Logic ERP licence must include this endpoint.

Known issue – the sale order is not checked against the branch. With SaleOrderVouchCode, an order of any branch is accepted, and the packing slip is saved in – and takes stock from – the branch you send. Always send the sale order's own branch.

Known issue – an order waiting for approval, or cancelled as a whole, is accepted. A packing slip can be saved against a sale order that has not been approved yet, or that has been cancelled as a whole while its lines were not cancelled one by one. Check the order's status before you pack against it.

Known issue – box quantities are counted in whole units. Except when the packing slip configuration reads ItemCode as a lot code, each box is packed one unit at a time, so a fraction is dropped (2.5 packs 2). In every mode a quantity below 1 packs nothing. If nothing at all is packed, the request fails with technical text saying the operation was canceled. Send whole-unit quantities.

Known issue – messages from the saving step come wrapped in technical text. Reasons found while the packing slip is being written – for example Packing Slip number already exists...., Entry not allowed in back date......., Invalid Packing Slip No........ or Sale Order Pending Quantity will become -ve.. – arrive preceded and followed by technical text. Look for the reason inside Message rather than at its start.

Known issue – an apostrophe in a code or name. PartyOrderNo, GodownName, BinName, ItemCode and PS_Prefix are looked up exactly as typed. An apostrophe (') in any of them makes the request fail with a database error. Leave apostrophes out of codes and names you send.

Example request

Test it

Send a request to the Logic ERP sandbox (a test company) from this page: open the block below, enter the sandbox user name and password (ask your Logic ERP support team), change the request if you like, and press Test it. This really saves in the sandbox and sets the packed stock aside. The example's test order may have nothing left to pack – first save a test order with Save a Sale Order and send its internal number.

Save a Packing Slip Against a Sale Order

post

Creates a packing slip against a sale order that is already in Logic ERP. A packing slip records which goods were packed in which box for an order: it takes the packed quantity off the order's pending quantity and sets the stock aside in the godown, so it is no longer free to sell. The packed goods are then billed or transferred from the packing slip – with Save a Sale Invoice Against a Delivery Order or Save a Stock Transfer Out Against a Delivery Order, using the packing slip's LastSavedCode.

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
BranchCodeintegerOptional

The branch the packing slip is saved in and packed from, by Logic ERP's branch number (Branch_Code in Get Branch Info). Send the sale order's branch. When neither this nor BranchShortName is sent, the default branch is used (see How Every API Call Works).

SaleOrderVouchCodeintegerOptional

Logic ERP's internal number of the sale order – the LastSavedCode from Save a Sale Order, or the order's internal number in Get Sale Orders.

GodownNamestringOptional

The godown the goods were packed from, by its name exactly as in Logic ERP. All stock is taken from this godown.

PS_PrefixstringOptional

Prefix of the packing slip number, for example "PS". A prefix set in your API site's settings replaces it.

RemarksstringOptional

Remarks saved on the packing slip.

Box_No_PrefixstringOptional

Prefix of the box numbers, saved on the packing slip.

Responses
200

Always HTTP 200. Check Status and Message.

application/json
LastSavedDocNostringOptional

The packing slip's number, for example PS-118.

StatusbooleanOptional

true = the packing slip was saved. (Also true when the endpoint is switched off – see the messages.)

MessagestringOptional

Success when saved; otherwise why it failed.

LastSavedCodeintegerOptional

Logic ERP's internal number of the packing slip. Send it as Doc_Code to bill or transfer the packed goods. 0 when nothing was saved.

request_IDstringOptional

The ID of this request – quote it to support. Can be empty when the request fails at an early check.

post/PackingSlipAgainstSO
POST /api/PackingSlipAgainstSO HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 233

{
  "BranchCode": 2,
  "SaleOrderVouchCode": 487068,
  "GodownName": "MAIN",
  "PS_Prefix": "APITESTPS",
  "Remarks": "API TEST",
  "Box_No_Prefix": "APITEST",
  "ListItems": [
    {
      "ItemCode": "APITEST0001",
      "ListBoxs": [
        {
          "PackingBoxNo": "APITEST-B01",
          "Quantity": 1
        }
      ]
    }
  ]
}
{
  "LastSavedDocNo": "text",
  "Status": true,
  "Message": "text",
  "LastSavedCode": 1,
  "request_ID": "text"
}

Response

Field
Type
Meaning

Status

true / false

true = the packing slip was saved. (Also true when the endpoint is switched off – see the messages.)

Message

text

Success when saved; otherwise why it failed.

LastSavedCode

number

Logic ERP's internal number of the packing slip. Send it as Doc_Code to bill or transfer the packed goods. 0 when nothing was saved.

LastSavedDocNo

text

The packing slip's number, for example PS-118.

request_ID

text

The ID of this request – quote it to support. Can be empty when the request fails at an early check.

Example response

Messages you may see

All with Status: false unless stated. Text in … is replaced by the value concerned. Where the reason comes from an error inside Logic ERP it may be followed by technical detail – read the first line (and see the known issue on the saving step).

Message
Meaning
What to do

Packing Slip Configuration Not Set in Setup API Template

No packing slip configuration is chosen for this endpoint in your API site.

Ask your Logic ERP team to choose one.

Unable to found Sale Order...

No order with that party order number in the branch, or neither SaleOrderVouchCode nor PartyOrderNo was sent.

Send SaleOrderVouchCode, or check PartyOrderNo and the branch.

New Financial Year has been created... Cannot allow New Entry/Modification.

A newer financial year already exists for stock.

Ask your Logic ERP team.

Invalid GodownName.., Unable to found Godown Name :…

GodownName is empty or not found.

Send the godown name exactly as in Logic ERP.

Invalid Bin Name..., Unable to found Bin Name :…

Bins are required and a box has no bin, or the bin is not found.

Send BinName or BinCode for every box.

Packing BOX Number cannot be blank.....

A box has no PackingBoxNo.

Send a box number.

Item/Lot does Not exist In database....

ItemCode was not found (read as the configuration says).

Check the code with Get Item Master.

Invalid Barcode.... Item does Not exist In Sale Order. Please check.

The item has nothing pending on the order – or SaleOrderVouchCode is not the number of a sale order, or the order has nothing pending at all.

Pack only items of the order; check SaleOrderVouchCode with Get Sale Orders.

No Pending quantity found......, No Pending Items found for Sale Order.......

You packed more of an item than the order still has pending.

Reduce the box quantities.

No Stock Found.........

No lot of the item has stock in that godown.

Check stock in the godown.

Invalid Lot Code, Invalid Serial Number, Barcode - … belongs To multiple items. Please check., No Stock found For this barcode....

Only when the configuration reads ItemCode as a lot, serial or lot number: the code is not valid.

Check the code.

Invalid Packing Slip No........ (inside technical text)

No prefix – neither PS_Prefix nor a prefix in your API site.

Send PS_Prefix.

Packing Slip number already exists.... (inside technical text)

The next number is already used in the branch.

Send again; ask your Logic ERP team if it repeats.

Entry not allowed in back date......., Entry/Modification is locked for this period.... (inside technical text)

Logic ERP's date locks do not allow a packing slip today.

Ask your Logic ERP team.

Request cannot be processed. API Template is marked as In-Active in the configuration. – with Status: true

Your Logic ERP team has switched this endpoint off. Nothing is saved, although Status is true.

Treat as not saved; ask your Logic ERP team.

Last updated