• Hi all,
    I need to create order via rest api. It works successfully but I’d like to manage also shipping tax and coupon.

    I don’t understand how set these information.

    My Body request:

    {
    	"customer_id": 613,
    	"billing": {
    		"first_name": "demo",
    		"last_name": "demo",
    		"company": "",
    		"address_1": "",
    		"address_2": "",
    		"city": "",
    		"postcode": "",
    		"country": "",
    		"state": "",
    		"email": "[email protected]",
    		"phone": ""
    	},
    	"shipping": {
    		"first_name": "Pippo",
    		"last_name": "Paperino",
    		"company": "",
    		"address_1": "Via Pippo 88",
    		"address_2": "",
    		"city": "Roma",
    		"postcode": "00100",
    		"country": "",
    		"state": "Italia"
    	},
    	"line_items": [
    		{
    			"product_id": 96108,
    			"quantity": 3
    		},
    		{
    			"product_id": 96119,
    			"quantity": 1
    		}
    	],
    	"shipping_lines": [{
    		"method_title": "Tariffa unica",
    		"method_id":"flat_rate"
    	}],
    	"coupon_lines": [
    		{
    			"id": 93651,
    			"code": "7u4xdqmj"
    		}
    	],
    	"payment_method": "payPal",
    	"payment_method_title": "Paypal"
    }

    I added coupon_lines array and shipping_lines array but in my admin panel, in order detail, these information not displayed. If I compleate an order via website, it works very well

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter lsantaniello

    (@lsantaniello)

    added “total” attribute to shipping_lines and now the shipping has been added to order but I don’t want add tax on shipping. System automatically add tax to my shipping total. Why? If I buy on website (no rest api), sipping is free tax.

    Plese help me
    L

Viewing 1 replies (of 1 total)
  • The topic ‘Woocommerce create order via rest api’ is closed to new replies.