Skip to main content
Answer

Update Purchase Order Detail Line Using PUT and GUID

  • September 1, 2025
  • 2 replies
  • 63 views

Forum|alt.badge.img+2

Hi I am trying to update the purchase order line details via API call below using the GUID:

Request Type: PUT

URL: https://{URL}/entity/Integration/23.200.001/PurchaseOrder/5ad3671b-217f-f011-ac46-0a3ddcc27c8d

The above GUID used in the request URL is the purchase order related one. 

Body:

{

    "id": "5ad3671b-217f-f011-ac46-0a3ddcc27c8d",

    "Type": {

        "value": "RO"

    },

    "OrderNbr": {

        "value": "SPC005897"

    },

    "Details": [

        {

            "id": "d109d928-217f-f011-ac46-029be7b75a6f",

            "VesselName": {

                "value": "TEST"

            },

            "DepartureDate": {

                "value": "2024-01-15T00:00:00Z"

            },

            "ETA": {

                "value": "2024-02-20T00:00:00Z"

            },

            "FirstFreeDay": {

                "value": "2024-02-22T00:00:00Z"

            },

            "LastFreeDay": {

                "value": "2024-02-25T00:00:00Z"

            },

            "ContainerNumber": {

                "value": "CONTAINER123"

            },

            "MBL": {

                "value": "MBL123456"

            },

            "FreightForwarder": {

                "value": "FreightCo Inc"

            },

            "ShippingLine": {

                "value": "ShippingLine Ltd"

            },

            "ExplorateShipmentReference": {

                "value": "SHIPREF789"

            },

            "FreeDays": {

                "value": 5

            },

            "INCOTerm": {

                "value": "FOB"

            }

        }

    ]

}

 

But I get response 500  below,
    "message": "An error has occurred.",
    "exceptionMessage": "Invalid uri structure",
    "exceptionType": "System.InvalidOperationException",

 

The GET request to retrieve the GUIDs is below,

[
    {
        "id": "5ad3671b-217f-f011-ac46-0a3ddcc27c8d",
        "rowNumber": 1,
        "note": {
            "value": ""
        },
        "AccountName": {
            "value": "HENAN EME"
        },
        "BaseCurrencyID": {
            "value": "AUD"
        },
        "ControlTotal": {
            "value": 28600.0000
        },
        "CurrencyEffectiveDate": {
            "value": "2016-09-13T00:00:00+00:00"
        },
        "CurrencyID": {
            "value": "USD"
        },
        "CurrencyRate": {
            "value": 1.32450331
        },
        "CurrencyRateTypeID": {
            "value": "SPOT"
        },
        "CurrencyReciprocalRate": {
            "value": 0.75500000
        },
        "Date": {
            "value": "2025-08-22T00:00:00+00:00"
        },
        "Description": {},
        "Details": [
            {
                "id": "d109d928-217f-f011-ac46-029be7b75a6f",
                "rowNumber": 1,
                "note": {
                    "value": ""
                },
                "Account": {},
                "AlternateID": {},
                "BookingNumber": {},
                "BranchID": {
                    "value": "MAIN"
                },
                "CalculateDiscountsOnImport": {},
                "Cancelled": {
                    "value": false
                },
                "CargoReadyDate": {},
                "Completed": {
                    "value": false
                },
                "CompleteOn": {
                    "value": 100.000000
                },
                "ContainerNumber": {},
                "DepartureDate": {},
                "Description": {},
                "DescriptionProject": {
                    "value": "ARMSTRONG"
                },
                "ETA": {},
                "ExplorateShipmentReference": {},
                "ExtendedCost": {
                    "value": 28600.0000
                },
                "FirstFreeDay": {},
                "FreeDays": {},
                "FreightForwarder": {
                    "value": "SB"
                },
                "INCOTerm": {
                    "value": "CIF"
                },
                "InventoryID": {
                    "value": "DOTP FLEXI"
                },
                "LastFreeDay": {},
                "LineDescription": {
                    "value": "DOTP PLASTICISER FLEXIBAG"
                },
                "LineNbr": {
                    "value": 1
                },
                "LineType": {
                    "value": "Goods for IN"
                },
                "MaxReceiptPercent": {
                    "value": 100.000000
                },
                "MBL": {},
                "MinReceiptPercent": {
                    "value": 0.000000
                },
                "OrderedQty": {
                    "value": 0.000000
                },
                "OrderNbr": {
                    "value": "SPC005897"
                },
                "OrderQty": {
                    "value": 22000.000000
                },
                "OrderType": {
                    "value": "RO"
                },
                "OrigPONbr": {},
                "OrigPOType": {},
                "PortofDestination": {
                    "value": "MEL"
                },
                "PortofOrigin": {},
                "Promised": {
                    "value": "2025-10-15T00:00:00+00:00"
                },
                "QtyOnReceipts": {
                    "value": 0.000000
                },
                "ReceiptAction": {
                    "value": "Accept but Warn"
                },
                "ReceivedAmount": {},
                "Requested": {
                    "value": "2025-08-22T00:00:00+00:00"
                },
                "ShippingLine": {},
                "Subaccount": {},
                "TaxCategory": {
                    "value": "DEFAULTD"
                },
                "UnitCost": {
                    "value": 1.300000
                },
                "UOM": {
                    "value": "KG"
                },
                "VesselName": {},
                "WarehouseID": {
                    "value": "FBT TOTT"
                },
                "custom": {},
                "_links": {
                    "files:put": "/entity/SPCExplorateIntegration/23.200.001/files/PX.Objects.PO.POOrderEntry/Transactions/d109d928-217f-f011-ac46-029be7b75a6f/{filename}"
                }
            }
        ],
        "Hold": {
            "value": false
        },
        "IsTaxValid": {},
        "LastModifiedDateTime": {
            "value": "2025-08-22T06:28:57.877921+00:00"
        },
        "LineTotal": {
            "value": 28600.0000
        },
        "Location": {
            "value": "MAIN"
        },
        "OrderNbr": {
            "value": "SPC005897"
        },
        "OrderTotal": {
            "value": 28600.0000
        },
        "Owner": {
            "value": "2148"
        },
        "PromisedOn": {
            "value": "2025-08-22T00:00:00+00:00"
        },
        "Status": {
            "value": "Open"
        },
        "TaxTotal": {
            "value": 0.0000
        },
        "Terms": {
            "value": "TT30"
        },
        "Type": {
            "value": "Normal"
        },
        "VendorID": {
            "value": "HENAN EME"
        },
        "VendorRef": {},
        "VendorTaxZone": {
            "value": "OVERSEAS"
        },
        "custom": {},
        "_links": {
            "self": "/entity/Integration/23.200.001/PurchaseOrder/5ad3671b-217f-f011-ac46-0a3ddcc27c8d",
            "files:put": "/entity/Integration/23.200.001/files/PX.Objects.PO.POOrderEntry/Document/5ad3671b-217f-f011-ac46-0a3ddcc27c8d/{filename}"
        }
    }
]

 

Please let me know how to update the POLine using this request, thank you so much!

Best answer by dcomerford

@TharidhiP The URL i believe should be the base for Purchase Order the id should be in the body.

https://{URL}/entity/Integration/23.200.001/PurchaseOrder

2 replies

dcomerford
Captain II
Forum|alt.badge.img+15
  • Captain II
  • Answer
  • September 2, 2025

@TharidhiP The URL i believe should be the base for Purchase Order the id should be in the body.

https://{URL}/entity/Integration/23.200.001/PurchaseOrder


Forum|alt.badge.img+2
  • Author
  • Pro III
  • September 5, 2025

@dcomerford Thank you for the suggestion, this works!