Method: createOrder

This method creates an order ID.

Authentication

This method does requires authentication.

HTTP method

This method is called with HTTP method GET.

Arguments

Argument Type Element (array) Valid Values Default Value Detail
token string   authenticated session id (stored in the session $_SESSION['token']) required User Token

Returned Values

Element (path) Name Type Description
/ numCommand string The order ID
/ text array
SUCCESS!  or  ERROR: You have to be authentified to use this method!
A new order was created with the number: [order ID]

Example Query

	GET http://testapi.wannaprint.com/Rest/1/[API Key]/api/createOrder/token=[token]

PHP call of method:
	<?php
		session_start();
		$api_items = $apicaller->sendRequest(array(
					'controller' => 'api',
					'action' =>  'createOrder',
					'token' =>  $_SESSION['token']
					)); 
		foreach($api_items->text as $text)
		{
			echo $text;
		}
		if($api_items->numCommand)
		{
			$_SESSION['numCommand'] = $api_items->numCommand;
		}
	?>
   			

Example Response

	{
		"text":[
			"SUCCESS!",
			"A new order was created with the number: 000000-XZ"
		],
		"numCommand":"000000-XZ"
	}

						or

	{
		"text":["ERROR: You have to be authentified to use this method!"]
	}
   			

Error Codes

001: Wrong API Key
The API key is wrong or missing.
002: Failed to parse request
The request could not be parsed.
011: Controller is invalid.
The controller passed is not valid.
031: Invalid Method
This method does not exist in the method list.