Skip to main content
Answer

Generating Shipments from an SO via REST API

  • June 7, 2021
  • 11 replies
  • 715 views

Hi i have been having a strange issue when creating a shipment of a sales order via the API

 

This is the standard endpoint i am using: (replaced my base address)

https://baseaddress/entity/Default/18.200.001/Shipment

And the request:

{

    "Type":{"value":"Shipment"},

    "CustomerID":{"value":"TEST1"},

    "LocationID":{"value":"MAIN"},

    "WarehouseID":{"value":"WAREHOUSE1"},

    "Details":[

        {

            "OrderType":{"value":"SA"},

            "OrderNbr":{"value":"ORDER123"}

        }

    ]

}

This does create a shipment for the order however the shipment number it creates has already been allocated to another shipment on the system. What could i be missing here? the Shipment number i an expecting is a new one that has not been previously allocated to any sales order.

Best answer by Naveen Boga

Hi @andrewm80,

We have tried with the below API Request and able to create the shipment for the Sales Order. Please find the details below.

Method : POST

URL:  https://baseaddress/entity/Default/18.200.001/SalesOrder/SalesOrderCreateShipment

API Request:
 

 

{

    "entity": {

        "OrderType": {

            "value": "SO"

        },

        "OrderNbr": {

            "value": "SO006389"

        }

    },

    "parameters": {

        "ShipmentDate": {

            "value": "2021-06-07"

        },

        "WarehouseID": {

            "value": "WHOLESALE"

        }

    }

}

 

 

Hope this helps!!

 

11 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • June 7, 2021

Hi @andrewm80,

We have tried with the below API Request and able to create the shipment for the Sales Order. Please find the details below.

Method : POST

URL:  https://baseaddress/entity/Default/18.200.001/SalesOrder/SalesOrderCreateShipment

API Request:
 

 

{

    "entity": {

        "OrderType": {

            "value": "SO"

        },

        "OrderNbr": {

            "value": "SO006389"

        }

    },

    "parameters": {

        "ShipmentDate": {

            "value": "2021-06-07"

        },

        "WarehouseID": {

            "value": "WHOLESALE"

        }

    }

}

 

 

Hope this helps!!

 


  • Author
  • Freshman II
  • June 7, 2021

Hi i tried the above request but am getting a response of 500 internal error.

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • June 7, 2021

That is working API request and I can able to create the shipments successfully. Can you please share the URL, which you are using?


  • Author
  • Freshman II
  • June 7, 2021

https://MYDOMAIN/entity/Default/18.200.001/SalesOrder/SalesOrderCreateShipment

 {

    "entity": {

        "OrderType": {

            "value": "SA"

        },

        "OrderNbr": {

            "value": "TESTRAM01"

        }

    },

    "parameters": {

        "ShipmentDate": {

            "value": "2021-06-07"

        },

        "WarehouseID": {

 

            "value": "DIGITAL"

        }

    }

}

 

Error:

"message": "An error has occurred.",

    "exceptionMessage": "An error occurred during processing of the field Warehouse ID value DIGITAL 'Warehouse ID' cannot be found in the system. Please verify whether you have proper access rights to this object..\nPX.Data.PXOuterException: An error occurred during processing of the field Warehouse ID value DIGITAL 'Warehouse ID' cannot be found in the system. Please verify whether you have proper access rights to this object..",

 

I have this Warehouse ID Setup etc so i dont understand the error.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • June 7, 2021

Strange!! :nerd:

Can you please share your Sales Order screenshot as well, just wanted to confirm the Warehouse and the order details?


  • Author
  • Freshman II
  • June 7, 2021

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • June 7, 2021

Something strange with your instance. I just created in another instance also and working fine.

Can you please check with other TEST instance, if you have?

 

 

 


  • Author
  • Freshman II
  • June 7, 2021

OK thank you for your help will try different instance and tenant to see if there is something related to that.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • June 7, 2021

Sure @andrewm80  NOT sure about the issue with this instance. I see everything looks good except the only difference I see that Sales Order date format different from default date format (I know this will NOT be an issue, in this case).

You can verify in other TEST instance, and will get the expected results. 


  • Author
  • Freshman II
  • June 8, 2021

Problem resolved. The issue was around user credentials for some reason.Created new credentials and was able to complete the shipment creation. 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • June 8, 2021

Wonderful. You have identified that root cause of an issue and thanks for sharing the update.