0

I want to delete data for the DistributionCenterCode 'Stock'(here the second entry) completely using PHP for ChannelAdvisor. But I am getting error but I have checked the DistributionCenterCode exists.

SKU: ADLAACW009
stdClass Object
(
[DistributionCenterCode] => Monroe
[AvailableQuantity] => 0
[OpenAllocatedQuantity] => 0
[OpenAllocatedPooledQuantity] => 0
[ReceivedInInventory] =>
)
stdClass Object
(
[DistributionCenterCode] => Stock
[AvailableQuantity] => 0
[OpenAllocatedQuantity] => 0
[OpenAllocatedPooledQuantity] => 0
[ReceivedInInventory] =>
)
stdClass Object
(
[DistributionCenterCode] => LBG
[AvailableQuantity] => 999
[OpenAllocatedQuantity] => 0
[OpenAllocatedPooledQuantity] => 0
[ReceivedInInventory] =>
)

The error is like as follows-

 stdClass Object
(
[SynchInventoryItemResult] => stdClass Object
    (
        [Status] => Failure
        [MessageCode] => 12
        [Message] => Distribution Center Code is missing from DistributionCenterInfo!
        [ResultData] =>
    )

)

2 Answers2

0

As the error suggests you are looking for key 'Distribution Center Code' where as the key in the object is 'DistributionCenterCode'

Please try changing that to fix this.

abhinsit
  • 3,214
  • 4
  • 21
  • 26
0

The Item array should be properly keyed by the Distribution Center. Then this error will not emerge.

ITEM:

Array
(
[Sku] => ADLAACW009
[DistributionCenterList] => Array
    (
        [Stock] => Array
            (
                [DistributionCenterInfoSubmit] => Array
                    (
                        [0] => Array
                            (
                                [DistributionCenterCode] => Stock
                                [AvailableQuantity] => 0
                                [OpenAllocatedQuantity] => 0
                                [OpenAllocatedPooledQuantity] => 0
                                [WarehouseLocation] => _DELETE_
                            )

                    )

            )

    )

)