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

Create or Update a Party

Creates a customer or supplier (a party) in Logic ERP, with its address, contact, GST, agent and account-group details. If the party code you send already belongs to a customer or supplier, the same call updates that party instead. Other kinds of account (bank, expense, sale, purchase and so on) can also be created with this endpoint, but not updated.

Endpoint

Name
Detail

Address

https://your-server/api/SaveParty

Method

POST

Authorization

Basic Auth

The response and the common messages are explained in How Every API Call Works.

Send one party per request. Field names are matched without regard to upper/lower case. Fields not listed below are ignored. Leave out an object or list you do not use (Cust_Sup_Details, BankDetails, ListCustomFields and the others) rather than sending it as null: a null object or list makes the request fail.

Request fields

Field
Type
Required
Default
Meaning

Account_Name

text

Yes

–

Party name, up to 100 characters (fewer when a city is given – see the rules). On an update the name is replaced by what you send.

Account_Type

text

Yes

–

CU = customer, SU = supplier. Other account types are listed under the rules. Write it in capitals (see the known issue below).

User_Code

text

No

next free number

The party code shown in Logic ERP (User_Code in Get Party Master), up to 20 characters. If a customer or supplier already has this code, that party is updated. Left empty, see "How a party is matched" below.

PrintAccountName

text

No

empty

Name printed on documents, up to 200 characters. Logic ERP does not copy Account_Name into it when you leave it empty.

AddlAccountUserCode

text

No

empty

An additional party code (AddlActUserCode in Get Party Master), up to 100 characters.

Group_Name1 … Group_Name8

text

No

empty

The party's account groups at levels 1 to 8 (Group_Name1…Group_Name8 in Get Party Master). A group that does not exist yet is created – see the rules.

Use_As_Cust_Supp_Both

number

No

0

1 = the party is also used as the other type (a customer that is also a supplier, or the reverse). Any other value = no.

Cust_Sup_Details

object

No

all empty

Address, contact, GST and trading details. See the table below.

ListCustomFields

list

No

empty

Extra fields your company has defined for parties. See the table below.

BankDetails

object

No

all empty

Only for bank accounts – leave it out for parties.

Opening_Balance

number

No

0

Ignored – see the known issue below.

Tax_Region

text

No

empty

Ignored – the value is not saved.

Group_Name, BS_Grp1, BS_Grp2, New_BS_Grp

text

No

empty

Ignored on a normal Logic ERP setup: the general and balance-sheet groups always come from the defaults set for the account type in Logic ERP. They are read only when that default balance-sheet group is missing in Logic ERP.

FixedAssetDetails, CaptialDetails, AccountExciseDetails

object

No

empty

For fixed-asset and capital accounts, and old excise registrations. Leave them out for parties.

DisplayError

text

No

"0"

Ignore.

Cust_Sup_Details

Names you send (city, state, agent, branch, transport and so on) must already exist in Logic ERP; they are matched exactly as typed, ignoring upper/lower case only. Nothing in this object is created automatically.

Field
Type
Required
Default
Meaning

First_Add1, First_Add2, First_Add3

text

No

empty

First (main) address lines, up to 80 characters each.

First_CityName

text

No

empty

City of the first address, as in the Logic ERP city list. The party's state and country are taken from this city. The city is also added to the stored party name (see the rules).

First_Pincode

text

No

empty

PIN code of the first address, up to 6 characters.

First_Location

text

No

empty

A location (area) defined under the first city in Logic ERP. Used only when First_Pincode is empty: Logic ERP then fills the PIN code from the location.

First_State_Name, First_Country_Name

text

No

empty

Only checked – they must exist in Logic ERP – but not saved. The country is checked only when First_CityName is filled.

Second_Add1, Second_Add2, Second_Add3

text

No

empty

Second address lines (for example a delivery address).

Second_CityName, Second_PinCode, Second_Location

text

No

empty

City, PIN code and location of the second address, used the same way as for the first address.

Second_State_Name, Second_Country_Name

text

No

empty

Only checked, not saved, as for the first address.

Telephone_Off, Telephone_Res

text

No

empty

Office and residence telephone numbers.

Mobile_No

text

No

empty

Mobile number.

Fax_No

text

No

empty

Fax number.

Email_Address

text

No

empty

E-mail address.

WebsiteAddress

text

No

empty

Website.

Contact_Person

text

No

empty

Contact person, up to 30 characters (Contact_Name in Get Party Master).

Designation

text

No

empty

Designation of the contact person.

GST_No

text

No

empty

The party's GSTIN. Saved as sent – Logic ERP does not check its format.

GST_StateCode

text

No

empty

GST state code, for example "03". Not checked against the GSTIN.

GST_Date

date

No

empty

GST registration date, yyyy-MM-dd.

GST_Reg_Type

number

No

0

0 = unregistered, 1 = registered, 2 = composite. Send 1 together with a GSTIN – the default 0 marks the party unregistered even when GST_No is filled.

GST_Reverse_Charge

true / false

No

false

true when GST on purchases from this party is paid under reverse charge.

ECommGST_Party

true / false

No

false

true when the party is an e-commerce operator.

ECommGST_No

text

No

empty

GSTIN of the e-commerce operator.

PAN_No

text

No

empty

PAN.

Aadhaar_No

text

No

empty

Aadhaar number.

CIN_No

text

No

empty

Company identification number.

MSME_Type

text

No

"None"

None, Micro, Small or Madium (sic – see the known issue); upper/lower case does not matter. Any other value saves "none" and clears MSME_No. Do not send null – the request fails.

MSME_No

text

No

empty

MSME (Udyam) registration number.

FoodLicNo

text

No

empty

Food licence (FSSAI) number.

Drug_Lisc_No1, Drug_Lisc_No2, Drug_Lisc_No3

text

No

empty

Drug licence numbers.

Drug_Lisc1_ExpDate, Drug_Lisc2_ExpDate, Drug_Lisc3_ExpDate

date

No

empty

Expiry dates of the drug licences, yyyy-MM-dd.

AgentName

text

No

empty

The party's agent or broker, by name.

BranchName

text

No

empty

The branch the party is linked to, by its full branch name (not the short name).

Trans_Name

text

No

empty

Default transporter, by name.

BuyingAgent_Name

text

No

empty

Buying agent (an agent set up as an export buying agent).

ForwardingAgent_Name

text

No

empty

Forwarding agent (an agent set up as an export forwarding agent). Read only when FoodLicNo is also filled – see the known issue.

StockTrans

true / false

No

false

true = the party is a stock-transfer party. Used only when the party is created.

STBranchCode

number

No

0

The branch linked to this party for stock transfers, by Logic ERP's branch number. Not checked.

STBranchName

text

No

empty

The same branch by its full name; used when STBranchCode is 0.

StopBilling

true / false

No

false

true = billing to this party is blocked. Used only when the party is created.

ExportImportParty

true / false

No

false

true for an export / import party.

Credit_Limit

number

No

0

Credit limit in ₹.

Credit_Limit_Variance

number

No

0

Allowed variance on the credit limit.

Bill_Limit

number

No

0

Limit per bill in ₹.

OverDueDaysLimit

number

No

0

Overdue-days limit.

Security_Amount

number

No

0

Security deposit in ₹.

Bank_Guarantee_Date

date

No

empty

Bank guarantee date, yyyy-MM-dd.

Comm_P

number

No

0

Commission %.

Add_P

number

No

0

Additional %.

Octroi_P, Add_Octroi

number, true / false

No

0, false

Octroi / market-fee settings.

Allow_CD, Allow_Slab_CD, Less_Cd, Allow_TD

true / false

No

false

Cash-discount and trade-discount switches for this party.

LockSchPerUnit, LockSchRs, LockAdjustItemRs

true / false

No

false

Locks on scheme and item-rate adjustments in documents for this party.

Bank_Name, Bank_Add1, Bank_add2

text

No

empty

The party's bank and its address.

Remarks_1, Remarks_2, Remarks_3

text

No

empty

Remarks.

Extra_Str_1, Extra_Str_2

text

No

empty

Two free text fields.

BuyerReference, SupplierNo, RegistrationNo, BookingFormat, AcdFormat, DaysForBooking

text

No

empty

Further reference fields shown on the party screen.

Cst_No, Cst_Date, Lst_No, Lst_Date, Give_CForm, TIN_No, Service_Tax_No, SSI_No, SSE_No

–

No

empty / false

Pre-GST registrations. Leave them out.

Dest_Code, Final_Dest_Code

number

No

0

Logic ERP's internal destination numbers. Dest_Code is read only when Designation is filled. Leave both out unless your Logic ERP team gives you the numbers.

First_Location_Code, Second_Location_Code

number

No

0

Ignored.

ListCustomFields — one entry per extra field you want to fill:

Field
Type
Required
Default
Meaning

FieldName

text

Yes

–

Name of the extra field as defined in Logic ERP (FieldName in Get Party Master). Spaces around it are removed; upper/lower case does not matter. Each name only once.

FieldValue_1

text

No

empty

The value.

FieldValue_2

text

No

empty

A second value, used by some field types.

Rules Logic ERP applies

How a party is matched for an update

  • With User_Code. If any account has this code (upper/lower case does not matter) and you send Account_Type CU or SU, that account is updated. If the code belongs to an account and you send any other type, the request is refused with Account User Code already exists!!. If no account has the code, a new party is created with it.

  • Without User_Code. Logic ERP looks for an account with exactly the same stored name – the name plus the first city, built as described below. If one is found, its code is used and the rule above applies (so a customer or supplier with the same name in the same city is updated). If none is found, a new party is created with the next free number as its code: one more than the highest code made only of digits.

  • Logic ERP never changes the account type, the party code or the account groups chosen at creation when it updates a party – see "What an update changes".

What is created

  • One account, with its address and GST details, and – for ListCustomFields – the extra-field values.

  • Account groups. For each Group_Name1…Group_Name8 you fill, Logic ERP looks for a top-level group of that level with this name (upper/lower case does not matter). If there is none, it creates one, with the name exactly as you typed it. A sub-group with the same name is not used: a new top-level group is created beside it.

  • Cities, states, countries, locations, agents, transporters and branches are never created. A name that does not exist stops the request (see the messages).

  • The general group and the balance-sheet groups come from the defaults set for the account type in Logic ERP.

  • If your company requires approval of accounts, the party is saved as awaiting approval and cannot be used until it is approved in Logic ERP. Depending on the approval setup, an update can also send the party back for approval.

Names and duplicates

  • The stored party name includes the first city: the name is followed by spaces up to 30 characters (one space when the name is 30 characters or longer), then - and the first 19 characters of the city, for example BALAJI FABRICS -AMRITSAR. This is the name returned in AccountName. Without a city, the name is stored as sent. Keep Account_Name to about 80 characters when you send a city.

  • Two parties may have the same name in different cities. The same name in the same city is not allowed: without User_Code the existing party is updated; with a different User_Code the request fails with a database error.

  • When a new party is created, an existing account of any type whose stored name is exactly the name you sent (an account saved with no city) gives Account with same name already exists!!.

  • Account codes must be unique: Logic ERP's own code check is not case-sensitive.

What an update changes

  • Text fields you leave empty keep their current value, and number fields you send as 0 keep theirs. So you cannot clear a text field or set a number back to 0 through this endpoint.

  • These are always replaced with what you send, so send their current values when you update: all true / false fields (except StockTrans and StopBilling), Use_As_Cust_Supp_Both, GST_Reg_Type, MSME_Type, Final_Dest_Code and the stock-transfer branch (STBranchCode / STBranchName – both empty removes it).

  • These are never changed by an update: the account type, the party code, StockTrans, StopBilling, the general and balance-sheet groups.

  • Group_Name1…Group_Name8, AgentName, BranchName, Trans_Name, First_CityName, Second_CityName and the extra fields are changed only when you fill them; empty keeps the current value. Changing First_CityName also changes the stored name.

  • An update cannot give a party the stored name of another account: it fails with Invalid Account Name when that account was saved without a city, otherwise with a database error.

Other things to know

  • Parties belong to the whole company; the request has no branch and no date.

  • Party saves on your API site are processed one at a time.

  • The whole save is all-or-nothing: if it fails, nothing is kept – including groups that would have been created. (See the known issue on an empty message.)

  • Extra fields (ListCustomFields) are saved only when extra fields for accounts are switched on in your Logic ERP setup. Otherwise they are checked but silently not saved.

  • Dates: write them as yyyy-MM-dd. A value that is not a date is ignored, except GST_Date, which is then saved empty.

  • Other account types. Account_Type accepts the short names of all Logic ERP account types: AS current assets, BD bad debts, BK bank, CH cash, CT creditors, CU customer, DT debtors, EX expenses, FS fixed assets, IN income, IT income tax, LB current liabilities, MF manufacturing, OP opening stock, PL profit & loss, PR capital, PU purchase, SL sale, SU supplier, TD trading. Only one PL, TD and MF account may exist. Accounts of these other types are only created, never updated; for them the GST fields are read from BankDetails (Bank_Gst_No, Bank_Gst_State_Code, Bank_Gst_Date), and BankDetails also holds a bank account's address, city, account number, IFSC and SWIFT code.

Known issue – an apostrophe in a name or code. Creating a party whose name contains an apostrophe, such as D'SOUZA TRADERS, fails with a database error. So does a ' in User_Code or in any name you send for a lookup (city, state, agent, branch, transporter, location, extra field). Leave the apostrophe out of the name (for example DSOUZA TRADERS); you can keep it in PrintAccountName.

Known issue – the next free party code fails on some companies. When you leave User_Code empty and Logic ERP has to number a new party, the request fails with a database error if any existing account code is a number too large for Logic ERP's numbering (more than 10 digits, or above 2147483647) or contains only symbols such as \. Always send your own User_Code.

Known issue – Opening_Balance is not saved. The opening balance is never written, whatever you send. Enter opening balances in Logic ERP.

Known issue – an update clears the GSTIN when you leave it empty. When a customer or supplier is updated, GST_No, GST_StateCode and GST_Date are replaced by what you send, even when empty. Always send the party's current GST details in an update.

Known issue – Account_Type in small letters. With cu or su a new party is created, but its GST details are taken from BankDetails instead of Cust_Sup_Details (so they are usually lost), and an existing party cannot be updated (Account User Code already exists!!). Always write CU or SU.

Known issue – an update can change an account that is not a party. When the code you send (or, without a code, the name) belongs to another kind of account – for example a bank account – and you send CU or SU, that account is updated with your party details. Make sure User_Code belongs to a customer or supplier before you update.

Known issue – forwarding agent needs a food licence number. ForwardingAgent_Name is read only when FoodLicNo is also filled. To set a forwarding agent for a party without a food licence, set it in Logic ERP.

Known issue – MSME type "Medium". The medium enterprise type is accepted only spelt Madium. Medium saves "none" and clears MSME_No.

Known issue – a failed save can report an empty message. Rarely, Logic ERP stops the save internally and answers Status: false with an empty Message; part of the party may still have been saved. Check with Get Party Master (PartyUserCode) before you send it again.

Known issue – an extra field can be matched to an item field. FieldName is looked up among all extra fields, including those defined for items. If an item extra field has the same name as a party extra field, the value may be stored against the wrong field. Ask your Logic ERP team to keep extra-field names unique.

Example request

A new customer:

Updating the same customer (new mobile number; the GST details, flags and GST_Reg_Type are sent again because an update replaces them):

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, so use test values like the example. The example creates (or, when sent again, updates) the sandbox's test supplier APITESTS01.

Create or Update a Party

post

Creates a customer or supplier (a party) in Logic ERP, with its address, contact, GST, agent and account-group details. If the party code you send already belongs to a customer or supplier, the same call updates that party instead. Other kinds of account (bank, expense, sale, purchase and so on) can also be created with this endpoint, but not updated.

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
Account_NamestringOptional

Party name, up to 100 characters (fewer when a city is given – see the rules). On an update the name is replaced by what you send.

PrintAccountNamestringOptional

Name printed on documents, up to 200 characters. Logic ERP does not copy Account_Name into it when you leave it empty.

Account_TypestringOptional

CU = customer, SU = supplier. Other account types are listed under the rules. Write it in capitals (see the known issue below).

User_CodestringOptional

The party code shown in Logic ERP (User_Code in Get Party Master), up to 20 characters. If a customer or supplier already has this code, that party is updated. Left empty, see "How a party is matched" below.

Use_As_Cust_Supp_BothintegerOptional

1 = the party is also used as the other type (a customer that is also a supplier, or the reverse). Any other value = no.

Responses
200

Always HTTP 200. Check Status and Message.

application/json
AccountNamestringOptional

The name as stored, including the padded city part (for example BALAJI FABRICS -AMRITSAR). For a party saved without a city it is the name followed by spaces up to 100 characters – trim it before you compare. With Account with same name already exists!! it holds the code of the existing party instead. Empty or null on other failures.

AccountCodestringOptional

The party code (User_Code) of the saved party – useful when Logic ERP numbered it for you. With Account User Code already exists!! and Account with same name already exists!! it repeats the code you sent (empty when you sent none).

StatusbooleanOptional

true when the party was saved.

MessagestringOptional

Success when saved; otherwise the reason.

LastSavedCodeintegerOptional

Logic ERP's internal party number (ActCode in Get Party Master). The same number is returned when a party is updated. 0 on failure.

request_IDstringOptional

As described in How Every API Call Works. null when the request was refused before saving started (the first five messages below).

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

{
  "Account_Name": "API TEST SUPPLIER",
  "PrintAccountName": "API Test Supplier",
  "Account_Type": "SU",
  "User_Code": "APITESTS01",
  "Use_As_Cust_Supp_Both": 0,
  "Cust_Sup_Details": {
    "First_Add1": "Test address - do not use",
    "First_Pincode": "141001",
    "Mobile_No": "9000000009",
    "Contact_Person": "API Test",
    "GST_Reg_Type": 0,
    "MSME_Type": "None"
  }
}
{
  "AccountName": "text",
  "AccountCode": "text",
  "Status": true,
  "Message": "text",
  "LastSavedCode": 1,
  "request_ID": "text"
}

Response

Field
Type
Meaning

AccountName

text

The name as stored, including the padded city part (for example BALAJI FABRICS -AMRITSAR). For a party saved without a city it is the name followed by spaces up to 100 characters – trim it before you compare. With Account with same name already exists!! it holds the code of the existing party instead. Empty or null on other failures.

AccountCode

text

The party code (User_Code) of the saved party – useful when Logic ERP numbered it for you. With Account User Code already exists!! and Account with same name already exists!! it repeats the code you sent (empty when you sent none).

Status

true / false

true when the party was saved.

Message

text

Success when saved; otherwise the reason.

LastSavedCode

number

Logic ERP's internal party number (ActCode in Get Party Master). The same number is returned when a party is updated. 0 on failure.

request_ID

text

As described in How Every API Call Works. null when the request was refused before saving started (the first five messages below).

Example response

Messages you may see

All with Status: false. Nothing is saved, except possibly in the last case.

Message
Meaning
What to do

Account Name is Missing!!

Account_Name is empty or missing.

Send the party name.

Account Type is Missing!!

Account_Type is empty or missing.

Send CU or SU.

Invalid Account Type Selected!!

Account_Type is not a Logic ERP account type.

Send CU or SU (or another type from the list above).

Account User Code already exists!!

The code is already used by an account, and you did not send CU or SU in capitals, so it cannot be updated.

For a party, send CU or SU. For a new account, use a different code.

Account with same name already exists!!

A new party was asked for, but an account with this name and no city exists. AccountName holds that account's code.

Update that party by sending its code, or use a different name.

A message containing Invalid First City Name, Invalid Second City Name, Invalid First State Name, Invalid Second State Name, Invalid First Country Name, Invalid Second Country Name, Invalid Agent Name, Invalid Branch Name, Invalid Buying Agent Name, Invalid Forwarding Agent Name, Invalid ST Branch Name, Invalid Transport Name or Invalid Bank City Name..

The name you sent does not exist in Logic ERP. The message holds technical detail; the reason is on the first line.

Correct the name, or ask your Logic ERP team to add it.

A message containing Unable to found First Location Name... or Unable to found Second Location Name...

The location does not exist under that city. Technical detail as above.

Send the PIN code instead, or correct the location.

A message containing Invalid Custom Field Name : … (the name you sent) or Invalid Custom Field Name..

An extra field with this name does not exist, or FieldName is empty. Technical detail as above.

Use the names returned in ListCustomFields by Get Party Master.

A message containing Invalid Account Name

An update would give the party the name of another account. Technical detail as above.

Use a different name.

A message containing New Balance Sheet Group not found....

The default balance-sheet group for the account type is missing in Logic ERP. Technical detail as above.

Ask your Logic ERP team.

A message containing Multiple accounts of … cannot exist. (the type)

A second profit & loss, trading or manufacturing account was asked for.

Do not create it.

A database error

The name or code contains ', the name and city already belong to another party, a text value is longer than Logic ERP allows, or the next free code could not be worked out (see the known issues). The reason may be followed by technical detail – read the first line.

See the known issues above.

Status: false with an empty Message

Logic ERP stopped the save internally.

See the known issue on an empty message.

Last updated