Get Branch + Party + Item Group Defaults
Returns the party + item group wise defaults set up in Logic ERP for one branch. These are the same kind of terms as party + item defaults – discounts, taxes, labour, adjustment and add % in rate agreed with a particular customer (party) – but set once for a whole item group instead of item by item. For example "at the Ludhiana branch, Shree Ganesh Traders gets 3% cash discount on everything in the TEA group". When that party is billed at that branch for an item of the group, Logic ERP fills these values into the bill (a default set for the single item can take priority). Use this endpoint to give your ordering or billing system the same terms.
Endpoint
Address
https://your-server/api/GetBranchPartyItemGroupDefaults
Method
POST
Authorization
Basic Auth
The response envelope is explained in How Every API Call Works. This endpoint does not use the common request fields (GlobalModifyCode, DateFrom, DateTo, Doc_Codes, Branch_Codes_From, Doc_Num_Like); it has its own request, below. Every call returns the current defaults; LastGlobalModifyCode is always 0.
Request fields
BranchCode
number
Yes
0
The branch whose defaults you want (Logic ERP's branch number). If you leave it out, 0 is used.
ListCustomers
list
Yes
—
The parties you want, each with the item groups you want. An empty list returns no parties.
ListCustomers – one entry per party:
CustomerCode
text
Yes
—
The party code as shown in Logic ERP, for example "C1045". Capitals and small letters are treated alike.
ItemGroupNames
text
Yes
—
Item group names separated by commas, without spaces after the commas and without a comma at the end, for example "TEA,COFFEE". Each name must match a group name in Logic ERP; capitals and small letters are treated alike.
ListItems, UseEANItemCodeAsItemCode
—
No
—
Not used by this endpoint.
Rules Logic ERP applies
Only defaults set for a named party and an item group are returned. Defaults that Logic ERP keeps for all parties or for a party group at the branch are not returned, although they also affect the bill.
The branch must have at least one default of any kind, otherwise the call fails (see Messages).
Each party and each group name you list must exist. One wrong code or name makes the whole call fail – nothing is returned for the other parties.
Each party must have a default for at least one of the groups you listed at this branch; otherwise the whole call fails. A group that exists but has no default for that party is simply left out.
A group name followed by a space after the comma (for example
"TEA, COFFEE") is not found, because the space is taken as part of the name.Listing the same group twice returns it once. Listing the same party twice returns its groups twice, inside the same party entry.
Parties and groups come in no particular order.
Rateis not part of an item-group default and is not returned.The call has succeeded when
GetDatais notnull.
Known limitations
Statusisfalseeven when the call succeeds. Do not rely onStatus; the call has succeeded whenGetDatais notnull.An empty
ListCustomersreturns nothing useful. The answer hasBranchCode0,BranchNamenulland an emptyCustomerslist, with no message. Always send the parties you want.A group name that repeats in Logic ERP may pick the wrong group. When two item groups share a name, only one of them is looked up. If that one has no default for the party, the call fails although the other group has one. Ask your Logic ERP administrator to give the groups distinct names.
A comma at the end of
ItemGroupNames, or two commas together, makes the call fail. The empty name between them is looked up as a group. Send"TEA,COFFEE", not"TEA,COFFEE,".A party code or group name containing an apostrophe (
') makes the call fail."ListCustomers": nullmakes the call fail. Send the parties you want.LabourInandLabourType(andAdjustInandAdjustType) do not carry what their names say.LabourInholds the labour type (Use Zero/Ignore Zero).LabourTypeholdsIgnore Zerowhen labour is per unit andUse Zerofor any other basis, so the actual basis cannot be read from it. The same applies to the adjust fields.Error messages carry technical text. The reason (quoted under Messages) comes after a technical prefix and may be followed by technical detail. Read the reason only.
What "Use Zero" and "Ignore Zero" mean
Each value comes with a type. When the value is more than zero, the bill uses it. When the value is zero:
Use Zero – the bill uses zero (for example: no cash discount for this party on this group).
Ignore Zero – the zero means "not set here", and Logic ERP takes the value from its next setting.
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. Always list the parties you want in ListCustomers.
Returns the party + item group wise defaults set up in Logic ERP for one branch. These are the same kind of terms as party + item defaults – discounts, taxes, labour, adjustment and add % in rate agreed with a particular customer (party) – but set once for a whole item group instead of item by item. For example "at the Ludhiana branch, Shree Ganesh Traders gets 3% cash discount on everything in the TEA group". When that party is billed at that branch for an item of the group, Logic ERP fills these values into the bill (a default set for the single item can take priority). Use this endpoint to give your ordering or billing system the same terms.
The user name and password of your API site.
The branch whose defaults you want (Logic ERP's branch number). If you leave it out, 0 is used.
The party code as shown in Logic ERP, for example "C1045". Capitals and small letters are treated alike.
Item group names separated by commas, without spaces after the commas and without a comma at the end, for example "TEA,COFFEE". Each name must match a group name in Logic ERP; capitals and small letters are treated alike.
Not used by this endpoint.
Not used by this endpoint.
Always HTTP 200. Check Status, Message and GetData.
See the Status rules on this page and on How Every API Call Works.
Why the call failed, or a note. The reason may be followed by technical detail - read the first line.
The change-log bookmark (see How Every API Call Works).
Size of the answer, for example "2 KB".
No login was sent.
POST /api/GetBranchPartyItemGroupDefaults HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 77
{
"BranchCode": 2,
"ListCustomers": [
{
"CustomerCode": "308",
"ItemGroupNames": ""
}
]
}{
"GetData": {
"BranchCode": 1,
"BranchName": "text",
"Customers": [
{
"PartyCode": "text",
"PartyName": "text",
"ItemGroups": [
{
"GroupName": "text",
"CD_P": 1,
"CD_Type": "text",
"SPCD_P": 1,
"SPCD_Type": "text",
"TD_P": 1,
"TD_Type": "text",
"Excise_P": 1,
"Excise_Type": "text",
"Tax1_P": 1,
"Tax1_Type": "text",
"Tax2_P": 1,
"Tax2_Type": "text",
"LabourPerUnit": 1,
"LabourIn": "text",
"LabourType": "text",
"AdjustPerUnit": 1,
"AdjustIn": "text",
"AdjustType": "text",
"Add_PInRate": 1
}
]
}
]
},
"Status": true,
"Message": "text",
"LastGlobalModifyCode": 1,
"resultSize": "text"
}Response fields
GetData is one object (not a list) for the branch:
BranchCode
number
The branch number.
BranchName
text
The branch name.
Customers
list
One entry per party. See below.
Customers:
PartyCode
text
The party code shown in Logic ERP.
PartyName
text
The party name.
ItemGroups
list
One entry per item group that has a default for this party. See below.
ItemGroups:
GroupName
text
The item group name.
CD_P
number
Cash discount %.
CD_Type
text
Use Zero or Ignore Zero for CD_P.
SPCD_P
number
Special cash discount %.
SPCD_Type
text
Use Zero or Ignore Zero for SPCD_P.
TD_P
number
Trade discount %.
TD_Type
text
Use Zero or Ignore Zero for TD_P.
Excise_P
number
Excise %.
Excise_Type
text
Use Zero or Ignore Zero for Excise_P.
Tax1_P
number
Tax 1 %.
Tax1_Type
text
Use Zero or Ignore Zero for Tax1_P.
Tax2_P
number
Tax 2 %.
Tax2_Type
text
Use Zero or Ignore Zero for Tax2_P.
LabourPerUnit
number
Labour charge, in ₹ – per unit, or per conversion unit of the item (the basis is not returned, see Known limitations).
LabourIn
text
Use Zero or Ignore Zero for LabourPerUnit (see Known limitations).
LabourType
text
See Known limitations.
AdjustPerUnit
number
Adjustment, in ₹ – per unit, or per conversion unit of the item (the basis is not returned, see Known limitations).
AdjustIn
text
Use Zero or Ignore Zero for AdjustPerUnit (see Known limitations).
AdjustType
text
See Known limitations.
Add_PInRate
number
% to add to the rate.
Example response
Messages you may see
On failure Status is false and GetData is null. The message holds one of the reasons below; the reason comes after a technical prefix and may be followed by technical detail. In the table, … stands for the value named in brackets.
Unable to found Branch Code :… (the branch number)
The branch has no defaults at all, or the number is wrong.
Check BranchCode.
Unable to found Customer for Customer Code : … (the code you sent)
No party has this code.
Check CustomerCode.
Unable to found Item Groups for Customer Code : … (the party code)
ItemGroupNames is empty for this party.
Send at least one group name.
Unable to found Group Name : … againts Customer Code : … (group name, party code)
No item group has this name. A blank name means a comma at the end or two commas together.
Check the spelling, remove spaces after commas and any extra comma.
Unable to found Record in Database for Item Groups : … and Customer Code : … (the group names as you sent them, and the party code)
The party has no default at this branch for any of the groups listed.
Check the party and the groups.