Skip to main content
Question

REST API: Manual Supplier Invoice - SUP_TAX_MANDATORY: A Tax Code is required...

  • July 30, 2025
  • 3 replies
  • 170 views

Forum|alt.badge.img+1

Is there a full example on how to create a Manual Supplier Invoice using the API? If not, here’s my attempt:
 

  1. Get Token:
    • https://[root].cloud/auth/realms/linmcfg1/protocol/openid-connect/token
  2. Post Header:
    • https://[root]/main/ifsapplications/projection/v1/ManualSupplierInvoiceAssistantHandling.svc/ManSuppInvoiceVirtualSet
    • Body:   
      •  {
        "Company": "001",
        "AffLinePost":false,
        "AdvInv":false,
        "ProposalExist":false,
        "PostPrelTaxWith":false,
        "PrepayBasedInv":false,
        "UseProjAddressForTax":false,
        "SiiProposal":false,
        "AboveTaxControlLimit":false,
        "EinvoiceSent":false,
        "UseDeliveryInvAddress":false,
        "ExcludePostingAuth":true,
        "CurrDifferenceInvoice":false,
        "CPeriodicInvoice":false,
        "PrepayBasedEnabled":"FALSE",
        "InvoiceNo":"INV-10042",
        "Identity":"10042",
        "InvGrossCurrAmt":250,
        "Currency": "CAD",
        "CurrRate":1,
        "AuthId":"*",
        "DueDate":"2025-08-10",
        "InvoiceRecipient":"*",
        "TaxCurrRate": 1.3718,
        "PayTermId": "0",
        "DivFactor":1
        }
  3. Post Invoice Line:
    • https://[root]/main/ifsapplications/projection/v1/ManualSupplierInvoiceAssistantHandling.svc/ManSuppInvoiceVirtualSet('3B2587DDEC9283BDE063A478EF0AA2EA')/ManSuppInvoiceItems
    • Body
      • {
        "ParentObjkey": "3B2587DDEC9283BDE063A478EF0AA2EA",
        "Company": "001",

        "ItemId": 1,
        "CurrCode":"CAD",
        "CurrRate":1,
        "NetCurrAmount": 221.24,
        "Creator":"JSMITH",
        "Identity":"001",
        "PartyType":"Supplier",
        "DivFactor":1,
        "TaxCodeRef":"1"
        }
  4. Posting Lines
    • https://[root]/main/ifsapplications/projection/v1/ManualSupplierInvoiceAssistantHandling.svc/$batch
    • content-type: multipart/mixed; boundary=42d4c04e-78b3-448c-b5b3-de6ff7df35e8
    • Body (raw)
      • --42d4c04e-78b3-448c-b5b3-de6ff7df35e8
        Content-Type: multipart/mixed;boundary=138bf85c-46b4-48bd-9300-12bde713fe50

        --138bf85c-46b4-48bd-9300-12bde713fe50
        Content-Type: application/http
        Content-Transfer-Encoding:binary
        Content-Id: 1

        POST SaveCheckOk HTTP/1.1
        Accept:application/json;odata.metadata=full;IEEE754Compatible=true
        Content-Type: application/json;IEEE754Compatible=true

        {"Init":true}

        --138bf85c-46b4-48bd-9300-12bde713fe50
        Content-Type: application/http
        Content-Transfer-Encoding:binary
        Content-Id: 2

        POST ManSuppInvoiceVirtualSet(Objkey='3B2587DDEC9283BDE063A478EF0AA2EA')/ManSuppInvoicePostingsArray?select-fields=PeriodAllocSeq,CurrAmount,DomAmount,CodeA,VoucherDate,Company,InternalSeq,Identity,InvoiceId,ItemId,VoucherType,CurrRate,DivFactor,ParallelCurrRate,ParallelDivFactor,RowId,CurrCode,AddInternal,ProjectId,Objkey,InvoiceNo,PeriodAllocAccount,CodeB,CodeC,CodeD,CodeE,CodeF,CodeG,CodeH,CodeI,CodeJ,Quantity,ProjectActivityId,WoNo,WorkTask,PostingType,VoucherCompany,NetCurrAmount,LineRef,OptionalCode,ParentObjkey,ProjectCodePart,Text,RequiredString,AutoPostingProcCode,OrderNo,CurrAmountDebit,CurrAmountCredit,DomAmountDebit,DomAmountCredit,ThirdAmount,ThirdAmountDebit,ThirdAmountCredit,NonDeductTaxCurrAmount,CurrAmtDummy,luname,keyref HTTP/1.1
        Accept:application/json;odata.metadata=full;IEEE754Compatible=true
        Content-Type: application/json;IEEE754Compatible=true
        X-IFS-Accept-Warnings: false

        {
        "ParentObjkey": "3B2587DDEC9283BDE063A478EF0AA2EA",
        "Company": "001",
        "CodeA": "0000001",
        "Identity": "00001",
        "PartyType": "Supplier",
        "CodeB": "00001",
        "CodeC": "00",
        "OptionalCode": "HST",
        "CurrAmount": "221.24",
        "DomAmount": "221.24",
        "CurrAmountDebit": "221.24",
        "DomAmountDebit": "221.24",
        "Text": "SOME SUPPLIER- CAD",
        "PostingType": "MANUAL",
        "VoucherType": "I",
        "VoucherDate": "2025-07-17",
        "UserGroup": "AC",
        "Reference": "MANUAL",
        "VoucherCompany": "001",
        "AddInternal": false,
        "LineRef": "1",
        "CurrCode": "CAD",
        "CurrRate": "1",
        "DivFactor": "1",
        "Spend": false,
        "InvoiceRecipient": "JSMITH",
        "RequiredString": "M;K;K;S;S;K;S;S;S;K;K;K;N;"
        }

        --138bf85c-46b4-48bd-9300-12bde713fe50
        Content-Type: application/http
        Content-Transfer-Encoding:binary
        Content-Id: 3

        POST SaveCheckOk HTTP/1.1
        Accept:application/json;odata.metadata=full;IEEE754Compatible=true
        Content-Type: application/json;IEEE754Compatible=true

        {"Init":false}

        --138bf85c-46b4-48bd-9300-12bde713fe50--
        --42d4c04e-78b3-448c-b5b3-de6ff7df35e8--
  5. Finish Invoice
    • https://[root]/main/ifsapplications/projection/v1/ManualSupplierInvoiceAssistantHandling.svc/FinishInvoice
    • Body
      • {
        "Objkey":"3B2587DDEC9283BDE063A478EF0AA2EA",
        "Identity":"00001",
        "UpdateHeader":false,
        "IsZeroInv":false
        }
    • FAILS WITH:
      • {
        "error": {
        "code": "DATABASE_ERROR",
        "message": "Database error occurred. Contact administrator.",
        "details": [
        {
        "code": 20110,
        "message": "ORA-20110: TaxHandlingUtil.SUP_TAX_MANDATORY: A Tax Code is required when supplier tax validation has Transaction Level selected on Company, Tax Control tab."
        }
        ]
        }
        }

Everything works fine until step 5 (finish the invoice), it asks me for a taxcode

I don’t know the field I must use, there is TaxId, but it only accepts numeric values and I don’t know where to get those from, so I can’t just put “HST”, any help is welcome

3 replies

Marcel.Ausan
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • July 31, 2025

@torresa you need Tax Code (FeeCode) on your posting line or disable the tax settings at Company level (if you’re just testing).

 


Forum|alt.badge.img+9
  • Sidekick (Partner)
  • July 31, 2025

Hi ​@torresa ,

For interface specific tasks, you should try to explore the possiblity of using the projection  ManualSupplierInvoiceHandling instead of trying to use assistant specific projections.
I would say probability of failing of using assistant specific projections for interfaces is more than 99% as they are specifically written for assistants and not for interface specific requirements.Note that Aurena client handles some logics behind the scene not visible to the payload. 
 


asahin
Do Gooder (Customer)
Forum|alt.badge.img+4
  • Do Gooder (Customer)
  • August 1, 2025
Hello;If I were you, here's what I'd do:Write a procedure. Implement manual supplier invoice creation in it. Even try it in a test DB. Use it in a web service. You can easily use the Rest API with the IAM Client in IFS.