Woo REST API returns a 200 but with ‘Syntax error.’
-
First we fire this json call:
{ "articleNumber": 6050, "pluNumber": "", "syncMarker": 84917, "changeTimestamp": { "sec": 29, "min": 10, "hour": 11, "day": 2, "mon": 2, "year": 2022, "isdst": false, "timezone": 0 }, "createTimestamp": { "sec": 57, "min": 54, "hour": 21, "day": 26, "mon": 5, "year": 2021, "isdst": false, "timezone": 0 }, "active": true, "description": "FunCakes Musketzaad Discomix 80 g", "colour": "", "size": "", "invoiceText": "", "receiptText": "", "displayText": "", "barcode": "8720143517112", "brandName": "FunCakes", "turnoverGroup": 2, "vatCode": 1, "vatPercentage": 900, "averagePurchasePrice": 139, "purchasePrice": 135, "priceIncl": 260, "priceExcl": 239, "supplierRelationNumber": 4, "supplierRelationName": "CakeSupplies", "supplierArticleNumber": "F51565", "webshop": true, "categoryId": 0, "stockArticle": true, "specialPrice": "PRICE-NORMAL", "showPreparationMethodsDirectly": true, "showPreparationMethodsPerGroup": false, "barcodeList": { "barcode": [ { "barcodeId": 17920, "description": "FunCakes Musketzaad Discomix 80 g", "barcode": "8720143517112", "quantity": 1, "decimalPlaces": 0, "purchasePrice": 135, "priceIncl": 260, "isCurrent": true } ] }, "askFor": "ASK-FOR-NOTHING", "nutritionalCharacteristics": { "allergenList": [ { "id": 11, "name": "Mosterd", "abbreviation": "MOS", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 12, "name": "Sesamzaad", "abbreviation": "SES", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 10, "name": "Selderij", "abbreviation": "SEL", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 2, "name": "Eieren", "abbreviation": "EI", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 13, "name": "Sulfiet", "abbreviation": "SUL", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 5, "name": "Noten", "abbreviation": "NOT", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 8, "name": "Schaaldieren", "abbreviation": "SCH", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 6, "name": "Soja", "abbreviation": "SOJ", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 4, "name": "Pinda", "abbreviation": "PIN", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 1, "name": "Gluten", "abbreviation": "GLU", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 3, "name": "Vis", "abbreviation": "VIS", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 14, "name": "Lupine", "abbreviation": "LUP", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 9, "name": "Weekdieren", "abbreviation": "WEE", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 7, "name": "Melk", "abbreviation": "MEL", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 } ], "dietRestrictionList": [ { "id": 20, "name": "Vegetarisch", "abbreviation": "VEGA", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 25, "name": "Vetarm", "abbreviation": "VET", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 26, "name": "Cholesterolarm", "abbreviation": "CHOL", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 21, "name": "Vegan", "abbreviation": "VEGAN", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 24, "name": "Zoutarm", "abbreviation": "ZOU", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 23, "name": "Koosjer", "abbreviation": "KOS", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 22, "name": "Halal", "abbreviation": "HAL", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 } ] }, "imageList": [], "stock_amountFree": 3, "branch_stock": { "1": { "amountFree": 3, "amountReserved": 0, "amountIncoming": 0, "stockId": 383985, "branchNumber": 1 } }, "custom_barco2": "", "custom_web_kleur": "Meerkleurig", "custom_web_thema": "", "variationProductNumber": 6050, "productNumber": 6050, "variationDescription": "FunCakes Musketzaad Discomix 80 g", "variationExtraText": "", "groupNumbers": [ 36 ], "sortOrderGroupList": [ { "groupNumber": 36, "sortOrder": 150 } ], "variation": false }
this works, it returns a 200
than minutes later we update the product because the stock has changed:
{ "articleNumber": 6050, "pluNumber": "", "syncMarker": 84917, "changeTimestamp": { "sec": 29, "min": 10, "hour": 11, "day": 2, "mon": 2, "year": 2022, "isdst": false, "timezone": 0 }, "createTimestamp": { "sec": 57, "min": 54, "hour": 21, "day": 26, "mon": 5, "year": 2021, "isdst": false, "timezone": 0 }, "active": true, "description": "FunCakes Musketzaad Discomix 80 g", "colour": "", "size": "", "invoiceText": "", "receiptText": "", "displayText": "", "barcode": "8720143517112", "brandName": "FunCakes", "turnoverGroup": 2, "vatCode": 1, "vatPercentage": 900, "averagePurchasePrice": 139, "purchasePrice": 135, "priceIncl": 260, "priceExcl": 239, "supplierRelationNumber": 4, "supplierRelationName": "CakeSupplies", "supplierArticleNumber": "F51565", "webshop": true, "categoryId": 0, "stockArticle": true, "specialPrice": "PRICE-NORMAL", "showPreparationMethodsDirectly": true, "showPreparationMethodsPerGroup": false, "barcodeList": { "barcode": [ { "barcodeId": 17920, "description": "FunCakes Musketzaad Discomix 80 g", "barcode": "8720143517112", "quantity": 1, "decimalPlaces": 0, "purchasePrice": 135, "priceIncl": 260, "isCurrent": true } ] }, "askFor": "ASK-FOR-NOTHING", "nutritionalCharacteristics": { "allergenList": [ { "id": 11, "name": "Mosterd", "abbreviation": "MOS", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 12, "name": "Sesamzaad", "abbreviation": "SES", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 10, "name": "Selderij", "abbreviation": "SEL", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 2, "name": "Eieren", "abbreviation": "EI", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 13, "name": "Sulfiet", "abbreviation": "SUL", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 5, "name": "Noten", "abbreviation": "NOT", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 8, "name": "Schaaldieren", "abbreviation": "SCH", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 6, "name": "Soja", "abbreviation": "SOJ", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 4, "name": "Pinda", "abbreviation": "PIN", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 1, "name": "Gluten", "abbreviation": "GLU", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 3, "name": "Vis", "abbreviation": "VIS", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 14, "name": "Lupine", "abbreviation": "LUP", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 9, "name": "Weekdieren", "abbreviation": "WEE", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 7, "name": "Melk", "abbreviation": "MEL", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 } ], "dietRestrictionList": [ { "id": 20, "name": "Vegetarisch", "abbreviation": "VEGA", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 25, "name": "Vetarm", "abbreviation": "VET", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 26, "name": "Cholesterolarm", "abbreviation": "CHOL", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 21, "name": "Vegan", "abbreviation": "VEGAN", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 24, "name": "Zoutarm", "abbreviation": "ZOU", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 23, "name": "Koosjer", "abbreviation": "KOS", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 22, "name": "Halal", "abbreviation": "HAL", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 } ] }, "imageList": [], "stock_amountFree": 2, "branch_stock": { "1": { "amountFree": 2, "amountReserved": 0, "amountIncoming": 0, "stockId": 384552, "branchNumber": 1 } }, "custom_barco2": "", "custom_web_kleur": "Meerkleurig", "custom_web_thema": "", "variationProductNumber": 6050, "productNumber": 6050, "variationDescription": "FunCakes Musketzaad Discomix 80 g", "variationExtraText": "", "groupNumbers": [ 36 ], "sortOrderGroupList": [ { "groupNumber": 36, "sortOrder": 150 } ], "variation": false }
this returns a: http response code : 200 message : Syntax error.
Then we try again with this code:
{ "articleNumber": 6050, "pluNumber": "", "syncMarker": 84917, "changeTimestamp": { "sec": 29, "min": 10, "hour": 11, "day": 2, "mon": 2, "year": 2022, "isdst": false, "timezone": 0 }, "createTimestamp": { "sec": 57, "min": 54, "hour": 21, "day": 26, "mon": 5, "year": 2021, "isdst": false, "timezone": 0 }, "active": true, "description": "FunCakes Musketzaad Discomix 80 g", "colour": "", "size": "", "invoiceText": "", "receiptText": "", "displayText": "", "barcode": "8720143517112", "brandName": "FunCakes", "turnoverGroup": 2, "vatCode": 1, "vatPercentage": 900, "averagePurchasePrice": 139, "purchasePrice": 135, "priceIncl": 260, "priceExcl": 239, "supplierRelationNumber": 4, "supplierRelationName": "CakeSupplies", "supplierArticleNumber": "F51565", "webshop": true, "categoryId": 0, "stockArticle": true, "specialPrice": "PRICE-NORMAL", "showPreparationMethodsDirectly": true, "showPreparationMethodsPerGroup": false, "barcodeList": { "barcode": [ { "barcodeId": 17920, "description": "FunCakes Musketzaad Discomix 80 g", "barcode": "8720143517112", "quantity": 1, "decimalPlaces": 0, "purchasePrice": 135, "priceIncl": 260, "isCurrent": true } ] }, "askFor": "ASK-FOR-NOTHING", "nutritionalCharacteristics": { "allergenList": [ { "id": 11, "name": "Mosterd", "abbreviation": "MOS", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 12, "name": "Sesamzaad", "abbreviation": "SES", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 10, "name": "Selderij", "abbreviation": "SEL", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 2, "name": "Eieren", "abbreviation": "EI", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 13, "name": "Sulfiet", "abbreviation": "SUL", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 5, "name": "Noten", "abbreviation": "NOT", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 8, "name": "Schaaldieren", "abbreviation": "SCH", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 6, "name": "Soja", "abbreviation": "SOJ", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 4, "name": "Pinda", "abbreviation": "PIN", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 1, "name": "Gluten", "abbreviation": "GLU", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 3, "name": "Vis", "abbreviation": "VIS", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 14, "name": "Lupine", "abbreviation": "LUP", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 9, "name": "Weekdieren", "abbreviation": "WEE", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 7, "name": "Melk", "abbreviation": "MEL", "type": "NC-TYPE-ALLERGEN", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 } ], "dietRestrictionList": [ { "id": 20, "name": "Vegetarisch", "abbreviation": "VEGA", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 25, "name": "Vetarm", "abbreviation": "VET", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 26, "name": "Cholesterolarm", "abbreviation": "CHOL", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 21, "name": "Vegan", "abbreviation": "VEGAN", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 24, "name": "Zoutarm", "abbreviation": "ZOU", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 23, "name": "Koosjer", "abbreviation": "KOS", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 }, { "id": 22, "name": "Halal", "abbreviation": "HAL", "type": "NC-TYPE-DIET-RESTRICTION", "isPresent": false, "presence": "NC-PRESENCE-UNKNOWN", "sourceNumber": 6050 } ] }, "imageList": [], "stock_amountFree": 2, "branch_stock": { "1": { "amountFree": 2, "amountReserved": 0, "amountIncoming": 0, "stockId": 384552, "branchNumber": 1 } }, "custom_barco2": "", "custom_web_kleur": "Meerkleurig", "custom_web_thema": "", "variationProductNumber": 6050, "productNumber": 6050, "variationDescription": "FunCakes Musketzaad Discomix 80 g", "variationExtraText": "", "groupNumbers": [ 36 ], "sortOrderGroupList": [ { "groupNumber": 36, "sortOrder": 150 } ], "variation": false }
and this gives a 200 without syntax error.
It seems an unreplicalbe bug and I can’t put my vinger on it. But I do have a question: why is the API returning a 200 when there is a Syntax error.?
When diff the json arrays I can’t find anything strange https://i.imgur.com/6yBZyCX.png
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Woo REST API returns a 200 but with ‘Syntax error.’’ is closed to new replies.