michaelbonds / ship-station

A php wrapper for ShipStation's api.
10 stars 32 forks source link

Create and order not working #5

Closed frankhdz closed 6 years ago

frankhdz commented 6 years ago

Creating an order using an array or json not working $neworder = ['orderNumber'=>1008,'orderKey'=>'1000','orderDate'=>'7/11/2018','paymentDate'=>'7/11/2018','shipByDate'=>'10/10/2018','orderStatus'=>'awaiting_shipment','billTo'=>'1243 Excel Ave. Dallas TX 77045','shipTo'=>'1243 Excel Ave. Dallas TX 77045']; $order = $shipstation->orders;

$order->createOrder(json_encode($neworder));

How do you go about creating an order?

frankhdz commented 6 years ago

I had to use the order model in my code

use MichaelB\ShipStation\Models\Order;

        $order = new Order();
        $order->orderNumber=1010;
        $order->orderKey=1010;
        $order->amountPaid=100;
        $order->shippingAmount = 0;
        $order->orderTotal = 100;