How to create shipment and add tracking number through API in Magento 2?Adding a barcode for Order number and Tracking Number in Shipment PDFProgramatically add tracking to shipment - Mage_Api_Model_Resource_Abstract->_fault('not_exists')Magento 2 Log Bundle Product Data in List Page?Add tracking link to shipment email doesn't workMagento2: How to add tracking url in shipment email for customer in magento 2Magento 2 - How to create item wise shipment And add tracking number programmaticallyFetching last tracking number from another magento usin APIAdding a tracking number and shipping label to shipmentMagento 2 Cannot create shipment Rest ApiMagento 2 order shipment tracking details
What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?
Need help identifying/translating a plaque in Tangier, Morocco
Symmetry in quantum mechanics
Finding files for which a command fails
Can the Produce Flame cantrip be used to grapple, or as an unarmed strike, in the right circumstances?
Why do UK politicians seemingly ignore opinion polls on Brexit?
Uplifted animals have parts of their "brain" in various locations of their body. Where?
Is this food a bread or a loaf?
Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?
Why was the "bread communication" in the arena of Catching Fire left out in the movie?
How to answer pointed "are you quitting" questioning when I don't want them to suspect
Could a US political party gain complete control over the government by removing checks & balances?
Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?
Can I legally use front facing blue light in the UK?
Was there ever an axiom rendered a theorem?
I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine
New order #4: World
What happens when a metallic dragon and a chromatic dragon mate?
Is there any use for defining additional entity types in a SOQL FROM clause?
Shall I use personal or official e-mail account when registering to external websites for work purpose?
aging parents with no investments
How could a lack of term limits lead to a "dictatorship?"
Are objects structures and/or vice versa?
Where to refill my bottle in India?
How to create shipment and add tracking number through API in Magento 2?
Adding a barcode for Order number and Tracking Number in Shipment PDFProgramatically add tracking to shipment - Mage_Api_Model_Resource_Abstract->_fault('not_exists')Magento 2 Log Bundle Product Data in List Page?Add tracking link to shipment email doesn't workMagento2: How to add tracking url in shipment email for customer in magento 2Magento 2 - How to create item wise shipment And add tracking number programmaticallyFetching last tracking number from another magento usin APIAdding a tracking number and shipping label to shipmentMagento 2 Cannot create shipment Rest ApiMagento 2 order shipment tracking details
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a csv file with 3 columns with list of (increment_id, carrier_code, tracking_number). How do I Post POST these values to existing magento 2 order using API? I have managed to load the values from csv into a data array and into $incrementid, $carrier, $tracking. i'm new to API, please be detailed as possible.
<?php
$file = fopen('track.csv', 'r', '"'); // set path to the CSV file
if ($file !== false)
{
// add logging capability
$writer = new ZendLogWriterStream(BP . '/var/log/import-update.log');
$logger = new ZendLogLogger();
$logger->addWriter($writer);
public function execute()
// enter the number of data fields you require the product row inside the CSV file to contain
$required_data_fields = 3; //number of column in csv
while (($row = fgetcsv($this->_file, 100, ",")) !== FALSE)
$data_count = count($row);
if ($data_count < 1)
continue;
$data = array();
//$data = array_combine($header, $row);
$data = array($row);
$ponumber = $row[0]; //$data['ponumber']; // column A
if ($data_count < $required_data_fields)
$logger->info("Skipping Order Number " . $ponumber . ". Not enough data to import.");
continue;
$shipvia = isset($row[1]) ? $row[1] : null;
$trackingnumber = isset($row[2]) ? $row[2] : null;
switch ($shipvia)
case "FEDEX":
$shipvia = "fedex";
break;
case "UPS":
$shipvia = "ups";
break;
case "USPS":
$shipvia = "usps";
break;
default:
$shipvia = "fedex";
fclose($file);
magento2 api rest-api shipment shipment-tracking
add a comment |
I have a csv file with 3 columns with list of (increment_id, carrier_code, tracking_number). How do I Post POST these values to existing magento 2 order using API? I have managed to load the values from csv into a data array and into $incrementid, $carrier, $tracking. i'm new to API, please be detailed as possible.
<?php
$file = fopen('track.csv', 'r', '"'); // set path to the CSV file
if ($file !== false)
{
// add logging capability
$writer = new ZendLogWriterStream(BP . '/var/log/import-update.log');
$logger = new ZendLogLogger();
$logger->addWriter($writer);
public function execute()
// enter the number of data fields you require the product row inside the CSV file to contain
$required_data_fields = 3; //number of column in csv
while (($row = fgetcsv($this->_file, 100, ",")) !== FALSE)
$data_count = count($row);
if ($data_count < 1)
continue;
$data = array();
//$data = array_combine($header, $row);
$data = array($row);
$ponumber = $row[0]; //$data['ponumber']; // column A
if ($data_count < $required_data_fields)
$logger->info("Skipping Order Number " . $ponumber . ". Not enough data to import.");
continue;
$shipvia = isset($row[1]) ? $row[1] : null;
$trackingnumber = isset($row[2]) ? $row[2] : null;
switch ($shipvia)
case "FEDEX":
$shipvia = "fedex";
break;
case "UPS":
$shipvia = "ups";
break;
case "USPS":
$shipvia = "usps";
break;
default:
$shipvia = "fedex";
fclose($file);
magento2 api rest-api shipment shipment-tracking
add a comment |
I have a csv file with 3 columns with list of (increment_id, carrier_code, tracking_number). How do I Post POST these values to existing magento 2 order using API? I have managed to load the values from csv into a data array and into $incrementid, $carrier, $tracking. i'm new to API, please be detailed as possible.
<?php
$file = fopen('track.csv', 'r', '"'); // set path to the CSV file
if ($file !== false)
{
// add logging capability
$writer = new ZendLogWriterStream(BP . '/var/log/import-update.log');
$logger = new ZendLogLogger();
$logger->addWriter($writer);
public function execute()
// enter the number of data fields you require the product row inside the CSV file to contain
$required_data_fields = 3; //number of column in csv
while (($row = fgetcsv($this->_file, 100, ",")) !== FALSE)
$data_count = count($row);
if ($data_count < 1)
continue;
$data = array();
//$data = array_combine($header, $row);
$data = array($row);
$ponumber = $row[0]; //$data['ponumber']; // column A
if ($data_count < $required_data_fields)
$logger->info("Skipping Order Number " . $ponumber . ". Not enough data to import.");
continue;
$shipvia = isset($row[1]) ? $row[1] : null;
$trackingnumber = isset($row[2]) ? $row[2] : null;
switch ($shipvia)
case "FEDEX":
$shipvia = "fedex";
break;
case "UPS":
$shipvia = "ups";
break;
case "USPS":
$shipvia = "usps";
break;
default:
$shipvia = "fedex";
fclose($file);
magento2 api rest-api shipment shipment-tracking
I have a csv file with 3 columns with list of (increment_id, carrier_code, tracking_number). How do I Post POST these values to existing magento 2 order using API? I have managed to load the values from csv into a data array and into $incrementid, $carrier, $tracking. i'm new to API, please be detailed as possible.
<?php
$file = fopen('track.csv', 'r', '"'); // set path to the CSV file
if ($file !== false)
{
// add logging capability
$writer = new ZendLogWriterStream(BP . '/var/log/import-update.log');
$logger = new ZendLogLogger();
$logger->addWriter($writer);
public function execute()
// enter the number of data fields you require the product row inside the CSV file to contain
$required_data_fields = 3; //number of column in csv
while (($row = fgetcsv($this->_file, 100, ",")) !== FALSE)
$data_count = count($row);
if ($data_count < 1)
continue;
$data = array();
//$data = array_combine($header, $row);
$data = array($row);
$ponumber = $row[0]; //$data['ponumber']; // column A
if ($data_count < $required_data_fields)
$logger->info("Skipping Order Number " . $ponumber . ". Not enough data to import.");
continue;
$shipvia = isset($row[1]) ? $row[1] : null;
$trackingnumber = isset($row[2]) ? $row[2] : null;
switch ($shipvia)
case "FEDEX":
$shipvia = "fedex";
break;
case "UPS":
$shipvia = "ups";
break;
case "USPS":
$shipvia = "usps";
break;
default:
$shipvia = "fedex";
fclose($file);
magento2 api rest-api shipment shipment-tracking
magento2 api rest-api shipment shipment-tracking
asked 1 hour ago
Kris WenKris Wen
1418
1418
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269272%2fhow-to-create-shipment-and-add-tracking-number-through-api-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269272%2fhow-to-create-shipment-and-add-tracking-number-through-api-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown