Liu James
Liu James

Reputation: 11

Does anyone know why Sage 300 return invalid payload via http call

Does anyone know why Sage 300 rejected my valid json payload (attached below) with Invalid payload error message?

Authorization: Basic Auth User:********* Pass: **********

Header Content-Type: application/json Accept: text/plain

{
  "Invoices" : [
    {
      "VendorNumber" : "vendorA",
      "DocumentNumber" : "1234",
      "DocumentType" : "Invoice",
      "DocumentDate" : "2019-09-06T06:00:00.000Z",
      "DueDate" : "2019-10-06T06:00:00.000Z",
      "Taxable" : "1",
      "TaxAmountControl" : "0",
      "TaxGroup" : "GST",
      "TaxAuthority1" : "GST",
      "TaxClass1" : 1,
      "TaxAmount1" : 5,
      "DocumentTotalIncludingTax" : 105,
      "InvoiceDetails" : [
        {
          "ManualTaxEntry" : "1",
          "TaxClass1" : 1,
          "TaxAmount1" : 5,
          "GLAccount" : "00000000000000",
          "DistributedAmount" : 100,
          "DestinationDescription" : "Description"
        }
      ]
    }
  ],
  "UpdateOperation" : "Insert"
}

I have already tried update content types and updated my request profile with swagger definition.

User able to execute same json payload under swagger and success response.

Upvotes: 1

Views: 202

Answers (1)

David Lipschitz
David Lipschitz

Reputation: 152

I'm trying a GL Entry. Sage creates an entry, but with no data in it.

{
  "BatchNumber": "000000",

  "Description": "gl journal entry",

  "JournalHeaders": [

{

  "BatchNumber": "000000",

  "EntryNumber": "00001",

  "SourceLedger": "GL",

  "SourceType": "JE",

  "Description": "entry 1",

  "DocumentDate": "2019-11-05",

  "JournalDetails": [

    {

      "BatchNumber": "000000",

      "EntryNumber": "00001",

      "TransactionNumber": "0000000020",

      "AccountNumber": "1221200617",

      "Amount": 30,

      "Description": "desc",

      "Reference": "ref"

    },

    {

      "BatchNumber": "000000",

      "EntryNumber": "00001",

      "TransactionNumber": "0000000040",

      "AccountNumber": "1221200517",

      "Amount": -30

    }

  ],

  "UpdateOperation": "Insert"

}



 ],

  "UpdateOperation": "Insert"
}

Upvotes: 0

Related Questions