Question

Authorizing Supplier Invoices through API

  • 14 August 2023
  • 2 replies
  • 75 views

Badge +1

Hi.

I am building automation for my company, that after evaluating an invoice will either authorize the invoice, or forward it to a human for manual handeling.

In this regard I am trying to find out how to authorize through the API.

I am fairly certain I found out how to transfer an Invoice to a different authorizer using:
/main/ifsapplications/projection/v1/AuthorizeDetailsHandling.svc/ChangeAuthorizer

But under AuthorizeDetailsHandling I could not find anything that looks like it authorizes the invoice.

I’ve tried searching the API Explorer, but its not easy to decode what each endpoint does.


2 replies

Badge +1

I have since discovered “Invoke action Authorize”, but even though my action seems to be set up correctly compared to what I see in the nework headers when I do the same action through Aurena in the browser, I still get an error:
“The remote server returned an error: (500) Internal Server Error.”

I am using the following HTTP request as a POST:
https://{internal url}/main/ifsapplications/projection/v1/PostingProposalHandling.svc/PostingProposalHeadSet(Company='{Company}',InvoiceId={InvoiceId})/IfsApp.PostingProposalHandling.ManSuppInvoice_Authorize

With Content type set to “application/JSON”
and Accept set to “*/*”

I am sending the If-Match header with the @odata.etag value I got from this call:
https://{internal url}/main/ifsapplications/projection/v1/PostingProposalHandling.svc/PostingProposalHeadSet(Company='{Company}',InvoiceId={InvoiceId})/Authorizations?$orderby=Sequence&$select=AuthorizationRole,CompSecEnabled,Objstate,AuthorizerGroupId,AuthorizerId,Company,InvoiceId,ProposalId,RowId,Sequence,VoucherCompany,AuthorizationRoleDesc,AuthorizationType,AmountInAccCurr,Objgrants,luname,keyref&$expand=AuthorizerGroupIdRef($select=Description,Objgrants,luname,keyref)&$skip=0&$top=25

 

Does anyone know why this seems to work through the browser, but not through the API?
The access token is correct, as we refresh it before every try, and it works on all the other api calls we’ve set up for posting notes for instance.

Userlevel 3
Badge +8

Hi,

we got the supplier invoice authorization to work using rest API calls. The solution is somewhat different as we start by adding the authorizer row to the supplier invoice by using below POS request

...projection/v1/PostingProposalHandling.svc/PostingProposalHeadSet(Company='XX',InvoiceId=12345)/Authorizations

Payload is needed in the above request to work

 

After this we send the POST request using endpoint /Authorization. This is to perform the invoice authorization.

...projection/v1/PostingProposalHandling.svc/PostingProposalHeadSet(Company='XX',InvoiceId=12345)/Authorizations(Company='XX',InvoiceId=12345,ProposalId=1,RowId=1,Sequence=10)/IfsApp.PostingProposalHandling.PostingProposalAuthSummary.AuthorizeAllAuthNone

 

This request don’t require payload but header elements are required - I’m not that technical, so I cannot answer why the header elements are needed. The API documentation do not tell why header is needed. We used browser debugging and a lot of ‘try and error’ attempts.

Header:

 

Reply