SOAP API

You may have already got orders to work from Centra to your ERP. So let's go through how to send information back to Centra depending on what should be shipped.

Okay, so you've basically called the events_Get function from your ERP and received an order that looks something like this:

​<ns1:event>
    <ns1:id>156</ns1:id>
    <ns1:type>order</ns1:type>
    <ns1:entry>24</ns1:entry>
    <ns1:mission>update</ns1:mission>
    <ns1:date>2013-08-26 16:56:32</ns1:date>
    <ns1:data>
        <ns1:order>
            <ns1:id>24</ns1:id>
            <ns1:type>retail</ns1:type>
            <ns1:store>1</ns1:store>
            <ns1:status>pending</ns1:status>
            <ns1:ordertotal>1.00</ns1:ordertotal>
            <ns1:currency>SEK</ns1:currency>
            <ns1:currencyrate>1.00000</ns1:currencyrate>
            <ns1:basecurrency>SEK</ns1:basecurrency>
            <ns1:created>2013-08-26T16:50:55+02:00</ns1:created>
            <ns1:internal>false</ns1:internal>
            <ns1:preferred_shipping_date></ns1:preferred_shipping_date>
            <ns1:primary_warehouse>
                <ns1:warehouse><ns1:id>SYSTRANS</ns1:id></ns1:warehouse>
            </ns1:primary_warehouse>
            <ns1:shipping>...</ns1:shipping>
            <ns1:payments>...</ns1:payments>
            <ns1:products>
                <ns1:product>
                    <ns1:id>1817</ns1:id>
                    <ns1:tax>25.00</ns1:tax>
                    <ns1:sku>11425721-2080</ns1:sku>
                    <ns1:origprice>1.00</ns1:origprice>
                    <ns1:price>1.00</ns1:price>
                    <ns1:discount>0</ns1:discount>
                    <ns1:qty>1</ns1:qty>
                    <ns1:subtotal>1</ns1:subtotal>
                    <ns1:description>Marble Seal T-shirt</ns1:description>
                    <ns1:variation>
                        <ns1:id>4933</ns1:id>
                    </ns1:variation>
                    <ns1:brand>
                        <ns1:id>3</ns1:id>
                        <ns1:description>Wood Wood</ns1:description>
                    </ns1:brand>
                    <ns1:sizes>
                        <ns1:size>
                            <ns1:id>586</ns1:id>
                            <ns1:sku></ns1:sku>
                            <ns1:qty>1</ns1:qty>
                            <ns1:preorder>no</ns1:preorder>
                            <ns1:description>S</ns1:description>
                            <ns1:orderitem>
                                <ns1:id>339</ns1:id>
                            </ns1:orderitem>
                            <ns1:warehouseitems>
                                <ns1:warehouse>
                                    <ns1:id>SYSTRANS</ns1:id>
                                    <ns1:qty>1</ns1:qty>
                                </ns1:warehouse>
                            </ns1:warehouseitems>
                        </ns1:size>
                    </ns1:sizes>
                </ns1:product>
            </ns1:products>
        </ns1:order>
    </ns1:data>
</ns1:event>

Sometimes Centra is also setup so it will send a shipment directly as the order is placed. This shipment will have a <id>-node that should be used so we can change the same shipment that has already been created. However, if the solution demands that it should be created by the ERP, this is an easy setting to turn off. Now we need to call orders_Update with a shipment to this order. This is how it should look like:

​<ns1:order>
    <ns1:id>24</ns1:id>
    <ns1:type>retail</ns1:type>
    <ns1:store>1</ns1:store> <!--
    <ns1:shipments>
        <ns1:shipment>
            <ns1:id>1125</ns1:id> <!-- UNIQUE ID OF THIS SHIPMENT, should be the unique ID of this shipment in the ERP -->
            <ns1:paid>yes</ns1:paid> <!-- Set this to yes to mark it as paid, the integrations should always send the order as paid before ERP gets it -->
            <ns1:shipped>yes</ns1:shipped> <!-- Set this to yes, as you're doing this call to actually tell Centra it has been shipped. -->
            <ns1:appendix>1</ns1:appendix> <!-- This should be an incremental number telling Centra what shipment of this order this is. 1 for the first order, 2 as the second one. -->
            <ns1:currency>SEK</ns1:currency>
            <ns1:currencyrate>1.00000</ns1:currencyrate>
            <ns1:basecurrency>SEK</ns1:basecurrency>
            <ns1:created>2013-08-26T17:04:53+02:00</ns1:created>
            <ns1:shippingaddress>
                <!-- This address should be the same one as you received as the shipping address from Centra -->
                <ns1:firstname>John</ns1:firstname>
                <ns1:lastname>Doe</ns1:lastname>
                <ns1:address1>Highway 1</ns1:address1>
                <ns1:address2></ns1:address2>
                <ns1:city>Stockholm</ns1:city>
                <ns1:state></ns1:state>
                <ns1:zipcode>12344</ns1:zipcode>
                <ns1:country>SE</ns1:country>
                <ns1:email>john.doe@example.com</ns1:email>
                <ns1:telephone>0701234567</ns1:telephone>
            </ns1:shippingaddress>
            <ns1:carrierinformation>
                <ns1:carrier>FEDEX</ns1:carrier>
                <ns1:service>EXPRESS</ns1:service>
                <ns1:tracking>TRACKINGNUMBER</ns1:tracking> <!-- Set this as the trackingnumber of the order from the ERP. The client will receive this tracking number in the Shipping Confirmation -->
                <ns1:packages>1</ns1:packages>
            </ns1:carrierinformation>
            <ns1:products>
                <ns1:product>    
                    <!-- The id nodes of the product, variation and the size should be the same IDs as you listen to when receiving an order from Centra, these are often mapped up to reflect the IDs inside the ERP. Centra tries to figure out what product you want to send so the size <id>-node can be skipped for example since we're using the size description to find the product anyway. -->
                    <ns1:id>1817</ns1:id>
                    <ns1:sku>11425721-2080</ns1:sku>
                    <ns1:price>1.00</ns1:price>
                    <ns1:variation>
                        <ns1:id>4933</ns1:id>
                    </ns1:variation>
                    <ns1:sizes>
                        <ns1:size>
                            <ns1:id>586</ns1:id>
                            <ns1:qty>1</ns1:qty>
                            <ns1:description>S</ns1:description>
                        </ns1:size>
                    </ns1:sizes>
                </ns1:product>
            </ns1:products>
            <ns1:voucher>
                <ns1:subtotal>0</ns1:subtotal>
            </ns1:voucher>
            <ns1:shipping>
                <ns1:subtotal>0</ns1:subtotal>
            </ns1:shipping>
        </ns1:shipment>
    </ns1:shipments>
</ns1:order>

You should now take a look inside Centra, you should now have a shipment on the order completed: