This documentation aims to guide you step by step through the process of updating a product price in a Soulmkt Marketplace store using APIs V1 and V2. Even if you are not familiar with the process, this detailed explanation will help you understand how to perform the task.
1. Introduction #
The Soulmkt Marketplace offers two API versions (V1 and V2) to interact with the system and perform operations such as product price updates. Both versions use the SOAP protocol (Simple Object Access Protocol) to send and receive data in XML format.
Here, we will cover how to update a product’s price using APIs V1 and V2, with examples of XML requests that can be sent using tools like Postman.
2. Prerequisites #
Before starting, make sure you have:
- Access to the Soulmkt Marketplace API: You will need access credentials (username and password) to obtain a sessionId, which is required to authenticate requests.
- Product Identifier: The product SKU (Stock Keeping Unit) or ID that you want to update.
- Request Submission Tool: It is recommended to use Postman or any other tool that allows sending SOAP requests.
3. Step-by-Step Price Update #
3.1. Obtaining the sessionId #
Before performing any API operation, you need to obtain a sessionId to authenticate your requests. This is done through a login call to the API.
Login Request Example:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:OpenMage"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:login>
<username xsi:type="xsd:string">User</username>
<apiKey xsi:type="xsd:string">Password</apiKey>
</ns1:login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Keep this sessionId:
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<ns1:loginResponse>
<result xsi:type="xsd:string">1234567890abcdef1234567890abcdef</result>
</ns1:loginResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
3.2. Price Update using API V2 #
The Soulmkt Marketplace API V2 uses a more straightforward structure to update a product’s price. Below is an example of how to do it.
Example Request for Price Update (API V2):
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:OpenMage"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:catalogProductUpdate>
<sessionId xsi:type="xsd:string">1234567890abcdef1234567890abcdef</sessionId>
<product xsi:type="xsd:string">produto-sk123</product>
<productData xsi:type="ns1:catalogProductCreateEntity">
<price xsi:type="xsd:string">150.00</price>
</productData>
<storeView xsi:nil="true"/>
<identifierType xsi:nil="true"/>
</ns1:catalogProductUpdate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Field Explanations:
sessionId: The authentication token obtained in the previous step.product: The SKU or product ID you wish to update.productData: Contains the product data, including the new price.price: The new product price (in this example, R$ 150.00).
Response:
If the update is successful, you will receive a response like:
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<ns1:catalogProductUpdateResponse>
<result xsi:type="xsd:boolean">true</result>
</ns1:catalogProductUpdateResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
3.3. Price Update using API V1 #
API V1 uses a slightly different structure where product data is passed in a map format.
Example Request for Price Update (API V1):
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:OpenMage"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:call>
<sessionId xsi:type="xsd:string">1234567890abcdef1234567890abcdef</sessionId>
<resourcePath xsi:type="xsd:string">catalog_product.update</resourcePath>
<args SOAP-ENC:arrayType="xsd:ur-type[2]" xsi:type="SOAP-ENC:Array">
<item xsi:type="xsd:string">produto-sk123</item>
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">price</key>
<value xsi:type="xsd:string">150.00</value>
</item>
</item>
</args>
</ns1:call>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Field Explanations:
sessionId: The authentication token obtained in the previous step.resourcePath: The API resource path to be called (catalog_product.update).args: A list of arguments, where:- The first item is the SKU or product ID.
- The second item is a map containing the fields to be updated (in this case, the price).
Response:
If the update is successful, you will receive a response like:
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<ns1:callResponse>
<result xsi:type="xsd:boolean">true</result>
</ns1:callResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
4. Final Considerations #
- Testing: Always test your requests in a development environment before applying them to production.
- Common Errors: Make sure the sessionId is valid and the product SKU is correct. Authentication errors or incorrect SKUs are the most common causes of failure.
- Tools: Use tools like Postman to make it easier to send and view request responses.
With this documentation, you are ready to update product prices in the Soulmkt Marketplace using APIs V1 and V2. If you have any questions, please contact the support team.
Note: The data used in the examples are fictitious and should be replaced with the real values from your environment.