SX.e API Documentation

Thomas Barbieri
Thomas Barbieri Member Posts: 7
edited October 2024 in API Gateway

Hello,

I'm using the SX REST Service API to automate some data entry tasks at my company within the OS portal using OE (order entry) modules. I've found a few functions that closely relate to what I'm needing to do. One function I'm using to update fields for an order in OE works by providing key: value pairs in the request,

i.e. "fieldName": "fieldvalue"

The resulting fields in OE are changed to what I specify in this request.

Problem:

I'm having some trouble validating field names I'm able to use in the request to change specific fields. I've been testing other functions that get field data from an order in OE, and inputting the fieldnames in their responses into the update function I want to use. When I try to cross-reference fieldnames like this it doesn't always work out. Fieldnames that work in the update function have an expected result, the correct field is updated in OS. There are also many fieldnames I try that give me an error, they are not valid fieldnames.

I plan to keep testing other getter functions for OE and finding new fieldnames to test out, however it's a long and tedious process. It would really help to find some documentation that lists acceptable field names for a particular function, like the update function I'm wanting to use. The documentation in Swagger UI doesn't specify valid fieldnames for a function.

Are there any resources out there that provide a more detailed documentation with Infor APIs? It may be something I would have to get directly from the developers that worked with setting up the APIs specific to my company's Infor package, hopefully that's not the case!

TL;DR:

In SX REST API functions, SwaggerUI documentation does not have enough information in an example response to determine valid fieldname parameters to input in a request. Are there other sources of documentation that list valid fieldnames?

Best Answers

  • Brandon Watson
    Brandon Watson Member, Infor Partner Posts: 52
    Answer ✓
    {  "request": {    "companyNumber": 1000,    "operatorInit": "bpw",    "operatorPassword": "",    "orderNumber": 1051579,    "orderSuffix": 0,    "includeLines": false,    "tInoeordheader": {      "t-inoeordheader": []    },    "tInoeordlinev2": {      "t-inoeordlinev2": []    },    "tInoeordlinecomp": {      "t-inoeordlinecomp": []    },    "tInoeordnotes": {      "t-inoeordnotes": []    },    "tInoeordchgserlotdata": {      "t-inoeordchgserlotdata": []    },    "tInoeordhdrextra": {      "t-inoeordhdrextra": []    },    "tInoeordlineextra": {      "t-inoeordlineextra": []    }  }}

    There are several API's that are a two-part call, and this is one of them. So, an example 1st request is above, without anything else filled out. The reason you are getting an error is due to adding that shipvia node. Make the call like the above, then using the returned data, map all of the items back into the request and change your values. You should be able to use orderchange in Pck stage, but i do not think the oeheader one would work, but I could be wrong.

  • Thomas Barbieri
    Thomas Barbieri Member Posts: 7
    edited October 2024 Answer ✓

    It works! Thank you so much for the help, I didn't know some of the APIs were two step. Also for the oeheader API I was able to change some fields for an order in Pck stage. I initially used the api getsingleorderv3 to retrieve fields from an order, and I tried using fieldnames from that response in the request for oeheaderupdate. Some of them worked with an order in picked stage but the main problem I had was many of the fieldnames did not exist, which makes sense because you said oeheaderupdate was not up to date.

Answers

  • Brandon Watson
    Brandon Watson Member, Infor Partner Posts: 52

    Reach out to your CSM, there is an SX Architect site as well as API Documentation you can get. Which API are you referencing?

  • Thomas Barbieri
    Thomas Barbieri Member Posts: 7
    edited October 2024

    Hey Brandon, thanks for the reply.

    I'm referencing <My Endpoint>/SX/rest/sxapirestservice/sxapioeheaderupdate

    Have tried various "fieldnames" with a value with some success but not for every field I need to be updating. A list of valid fieldnames would give me something to work with. You say I could get this from additional documentation, outside of the docs included in Swagger UI? I looked into SX Architect and this seems exactly what I'm looking for, it includes a comprehensive list of fields and formatting for their values in all modules of Infor.

    SX Architect seems a bit outdated, would it still be relevant today?

  • Brandon Watson
    Brandon Watson Member, Infor Partner Posts: 52
    {
    "request": {
    "companyNumber": 1000,
    "operatorInit": "bpw",
    "operatorPassword": "",
    "orderNumber": 1051579,
    "orderSuffix": 0,
    "tOehdrupdatett": {
    "t-oehdrupdatett": [
    {
    "seqno": 0,
    "fieldname": "route",
    "fieldvalue": "7654321"
    },
    {
    "seqno": 0,
    "fieldname": "shipviaty",
    "fieldvalue": "OT"
    },
    {
    "seqno": 0,
    "fieldname": "user5",
    "fieldvalue": "DELIVERED"
    }
    ]
    },
    "tInfieldvalue": {
    "t-infieldvalue": []
    }
    }
    }

    There is additional documentation along with the SX Architect site I mentioned. However, with that specific API, I have found the documentation lacking and requires code review to find available fields. Above is an example I have used. Due to the limitation, though, I have more so used the sxapioeorderchangev2, as that has many more fields available to update.

  • Thomas Barbieri
    Thomas Barbieri Member Posts: 7

    sxapioeorderchangev2 seems promising. Also nice that the fieldnames are all included in the main docs. Let's say I only need to update the field "shipviaty" with a new value. How would I handle all other fields in the request? Would I just leave them out of the request body entirely? Something like this:

    {

    "request": {

    "companyNumber": 1000,

    "operatorInit": "bpw",

    "operatorPassword": "",

    "orderNumber": 1051579,

    "orderSuffix": 0,

    "tOehdrupdatett": {

    "t-oehdrupdatett": [

    {

    "seqno": 0,

    "fieldname": "shipviaty",

    "fieldvalue": "<value>"

    }]},

    "tInfieldvalue": {

    "t-infieldvalue": []

    }

    }

    }

  • Brandon Watson
    Brandon Watson Member, Infor Partner Posts: 52

    Yessir, that exact request just worked as expected in my environment. You dont have to put all the fields, like orderchange, just the ones you actually want to change. If you test with a field that is not available, the API response will tell you it is not allowed, like below for the drdeldt field.

  • Thomas Barbieri
    Thomas Barbieri Member Posts: 7
    edited October 2024

    I tried this out with my own credentials and I keep getting this error

    "cErrorMessage": "Unable to complete update...The OE order has changed since it was originally retrieved"

    Is there any documentation for error messages I could refer to, to figure out the problem here (Architect possibly)? I'm working in a sandbox environment and am a bit confused how the OE order could have changed since no one is active in the environment at the moment.

  • Brandon Watson
    Brandon Watson Member, Infor Partner Posts: 52

    Is that for the oeheader or orderchange? I have only seen that with orderchange I believe, but orderchange is a two step API, where you pass just the order information, then the response has all of the data that has to be ported back to the same request will all the data exactly like the response, then adjust your values that you need.

    The only thing i can think of with oeheader is the stage of the order, which i think is 0-1 only.

  • Thomas Barbieri
    Thomas Barbieri Member Posts: 7
    edited October 2024

    It's with orderchangev2. Each array in my request is blank except for the following.

    t-inoeordheader" [

    {"shipviaty": "<value>"}

    ]

    Interesting that its two part. Would I need to use an API like getsingleorder to retrieve order fields, passing that to orderchangev2 and modifying the fields I'm wanting to update?

    Also I'm needing to update fields for orders that are in stage "Pck", however testing the request with orders that are in stage Ordered also give the same error.