Bulk Import Products
curl --request POST \
--url https://api-ai.textyess.com/products/bulk-import \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--data '
{
"file_url": "<string>"
}
'import requests
url = "https://api-ai.textyess.com/products/bulk-import"
payload = { "file_url": "<string>" }
headers = {
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-auth-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_url: '<string>'})
};
fetch('https://api-ai.textyess.com/products/bulk-import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-ai.textyess.com/products/bulk-import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-ai.textyess.com/products/bulk-import"
payload := strings.NewReader("{\n \"file_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-auth-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-ai.textyess.com/products/bulk-import")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"file_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-ai.textyess.com/products/bulk-import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Products update queued successfully"
}
{
"message": "You hit rate limit"
}
{
"message": "Unauthorized"
}
Products API
Bulk Import Products
Import multiple products at once into your catalog
POST
/
products
/
bulk-import
Bulk Import Products
curl --request POST \
--url https://api-ai.textyess.com/products/bulk-import \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--data '
{
"file_url": "<string>"
}
'import requests
url = "https://api-ai.textyess.com/products/bulk-import"
payload = { "file_url": "<string>" }
headers = {
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-auth-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_url: '<string>'})
};
fetch('https://api-ai.textyess.com/products/bulk-import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-ai.textyess.com/products/bulk-import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-ai.textyess.com/products/bulk-import"
payload := strings.NewReader("{\n \"file_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-auth-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-ai.textyess.com/products/bulk-import")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"file_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-ai.textyess.com/products/bulk-import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Products update queued successfully"
}
{
"message": "You hit rate limit"
}
{
"message": "Unauthorized"
}
Overview
The bulk import endpoint allows you to add multiple products to your catalog by providing a URL to a JSONL file containing your products data. This is used only initial catalog.Authentication
This endpoint requires a valid JWT token in thex-auth-token header. You can find your token in the Developers section:
x-auth-token: your_jwt_token
Body Parameters
string
required
A valid URL pointing to a JSONL file containing your products data. The file should be publicly accessible.
Expected JSONL File Structure
Your JSONL file should contain an array of products with the following structure:[
{
"id": "prod_12345",
"title": "Sample Product",
"description": "A detailed product description",
"image": "https://example.com/image.jpg",
"url": "https://yourstore.com/products/sample-product",
"variants": [
{
"id": "var_12345",
"title": "Default Variant",
"price": "29.99",
"inventory_quantity": 100,
"variant_url": "https://yourstore.com/products/sample-product/variant"
}
],
"collections": ["New Arrivals", "Featured"]
}
]
Response
boolean
Indicates if the import was successful
string
A human-readable message describing the result
{
"success": true,
"message": "Products update queued successfully"
}
{
"message": "You hit rate limit"
}
{
"message": "Unauthorized"
}
Best Practices
- File Hosting: Ensure your JSONL file is hosted on a reliable, publicly accessible URL.
- File Size: Keep your JSONL file under 10MB for optimal processing.
- Data Validation: Validate your JSONL structure before uploading to avoid failed imports.
- Error Handling: Implement retry logic with exponential backoff for rate limit errors.
- Idempotency: The operation is NOT idempotent - uploading the same file multiple times will create duplicate products.