This page details the technical specification for posting an order to the Clothes2order API. There are no further steps required to place an order; once you submit a request as detailed below, the order is instantly generated on our system ready for processing.
The API endpoint for placing an order is:
https://www.clothes2order.com/api/post-order/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
<xml> <api_key>Your API Key</api_key> <order> <order_id>123456</order_id> <order_notes><![CDATA[Any extra information here]]></order_notes> <delivery_method>standard</delivery_method> </order> <customer> <name>Name Here</name> <email>email@email.com</email> <telephone>0161123456</telephone> </customer> <address> <delivery_name>Name</delivery_name> <company_name>Quayside Clothing Ltd</company_name> <address_line_1>Unit 9 Wheel Forge Way</address_line_1> <address_line_2>Trafford Park</address_line_2> <city>Manchester</city> <postcode>M17 1EH</postcode> <country>United Kingdom</country> </address> <products> <product> <sku>594-117-15</sku> <quantity>2</quantity> <logos> <logo> <unique_id>TEST_02</unique_id> <file><![CDATA[https://dl.dropboxusercontent.com/u/111/1.png]]></file> <position>3</position> <width>8</width> <type>print</type> </logo> <logo> <unique_id>TEST_03</unique_id> <file><![CDATA[https://dl.dropboxusercontent.com/u/111/2.png]]></file> <position>5</position> <width>12</width> <type>print</type> </logo> </logos> </product> <product> <sku>594-117-14</sku> <quantity>1</quantity> <logos> <logo> <unique_id>TEST_04</unique_id> <file><![CDATA[https://dl.dropboxusercontent.com/u/111/3.png]]></file> <position>5</position> <width>10</width> <type>embroidery</type> </logo> <logo> <unique_id></unique_id> <file><![CDATA[https://dl.dropboxusercontent.com/u/111/4.png]]></file> <position>9</position> <width>25</width> <type>print_1colour</type> </logo> </logos> </product> </products> </xml> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
{ "api_key": "Your API Key", "order": { "order_id": "123456", "order_notes": "Any extra information here", "delivery_method": "standard" }, "customer": { "name": "Name Here", "email": "email@email.com", "telephone": "0161123456" }, "address": { "delivery_name": "Name", "company_name": "Quayside Clothing Ltd", "address_line_1": "Unit 9 Wheel Forge Way", "address_line_2": "Trafford Park", "city": "Manchester", "postcode": "M17 1EH", "country": "United Kingdom" }, "products": { "product": [ { "sku": "594-117-15", "quantity": "2", "logos": { "logo": [ { "unique_id": "TEST_02", "file": "https:\/\/dl.dropboxusercontent.com\/u\/111\/1.png", "position": "3", "width": "8", "type": "print" }, { "unique_id": "TEST_03", "file": "https:\/\/dl.dropboxusercontent.com\/u\/111\/2.png", "position": "5", "width": "12", "type": "print" } ] } }, { "sku": "594-117-14", "quantity": "1", "logos": { "logo": [ { "unique_id": "TEST_04", "file": "https:\/\/dl.dropboxusercontent.com\/u\/111\/3.png", "position": "5", "width": "10", "type": "embroidery" }, { "unique_id": "", "file": "https:\/\/dl.dropboxusercontent.com\/u\/111\/4.png", "position": "9", "width": "25", "type": "print_1colour" } ] } } ] } } |
Node | Description |
---|---|
api_key | Your API key provided to you when you sign up to use our API. |
order->order_id | Your generated order id from your ordering system. This is recorded against the order on our system. |
order->order_notes | Any additional comments related to the order you wish to pass through (optional). |
order->delivery_method | The delivery method for this order; standard options here are ‘standard’, ‘4day’ or ‘express’. |
order->is_blank | If this is an order without customisation, set this to ‘yes’ or ‘1’ (optional). Default is ‘no’. Blank products should not be ordered on the same order as customised products. |
order->individual_bags | If you would like each item bagging in an individual poly bag, set this to ‘yes’ or ‘1’ (optional). Default is ‘no’. There is a charge applicable for this service; the charge can be found in the pricing data feed in your account. More information on this service is available here. |
customer->name | The name of the customer. |
customer->email | The email address of the customer. By default, the Clothes2order API will not send any emails to the customer. |
customer->telephone | The telephone number of the customer. |
address->delivery_name | The name to appear on the delivery address, if not set, customer->name will be used (optional). |
address->company_name | The company name to appear on the delivery address (optional). |
address->address_line_1 | The first line of the delivery address. |
address->address_line_2 | The second line of the delivery address. |
address->city | The postal city of the delivery address. |
address->county | This is not needed for UK addresses, but for international addresses you can add a county/state here (optional). |
address->postcode | The post code of the delivery address. |
address->country | The delivery country. Please see our delivery page for a list of countries we can deliver to. |
products->product->sku | The unique SKU code for the product selected. Please see the data feeds page for more information about our downloadable csv files. |
products->product->quantity | The quantity of the above SKU to order. The same SKU can be used multiple times if different customisations are required on each. |
products->product->logos->logo->unique_id | If you have customisations that can be purchased multiple times on different orders, setting a unique id will prevent the API having the pull the logo file each time an order is placed (optional). In addition, once the setup charge has been paid for a customisation in the specified size, using the same unique_id will automatically ensure you are not charged a setup charge again for that customisation (assuming the size has not changed). |
products->product->logos->logo->file | The full URL of the artwork file. This must be set or the order will not be accepted, even if the unique_id is set and the file has been used before. The file should be as you wish it to be produced and adhear to our standard artwork guidelines |
products->product->logos->logo->position | The position code for where the customisation should be placed. See the position codes page for a full list of position codes. |
products->product->logos->logo->width | Width image should be produced in cm. If not set or greater than the maximum size for a position, the maximum size will be used. See the position codes page for a full list of maximum sizes. |
products->product->logos->logo->type | Either ‘print’ (multi colour print), ‘print_1colour’ (single colour print) or ’embroidery’ (embroidery). |
The API will respond with XML once an order is submitted; please see below for details.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<xml> <status> <code>OK</code> <msg>Data accepted from Your Company Name. API Mode: LIVE</msg> </status> <order_details> <order_id>999000</order_id> <net_order_value>26.06</net_order_value> <gross_order_value>31.27</gross_order_value> <est_dispatch_date>13/11/2013</est_dispatch_date> </order_details> <warnings> <warning>Your postcode is not a valid UK postcode</warning> <warning>Current stock levels are below the ordered quantity for sku 203-1-13</warning> </warnings> </xml> |
The API will respond with JSON once an order is submitted; please see below for details.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
{ "status": { "code": "OK", "msg": "Data accepted from Your Company Name. API Mode: LIVE" }, "order_details": { "order_id": "999000", "net_order_value": "26.06", "gross_order_value": "31.27", "est_dispatch_date": "13\/11\/2013" }, "warnings": { "warning": [ "Your postcode is not a valid UK postcode", "Current stock levels are below the ordered quantity for sku 203-1-13" ] } } |
Node | Description |
---|---|
status->code | Either ‘OK’ or ‘ERROR’. If a fatal error is reported here, the order will not be accepted. You can also check the HTTP response code header; ‘OK’ returns 200, ‘ERROR’ returns 400. |
status->msg | The associated success or error message. |
order_details->order_id | The Clothes2order order number for the placed order. |
order_details->net_order_value | The net cost you have been charged for the order. |
order_details->gross_order_value | The gross cost you have been charged for the order. |
order_details->est_dispatch_date | The estimated dispatch date for your order. |
warnings->warning | Any warning messages about your order will be displayed here. |
test_msgs->msg | If you are running the API in test mode, testing results will be displayed here. |
Inside back next printed labels can be assigned to your order by attaching a customisation in position code 18. Only one printed label customisation can be used per order, but of course the same printed label customisation can be used on multiple items. The customisation used can only be a single colour print, maximum width 12cm and is only available on selected product types (mainly t-shirts and polo shirts). Inside back neck prints are charged at a much lower rate than standard printing applications; to see your price simply download the pricing data feed in your account. More information on this service is available here.
There are no system limits on the number of products or customisations that can be placed on an order. Although we limit Clothes2order users to 3 customisations on our main site (6 on request), there are no limits to how many customisations you can attach to a garment via the API.