Solved

422 Unprocessable Entity Error during request

  • 11 March 2022
  • 4 replies
  • 257 views

Userlevel 4
Badge +2

Hi, 

My application creates Bill in Acumatica via REST request 

URL : https://NewAcumatica/entity/ARTSEndpoint/18.200.001/Bill

Body :

{

  "VendorRef": {

    "value": "byIvan"

  },

  "Description": {

    "value": "d \"1\""

  },

  "Vendor": {

    "value": "AAVENDOR"

  },

  "Date": {

    "value": "2/15/2022"

  },

      

    "Terms": {

    "value": "NET15"

  },

"PostPeriod": {

    "value": "06-2022"

  },

"CashDiscountDate": {

    "value": "1/31/2022"

  },

  "DueDate": {

    "value": "2/15/2022"

  },

  "Details": [

    {

      "InventoryID": {

        "value": "AACOMPUT01"

      },

      "Project": {

        "value": "X"

      },

   

      "TransactionDescription": {

        "value": "Lysolays"

      },

      "Branch": {

        "value": "PRODWHOLE"

      },

      "POReceiptNbr": {

        "value": "PR001666"

      },

          "Type": {

        "value": "Receipt"

      },

         "ReceiptQty": {

        "value": "1"

      },

      "Qty": {

        "value": 1.0

      },

      "UnitCost": {

        "value": 23

      },

    

      "POReceiptLine": {

        "value": 1

      },

      "rowNumber": {

        "value": "1"

      }

    }

  ]

}

It return such error 

I searched and found similar case where it is advised to remove customizations

I checked customization projects and nothing is published 

What I should check in Acumatica configuration ? 

Here stacktrace

{

    "id": "475d27eb-4ca1-ec11-a082-000c290aa0cc",

    "rowNumber": 1,

    "note": {

        "value": ""

    },

    "error": "Inserting  'AP document' record raised at least one error. Please review the errors.; Inserting  'AP document' record raised at least one error. Please review the errors.; CuryDiscTot: Group and document discounts are not supported when the Pay by Line check box is selected.; CuryOrigWhTaxAmt: Withholding taxes are not supported when the Pay by Line check box is selected.",

    "Amount": {

        "value": 23.0

    },

    "ApprovedForPayment": {

        "value": false

    },

    "Balance": {

        "value": 23.0

    },

    "BranchID": {

        "value": "PRODWHOLE"

    },

    "CashAccount": {

        "value": "10200"

    },

    "CashDiscount": {

        "value": 0.00

    },

    "CashDiscountDate": {

        "value": "2022-01-31T00:00:00-08:00"

    },

    "CurrencyID": {

        "value": "USD"

    },

    "Date": {

        "value": "2022-02-15T00:00:00-08:00"

    },

    "Description": {

        "value": "docAlpha BatchID \"1\""

    },

    "Details": [

        {

            "id": "495d27eb-4ca1-ec11-a082-000c290aa0cc",

            "rowNumber": 1,

            "note": {

                "value": ""

            },

            "Account": {},

            "Amount": {

                "value": 23.0

            },

            "Branch": {

                "value": "PRODWHOLE"

            },

            "CalculateDiscountsOnImport": {},

            "DeferralCode": {},

            "Description": {},

            "DiscountCode": {},

            "DiscountPercent": {

                "value": 0.0

            },

            "DiscountSequence": {},

            "ExtendedCost": {

                "value": 23.0

            },

            "F1099Box": {},

            "InventoryID": {

                "value": "AACOMPUT01"

            },

            "ManualDiscount": {

                "value": false

            },

            "NonBillable": {

                "value": false

            },

            "POLine": {},

            "POOrderNbr": {},

            "POOrderType": {},

            "POReceiptLine": {},

            "POReceiptNbr": {},

            "PPVRefNbr": {},

            "Project": {

                "value": "X"

            },

            "ProjectTask": {},

            "Qty": {

                "value": 1.0

            },

            "Subaccount": {},

            "TaxCategory": {

                "value": "EXEMPT"

            },

            "TransactionDescription": {

                "value": "Lysol Disinfectant Sprays"

            },

            "UnitCost": {

                "value": 23.0

            },

            "UOM": {

                "value": "EA"

            },

            "VendorTaxZone": {},

            "custom": {}

        }

    ],

    "DueDate": {

        "value": "2022-02-15T00:00:00-08:00"

    },

    "Hold": {

        "value": true

    },

    "LastModifiedDateTime": {

        "value": "2022-03-11T07:07:11.183-08:00"

    },

    "LocationID": {

        "value": "MAIN"

    },

    "PostPeriod": {

        "value": "062022"

    },

    "Project": {

        "value": "X"

    },

    "ReferenceNbr": {

        "value": "<NEW>"

    },

    "Status": {

        "value": "On Hold"

    },

    "TaxTotal": {

        "value": 0.0

    },

    "Terms": {

        "value": "NET15",

        "error": "Terms 'NET15' cannot be found in the system."

    },

    "Type": {

        "value": "Bill"

    },

    "Vendor": {

        "value": "AAVENDOR"

    },

    "VendorRef": {

        "value": "byIvan"

    },

    "custom": {}

}

icon

Best answer by jinin 11 March 2022, 16:33

View original

4 replies

Userlevel 7
Badge +11

Hi @Ivan 

The issue is with Terms. If you see the response, you can find the message on the field level

 

 

Userlevel 4
Badge +2

Hi @Ivan 

The issue is with Terms. If you see the response, you can find the message on the field level

 

 

@jinin thanks

the request worked

However there is one moment that did not worked

In my request I send PoReceipt Data

which is lionked with PO 

Previously when I performed requests based on receipt the PO data appeared in Bill

However in this Acumatica 2021R2 PO Order data is missed

 

What I do wrong ?

Userlevel 5
Badge

Hey @Ivan --

Not that you should have to, but have you tried passing Pay by Line = False? You would have to extend the Bill endpoint to include field:

 

If you can, go and click the dots next to your postman collection and export it as JSON I will try it myself and see if i can help further!

 

 

Edit: Nevermind @jinin got it!

Userlevel 4
Badge +2

Hey @Ivan --

Not that you should have to, but have you tried passing Pay by Line = False? You would have to extend the Bill endpoint to include field:

 

If you can, go and click the dots next to your postman collection and export it as JSON I will try it myself and see if i can help further!

 

Hi @xkylewrightx 

Unfortunately it did not load PO data

Here is my request 

{

  "VendorRef": {

    "value": "byIvan"

  },

  "Description": {

    "value": "doc"

  },

  "Vendor": {

    "value": "AAVENDOR"

  },

  "Date": {

    "value": "2/15/2022"

  },

        "PaybyLine": {

    "value": "false"

  },

    "Terms": {

    "value": "30D"

  },

"PostPeriod": {

    "value": "06-2022"

  },

"CashDiscountDate": {

    "value": "1/31/2022"

  },

  "DueDate": {

    "value": "2/15/2022"

  },

  "Details": [

    {

      "InventoryID": {

        "value": "AACOMPUT01"

      },

      "Project": {

        "value": "X"

      },

   

      "TransactionDescription": {

        "value": "Lysol Disinfectant Sprays"

      },

      "Branch": {

        "value": "PRODWHOLE"

      },

      "POReceiptNbr": {

        "value": "PR001666"

      },

 

         "ReceiptQty": {

        "value": "1"

      },

    

      "UnitCost": {

        "value": 23

      },

    

      "POReceiptLine": {

        "value": 1

      },

      "rowNumber": {

        "value": "1"

      }

    }

  ]

}

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