• Resolved bakenoor1

    (@bakenoor1)


    I need to be able to pass options and the value provided by this plugin via API. Normally, when doing so via the website directly, when the POST request is sent and data is encoded using application/x-www-form-urlencoded, the following parameters are passed: &pi_delivery_type=delivery&pi_delivery_date=21S May 2021&pi_system_delivery_date=2021/05/21&pi_delivery_time=&

    My question is how to pass these parameters when creating an order via API, for example using the JSON for the order:

    {
    	"payment_method": "cod",
    	"payment_method_title": "Cash on Delivery",
    	"billing": {
    		"first_name": "Noorani",
    		"last_name": "Bakerally",
    		"address_1": "Abattoir Road",
    		"address_2": "",
    		"postcode": "230",
    		"country": "MU",
    		"email": "[email protected]",
    		"phone": "+23059290805"
    	},
    	"shipping": {
    		"first_name": "Noorani",
    		"last_name": "Bakerally",
    		"address_1": "Abattoir Road",
    		"address_2": "",
    		"postcode": "230",
    		"country": "MU",
    		"email": "[email protected]",
    		"phone": "+23059290805"
    	},
    	"line_items": [{
    		"product_id": 2323,
    		"quantity": 1
    	}]
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter bakenoor1

    (@bakenoor1)

    I forgot to mention in the above message, we are using the PRO version of this plugin

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    Hi,

    Data will be send in the meta_data variable see below json data

    {
    	"payment_method": "cod",
    	"payment_method_title": "Cash on Delivery",
    	"meta_data":[
    		{
    			"key":"pi_delivery_type",
    		  "value":"delivery"
    		},
    		{
    			"key":"pi_delivery_date",
    		  "value":"21S May 2021"
    		},
    		{
    			"key":"pi_system_delivery_date",
    		  "value":"2021/05/21"
    		},
    		{
    			"key":"pi_delivery_time",
    		  "value":""
    		}
    	],
    	"billing": {
    		"first_name": "Noorani",
    		"last_name": "Bakerally",
    		"address_1": "Abattoir Road",
    		"address_2": "",
    		"postcode": "230",
    		"country": "MU",
    		"email": "[email protected]",
    		"phone": "+23059290805"
    	},
    	"shipping": {
    		"first_name": "Noorani",
    		"last_name": "Bakerally",
    		"address_1": "Abattoir Road",
    		"address_2": "",
    		"postcode": "230",
    		"country": "MU",
    		"email": "[email protected]",
    		"phone": "+23059290805"
    	},
    	"line_items": [{
    		"product_id": 660,
    		"quantity": 1
    	}]
    }

    for pro related support please contact [email protected]

    Thread Starter bakenoor1

    (@bakenoor1)

    ok thanks, that helps !

    Thread Starter bakenoor1

    (@bakenoor1)

    Regarding the field pi_delivery_date, what is the date format, I see an ‘S’ after the date, for example, an ‘S’ after ’21S May 2021′, is there always an ‘S’ after the date, or does this letter changes also?

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    Hi,

    pi_delivery_date has the date format set by you in your WordPress > setting > General

    you must have added S in your date format that’s why it is coming in your date

    please check your setting https://i.ibb.co/zQy9qRm/image-2-1024×224-1.png

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Setting information when creating via API’ is closed to new replies.