Jet.com is e-commerce platform, which provide powerful marketplace to his partners. But products listing on Jet.com is not quite simple as others platform. To upload products on Jet.com, first you need to register their Partner program. After received approval, you will able to access Jet API to upload products.
You can also check our ready Jet API template, using this tool you can easily manage products and orders on Jet.com.
Start Product Listing in Jet.com via API call
Initially you have Test API environment access. After login in Jet partner account, go in the API tab at left side. Where you can find Test API keys, which are going to use for authentication.
Jet Api Authentication:
Send API user and merchant pass in request body to authenticate Jet API. Use below PHP code to authenticate. After that you will get id_token, which will pass in header to execute further API calls.
$url = "https://merchant-api.jet.com/api/token";
$data = array(
'user' => '2BD8*******************B06A7AC',
'pass' => 'WJTa*******************jHPxecL'
$body = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
// get jet token here
echo $token = $resultdata->id_token;
Jet Api Call to Add Product Sku:
Now you have the id_token, lets write an code to add products sku in Jet.com. Complete SKU Products parameter information described here: https://developer.jet.com/docs/overview
Need to Implement This : Get Quote
Pass previously get authentication id_token in header request. Make sure content type is JSON. Below request product parameters are required to upload SKU.
$headers = array(
"Authorization: Bearer ".$token
$prod_url = "https://merchant-api.jet.com/api/merchant-skus?sku=788546457322";
$standard_product_codes = array( "standard_product_code" => "788546457322", "standard_product_code_type" => "UPC");
$prod_data = array(
"product_title" => "Product Title",
"multipack_quantity" => 8,
"brand" => "Brand Name",
"standard_product_codes" => $standard_product_codes, // If you ASIN code use instead of UPC code
"main_image_url" => "https://example.com/assets/image.png",
$pro_body = json_encode($prod_data);
$chnew = curl_init();
curl_setopt($chnew, CURLOPT_URL, $prod_url);
curl_setopt($chnew, CURLOPT_HTTPHEADER, $headers);
curl_setopt($chnew, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($chnew, CURLOPT_POSTFIELDS, $pro_body);
curl_setopt($chnew, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($chnew, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($chnew);
After execute above code new Product SKU added in Jet.com. Although Jet have another method to upload products, that is Bulk Json File Upload method. This method use for upload large number of products at one time. If you have limited products then single SKU method is best.
You May Also Like:
How to Add New Product in Bigcommerce via API V2
How to Connect With Cloudshare Rest API
How to Get Opportunity Data from Salesforce Through API in PHP
How to Install Magento Security Patch via Putty
Code to Use Paypal Payment Gateway on Website
After adding SKU in jet com, use this same method to add Inventory and Price data of products. Your added products status goes to Under Review. After reviewing uploaded products by Jet, your SKU goes live. Must share with others. Thanks