Solved

Insert Vendor API needs cash discount account and cash discount sub.

  • 29 December 2023
  • 3 replies
  • 91 views

Badge

I am trying to insert a vendor record using the REST API. I am met with the following error message.

    "error": "Inserting  'Vendor' record raised at least one error. Please review the errors.; DiscTakenAcctID: 'Cash Discount Account' cannot be empty.; DiscTakenSubID: 'Cash Discount Sub.' cannot be empty.; TaxUseVendorCurPrecision: The Use Currency Precision flag was set because the tax report precision is equal to the currency precision",

 

The JSON I am sending looks like this.

{         "note": {             "value": "Abhijit - Testing"         },         "Cash Discount Account":{"value":"5922"},         "Cash Discount Sub":{"value":null},         "AccountRef": {},         "APAccount": {             "value": "2000"         },         "APSubaccount": {             "value": "000"         },         "CashAccount": {},         "CurrencyID": {             "value": "USD"         },         "CurrencyRateType": {},         "EnableCurrencyOverride": {             "value": false         },         "EnableRateOverride": {             "value": false         },         "FOBPoint": {},         "LandedCostVendor": {             "value": false         },         "LastModifiedDateTime": {             "value": "2023-07-26T13:23:20.56+00:00"         },         "LeadTimedays": {},         "LocationName": {             "value": "Primary Location"         },         "MaxReceipt": {             "value": 100.000000         },         "MinReceipt": {             "value": 0.000000         },         "ParentAccount": {},         "PaymentBy": {             "value": "Discount Date"         },         "PaymentLeadTimedays": {             "value": 0         },         "PaymentMethod": {             "value": "CHECK"         },         "PaySeparately": {             "value": false         },         "PrintOrders": {             "value": false         },         "ReceiptAction": {             "value": "Accept but Warn"         },         "ReceivingBranch": {},         "RemittanceAddressOverride": {             "value": true         },         "RemittanceContactOverride": {             "value": true         },         "SendOrdersbyEmail": {             "value": false         },         "ShippingAddressOverride": {             "value": true         },         "ShippingContactOverride": {             "value": true         },         "ShippingTerms": {},         "ShipVia": {},         "Status": {             "value": "Active"         },         "TaxRegistrationID": {},         "TaxZone": {},         "Terms": {             "value": "NET30"         },         "ThresholdReceipt": {             "value": 100.000000         },         "VendorClass": {             "value": "ANCILLARY"         },         "VendorIsLaborUnion": {             "value": false         },         "VendorIsTaxAgency": {             "value": false         },         "VendorName": {             "value": "Computer Express"         } }

 

 

This is very similar to the JSON that is retrieved from GetVendor record call. I have tried a few variations to send the cash discount and cash discount sub, but all of them have met with the same error. I have tried to send DiscTakenAcctID, Cash Discount Account, CashDiscountAccount.

How do I get around this to insert a vendor record?

Thank You,
Abhijit

 

 

icon

Best answer by jinin 2 January 2024, 07:32

View original

3 replies

Userlevel 7
Badge +12

No you will need to Extend the default endpoint as you cannot edit it. It will copy everything from the Default so you can then make the changes

Badge

Can I add this GLAccounts node to the Default Webservice endpoint?

Userlevel 7
Badge +11

 

Hi @abhijit,

By default, the endpoint lacks the GL account node. To address this, you need to extend the endpoint and include the GL account node on the vendor entity. Follow these steps:

1. Select the vendor entity in the extended endpoint.
2. Click on the insert button to add the GL account and other required fields.
3. Save the endpoint.

I have also attached sample screenshots and the endpoint request for your review.

 

{
"note": {
"value": "Abhijit - Testing"
},
"GLAccounts": {
"APAccount": {
"value": "2000"
},
"APSubaccount": {
"value": "000"
},
"CashDiscountAccount": {
"value": "5922"
},
"CashDiscountSub": {
"value": null
}
},
"CashAccount": {},
"CurrencyID": {
"value": "USD"
},
"CurrencyRateType": {},
"EnableCurrencyOverride": {
"value": false
},
"EnableRateOverride": {
"value": false
},
"FOBPoint": {},
"LandedCostVendor": {
"value": false
},
"LastModifiedDateTime": {
"value": "2023-07-26T13:23:20.56+00:00"
},
"LeadTimedays": {},
"MaxReceipt": {
"value": 100.000000
},
"MinReceipt": {
"value": 0.000000
},
"ParentAccount": {},
"PaymentBy": {
"value": "Discount Date"
},
"PaymentLeadTimedays": {
"value": 0
},
"PaymentMethod": {
"value": "CHECK"
},
"PaySeparately": {
"value": false
},
"PrintOrders": {
"value": false
},
"ReceiptAction": {
"value": "Accept but Warn"
},
"ReceivingBranch": {},
"RemittanceAddressOverride": {
"value": true
},
"RemittanceContactOverride": {
"value": true
},
"SendOrdersbyEmail": {
"value": false
},
"ShippingAddressOverride": {
"value": true
},
"ShippingContactOverride": {
"value": true
},
"ShippingTerms": {},
"ShipVia": {},
"Status": {
"value": "Active"
},
"TaxRegistrationID": {},
"TaxZone": {},
"Terms": {
"value": "30D"
},
"ThresholdReceipt": {
"value": 100.000000
},
"VendorClass": {
"value": "SERVICES"
},
"VendorIsLaborUnion": {
"value": false
},
"VendorIsTaxAgency": {
"value": false
},
"VendorName": {
"value": "Computer Express"
}
}

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved