having a trouble with creating ItemMatrix via API

SwarmingTechSwarmingTech Member Posts: 2

When i send attribute1Values field I always got an error response - "Internal server error"

Request example

{"description":"confProduct2.0","defaultCost":0,"discountable":true,"tax":true,"itemType":"default","serialized":false,"modelYear":0,"customSku":"confProduct2.0","Prices":{"ItemPrice":{"amount":0,"useTypeID":1,"useType":"Default"}},"categoryID":"67","taxClassID":"1","itemAttributeSetID":"5","attribute1Values":["Tasting","300ml","375ml","500ml","720ml","750ml","1L","1.5L","3L","4.5L"],"defaultVendorID":0,"manufacturerSku":"","manufacturerID":0}


URI - /API/Account/*******/ItemMatrix.json

Tags:

1 comment

  • [Deleted User][Deleted User] Posts: 0 moderator

    Hello @SwarmingTech ,

    You can't specify them directly; they're added as you add items.

    However, you have to do this in a 2-step process:

    1. Create the item with the itemMatrixID but no attributes:

    {
      "description": "Matrix Item",
      "itemMatrixID": 1234,
      .
      .
      .
    }  
    

    2. Update the item to add the attributes:

    {
      "ItemAttributes": {
        "attribute1": "Red",
        "attribute2": "S",
        "itemAttributeSetID": "2"
      }
    }
    

    The second step will add the attributes to the matrix (if they aren't already there). If you include the ItemAttributes in the first step, the attributes aren't added to the matrix.

Sign In or Register to comment.