Skip to content

Latest commit

 

History

History
214 lines (145 loc) · 14.2 KB

OrdersApi.md

File metadata and controls

214 lines (145 loc) · 14.2 KB

PicanovaApi.OrdersApi

All URIs are relative to https://localhost/api/beta

Method HTTP request Description
ordersGet GET /orders Show a list of all orders
ordersOrderIdDelete DELETE /orders/{order_id} Cancel an order
ordersOrderIdGet GET /orders/{order_id} Show an order
ordersPost POST /orders Create an order

ordersGet

InlineResponse2003 ordersGet()

Show a list of all orders

Get all orders

Example

var PicanovaApi = require('picanova_api');
var defaultClient = PicanovaApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new PicanovaApi.OrdersApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.ordersGet(callback);

Parameters

This endpoint does not need any parameter.

Return type

InlineResponse2003

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

ordersOrderIdDelete

ordersOrderIdDelete(orderId)

Cancel an order

Cancels an order

Example

var PicanovaApi = require('picanova_api');
var defaultClient = PicanovaApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new PicanovaApi.OrdersApi();

var orderId = "orderId_example"; // String | ID of order


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.ordersOrderIdDelete(orderId, callback);

Parameters

Name Type Description Notes
orderId String ID of order

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

ordersOrderIdGet

InlineResponse2004 ordersOrderIdGet(orderId)

Show an order

Get the given order

Example

var PicanovaApi = require('picanova_api');
var defaultClient = PicanovaApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new PicanovaApi.OrdersApi();

var orderId = "orderId_example"; // String | ID of order to return


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.ordersOrderIdGet(orderId, callback);

Parameters

Name Type Description Notes
orderId String ID of order to return

Return type

InlineResponse2004

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

ordersPost

InlineResponse2004 ordersPost(body)

Create an order

Creates an order and returns it.

Example

var PicanovaApi = require('picanova_api');
var defaultClient = PicanovaApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new PicanovaApi.OrdersApi();

var body = new PicanovaApi.OrderPost(); // OrderPost | `external_id` (optional) if it is set, it must be unique identifier for your orders. `is_test` (optional) when value is set to `true`, the order will be created as a TEST Order (PPOXXXXXXXXT) and will NOT be produced or shipped. When the store is in sandbox mode, all orders are created as TEST Orders regardless of the value sent in this field. `shipping_method` must be valid for the shipping country and the items listed in the order. See the guideline above: <a  data-dismiss=\"modal\" data-toggle=\"modal\" data-target=\"#calculate-shipping-guide-modal\" href=\"javascript:void(0);\">Guide to calculate shipping rate/method</a> to find out which shipping methods are valid for the given combination of values. Failure to choose a correct shipping method will result in an error. `customs_shipping_costs` (optional) This value is used to print the shipping costs shown on the Customs Declaration Papers when a shippemnt is sent to NON-EU countries. The value to place here is the retail shipping price you charged your end customer. It is always used in combination with items' `custom_value`.  `shipping` object contains the address and required information about end customer. There is no need of billing address. `email` (optional) end customer's email address `firstname` end customer's name. `lastname` end customer's last/family name. `company` (optional) end customer's company name when the end customer is ordering on behalf of a company. `street_primary` end customer's street name and house number. `street_secondary` (optional) additional address. `city` end customers's city name. `postcode` end customer's postal/zip code. `country_id` end customer's country - ISO 3166-1 numeric-3 OR `country_code` - ISO 3166-1 alpha-2 standards `region_id` (required for US and Canada) end customer's state name - ANSI INCITS 38:2009 digit-2. It should be used in combination with `country_id`. The list of regions/states can be checked at `/regions/{country_id}`. `region_code` It should be used in combination with `country_code` - ANSI INCITS 38:2009 alpha-2. The list of regions/states can be checked at `/regions/{country_id}`. `telephone` (optional) end customer's phone number - used in case of any problems during delivery by the shipment provider.  `items` is an array with one or more item objects `customs_value` (optional) This value will be used to print the net item cost shown on the Customs Declaration Papers when a shippemnt is sent to NON-EU countries. The value to place here is the net retail selling price you charged your end customer. It is always used in combination with order's `customs_shipping_costs`. `quantity` The number of copies to produce of this particular item `variant_code` is the identifier of which product variant this item is, for example \"DIGI-40X30-1\" is for a 40x30 cm canvas. See the guideline above: <a data-dismiss=\"modal\" data-toggle=\"modal\" data-target=\"#get-variant-guide-modal\" href=\"javascript:void(0);\">Guide to get a product variant</a> to find out which code/id to use. `variant_id` can be used alternatively in place of `variant_code` but only ONE of them should be used, failing to do so will result in error or create wrong orders. For example variant id \"3\" identifies the same 40x30 cm canvas as variant code \"DIGI-40X30-1\" does. See the guideline above: <a data-dismiss=\"modal\" data-toggle=\"modal\" data-target=\"#get-variant-guide-modal\" href=\"javascript:void(0);\">Guide to get a product variant</a> to find out which code/id to use. `file` is the URL to the print file for this particular item. See more detailed about the file format, resolution and aspect ratio in the \"Print Files\" section below.  `options` is list with one or more options set for a product variant. Some product variant have required options, for example all canvas variants have 2 required options (\"Canvas border\" and \"Stretcher frame\"). The key and value of an option can either be their ids or their names. For example, the option \"Canvas border\" option can be added like`'Canvas border':'Stretched'` (using names) or can be alternatively added `\"1\" : 3` (using ids). The names for keys and values are case-sensitive. The list of options for every variant can be checked at guideline above: <a data-dismiss=\"modal\" data-toggle=\"modal\" data-target=\"#get-variant-guide-modal\" href=\"javascript:void(0);\">Guide to get a product variant and details</a>


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.ordersPost(body, callback);

Parameters

Name Type Description Notes
body OrderPost `external_id` (optional) if it is set, it must be unique identifier for your orders. `is_test` (optional) when value is set to `true`, the order will be created as a TEST Order (PPOXXXXXXXXT) and will NOT be produced or shipped. When the store is in sandbox mode, all orders are created as TEST Orders regardless of the value sent in this field. `shipping_method` must be valid for the shipping country and the items listed in the order. See the guideline above: <a data-dismiss=&quot;modal&quot; data-toggle=&quot;modal&quot; data-target=&quot;#calculate-shipping-guide-modal&quot; href=&quot;javascript:void(0);&quot;>Guide to calculate shipping rate/method</a> to find out which shipping methods are valid for the given combination of values. Failure to choose a correct shipping method will result in an error. `customs_shipping_costs` (optional) This value is used to print the shipping costs shown on the Customs Declaration Papers when a shippemnt is sent to NON-EU countries. The value to place here is the retail shipping price you charged your end customer. It is always used in combination with items' `custom_value`. `shipping` object contains the address and required information about end customer. There is no need of billing address. `email` (optional) end customer's email address `firstname` end customer's name. `lastname` end customer's last/family name. `company` (optional) end customer's company name when the end customer is ordering on behalf of a company. `street_primary` end customer's street name and house number. `street_secondary` (optional) additional address. `city` end customers's city name. `postcode` end customer's postal/zip code. `country_id` end customer's country - ISO 3166-1 numeric-3 OR `country_code` - ISO 3166-1 alpha-2 standards `region_id` (required for US and Canada) end customer's state name - ANSI INCITS 38:2009 digit-2. It should be used in combination with `country_id`. The list of regions/states can be checked at `/regions/{country_id}`. `region_code` It should be used in combination with `country_code` - ANSI INCITS 38:2009 alpha-2. The list of regions/states can be checked at `/regions/{country_id}`. `telephone` (optional) end customer's phone number - used in case of any problems during delivery by the shipment provider. `items` is an array with one or more item objects `customs_value` (optional) This value will be used to print the net item cost shown on the Customs Declaration Papers when a shippemnt is sent to NON-EU countries. The value to place here is the net retail selling price you charged your end customer. It is always used in combination with order's `customs_shipping_costs`. `quantity` The number of copies to produce of this particular item `variant_code` is the identifier of which product variant this item is, for example &quot;DIGI-40X30-1&quot; is for a 40x30 cm canvas. See the guideline above: <a data-dismiss=&quot;modal&quot; data-toggle=&quot;modal&quot; data-target=&quot;#get-variant-guide-modal&quot; href=&quot;javascript:void(0);&quot;>Guide to get a product variant</a> to find out which code/id to use. `variant_id` can be used alternatively in place of `variant_code` but only ONE of them should be used, failing to do so will result in error or create wrong orders. For example variant id &quot;3&quot; identifies the same 40x30 cm canvas as variant code &quot;DIGI-40X30-1&quot; does. See the guideline above: <a data-dismiss=&quot;modal&quot; data-toggle=&quot;modal&quot; data-target=&quot;#get-variant-guide-modal&quot; href=&quot;javascript:void(0);&quot;>Guide to get a product variant</a> to find out which code/id to use. `file` is the URL to the print file for this particular item. See more detailed about the file format, resolution and aspect ratio in the &quot;Print Files&quot; section below. `options` is list with one or more options set for a product variant. Some product variant have required options, for example all canvas variants have 2 required options (&quot;Canvas border&quot; and &quot;Stretcher frame&quot;). The key and value of an option can either be their ids or their names. For example, the option &quot;Canvas border&quot; option can be added like`'Canvas border':'Stretched'` (using names) or can be alternatively added `&quot;1&quot; : 3` (using ids). The names for keys and values are case-sensitive. The list of options for every variant can be checked at guideline above: <a data-dismiss=&quot;modal&quot; data-toggle=&quot;modal&quot; data-target=&quot;#get-variant-guide-modal&quot; href=&quot;javascript:void(0);&quot;>Guide to get a product variant and details</a>

Return type

InlineResponse2004

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined