Jump to content

API PUT - Updating a few combinations in one request


TomaszMnemonic

Recommended Posts

Hi all,

I would like use PUT to updating a few combinations in one request. For test i used Postman application. My url is like a below.

PUT https://testonexxx.sellision.dev/api/combinations/

and my xml request

<?xml version="1.0" encoding="UTF-8"?>

<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">

   <combinations>

    <combination>

        <id>2903</id>

        <id_product>86</id_product>

        <ean13>5903587031052</ean13>

        <isbn></isbn>

        <price>3.3300</price>

        <weight>0.000000</weight>

        <minimal_quantity>1</minimal_quantity>

        <default_on>1</default_on>

        <available_date>0000-00-00</available_date>

    </combination>

    <combination>

        <id>2904</id>

        <id_product>86</id_product>

        <ean13>5903587031045</ean13>

        <isbn></isbn>

        <price>2.2200</price>

        <weight>0.000000</weight>

        <minimal_quantity>1</minimal_quantity>

        <default_on>1</default_on>

        <available_date>0000-00-00</available_date>

    </combination>

   </combinations>

</prestashop>

  

When i send the request with xml data then i've got error  : id is required when modifying a resource

image.png.58e674724396ca7ad95581bcfa9ec2ce.png

Is exist any way to solve this problem directly in url/request in Postman?

Tomasz

Link to comment
Share on other sites

  • 11 months later...

Remove

<combinations></combinations>

so then you will have:

<?xml version="1.0" encoding="UTF-8"?>

<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">

    <combination>

        <id>2903</id>

        <id_product>86</id_product>

        <ean13>5903587031052</ean13>

        <isbn></isbn>

        <price>3.3300</price>

        <weight>0.000000</weight>

        <minimal_quantity>1</minimal_quantity>

        <default_on>1</default_on>

        <available_date>0000-00-00</available_date>

    </combination>

    <combination>

        <id>2904</id>

        <id_product>86</id_product>

        <ean13>5903587031045</ean13>

        <isbn></isbn>

        <price>2.2200</price>

        <weight>0.000000</weight>

        <minimal_quantity>1</minimal_quantity>

        <default_on>1</default_on>

        <available_date>0000-00-00</available_date>

    </combination>

</prestashop>

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...