Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

StatusCode: 400 -- /Dynamics/Sales/Receivables/Transactions [POST]

Posted on by 5

Hey, I have an issue submitting (POST) SalesInvoice transaction. I can read and write Customers so I don't think it's a permissions thing (I may be wrong :-)) and I can read the Transactions but when I POST to e.g. 

r-sbgp-02.abcde.local/GPService/Tenants(DefaultTenant)/Companies(Abcde%20International%20Ltd.)/Dynamics/Sales/Receivables/Transactions

I get the following error (see error and payload below). I tried many combinations of values, leaving some out, making some strings and some numbers, etc.

Any suggestions welcome, if you see what could be wrong with my payload, or even better, if you ever successfully constructed a payload that worked, it would be greatly appreciated if you could share it.

Thanks so much. Alex

{StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Transfer-Encoding: chunked
GP-Correlation-Id: 92d23f9cb4b34fdea848d1ba308d13ef
Cache-Control: no-store, no-cache
Date: Sat, 21 Nov 2020 17:05:29 GMT
Server: Microsoft-HTTPAPI/2.0
Server: Microsoft-HTTPAPI/2.0
Content-Type: application/json; charset=UTF-8
}}

{
"Payload":{
"DocumentType":1,
"RMDocumentTypeAll":1,
"RMDocumentNumberWORK":"",
"DocumentNumber":"INV6520",
"DocumentPrefix":"",
"DocumentDescription":"",
"DocumentDate":"2020-11-21T00:00:00",
"BatchNumber":"7930",
"BatchSource":"SalesInvoices",
"NoteIndex":1.0,
"CustomerNumber":"CONTOSO",
"CustomerName":"CONTOSO",
"AddressCode":"001",
"SalespersonID":"",
"SalesTerritory":"",
"CommissionAppliedTo":0,
"CommissionDollarAmount":0.0,
"NonCommissionedAmount":0.0,
"ShippingMethod":"",
"CustomerPONumber":"",
"TaxScheduleID":"",
"SalesScheduleID":"",
"FreightScheduleID":"",
"MiscScheduleID":"",
"CostAmount":0.0,
"SalesAmount":0.0,
"TradeDiscountAmount":0.0,
"TradeDiscount":0.0,
"FreightAmount":0.0,
"MiscAmount":0.0,
"TaxAmount":0.0,
"BackoutSalesAmount":0.0,
"BackoutFreightAmount":0.0,
"BackoutMiscAmount":0.0,
"TaxEngineCalled":false,
"DocumentAmount":451.12,
"AppliedAmount":0.0,
"CashAmount":0.0,
"CheckbookIDCash":"",
"DocumentNumberCash":"",
"CheckAmount":0.0,
"CheckbookIDCheck":"",
"CheckbookIDCreditCard":"",
"CheckNumber":"",
"DocumentNumberCheck":"",
"CreditCardAmount":0.0,
"CreditCardName":"",
"ReceiptNumberCreditCard":"",
"DocumentNumberCreditCard":"",
"DiscountReturned":0.0,
"DiscountTakenAmount":0.0,
"DiscountAvailableTaken":0.0,
"WriteOffAmount":0.0,
"PPSAmountDeducted":0.0,
"GSTDiscountAmount":0.0,
"AccountAmount":0.0,
"PaymentTermsID":"",
"DiscountAvailableAmount":0.0,
"DiscountDollarAmount":0.0,
"DiscountPercentAmount":0,
"CurrencyID":"CAD",
"Posted":false,
"LastEditDate":"2020-11-21T00:00:00",
"LastUsertoEdit":"",
"RMTRXPostingErrorMessages":0,
"RMDistPostingErrorMessages":0,
"PostedUserID":"",
"ApplyWithholding":false,
"Correction":false,
"Simplified":false,
"CorrectiontoNonexistingTransaction":false,
"DocumentNumberCorrected":"",
"RMTRXPostingErrorMessages2":0,
"DocPrinted":false,
"DiscountGracePeriod":0,
"DueDateGracePeriod":0,
"Electronic":false,
"ECTransaction":false,
"PostingStatus":0,
"BackoutTradeDiscountAmount":0.0,
"DirectDebit":false,
"EFTFlag":false,
"DocumentStatus":0,
"TRXSource":"",
"CurrencyIndex":0,
"RateTypeID":"",
"ExchangeTableID":"",
"ExchangeRate":0.0,
"RateCalculationMethod":0,
"OriginatingCurrentTrxAmount":0.0,
"OriginatingSalesAmount":0.0,
"OriginatingCostAmount":0.0,
"OriginatingFreightAmount":0.0,
"OriginatingMiscAmount":0.0,
"OriginatingTaxAmount":0.0,
"OriginatingCashAmount":0.0,
"OriginatingCheckAmount":0.0,
"OriginatingCreditCardAmount":0.0,
"OriginatingAppliedAmount":0.0,
"OriginatingDiscountTakenAmount":0.0,
"OriginatingDiscountAvailableAmount":0.0,
"OriginatingDiscountAvailableTaken":0.0,
"OriginatingDiscountReturned":0.0,
"OriginatingDiscountDollarAmount":0.0,
"OriginatingTradeDiscountAmount":0.0,
"OriginatingOriginalTrxAmount":0.0,
"OriginatingWriteOffAmount":0.0,
"OriginatingCommissionDollarAmount":0.0,
"OriginatingBackoutSalesAmount":0.0,
"OriginatingBackoutFreightAmount":0.0,
"OriginatingBackoutMiscAmount":0.0,
"UnrealizedGainLossAmount":0.0,
"RMMCPostingErrorMessages":0,
"DenominationExchangeRate":0.0,
"MCTransactionState":0,
"OriginatingBackoutTradeDiscountAmount":0.0
}
}

  • Suggested answer
    raelhefn Profile Picture
    raelhefn on at
    RE: StatusCode: 400 -- /Dynamics/Sales/Receivables/Transactions [POST]

    It seem this is a dynamics GP web service not NAV 2018.

    Please resend post on dynamics GP forum.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans