File import
Send the Excel, CSV or XML file you already have, as it is: a marketplace export, a supplier XML feed or your own sheet. Column headers are recognised in Turkish or English, ignoring case and Turkish letters; most files import without a mapping step.
The request
POST /seller/imports takes the file as base64 (25 MB at most):
curl -X POST https://api.ustageliyor.com/v1/seller/imports \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: products-2026-10-23" \
-d "{
\"file_name\": \"products.csv\",
\"content\": \"$(base64 < products.csv | tr -d '\n')\",
\"default_category_id\": \"pcat_…\",
\"defaults\": { \"status\": \"published\", \"tax_rate\": 20, \"deliveries\": [\"cargo\"] }
}"| Field | Meaning |
|---|---|
file_name | File name; helps tell the format |
content | The file as base64 (.xlsx, .csv, .xml) |
default_category_id | Category for rows whose category cell is empty or does not match |
defaults | Values the file lacks: status (default draft), tax_rate (20), deliveries (["cargo"]) |
columns | Manual mapping: header → field (title, sku, barcode, price, …), axis:Renk, attr:Materyal or ignore |
The file is read at once: an unreadable file gets a 400 on this request. When it reads, the answer is 202 with a job and how each header was understood:
{
"job": {
"id": "mij_…",
"source": "csv",
"status": "queued",
"total": 2,
"problems": []
},
"columns": {
"Model Kodu": { "kind": "field", "field": "model_code" },
"Renk": { "kind": "axis", "title": "Renk" },
"Özellik: Materyal": { "kind": "attribute", "name": "Materyal" },
"Notes": { "kind": "ignored" }
}
}Check columns: if a header was misread or stayed ignored, send the same file again with a columns mapping. Follow progress with GET /seller/jobs/{id}; row problems are in problems.
Publishing
Products from a file are drafts by default. Send defaults.status: "published" to publish them directly. A Status column can only turn a row into a draft (0, hayır, pasif, taslak, false, no, draft, inactive, kapalı).
Recognised columns
| Field | Recognised headers (examples) |
|---|---|
| Product name | Ürün Adı, Ürün İsmi, Başlık, Title, Name, Product Name, productName |
| Model code | Model Kodu, Ürün Grup Kodu, Grup Kodu, Ana Ürün Kodu, productMainId, Parent SKU, Group Code |
| Stock code | Stok Kodu, SKU, Ürün Kodu, Product Code, productCode, Stock Code, Merchant SKU, Satıcı Stok Kodu |
| Barcode | Barkod, Barcode, GTIN, EAN, EAN13, UPC |
| Brand | Marka, Brand, Marka Adı |
| Category | Kategori, Category, Kategori Adı, Kategori ID, Category ID, Category Name, Group |
| Sale price | Satış Fiyatı, Fiyat, Price, Sale Price, İndirimli Fiyat, KDV Dahil Satış Fiyatı, price1 |
| List price | Piyasa Fiyatı, Liste Fiyatı, List Price, PSF, First Price |
| Stock | Stok, Stok Adedi, Stock, Quantity, Miktar, Adet, Envanter |
| VAT | KDV, KDV Oranı, VAT, VAT Rate, Tax Rate, kdv_id |
| Description | Açıklama, Ürün Açıklaması, Description, Detay |
| Subtitle | Alt Başlık, Subtitle, Kısa Açıklama, Short Description |
| Desi | Desi, Kargo Desi, Dimensional Weight |
| Status | Durum, Status, Aktif, Yayında |
| Images | Görsel 1…8, Resim 1, Image, Image URL 2, Foto, Picture 1, Photo — one cell may also hold several URLs separated by spaces, ,, ; or | |
| Attribute | Özellik: <name> (e.g. Özellik: Materyal); Attr: <name>, Attribute: <name>, Nitelik: <name> |
| Variant axis | Renk, Beden, Numara, Boyut, Ebat, Kapasite, Hacim, Ağırlık, Color, Colour, Size, Capacity, Volume, Weight, Seçenek |
| Variant pair | Varyant 1 Adı + Varyant 1 Değeri (up to 9); Variant 1 Name + Variant 1 Value |
The first header that names a field wins; a second header for the same field is ignored. Headers not listed here (like Notes) become ignored; map them with columns to a field, an axis (axis:Material Type) or an attribute (attr:Warranty).
How rows become products
- Rows sharing a model code are one product's variants; the axis columns (Renk, Beden…) tell them apart.
- A row without a model code is a product of its own (keyed by stock code).
- An empty stock code falls back to the barcode; a row with neither is refused.
- Product-level details (name, brand, category, description, VAT, desi) come from the group's first row. A later row that disagrees on name, brand or category is reported as
conflict; it is still added as a variant. - A category cell may be an id, a name or a
Parent > Child > Leafpath. An unmatched name falls back todefault_category_id(without one the product is saved with no category), and the row gets acategoryproblem note. - A single-row product is a plain product; its axis cells are ignored.
- 50,000 rows per file at most.
Numbers are read in Turkish or English notation: 1.299,90, 1299,90, 1,299.90, 1299.9, ₺ 1.299 (= 1299). VAT may be 20, %20 or 0,20. Stock must be a whole number.
Sample CSV
Model Kodu;Stok Kodu;Barkod;Ürün Adı;Marka;Kategori;Renk;Beden;Satış Fiyatı;Piyasa Fiyatı;Stok;KDV;Özellik: Materyal;Görsel 1;Görsel 2
TLM-100;TLM-100-LAC-M;8680000000011;Çalışma Tulumu;Usta İş;İş Kıyafetleri;Lacivert;M;749,90;899,90;25;20;Pamuk;https://cdn.example.com/tlm-100-lacivert.jpg;https://cdn.example.com/tlm-100-arka.jpg
TLM-100;TLM-100-LAC-L;8680000000028;Çalışma Tulumu;Usta İş;İş Kıyafetleri;Lacivert;L;749,90;899,90;12;20;Pamuk;https://cdn.example.com/tlm-100-lacivert.jpg;
TLM-100;TLM-100-GRI-M;8680000000035;Çalışma Tulumu;Usta İş;İş Kıyafetleri;Gri;M;729,90;899,90;0;20;Pamuk;https://cdn.example.com/tlm-100-gri.jpg;
TLM-100;TLM-100-GRI-L;8680000000042;Çalışma Tulumu;Usta İş;İş Kıyafetleri;Gri;L;729,90;899,90;7;20;Pamuk;https://cdn.example.com/tlm-100-gri.jpg;
;VDA-12;8680000000059;Akülü Vidalama 12V;Usta İş;El Aletleri;;;1.299,00;;8;20;;https://cdn.example.com/vda-12.jpg;Two products come out: TLM-100 with four variants (Renk × Beden) and the plain VDA-12.
The CSV delimiter may be ;, , or a tab; quoted fields are supported. Encoding is UTF-8 (with or without a BOM) or Windows-1254, which Turkish Excel saves.
Sample XML
<?xml version="1.0" encoding="UTF-8"?>
<Urunler>
<Urun>
<Model_Kodu>TLM-100</Model_Kodu>
<Urun_Adi>Çalışma Tulumu</Urun_Adi>
<Marka>Usta İş</Marka>
<Kategori>İş Kıyafetleri</Kategori>
<KDV>20</KDV>
<Aciklama>Ter tutmayan pamuklu kumaş, çok cepli.</Aciklama>
<Gorseller>
<Gorsel>https://cdn.example.com/tlm-100-lacivert.jpg</Gorsel>
<Gorsel>https://cdn.example.com/tlm-100-arka.jpg</Gorsel>
</Gorseller>
<Ozellikler>
<Ozellik name="Materyal">Pamuk</Ozellik>
</Ozellikler>
<Varyantlar>
<Varyant>
<Stok_Kodu>TLM-100-LAC-M</Stok_Kodu>
<Barkod>8680000000011</Barkod>
<Renk>Lacivert</Renk>
<Beden>M</Beden>
<Satis_Fiyati>749.90</Satis_Fiyati>
<Piyasa_Fiyati>899.90</Piyasa_Fiyati>
<Stok>25</Stok>
</Varyant>
<Varyant>
<Stok_Kodu>TLM-100-GRI-L</Stok_Kodu>
<Barkod>8680000000042</Barkod>
<Renk>Gri</Renk>
<Beden>L</Beden>
<Satis_Fiyati>729.90</Satis_Fiyati>
<Stok>7</Stok>
</Varyant>
</Varyantlar>
</Urun>
<Urun>
<Stok_Kodu>VDA-12</Stok_Kodu>
<Barkod>8680000000059</Barkod>
<Urun_Adi>Akülü Vidalama 12V</Urun_Adi>
<Marka>Usta İş</Marka>
<Kategori>El Aletleri</Kategori>
<Satis_Fiyati>1299.00</Satis_Fiyati>
<Stok>8</Stok>
<KDV>20</KDV>
<Gorseller>
<Gorsel>https://cdn.example.com/vda-12.jpg</Gorsel>
</Gorseller>
</Urun>
<Urun>
<Stok_Kodu>ELD-NTR-9</Stok_Kodu>
<Barkod>8680000000066</Barkod>
<Urun_Adi>Nitril İş Eldiveni</Urun_Adi>
<Marka>Usta İş</Marka>
<Kategori>İş Kıyafetleri</Kategori>
<Satis_Fiyati>89.90</Satis_Fiyati>
<Stok>140</Stok>
<KDV>20</KDV>
</Urun>
</Urunler>In XML, element names are read like column headers (Urun_Adi = "Ürün Adı"). Recognised shapes:
- The product list is the most repeated element in the file (a product's own variant list is never taken for it):
<Urunler><Urun>,<products><product>, Google Merchant<rss><channel><item>and the like. - Variants sit inside the product under
<Varyantlar>,<variants>,<variations>,<Secenekler>,<options>or<subproducts>; each inherits the product's fields and the product's code (Model_Kodu,productMainId,Stok_Kodu…) groups them. - Images under
<Gorseller>,<Resimler>,<images>,<pictures>; a<url>child works too. - Attributes under
<Ozellikler>,<attributes>,<specs>; the name in anameattribute or a<name>/<ad>child, the value as text or in a<value>/<deger>child.
Excel
The first sheet of an .xlsx is read; the first non-empty row is the header. Formulas are not evaluated; the last value Excel saved is used. Old .xls is not supported: "Save as → Excel Workbook (.xlsx)".
File errors
| Code | Status | Meaning |
|---|---|---|
IMPORT_FORMAT_UNKNOWN | 400 | Not .xlsx, .csv or .xml |
IMPORT_FILE_UNREADABLE | 400 | The file is broken or could not be read |
IMPORT_FILE_EMPTY | 400 | No product rows |
IMPORT_PLAN_EMPTY | 400 | Rows exist but none became a product; first 50 problems in problems |
IMPORT_FILE_TOO_LARGE | 413 | Larger than 25 MB |
Row problems on the job (problems, first 1000; total in problem_count):
code | Meaning |
|---|---|
required | A required field is empty or breaks a product rule (field says which) |
invalid_number | Price, list price or stock is not a number |
invalid_barcode | Barcode over 40 characters or with invalid characters |
duplicate_sku | The same stock code appears twice in the file |
conflict | Product details disagree within a group, or saving failed (field holds the error code, e.g. CATALOG_SKU_TAKEN) |
too_many | More than 50,000 rows |
Each problem carries row (the header is row 1), field and, when there is one, value.