Import products from CSV
curl --request POST \
--url https://api.virtual.fit/vfr/manage/sites/{site_id}/products/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.virtual.fit/vfr/manage/sites/{site_id}/products/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.virtual.fit/vfr/manage/sites/{site_id}/products/import"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.virtual.fit/vfr/manage/sites/{site_id}/products/import"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"imported_count": 123,
"deleted_product_count": 123,
"deleted_variant_count": 123,
"products": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}API reference
Import catalog CSV
Import current products and exact variant rows from a CSV file.
POST
https://api.virtual.fit
/
vfr
/
manage
/
sites
/
{site_id}
/
products
/
import
Import products from CSV
curl --request POST \
--url https://api.virtual.fit/vfr/manage/sites/{site_id}/products/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.virtual.fit/vfr/manage/sites/{site_id}/products/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.virtual.fit/vfr/manage/sites/{site_id}/products/import"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.virtual.fit/vfr/manage/sites/{site_id}/products/import"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"imported_count": 123,
"deleted_product_count": 123,
"deleted_variant_count": 123,
"products": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}The multipart field name is
file. See Sync the catalog
for row inheritance, current columns, and delete rows.Authorizations
Keep the virtual.fit API key on your server.
Path Parameters
Custom JavaScript site ID from virtual.fit.
Body
multipart/form-data