Exploring Three Integration Strategies.

Discussion in 'Shapeways API' started by giusepperomano82, Nov 18, 2022.

Tags:
  1. Hello,

    I am starting API integration with my App, which creates custom models. I have three questions:

    1. I am exploring three routes. The first one is that once I get the quote and shipping cost (via the API) for a model, I place an order through the API but charge the users using another App (e.g., Stripe). I noted that adding an email address in the API is impossible (but I may be wrong) while placing an order. How can I let the user know about the tracking number programmatically?

    2. The second option is to process users' payments with Shapeways, where the price has a markup. That way, I will have to embed an SW cart with the already uploaded model so the user can place an order easily. Is it possible to do it?

    3. The last option is setting up an SW shop, which I already did. However, in my case, the models are created dynamically from user inputs (two numbers). Therefore, there should be an API call to my App. Would that be possible?

    Thanks!
     
  2. eirahope
    eirahope Member
    To learn how to programmatically save a tracking number while generating a shipment, please refer to the code provided below.

    the config.xml file with the following code
    basketball stars

    PHP:
     \s<events> \s<sales order shipment save before> \s<observers> \s<sales order shipment save before> \s<type>singleton</type> \s<class>ship/observer</class> \s<method>

    salesOrderShipmentSaveBefore</method> \s</sales order shipment save before>
    </
    observers> \s</sales order shipment save before> \s</events>
    basketball stars
    Now make a brand-new observer file in the Model folder. Name of the file Observer.php

    PHP:
    $track Mage::getModel('sales/order shipment track') ->setNumber("123123") /tracking number awb number ->setCarrierCode('dhl') /carrier code ->setTitle('Dhl'); /carrier title
    $shipment
    ->addTrack($track); $track Mage::getModel('sales/order shipment track') ->setNumber("234234"); /tracking number/AWB number; ->setCarrierCode('dhl'); /carrier code; ->setTitle('Dhl'); /carrier title$shipment->addTrack($track);

     
  3. romano5
    romano5 Member
    Thanks! It was very helpful!