TMF622 payload example (Change)

bmedic
Tera Contributor

Hi,

 

Instance info:

Build name: Xanadu
Build date: 02-11-2025_1733

 

I am trying to create a payload for the MACD scenario, where I am trying to update/change the Product Inventory. the payload I have created is pretending to be sent from an external system, I am using the External IDs. With a similar one, I have successfully created the new provide, but when trying a "change" action, I am getting the following message:

{
  "code": 23,
  "reason": "Invalid body field",
  "message": "Invalid body field",
  "details": [
    {
      "message": "Invalid payload: Product Inventory does not exist",
      "datapath": "/productOrderItem[0]/product/"
    }
  ]
}

But in the instance, I can find both, the External Product Inventory and Product Inventory records, with correct External Id values.

I have tried using the Create Order (POST) and Patch Order (PATCH) methods, but the result is the same.

Additionally, what I discovered in the documentation, is the following:

"External id to map to the product inventory. Data type: String, Table/field updated: sn_ind_tmt_orm_order_line_item/external_inventory_id and sn_prd_invt_product_inventory/sn_prd_invt_external_id.

The sn_ind_tmt_orm_order_line_item/external_inventory_id does not exist on my instance.

I have attached the payload I am working with.

 

Can someone instruct me on how the payload should look, or why am I getting this "Product Inventory does not exist message"?

 

Thanks in advance for the help.

@SrdanMatijevic 

1 ACCEPTED SOLUTION

Ok, great. can you try to set the value of your productorderitem.product.id same value as your externalproductInventoryId

"externalProductInventory": [
{"externalProductInventoryId": "ProductInventorySIP"}
],
"product": {
"id": "ProductInventorySIP"

 

View solution in original post

6 REPLIES 6

kserrano
Tera Expert

Can you try doing a GET request using the "product inventory open api" see if you can fetch any records with the external Id you have?

bmedic
Tera Contributor

Hi, tnx for advice.

I have tried, and yes, I can GET the PI with the external ID.

Ok, great. can you try to set the value of your productorderitem.product.id same value as your externalproductInventoryId

"externalProductInventory": [
{"externalProductInventoryId": "ProductInventorySIP"}
],
"product": {
"id": "ProductInventorySIP"

 

bmedic
Tera Contributor

Thank you very much @kserrano . This works for the MACD. 

 

When trying similar for the "Patch", I am getting an error message as follows:

{
  "code": 23,
  "reason": "Invalid body field",
  "message": "Invalid body field",
  "details": [
    {
      "message": "change cannot be applied on sold product in state : installation_pending",
      "datapath": "/productOrderItem[1]/product/"
    }
  ]
}

 My PIs are in the Installation Pending state, which is clear from the message.

From the documentation: 

bmedic_0-1742993460579.png

 

So, I am not clear, on which state should that be, since when OLIs are in the In Progress state, PIs are in the  Installation Pending state, and the decomposition is finished.

What am I missing?

Should I introduce some custom logic, or introduce a new PI state?