ho-nl / BolCom_RetailerApi

Package that talks to the bol.com v8 API
10 stars 10 forks source link

latestDeliveryDate is required but not always present in the API response #41

Closed loekvangool closed 3 years ago

loekvangool commented 3 years ago

Got fatal error PHP Fatal error: Uncaught InvalidArgumentException: Key 'latestDeliveryDate' is missing in data array or is not a string in vendor/bol-com/retailer-api/src/Model/Order/OrderItem.php:229

However, latestDeliveryDate is not always present:

Array
(
    [orderItemId] => 
    [offerReference] => 
    [ean] => 
    [title] => 
    [quantity] => 
    [offerPrice] => 
    [offerId] =>
    [transactionFee] => 
    [expiryDate] => 2021-02-22
    [exactDeliveryDate] => 2021-02-19
    [offerCondition] => NEW
    [cancelRequest] =>
    [fulfilmentMethod] => FBR
)

In addition, the fields exactDeliveryDate, expiryDate are not supported at this time.

{
   "orderItemId":"2012345678",
   "offerReference":"BOLCOM00123",
   "ean":"0000007740404",
   "title":"Product Title",
   "quantity":10,
   "offerPrice":27.95,
   "offerId":"xxxx",
   "transactionFee":5.18,
   "latestDeliveryDate":"2017-02-10",
   "expiryDate":"2017-02-13",
   "exactDeliveryDate":"2017-02-13",
   "offerCondition":"NEW",
   "cancelRequest":false,
   "fulfilmentMethod":"FBR",
   "additionalServices":[
      {
         "serviceType":"PLACEMENT_AND_INSTALLATION"
      }
   ]
}
nocturnalfrog commented 3 years ago

We're running into the same problem. Is there a temporary workaround?

loekvangool commented 3 years ago

You can just patch the check of course to fill in something else, as a quick fix.

https://github.com/picqer/bol-retailer-php-client is similar and does not seem to have this check at all.