Skip to main content
Solved

Create arrivals via REST in IFS Cloud

  • February 29, 2024
  • 7 replies
  • 213 views

Forum|alt.badge.img+6
  • Sidekick (Customer)
  • 14 replies

Hello, I am attempting to create an arrival to receive a Purchase Order line via REST API. I am inspecting the endpoint calls that Aurena makes during the process, but i’m unable to figure out which call is actually performing the receipt. I see calls to CreateReceiptSet but the payload doesnt include the information from the arrival line (PO #, Line, Etc). I also see CreateArrivalReceipt, but it only uses what i assume is the OBJKEY that is returned from CreateReceiptSet. I know this is a little tricky because an assistant is involved, but I cant seem to make sense of the calls that are happening. Any tips for figuring out how this assistant works? 

Best answer by Trewon

Hi @mdezzi ,


It’s quite interesting how IFS assistants work 😀, The workflow behind editing fields in an assistant involves several HTTP requests, beginning with a POST API call to create a record in a temporary table when a field is first edited. Subsequently, a series of PATCH requests are made to update the initial record created. Each request returns the objkey of the corresponding record in the temporary table. Upon completing the assistant, a separate POST request is sent to a different endpoint, often labeled as "finish" or "create".Usually objkey returned from the previous requests is passed as a parameter in this final request. This objkey serves as a reference to the edited record in the temporary table and ensures that the changes made during the assistant's interaction are properly captured and processed. 

/Trewon

View original
Did this topic help you find an answer to your question?

7 replies

Forum|alt.badge.img+6
  • Hero (Employee)
  • 35 replies
  • Answer
  • February 29, 2024

Hi @mdezzi ,


It’s quite interesting how IFS assistants work 😀, The workflow behind editing fields in an assistant involves several HTTP requests, beginning with a POST API call to create a record in a temporary table when a field is first edited. Subsequently, a series of PATCH requests are made to update the initial record created. Each request returns the objkey of the corresponding record in the temporary table. Upon completing the assistant, a separate POST request is sent to a different endpoint, often labeled as "finish" or "create".Usually objkey returned from the previous requests is passed as a parameter in this final request. This objkey serves as a reference to the edited record in the temporary table and ensures that the changes made during the assistant's interaction are properly captured and processed. 

/Trewon


Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • 14 replies
  • February 29, 2024

@Trewon Yes, i can see from the trace that multiple endpoints are called sequentially, and they are all refrencing an OBJKEY. However I dont see anywhere where the actual input information (PO#, Line, etc) is fed in and OBJKEY is returned. 


Marcel.Ausan
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 1142 replies
  • March 1, 2024

@mdezzi from what I can see, there’s a GET API call that selects the PO Number & Line:

https://xxxxxx-uat.ifs.cloud/main/ifsapplications/projection/v1/CreateReceipt.svc/CreateReceiptSet(Objkey='128F5FFCF77CAF0BE0632562F20A1D4A')/ReceiveLines?

 

And then a few calls below is a POST that does the actual receipt based on Objkey:

https://xxxxxxx-uat.ifs.cloud/main/ifsapplications/projection/v1/CreateReceipt.svc/CreateArrivalReceipt

Payload:
{ParentObjkey: "128F5FFCF77CAF0BE0632562F20A1D4A"}

 

So, I would say that based on your Source Ref 1 / 2 /3 / 4 you need to get the Objkey and then call CreateReceipt.svc/CreateArrivalReceipt


Forum|alt.badge.img+11
  • Sidekick (Customer)
  • 99 replies
  • December 4, 2024

@mdezzi Were you able to solve your query using this method to get the ObjKey?


Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • 14 replies
  • December 4, 2024

@lisa.gilesAB yes, i did discover that due to the virtual/assistant flow, its rouighly a 9 step process to complete an arrival with the odata API. 


Forum|alt.badge.img+11
  • Sidekick (Customer)
  • 99 replies
  • December 4, 2024

@mdezzi are you able to share with me the logic / steps as we are trying to do this and having the same issues you encountered

 

Thanks, 


Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • 14 replies
  • December 4, 2024

Hi ​@lisa.gilesAB, I am using Novacura, an automation platform for IFS, but it is connected to the Odata API, so the calls will be the same. Here is a rough approximation of the steps to register arrivals for a PO: 

Disclaimer: I am self taught, and this is the result of hours of trial and error, so no promises. 

Note: I’ll list all of the endpoints as projections, so for instance, the CreateReceipt.svc full path would be: https://[yourIFSserver]/main/ifsapplications/projection/v1/CreateReceipt.svc

 

Step 1: Build the CLOB data for the PO Line being received: 

This is a long text string that is delimited by “^” characters, and includes a lot of the data for the line. Here’s an example of one:

["SOURCE_REF1=T12345^SOURCE_REF2=1^SOURCE_REF3=1^SOURCE_REF4=^SOURCE_REF_TYPE_DB=PURCHASE_ORDER^SOURCE_QTY_TO_RECEIVE=1^INV_QTY_TO_RECEIVE=1^CATCH_QTY_TO_RECEIVE=^LOCATION_NO=^LOCATION_TYPE_DB=^LOT_BATCH_NO=T12345-1-1^ENG_CHG_LEVEL=1^WAIV_DEV_REJ_NO=*^CONDITION_CODE=^RECEIVE_CASE=ReceiveIntoInventory^SOURCE_QTY_TO_INSPECT=0^QC_CODE=^NOTE_TEXT=^ORDER_CODE=1^INPUT_QTY=^INPUT_CONV_FACTOR=^INPUT_VARIABLE_VALUES=^PART_COST_LEVEL_DB=COST PER LOT BATCH^PACKING_INSTRUCTION_ID=^ADD_EMPTY_TO_PARENT_OPTION_DB=^RENTAL_DB=false^MANUFACTURER_ID=^MANUFACTURER_PART_NO=^;"]

As you can see, i have entered my PO, Line, Release, Qty, etc into the string. A lot of the options are left blank. I could not find any documentation on this part, I reverse engineered this string from watching the calls happening in real time. 

 

Step 2: POST request to CreateReceipt.svc/FndTempLobs to begin the process

Data payload:

{"CreatedByModule": "CreateReceipt"}

You will need the ETag and the LobId from the response of this call 

 

Step 3: PATCH request to CreateReceipt.svc/FndTempLobs(LobId='{lobId}')/ClobData

The LobId from step 2 should be substituted into the path above, You will also need to add an If-Match header to your request with the Etag received from step 2. 
The body for this request is the text of the CLOB you created in step 1. 

 

Step 4: POST request to CreateReceipt.svc/InsertSelection

Data Payload: 

{
    "Source": "RegisterArrivals",
    "SelectionTempLobId": "[LOBID FROM STEP 2]"
}

You’ll need the LineGuid from the response of this call. 

 

Step 5: POST request to CreateReceipt.svc/CreateReceiptSet

Example Data Payload (anything in [ ] brackets must be substituted): 

{
  "PrintBarCodes": false,
  "PrintArrival": false,
  "PrintServiceabiliyTag": false,
  "PackingRule": "SingleHandlingUnit",
  "LineGuid": "[LINE GUID FROM STEP 4}",
  "ReceivedBy": "[ADD A USER ID HERE]",
  "ArrivalDate": "[THIS WILL NEED TO BE A TIMESTAMP]",
  "ReceiptReference": "[THIS IS A REFERENCE NOTE]"
}

You’ll need the ObjKey from the response of this call. 

 

Step 6: GET request to CreateReceiptSet(Objkey='[ObjKey from Step 5]')/ReceiveLines

This will return a list of lines on the receipt (i think it should just be one because we’re making a single request). You will need the ObjKey for this line. 

 

Step 7: PATCH request to CreateReceipt.svc/CreateReceiptSet(Objkey='[ObjKey for Receipt from Step Step 5]')/ReceiveLines(Objkey='[ObjKey for line from Step 6]')

Example Data Payload (You’ll need to sub in your own Locations/Warehouse/etc):

{
  "LocationNo": "{{selectLocationNo}}",
  "Warehouse": "{{selectLocationWarehouse}}",
  "BayNo": "{{selectLocationBay}}",
  "RowNo": "{{selectLocationRow}}",
  "TierNo": "{{selectLocationTier}}",
  "BinNo": "{{selectLocationBin}}"
}

You’ll need the ParentObjKey from the response of this call. 

 

Step 8: POST request to CreateReceipt.svc/CreateArrivalReceipt

Example Data Payload: 

{
    "ParentObjkey": "[ParentObjKey from Step 7]"
}

 

If everything works correctly that should complete the receipt of the line. 

Hope this helps. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings