---
title: "API Integration: ProductSync (Developer)"
description: ProductSync is a sample program written C# that integrates with the Volusion API.
---

[Skip to content](https://help.volusion.com/s/apiintegrationproductsyncdeveloper#main-content)

English - United States

Show submenu for translations

![Volusion Logo](https://help.volusion.com/hs-fs/hubfs/Color_Logo_Horizontal.png?width=1500&height=1500&name=Color_Logo_Horizontal.png)

Open main navigation

Close main navigation

- English - United States
  
  Show submenu for translations
- [Contact Us](https://volusion.com/contact)

[Contact Us](https://volusion.com/contact)

 Search the Help Center

- There are no suggestions because the search field is empty.

1. [Volusion Help Center](https://help.volusion.com/s?hsLang=en-us)
2. [V1](https://help.volusion.com/s/v1?hsLang=en-us)

# API Integration: ProductSync (Developer)

ProductSync is a sample program written C# that integrates with the Volusion API. The purpose of this program is to sync the Volusion database with an external database that is used by a customized application. This sample program demonstrates on how to sync Volusion product stock with an external database. This stock sync is done in three steps. First, the program downloads the Volusion stock information through an API request. Second, it calculates the new stock status and uploads the updated changes through an API update request to update the Volusion database. Lastly, it updates the external database for changes

# Step 1: Download Volusion Stock Information

```
api_url = "http://YourUrl/net/WebService.aspx?Login=YourEmail@YourDomain.com&EncryptedPassword=YourPassword&
API_Name=Generic\\Products&SELECT_Columns=p.ProductCode,p.ProductID,p.ProductName,p.StockStatus";

xml_http = new XMLHTTP();
xml_http.open("POST", api_url, false, "", "");
xml_http.send(null);
api_response = xml_http.responseText;
```

Note that this XML request will only download products that has been modified.

# Step 2: Calculate the New Stock Status and Update the Volusion Database

The new stock can be calculated by using the formula below:

new\_stock = old\_stock - (old\_stock - volusion\_stock) - (old\_stock - external\_stock)

Once the new stock has been calculated, an API update request can be called. To do this, use the code below:

```
api_url = "http://YourUrl/net/WebService.aspx
Login=YourEmail@YourDomain.com&EncryptedPassword=YourPassword&Import=Update";
api_request = "";
api_request = api_request + "";
api_request = api_request + "";
api_request = api_request + "";
api_request = api_request + "0001";
api_request = api_request + "5";
api_request = api_request + "";
api_request = api_request + "";

xml_http = new XMLHTTP();
xml_http.open("POST", api_url, false, "", "");
xml_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
xml_http.setRequestHeader("Content-Action", "Volusion_API");
xml_http.send(api_request);
api_response = xml_http.responseText;
```

Note that this XML request will return one of two success statuses.

If the update was successfully committed, it returns:

```
True
```

If the update failed, it returns:

```
False
```

# Step 3: Update the External Database

Once the stock update is successfully completed, the external database can be updated with the new stock status.

Since step one only downloads products that were recently modified, not all products will be synced. So it is necessary to check products modified in the external database as well and request for an API update. This can be done by the same steps but with a WHERE clause in step one.

# Step 4: Download Volusion Stock Information With a WHERE Clause

```
api_url = "http://YourUrl/net/WebService.aspx?Login=YourEmail@YourDomain.com&EncryptedPassword=YourPassword&
API_Name=Generic\\Products&SELECT_Columns=p.ProductCode,p.ProductID,p.ProductName,p.StockStatus 
&WHERE_Column=p.ProductCode&WHERE_Value=0002";

xml_http = new XMLHTTP();
xml_http.open("POST", api_url, false, "", "");
xml_http.send(null);
api_response = xml_http.responseText;
```

- [Getting started](https://help.volusion.com/s/getting-started?hsLang=en-us)
- [Manage Your Store](https://help.volusion.com/s/manage-your-store?hsLang=en-us)
- [Marketing for Success](https://help.volusion.com/s/marketing-for-success?hsLang=en-us)
- [Volusion Payment Powered by Stripe](https://help.volusion.com/s/volusion-payment-powered-by-stripe?hsLang=en-us)
- [Partner Marketplace](https://help.volusion.com/s/partner-marketplace?hsLang=en-us)
- [Support](https://help.volusion.com/s/support?hsLang=en-us)
- [V1](https://help.volusion.com/s/v1?hsLang=en-us)
- [Security](https://help.volusion.com/s/security?hsLang=en-us)

[![Volusion Logo](https://help.volusion.com/hs-fs/hubfs/Color_Logo_Horizontal.png?width=1500&height=1500&name=Color_Logo_Horizontal.png "Volusion Logo")](https://volusion.com/)

<https://www.facebook.com/> <https://www.twitter.com/> <https://www.instagram.com/> <https://podcasts.apple.com/> [mailto:email@email.com](mailto:email@email.com)

Copyright © 2026, Volusion