Skip to main content
Solved

422 Unprocessable Entity Error during request


Forum|alt.badge.img+2
  • Varsity I
  • 283 replies

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": {}

}

Best answer by jinin

Hi @Ivan 

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

 

 

View original
Did this topic help you find an answer to your question?

4 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 701 replies
  • Answer
  • March 11, 2022

Hi @Ivan 

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

 

 


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • 283 replies
  • March 11, 2022
jinin wrote:

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 ?


xkylewrightx
Semi-Pro I
Forum|alt.badge.img

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!


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • 283 replies
  • March 11, 2022
xkylewrightx wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings