Jump to content

Recommended Posts

Posted

I've tried to create an APBILL using the Action Draft, but it still posts the Invoice instead of keeping it as a draft.  I'm not sure where to look to see if this is something in Sage doing this or something with the API not working.  The API request is accepted with no problem.  A manual creation of the AP Bill has no problem with me saving it as a Draft.

Here is the function portion of the API call from Postman:

<function controlid="{{$guid}}">
        <create_bill>
          <vendorid>V07388</vendorid>
          <datecreated>
            <year>2024</year>
            <month>11</month>
            <day>05</day>
          </datecreated>
          <datedue>
            <year>2024</year>
            <month>11</month>
            <day>06</day>
          </datedue>
          <action>Draft</action>
          <billno>IM REMIT</billno>
          <description>Test 2</description>
          <customfields>
            <customfield>
              <customfieldname>APID</customfieldname>
              <customfieldvalue>115</customfieldvalue>
            </customfield>
          </customfields>
          <billitems>
            <lineitem>
              <glaccountno>1207</glaccountno>
              <amount>300.00</amount>
              <memo>Test</memo>
              <locationid>Fellowship</locationid>
              <departmentid>1545040000</departmentid>
              <customfields>
                <customfield>
                  <customfieldname>BANK_GL_ACCOUNT</customfieldname>
                  <customfieldvalue>1116</customfieldvalue>
                </customfield>
              </customfields>
              <classid>4</classid>
            </lineitem>
          </billitems>
        </create_bill>
      </function>

I'm trying to determine if any attributes I'm sending or not sending are conflicting with the <action>

Thanks!
Daniel

Posted

I'm not sure that I've done anything differently, but today the <action>Draft</action> worked, and has worked several times.  In the example above I have <action> below the <datedue> element and above the <billno> element.  I'm using the same sequence today and it is working.  I had removed it for testing my other issue and when I put it back I had it below <billno> and the API kicks an error in postman, I randomly put it above <billno> and it seems to be working.  This makes me wonder how the XML request is being processed by the endpoint, but I have no control over that.  I'm also wondering if there is a WSDL somewhere for the API.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...