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

Get Branch + Party + Item Defaults

Returns the party + item wise defaults set up in Logic ERP for one branch. A default is a set of terms agreed with a particular customer (party) for a particular item at that branch – for example "at the Ludhiana branch, Shree Ganesh Traders gets 2% cash discount and 5% trade discount on Tea 500 g, at a rate of ₹ 245". When that party is billed for that item at that branch, Logic ERP fills these values into the bill automatically. Use this endpoint to give your ordering or billing system the same terms as a starting point. Some settings that also affect the bill are not returned (see Rules).

For defaults set for a whole item group rather than single items, use Get Branch + Party + Item Group Defaults.

Endpoint

Name
Detail

Address

https://your-server/api/GetBranchPartyItemDefaults

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

Field
Type
Required
Default
Meaning

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

No

empty

The parties you want, each with the items you want. Leave it empty to ask for every party that has defaults at the branch – but see Known limitations; we recommend always listing the parties you want.

ListCustomers – one entry per party:

Field
Type
Required
Default
Meaning

CustomerCode

text

Yes

—

The party code as shown in Logic ERP, for example "C1045". Capitals and small letters are treated alike.

ListItems

list of text

No

empty

The items you want, by item code (or by barcode, see next field), for example ["TEA-500", "TEA-250"]. Leave empty for all items that have a default for this party.

UseEANItemCodeAsItemCode

true / false

No

false

true when ListItems holds the items' barcode / EAN codes instead of item codes.

ItemGroupNames

text

No

—

Not used by this endpoint.

Rules Logic ERP applies

  • Only defaults set for a named party and a single item are returned. Defaults that Logic ERP keeps for all parties or for a party group at the branch, and defaults for item groups, are not returned, although they also affect the bill.

  • The branch must have at least one single-item default (for a party, a party group or all parties), otherwise the call fails (see Messages).

  • Each party you list must exist, and each item you list must exist. One wrong code makes the whole call fail – nothing is returned for the other parties.

  • Each party you list must have at least one default at the branch (for the items you listed, when you listed some). Otherwise the whole call fails.

  • An item you list that exists but has no default for that party is simply left out.

  • Listing the same item twice returns it once. Listing the same party twice returns its items twice, inside the same party entry.

  • Parties and items come in no particular order.

  • Two settings that the bill uses are not returned: a price expression on the default (when one is set, the bill does not use Rate), and the adjustment per item.

  • The call has succeeded when GetData is not null.

Known limitations

  • Status is false even when the call succeeds. Do not rely on Status; the call has succeeded when GetData is not null.

  • An empty ListCustomers can repeat items or fail. If the branch also has defaults for "all parties" or for a party group, every item is listed twice under its party. If the branch has only such defaults, the call fails with Unable to found Record in Database for Party Code : (nothing after the colon). Always send the parties you want.

  • An empty ListCustomers can return a very large answer at a branch with many parties. Send the parties you want.

  • A barcode shared by two items picks one of them. With UseEANItemCodeAsItemCode set to true, a barcode kept on more than one item returns the defaults of only one of those items. Use item codes when barcodes are not unique.

  • A party code or item code containing an apostrophe (') makes the call fail.

  • "ListCustomers": null makes the call fail. Send an empty list [] or leave the field out.

  • LabourIn and LabourType (and AdjustIn and AdjustType) do not carry what their names say. LabourIn holds the labour type (Use Zero / Ignore Zero). LabourType holds Ignore Zero when labour is per unit and Use Zero for any other basis, so the actual basis cannot be read from it. The same applies to the adjust fields.

  • Net_Rate is not a rate. It is the "rate type": -1 = Use Zero for Rate, 0 = Ignore Zero. The bill does not use it: a Rate of 0 is never applied.

  • 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 item).

  • Ignore Zero – the zero means "not set here", and Logic ERP takes the value from its next setting (for example the party's item-group default or the item's own default).

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 (see the known issues on this page).

Get Branch + Party + Item Defaults

post

Returns the party + item wise defaults set up in Logic ERP for one branch. A default is a set of terms agreed with a particular customer (party) for a particular item at that branch – for example "at the Ludhiana branch, Shree Ganesh Traders gets 2% cash discount and 5% trade discount on Tea 500 g, at a rate of ₹ 245". When that party is billed for that item at that branch, Logic ERP fills these values into the bill automatically. Use this endpoint to give your ordering or billing system the same terms as a starting point. Some settings that also affect the bill are not returned (see Rules).

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
BranchCodeintegerRequired

The branch whose defaults you want (Logic ERP's branch number). If you leave it out, 0 is used.

CustomerCodestringRequired

The party code as shown in Logic ERP, for example "C1045". Capitals and small letters are treated alike.

ListItemsstringOptional

The items you want, by item code (or by barcode, see next field), for example ["TEA-500", "TEA-250"]. Leave empty for all items that have a default for this party.

UseEANItemCodeAsItemCodebooleanOptional

true when ListItems holds the items' barcode / EAN codes instead of item codes.

ItemGroupNamesstringOptional

Not used by this endpoint.

Responses
200

Always HTTP 200. Check Status, Message and GetData.

application/json
StatusbooleanOptional

See the Status rules on this page and on How Every API Call Works.

MessagestringOptional

Why the call failed, or a note. The reason may be followed by technical detail - read the first line.

LastGlobalModifyCodeintegerOptional

The change-log bookmark (see How Every API Call Works).

resultSizestringOptional

Size of the answer, for example "2 KB".

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

{
  "BranchCode": 2,
  "ListCustomers": [
    {
      "CustomerCode": "308",
      "UseEANItemCodeAsItemCode": false,
      "ListItems": [
        "LOGIC84"
      ]
    }
  ]
}
{
  "GetData": {
    "BranchCode": 1,
    "BranchName": "text",
    "Customers": [
      {
        "PartyCode": "text",
        "PartyName": "text",
        "ListItems": [
          {
            "ItemCode": "text",
            "EANCode": "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,
            "Rate": 1,
            "Net_Rate": 1
          }
        ]
      }
    ]
  },
  "Status": true,
  "Message": "text",
  "LastGlobalModifyCode": 1,
  "resultSize": "text"
}

Response fields

GetData is one object (not a list) for the branch:

Field
Type
Meaning

BranchCode

number

The branch number.

BranchName

text

The branch name.

Customers

list

One entry per party. See below.

Customers:

Field
Type
Meaning

PartyCode

text

The party code shown in Logic ERP.

PartyName

text

The party name.

ListItems

list

One entry per item that has a default for this party. See below.

ListItems:

Field
Type
Meaning

ItemCode

text

The item code shown in Logic ERP.

EANCode

text

The item's barcode / EAN code; empty when none is kept.

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.

Rate

number

Fixed rate for this party and item, in ₹. 0 when none. The bill uses it only when it is more than zero and the default has no price expression (see Rules).

Net_Rate

number

The type for Rate: -1 = Use Zero, 0 = Ignore Zero (see Known limitations).

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.

Message
Meaning
What to do

Unable to found Branch + Party + Item Defaults against Branch Code :… (the branch number)

The branch has no single-item defaults, 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 Code : … againts Party Code : … (item code, party code)

No item has this code (or barcode, when UseEANItemCodeAsItemCode is true).

Check the item code, or the UseEANItemCodeAsItemCode setting.

Unable to found Record in Database for Party Code : … (the party code)

The party has no default at this branch for the items asked. With nothing after the colon: see Known limitations.

Check the party and items, and send the parties you want.