Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1032377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:04:04+00:00 2026-05-16T14:04:04+00:00

I know there is a way to programmatically invoice, ship, and set state on

  • 0

I know there is a way to programmatically invoice, ship, and set state on an order (http://www.magentocommerce.com/boards/viewthread/74072/), but I actually need to drill down even deeper to the item level of an order. We have a situation where, depending on item type, two different items can be processed in two different locations (from the same order). I can go into the Magento back-end and “ship” one item without “shipping” the other and append comments to that one item, but I’m looking for a way to do this programmatically. Thank you in advance for your help!

Update:
Here is the code I ended up using to accomplish this:

$client = new SoapClient('http://somesite.domain/magento/index.php/api/?wsdl');
$session = $client->login('username', 'password');

function extract_item_id($items, $sku ){
    foreach($items as $item ){
        if ($item["sku"]==$sku) {
            return $item["item_id"];
        }
    }
}

$orderNum = "200000052";

$oderInfo = $client->call($session, "sales_order.info", $orderNum );

$item_id = extract_item_id($oderInfo["items"], "someSKU") ;
$itemsQty = array( $item_id => "1" ); 
$shipment = array(
    $orderNum,
    $itemsQty,
    "Comment associated with item shipped.",
    true,
    true
);

var_dump($shipment);

$nship = $client->call($session, 'sales_order_shipment.create', $shipment);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:04:05+00:00Added an answer on May 16, 2026 at 2:04 pm

    I’ve never done it, but it looks like the SOAP API supports creating individual shipment items. That’d be the first thing I’d check.

    If that doesn’t work, I’d examine the source code the the Magento admin and reverse engineer what its doing with to create a single item shipment. Specifically, start tracing at the saveAction of the admin’s Shipment Controller

    app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php
    

    The order/shipment/invoice section of Magento codebase is one of the most volatile/iterative sections, with the core objects/methods/dependencies changing subtly between versions. Finding one “right” answer for this will prove difficult, if not impossible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to turn ON UAC programmatically with C#? I know, everyone
Is there any way to programmatically get the current user's email address? I know
Does anyone know if there any way that I can programmatically create a bean
I want to know if there is any good way of programmatically producing C#
I would like to know if there is a way to programmatically arrange desktop
Is there an easy way to programmatically know if the current page is a
Does anybody know if there is a way to programmatically get the current framework
Is there a way to programmatically know when someone is using the Default Document
Is there a way to programmatically reopen an order in Magento that has already
Someone know if there's a programmatically way to use a specific defined APN on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.