Import Catalog Info

Updated 1 week ago ​by nussi

Overview

In order to import catalog information, you must first download example template.

More information can be found Here.

  • Be authenticated user

For information on how you can authenticate, see: Authentication

As soon as you do authentication and receive a valid token, it needs to be passed on the call to the server.

  • Provide what type of import are you doing: For variations, kits, shadows etc.
  • Provide information about template content and format.

Endpoint

Example for such endpoint for TT server is https://tt.api.sellercloud.com/rest/api/Catalog/Imports/BasicImports/{typeOfImport}

Example endpoint URL could be:

https://tt.api.sellercloud.com/rest/api/Catalog/Imports/BasicImports/4

Request

  • Method Type: Http Post
  • Authorization: Use Bearer Token + token received from token authentication
  • Header info: Content-Type: application/json

Important: Content of the file must be sent as encoded to base-64 array of bytes

Different file format types are:

{
TAB_Delimited = 0
CSV = 1
Excel = 2
}

Type of imports are:

public enum CatalogImportKind
{
[Description("Bulk Product Update")]
BulkUpdateProducts = 0,

[Description("Import Info via Plugin/Profile")]
ViaPluginProfile = 1,

[Description("Import Shadows")]
Shadows = 2,

[Description("Import Variations")]
Variations = 3,

[Description("Import Kits")]
Kits = 4,

[Description("Import Kit Box Dimensions")]
KitBoxDimensions = 5,

[Description("Import Ebay Specifics")]
EbaySpecifics = 6,

[Description("Import Product Images")]
ProductImages = 7,

[Description("Import Product Channel Specific Images")]
ProductChannelSpecificImages = 8,

[Description("Import Walmart Marketplace Attributes")]
WalmartMarketplaceAttributes = 9,

[Description("Import Walmart Marketplace Variation Values")]
WalmartMarketplaceVariationValues = 10,

[Description("Import Newegg.com Attributes")]
NeweggComAttributes = 11,

[Description("Import Amazon Attributes")]
AmazonAttributes = 12,

[Description("Import Amazon Hazardous Attributes")]
AmazonHazardousAttributes = 13,

[Description("Import Product Clones")]
ProductClones = 14,

[Description("Import Variations Images")]
VariationImages = 15,

[Description("Import Product Groups")]
ProductGroups = 16,

[Description("Import Product Average Cost Adjustments")]
ProductAverageCostAdjustments = 17,

[Description("Import Product Rebates")]
ProductRebates = 18,

[Description("Import Product Replacements")]
ProductReplacements = 19,

[Description("Import Newegg Biz Attributes")]
NeweggBizAttributes = 20,

[Description("Import Product Titles")]
ProductTitles = 21,

[Description("Import Sears Attributes")]
SearsAttributes = 22,

[Description("Import Jet Attributes")]
JetAttributes = 23,

[Description("Import Magento Attributes")]
MagentoAttributes = 24,

[Description("Import Ebay Parts Compatibility")]
EbayPartsCompatibility = 25,

[Description("Import Related Products")]
RelatedProducts = 26,

[Description("Import Shopify Metafields")]
ShopifyMetafields = 27,

[Description("Import Product Documents")]
ProductDocuments = 28,

[Description("Import Bonanza Traits")]
BonanzaTraits = 29,

[Description("Import Product Notes")]
ProductNotes = 30,

[Description("Import Ebay Auctions")]
EbayAuctions = 31,

[Description("Import SKU Splitting Info")]
SkuSplittingInfo = 32,

[Description("Import Per-Channel UPC")]
PerChannelUpc = 33,

[Description("Import Magento Tier Pricing")]
MagentoTierPricing = 34,

[Description("Import Newegg.Com International Prices")]
NeweggComInternationalPrices = 35,

[Description("Import Product Alias")]
ProductAliases = 36,

[Description("Import Product Accessories")]
ProductAccessories = 37,

[Description("Import Rakuten Attributes")]
RakutenAttributes = 38,
}

Response

  • If user is authenticated and file successfully imported catalog info then response will be Status Code 200 => OK and content will be queued job generated link message.

  • If user is not authenticated, then response will be Status Code 401 => Not Valid Token

  • On server response => Status Code 500 => Internal Server Error

Example code in c#

static async Task Main(string[] args)
{
await ImportCatalogTemplate();
}


static async Task ImportCatalogTemplate()
{
string url = $"http://localhost:64158/api/Catalog/Imports/BasicImports/5";
string token = @"test token";

var content = new CatalogImportFileRequest()
{
FileContents = Convert.ToBase64String(File.ReadAllBytes($@"C:\Data\TestRuns\Test.xls")),
Format = 1
};

using (var client = new HttpClient())
using (var request = new HttpRequestMessage(HttpMethod.Post, url))
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

var json = JsonConvert.SerializeObject(content);
using (var stringContent = new StringContent(json, Encoding.UTF8, "application/json"))
{
request.Content = stringContent;

await client.SendAsync(request);
}
}
}


How did we do?