LogoLogo
API Documentation
API Documentation
  • What is Mediablob
  • Fields
  • Endpoints
    • Authorization
    • REST
    • SOAP (legacy)
      • Pictures
  • XML structure
    • XSD
    • Products
      • Extending existing products
      • Deleting products
    • Complement products
    • Pricelists
      • Local price overrides
      • Future price changes
    • Campaigns
    • Productgroups
    • Local integration
      • Signorder
      • Display groups
    • Error messages
  • Images
    • Formats and resolution
Powered by GitBook
On this page
  • Adding two complement products
  • Replacing existing complements
  • Deleting all complements for a product
Export as PDF
  1. XML structure

Complement products

For every product we can assign a list of complement products. The complements are displayed in Shoppa when the base product is displayed and can be automatically assigned to templates to easily build multi-product signs.

Note: Just because product A assigns product B as a complement does not mean the opposite is true. You must explicitly assign all relationships you want to use.

Adding two complement products

Lets assign a complement product to our sample product:

<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1">
      <complementProducts>
        <complementProduct id="65468-1" idType="Code1" />
        <complementProduct id="65468-3" idType="Code1" />
      </complementProducts>
    </product>
  </products>
</mediablob>

You can of course assign complement products at the same time you create your product or modify other properties of it. The only requirement is that the complement product already exists in Mediablob.

Replacing existing complements

If you send a <complementProducts /> list as above, the new complements will be merged with any existing complements and make the list of complements longer. If you instead want to replace the existing complements with a new list, you need to set replace="true":

<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1">
      <complementProducts replace="true">
        <complementProduct id="65468-1" idType="Code1" />
      </complementProducts>
    </product>
  </products>
</mediablob>

The above xml effectively deletes complement 65468-3, since it is no longer part of the list.

Deleting all complements for a product

If you want to delete all existing complements for a product, you set delete="true" on the <complementProducts /> section:

<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1">
      <complementProducts delete="true" />
    </product>
  </products>
</mediablob>

Note that deleting the complements list does not delete the product itself.

PreviousDeleting productsNextPricelists

Last updated 6 years ago