- Overview
- Personalisation API
- GetPreview
- GetViewUrls
- - Variable
- GetViewUrl
- Orders API
- SubmitOrder
- - ShippingAddress
- - OrderItem
- - Variable
- GetOrder
- GetOrders
- Supplier API
- GetOrders
- GetOrderDetails
- GetOrdersInProgress
- SetOrderProcessed
- SetOrderShipped
- CancelItem
Custom Brand Co APIs
Here you will find documentation and examples to work with our APIs.
Retailers
If you are creating your own user interface for customers to personalise products
then the Personalisation API will allow you to get product specifications and render
preview images. If you are using our JavaScript library "Plugin" then you do not need to use the Personalisation API.
The Order API enables you to place orders once your customer has checked out on your ecommerce platform.
Also you can check the status and details of an existing order.
Suppliers
Use the Supplier API to check for new orders, get order specifications, and update the status of orders when shipped
Personalisation API
This API gives a retailer access to personalise a product. This includes getting product information, submitting personalisation data and retrieving preview images.
If you are using our JavaScript Library "Plugin" you do not need to utilise the Personalisation API
GetPreview
POST /Personalisation/GetPreview
Description
Generates a personalisation session and return product setup information. If a guid is supplied in the call then an existing personalisation session is retrieved with with current values set as per last time the session was used.Security
[Body] AuthCodeParameters
AuthCode
Required
string
The personalisation authentication key provided by Custom Brand Co
ProductCode
Required
string
A code or SKU (stock keeping unit) that identifies the product
Guid
Optional
string
This call returns a GUID (Generated Unique Identifier) that identifies the personalisation
session just created and can be saved for later to recall the session or when placing an order. If you specify a guid as a parameter in this
call, the response will contain the current values of the session idenitfied by the Guid.
Language
Required
string (6)
This will tell this system shat language to return the product information in
(if supported by the product) and what language to use when checking for profanity (if applicable).
Langage codes are based upon the RFC 4646 standard, consisting of an ISO 639 two-letter lowercase language code with an ISO 3166 two letter country code, seperated by a hypen. For example English (UK) would be en-GB, French in France would be fr-FR, French in Canada would be fr-CA.
Langage codes are based upon the RFC 4646 standard, consisting of an ISO 639 two-letter lowercase language code with an ISO 3166 two letter country code, seperated by a hypen. For example English (UK) would be en-GB, French in France would be fr-FR, French in Canada would be fr-CA.
DefaultValues
Optional
object of string pairs
If this is a new session (a guid isn't provided in the call), you can set the default customisation
values for the product by supplying one or more string pairs in an object. The first item in the string pair should match the name for the variable,
the second string should be the value. Even if the value is a number, it should be sent as a string.
Example Request
POST /v2.0/Personalisation/GetPreview HTTP/1.1 Host: api.custombrandco.com Content-Type: application/json { "AuthCode" : "xxxx", "ProductCode" : "xxxx", "Guid" : "xxxx", "Language" : "xxxx", "DefaultValues" : {"text1":"value1","text2","value2"} }
curl --location --request POST 'http://api.custombrandco.com/v2.0/Personalisation/GetPreview' \ --header 'Content-Type: application/json' \ --data-raw '{ "AuthCode" : "xxxx", "ProductCode" : "xxxx", "Guid" : "xxxx", "Language" : "xxxx", "DefaultValues" : {"text1":"value1","text2","value2"} }'
var client = new RestClient("http://api.custombrandco.com/v2.0/Personalisation/GetPreview"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{'AuthCode' : 'xxxx', 'ProductCode' : 'xxxx', 'Guid' : 'xxxx', 'Language' : 'xxxx', 'DefaultValues' : {'text1':'value1','text2','value2'}}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Personalisation/GetPreview", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json" }, "data": JSON.stringify({"AuthCode":"xxxx","ProductCode":"xxxx","Guid":"xxxx","Language":"xxxx","DefaultValues" : {"text1":"value1","text2","value2"}}), }; $.ajax(settings).done(function (response) { console.log(response); });
Response
Guid
string
The identifier of the for the personalisation session
PreviewId
Integer
Another identifier of the for the personalisation session
Product
Product Name
String
A friendly name for the product
Variables
String
A friendly name for the product
LayerType
String
"TextLayer" or "ImageLayer". Represents the kind of input expected from the consumer.
SortOrder
Integer
The order in which the variables should apepar to the consumer
LayerName
String
The name of the variable
Alias
String
A friendly name for display to the consumer
HelpText
String
A prompt to the consumer of what to do
Value
String
The current value for the variable
AllowUserUploads
Boolean
If the LayerType is ImageLayer and photo uploads are allowed for this variable
SelectByDataValue
Boolean
If the LayerType is an ImageLayer and SelectByDataValue is true, then the
available images to choose in the ImageLibrary should be displayed as a list, using the DataValue as the text. If SelectByDataValue is
false then the available images should be shown as an image grid
CharacterLimit
Integer
If the LayerType is a TextLayer, this shows the maximum number of characters alowed. If null, then there is no maximum
PreviewIndex
Integer
If this product as multiple views, this number indicates which view that this variable is
first used on (starting with 0 being the first view)
Multiline
Boolean
If the LayerType is TextLayer and Multiline is true then the consumer should be able to
write text on multiple lines, using carriage returns.
FilterBy
String
If the LayerType is ImageLayer then the images to show in the image library can be
filtered by another variable. This value would be the name of another variable to filter by
ImageLibrary
If LayerType is ImageLayer and there are a selection of images to choose from
Url
String
The URL of the image that will be used in rendering the preview image(s)
Thumnail
String
A thumbnail image that represents the image selection. This should be
displayed to the cosumer to allow them to select the value for this variable. If there is no thumbnail then use the URL value to display to the consumer
DataValue
String
This is a name or text value that represents the image choice
FilterValues
Array of String
If the variable FilterBy value is not null, then the values in here determine
which images to show. E.g. another variable has two images with the DataValues of 'car' and 'boat', and the consumer selects the 'car' image.
If the word 'car' is in this array of strings then this image can be displayed, otherwise this image would be hidden from selection
Views
Represents a view of the product
ViewName
String
The system name of the view (usually an index number)
Alias
String
A user friendly name of the view
SortOrder
Integer
The order in which the views should be shown, starting at 0
Width
Double
The orignal width of the preview image (in pixels)
Height
Double
The original height of the preview image (in pixels)
Example Response
{ "Guid": "7f37d257-d1aa-4d7f-80f9-a6d75bdbf5fb", "PreviewId": 2697363, "Product": { "ProductName": "Cadburys Dairy Milk 360g with Emojis", "Variables": [ { "LayerType": "ImageLayer", "SortOrder": 1, "LayerName": "PreviewImage", "Alias": "Emoji", "HelpText": "Choose an Emoji", "Value": "https://api.custombrandco.com/v2.0/Image/GetImage?xxxxxx", "DefaultValue": "https://api.custombrandco.com/v2.0/Image/GetImage?xxxxxx", "AllowUserUploads": false, "SelectByDataValue": false, "CharacterLimit": null, "PreviewIndex": 0, "MultiLine": false, "FilterBy": null, "ImageLibrary": [ { "Url": "https://api.custombrandco.com/v2.0/Image/GetImage?xxxxxx", "ThumbnailUrl": "https://api.custombrandco.com/v2.0/Image/GetImage?xxxxxx", "DataValue": "Basketball", "FilterValues": [ null ] }, { "Url": "https://api.custombrandco.com/v2.0/Image/GetImage?xxxxxx", "ThumbnailUrl": "https://api.custombrandco.com/v2.0/Image/GetImage?xxxxxx", "DataValue": "Bike", "FilterValues": [ null ] } ] }, { "LayerType": "TextLayer", "SortOrder": 2, "LayerName": "Name", "Alias": "Name", "HelpText": "Enter a name", "Value": null, "DefaultValue": "Name", "AllowUserUploads": false, "SelectByDataValue": false, "CharacterLimit": null, "PreviewIndex": 0, "MultiLine": false, "FilterBy": null, "ImageLibrary": [] } ], "Views": [ { "ViewName": "0", "Alias": "Preview", "SortOrder": 0, "width": 1167.0, "Height": 1167.0 } ] } }
GetViewUrls
POST /Personalisation/GetViewUrls
Description
Submit the personalisation details for the session (identified by the GUID). The personalisation data will be recorded and an array of one or more URLs will be returned, providing access to the rendered product with personalisation.Security
[Body] AuthCodeParameters
AuthCode
Required
string
The personalisation authentication key provided by Custom Brand Co
Guid
Required
string
The unique identifier for the personalisation session
ImageWidth
Optional
Integer
Specifies the width of the image to return
ImageQuality
Optional
Integer
Specifies the quality of image 10-100 100 being the best quality (only applies if ImageType is JPG)
ImageType
Required
String
Supported image types are PNG or JPG
Can specify the values for each variable.
TimeStamp
Optional
Date and Time string
Example Request
POST /v2.0/Personalisation/GetViewUrls HTTP/1.1 Host: api.custombrandco.com Content-Type: application/json { "AuthCode": "xx", "Guid": "xx", "ImageWidth": 0, "ImageQuality": 0, "ImageType": "xx", "VariableValues": [ { "Name": "xx", "Value": "xx" } ], "TimeStamp": "2020-01-01T00:00:00.00000+00:00" }
curl --location --request POST 'http://api.custombrandco.com/v2.0/Personalisation/GetViewUrls' \ --header 'Content-Type: application/json' \ --data-raw '{ "AuthCode": "xx", "Guid": "xx", "ImageWidth": 0, "ImageQuality": 0, "ImageType": "xx", "VariableValues": [ { "Name": "xx", "Value": "xx" } ], "TimeStamp": "2020-01-01T00:00:00.00000+00:00" }'
var client = new RestClient("http://api.custombrandco.com/v2.0/Personalisation/GetViewUrls"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{'AuthCode': 'xx','Guid': 'xx','ImageWidth': 0,'ImageQuality': 0,'ImageType': 'xx','VariableValues': [{'Name': 'xx','Value': 'xx'}],'TimeStamp': '2020-01-01T00:00:00.00000+00:00'}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Personalisation/GetViewUrls", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json" }, "data": JSON.stringify({"AuthCode":"xx","Guid":"xx","ImageWidth":0,"ImageQuality":0,"ImageType":"xx","VariableValues":[{"Name":"xx","Value":"xx"}],"TimeStamp":"2020-01-01T00:00:00.00000+00:00"}), }; $.ajax(settings).done(function (response) { console.log(response); });
Response
URLs
Array of String
An array of URLs to the preview image(s)
Example Response
[ "https://api.custombrandco.com/v2.0/personalisation/GetViewUrls?xxxxxxx", "https://api.custombrandco.com/v2.0/personalisation/GetViewUrls?xxxxxxx" ]
Variable
Description
The name and value of a variable for a personalisation sessionParameters
Name
Required
String
Name of the variable
Value
Required
String
The value to set for the variable
{ "Name": "xx", "Value": "xx" }
GetViewUrl
POST /Personalisation/GetViewUrl
Description
Gets a single view URL linked to the guid and template nameSecurity
[Body] AuthCodeParameters
AuthCode
Required
String
The personalisation authentication key provided by Custom Brand Co
Guid
Required
String
The unique identifier for the personalisation session
TemplateName
Required
String
The name of the view for which you want to retrieve a preview image
ImageWidth
Optional
Integer
Specifies the width of the image to return
ImageQuality
Optional
Integer
Specifies the quality of image 10-100 100 being the best quality (only applies if ImageType is JPG)
ImageType
Required
String
Supported image types are PNG or JPG
Example Request
POST /v2.0/Personalisation/GetViewUrl HTTP/1.1 Host: api.custombrandco.com Content-Type: application/json { "AuthCode": "xx", "Guid": "xx", "TemplateName": "xx", "ImageWidth": 0, "ImageQuality": 0, "ImageType": "xx" }
curl --location --request POST 'http://api.custombrandco.com/v2.0/Personalisation/GetViewUrl' \ --header 'Content-Type: application/json' \ --data-raw '{ "AuthCode": "xx", "Guid": "xx", "TemplateName": "xx", "ImageWidth": 0, "ImageQuality": 0, "ImageType": "xx" }'
var client = new RestClient("http://api.custombrandco.com/v2.0/Personalisation/GetViewUrl"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{'AuthCode': 'xx','Guid': 'xx','TemplateName': 'xx','ImageWidth': 0,'ImageQuality': 0,'ImageType': 'xx'}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Personalisation/GetViewUrl", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json" }, "data": JSON.stringify({"AuthCode":"xx","Guid":"xx","TemplateName":"xx","ImageWidth":0,"ImageQuality":0,"ImageType":"xx"}), }; $.ajax(settings).done(function (response) { console.log(response); });
Response
URL
String
A URL to the preview image
Example Response
"https://api.custombrandco.com/v2.0/personalisation/GetViewUrls?xxxxxxx"
Orders API
Use this API to submit new orders once your customer has checkout on your ecommerce platform, or to check eth status of an existing order.
SubmitOrder
POST /Orders/SubmitOrder
Description
Submit an order to production, providing shipping information, order references, and items in the order.If using our Javascript library then you will need to provide the unique identifier (GUID) from the session, for each item. Otherwise you can supply the personalisation choices for each item.
Security
[Body] AuthKeyParameters
AuthKey
Required
String
The order authentication key provided by Custom Brand Co
OrderRef
Required
String (512)
A reference code that links to the order in the retailers system
PaymentRef
Optional
String (256)
A reference code that can appear on the invoice, such as a PO number
The order recipient's address
The products to be manufactured for the order
DeliveryNoteUrl
Optional
string (512)
A URL to download a Delivery Note
Example Request
POST /v2.0/Orders/SubmitOrder HTTP/1.1 Host: api.custombrandco.com Content-Type: application/json { "AuthKey": "xxxxxxx", "OrderRef": "123xxx", "PaymentRef": "123xxx", "ShippingAddress": { "FirstName": "xxxx", "LastName": "xxxx", "Line1": "xxxx", "Line2": "xxxx", "City": "xxxx", "PostCode": "xxxx", "CountryCode": "xxxx", "SpecialInstructions": "xxxx" }, "Items" : [{ "Qty": 1, "LineRef": "123xxx", "Sku": "xxxxxx", "Variables": [{ "Name": "Name1", "Value": "Value1" }, { "Name": "Name2", "Value": "Value2" }] }] }
curl --location --request POST 'http://api.custombrandco.com/v2.0/Orders/SubmitOrder' \ --header 'Content-Type: application/json' \ --data-raw '{ "AuthKey": "xxxxxxx", "OrderRef": "123xxx", "PaymentRef": "123xxx", "ShippingAddress": { "FirstName": "xxxx", "LastName": "xxxx", "Line1": "xxxx", "Line2": "xxxx", "City": "xxxx", "PostCode": "xxxx", "CountryCode": "xxxx", "SpecialInstructions": "xxxx" }, "Items": [{ "Qty": 1, "LineRef": "123xxx", "Sku": "xxxxxx", "Variables": [{ "Name": "Name1", "Value": "Value1" }, { "Name": "Name2", "Value": "Value2" }] }] }'
var client = new RestClient("http://api.custombrandco.com/v2.0/Orders/SubmitOrder"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{ 'AuthKey': 'xxxxxxx', 'OrderRef': '123xxx', 'PaymentRef': '123xxx', 'ShippingAddress': { 'FirstName': 'xxxx', 'LastName': 'xxxx', 'Line1': 'xxxx', 'Line2': 'xxxx', 'City': 'xxxx', 'PostCode': 'xxxx', 'CountryCode': 'xxxx', "SpecialInstructions": "xxxx" }, 'Items : [{ 'Qty': 1, 'LineRef': '123xxx', 'Sku': 'xxxxxx', 'Variables': [{ 'Name': 'Name1', 'Value': 'Value1' }, { 'Name': 'Name2', 'Value': 'Value2' }] }] }", ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Orders/SubmitOrder", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json" }, "data": JSON.stringify({ "AuthKey": "xxxxxxx", "OrderRef": "123xxx", "PaymentRef": "123xxx", "ShippingAddress": { "FirstName": "xxxx", "LastName": "xxxx", "Line1": "xxxx", "Line2": "xxxx", "City": "xxxx", "PostCode": "xxxx", "CountryCode": "xxxx", "SpecialInstructions": "xxxx" }, "Items" : [{ "Qty": 1, "LineRef": "123xxx", "Sku": "xxxxxx", "Variables": [{ "Name": "Name1", "Value": "Value1" }, { "Name": "Name2", "Value": "Value2" }] }] }}), }; $.ajax(settings).done(function (response) { console.log(response); });
Response
OrderId
Integer
The identifier of the order in the Custom Brand Co service
Items
LineRef
String
The reference supplied in the request for the line item
Sku
String
The Sku code supplied in the request for the line item
PreviewImages
Array of String
Urls to the preview images of the item generated by the service
Example Response
{ "OrderId": 260880, "Items": [ { "LineRef": "123", "Sku": "1265-106244", "PreviewImages": [ "http://localhost:51945/Image/GetViewImage?xxxxxxxxxxxxx" ] } ] }
ShippingAddress
Description
Recipient shipping informationParameters
FirstName
Required
String (512)
Recipient's first name
LastName
Required
String (512)
Recipient's last name
Company
Optional
String (100)
Recipient's company name
Line1
Required
String (512)
Line 1 of the recipient's address
Line2
Optional
String (512)
Line 2 of the recipient's address
Line3
Optional
String (512)
Line 3 of the recipient's address
City
Required
String (512)
City/Town of the recipient's address
PostCode
Required
String (512)
Postal/zip code of the recipient's address
CountryCode
Optional
String (2)
The code of the recipient country using ISO Alpha-2 codes. If country is not provided then it will be set as 'GB'
Email
Optional
String (512)
Recipient's email address, can be used to send tracking information direct from the courier
Tel
Optional
String (512)
Recipient's telephone number, can be used to send tracking information direct from the courier
SpecialInstructions
Optional
String
Extra delivery instructions
{ "FirstName" : "xxxx", "LastName" : "xxxx", "Line1" : "xxxx", "Line2" : "xxxx", "Line3" : "xxxx", "City" : "xxxx", "PostCode" : "xxxx", "CountryCode" : "xxxx" "Email" : "xxxx" "Tel" : "xxxx" }
Order Item
Description
A line item in an order, detailing product and customisationIf using our JavaScript library then you can submit the personalisation session GUID (unique identifier) created by the library. Otherwise you will need to submit the product SKU and variables.
Parameters
Qty
Required
Integer
The quantity of this item to be produced
Sku
Conditional
String
The quantity of this item to be produced
LineRef
Optional
String (256)
A reference in the retailers system to identify the line item
The values used to customise the item
Guid
Conditional
String
If using our JavaScript library then this is the unique session identifier created by the library.
Submitting Variables { "Qty" : 1, "LineRef" : "123", "Sku" : "1265-106244", "Variables" : [{ "Name" : "Text1", "Value" : "Richard" }, { "Name" : "Text2", "Value" : "Happy Birthday" }] } Submitting GUID { "Qty" : 1, "LineRef" : "123", "Guid" : "69f356f3-fcfa-447f-a189-fb4211d8e3ec", }
Variable
Description
A name and value pair for a single item of customisationParameters
Name
Required
String
The name of the customisation
Value
Required
String
The value for the customisation
{ "Name" : "Text1", "Value" : "Richard" }
GetOrder
POST /Orders/Order
Description
Retailers can get the details and status of an order.To retrieve the details of a single order supply either the Custom Brand Co Order ID (received in the response from a SubmitOrder request) or the order reference used when submitting the order.
Security
[Body] AuthKeyParameters
AuthKey
Required
String
The order authentication key provided by Custom Brand Co.
OrderId
Conditional
Integer
The Custom Brand Co Order ID. Either OrderId or OrderRef must be supplied.
OrderRef
Conditional
String
The Order Reference used when submitting an order. Either OrderId or OrderRef must be supplied.
Example Request
POST /v2.0/Orders/Order HTTP/1.1 Host: api.custombrandco.com Content-Type: application/json { "AuthKey" : "xxxxxxxx", "OrderRef" : "xxxxxx" }
curl --location --request POST 'http://api.custombrandco.com/v2.0/Orders/Order' \ --header 'Content-Type: application/json' \ --data-raw '{ "AuthKey" : "xxxxxxxx", "OrderRef" : "xxxxxx" }'
var client = new RestClient("http://api.custombrandco.com/v2.0/Orders/Order"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{ "AuthKey" : "xxxxxxxx", "OrderRef" : "xxxxxx" }", ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Orders/Order", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json" }, "data": JSON.stringify({ "AuthKey" : "xxxxxxxx", "OrderRef" : "xxxxxx" }), }; $.ajax(settings).done(function (response) { console.log(response); });
Response
OrderId
Integer
The identifier of the order.
OrderRef
String
The reference supplied when the order was created.
StatusId
Integer
The Status IDs are:
- New Order being created
- New Order submitted
- Processing
- Ready for production
- In production
- Cancelled
- Error
- Complete
- On hold
StatusName
String
The short name for the statuses listed above.
ExpectedDispatch
DateTime (UTC)
Date that order is expected to dispatch in Coordinated Universal Time
ExpectedDelivery
DateTime (UTC)
Date that order is expected to be with the consumer in Coordinated Universal Time
Items
itemId
Integer
The Custom Brand Co Item ID
LineRef
String
The reference supplied in the request for the line item
Sku
String
The Sku code supplied in the request for the line item
StatusId
Integer
The same status codes as used for order status ID.
StatusName
String
Short name for the status.
TrackingRef
String
Courier tracking reference if shipped.
Courier
String
Name of the courier used to ship the item.
TrackingUrl
String
Full web address to track the order.
Example Response
{ "OrderId": 12345, "OrderRef": "xxxxxxxx", "StatusId": 8, "StatusName": "Complete", "ExpectedDispatch" : "xx-xx-xxTxx:xx:xx.xxx", "ExpectedDelivery" : "xx-xx-xxTxx:xx:xx.xxx", "Items": [ { "ItemId": 12345, "LineRef": null, "StatusId": 8, "StatusName": "Complete", "Sku": "1234-123434", "TrackingRef": "xxxxxxxx", "Courier": "MyCourier", "TrackingUrl": "https://mycourier.com/?search=xxxxxxxxx" } ] }
GetOrders
POST /Orders/Orders
Description
Retailers can get the details and status of one or more order(s).To retrieve details of multiple orders supply either an array of Custom Brand Co Order IDs (received when submitting an order) or an array of your Order references.
Security
[Body] AuthKeyRequest Parameters
AuthKey
Required
String
The order authentication key provided by Custom Brand Co.
OrderId
Conditional
Array of Integer
The Custom Brand Co Order IDs. Either OrderIds or OrderRefs must be supplied.
OrderRefs
Conditional
Array of Integer
The Order References used when submitting a orders. Either OrderIds or OrderRefs must be supplied.
Example Request
POST /v2.0/Orders/Order HTTP/1.1 Host: api.custombrandco.com Content-Type: application/json { "AuthKey" : "xxxxxxxx", "OrderIds" : [123443,4324324,5345435] }
curl --location --request POST 'http://api.custombrandco.com/v2.0/Orders/Order' \ --header 'Content-Type: application/json' \ --data-raw '{ "AuthKey" : "xxxxxxxx", "OrderIds" : [123443,4324324,5345435] }'
var client = new RestClient("http://api.custombrandco.com/v2.0/Orders/Order"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{ "AuthKey" : "xxxxxxxx", "OrderIds" : [123443,4324324,5345435] }", ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Orders/Order", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json" }, "data": JSON.stringify({ "AuthKey" : "xxxxxxxx", "OrderIds" : [123443,4324324,5345435] }), }; $.ajax(settings).done(function (response) { console.log(response); });
Response
Orders
Array of Order
Please see order schema in GetOrder method above.
Errors
OrderId
Integer
The Custom Brand Co Order ID. Only shown if the ID was submitted in the request.
OrderRef
String
The order reference supplied. Only shown if the reference was submitted in the request.
Message
String
The reason for the error response
Example Response
{ "Orders": [ { "OrderId": 452776, "OrderRef": "xxxxxxxx", "StatusId": 5, "StatusName": "Complete", "ExpectedDispatch" : "xx-xx-xxTxx:xx:xx.xxx", "ExpectedDelivery" : "xx-xx-xxTxx:xx:xx.xxx", "Items": [ { "ItemId": 526344, "LineRef": null, "StatusId": 8, "StatusName": "Complete", "Sku": "1556-107409", "TrackingRef": "xxxxxxxx", "Courier": "MyCourier", "TrackingUrl": "https://mycourier.com/?search=xxxxxxxxx" }, { "ItemId": 526345, "LineRef": null, "StatusId": 8, "StatusName": "Complete", "Sku": "1555-107408", "TrackingRef": "xxxxxxxx", "Courier": "MyCourier", "TrackingUrl": "https://mycourier.com/?search=xxxxxxxxx" } ] } ], "Errors": [ { "OrderId": 12345, "OrderRef": null, "Message": "Order not found" }, { "OrderId": 4321, "OrderRef": null, "Message": "Order not found" } ] }
Suppliers API
Use the Supplier API to check for new orders, get order specifications, and update the status of orders when shipped.
The process to follow should be:
- Call GetOrders method to return a list of orders that are ready for production (new orders).
- For each order that is ready for production, call GetOrderDetails and download the order specifications as required to fulfill the order
- Update the status of an order to Production by calling SetOrderProcessed. It will no longer appear on the list of new orders.
- Once you have produced and shipped an item, update the status of the order by calling SetOrderItemShipped for each item in the order. You should provide tracking data if available.
GetOrders
GET /Supplier/GetOrders
Description
Returns an array of orders that are ready for production.Security
[Header] AuthKeyParameters
None
Example Request
GET /v2.0/Supplier/GetOrders HTTP/1.1 Host: api.custombrandco.com AuthKey: xxxx
curl --location --request GET 'http://api.custombrandco.com/v2.0/Supplier/GetOrders' \ --header 'AuthKey: xxxx'
var client = new RestClient("http://api.custombrandco.com/v2.0/Supplier/GetOrders"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("AuthKey", "xxxx"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Supplier/GetOrders", "method": "GET", "timeout": 0, "headers": { "AuthKey": "xxxx" }, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
Orders
UpdateType
Integer
Indicates whether this is a new order or the existing rder has been updated.
0 = new, 1 = update
0 = new, 1 = update
OrderId
Integer
The identifier for the order
Example Response
[ { "UpdateType": 1, "OrderId": 259300 } ]
GetOrderDetails
GET /Supplier/GetOrderDetails
Description
Returns order details for specified Order Id.Security
[Header] AuthKeyParameters
OrderId
Required
Integer
The ID of the order
Example Request
GET /v2.0/Supplier/GetOrderDetails?orderId=xxxx HTTP/1.1 Host: api.custombrandco.com AuthKey: xxxx
curl --location --request GET 'http://api.custombrandco.com/v2.0/Supplier/GetOrderDetails?orderId=xxxx' \ --header 'AuthKey: xxxx'
var client = new RestClient("http://api.custombrandco.com/v2.0/Supplier/GetOrderDetails?orderId=xxxx"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("AuthKey", "xxxx"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Supplier/GetOrderDetails?orderId=xxxx", "method": "GET", "timeout": 0, "headers": { "AuthKey": "xxxx" }, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
OrderId
Integer
The identifier for the order
CustomerId
Integer
The identifier for the retailer
CustomerName
String
The name of the retailer
DeliveryAddress
FirstName
String
Recipient's first name
LastName
String
Recipient's last name
Company
String
Recipient's Company name
AddressLine1
String
Line 1 of the shipping address
AddressLine2
String
Line 2 of the shipping address
AddressLine3
String
Line 3 of the shipping address
City
String
Town/City of the shipping address
Postcode
String
Post/zip code of the shipping address
CountryCode
String
ISO Alpha-2 code for shipping country
Email
String
Email address of recipient
Tel
String
Recipient's telephone number
Updated
Boolean
Indicates whether the address has been updated since the order was originally placed
OrderItems
OrderItemId
Integer
Identifier of the line item
ProductCode
String
The sku code of the product
ProductName
String
A friendly name of the product
ProductWidth
Double
ProductLength
Double
ProductHeight
Double
SupplierProductRef
String
This is a reference or identifier for the product in the supplier's system
Quantity
Integer
PrintRuns
Array of PrintRun
Products are made up of one or more components, each component will be listed here
PrintRunId
Integer
The identifier for the component
ProcessName
String
The name of the manufacturing process to undertake to create the component
SubstrateName
String
The name of the base material to use in the manufacturing of the component
PartName
String
If a second part is also used, then the name will be shown here
Pages
Integer
The number of pages or impressions for the component
Updated
Boolean
Indicates whether this component has been updated since the order was originally placed
PrintQty
Integer
The number of times this component should be produced to complete the product
PrintFileUrl
String
The URL to the print ready artwork
PersonalisationItems
Array of PersonalisationItem
Gives a list of the personalisation variables used in the product
PersonalisationId
Integer
The identifier for the variable
Type
String
Could be 'Text' or 'Image'
Name
String
The name of the variable
Value
String
Text for a Text Type or URL for an Image Type
AlternativeValue
String
Image types may have an alternative value to describe the image selected
PreviewImages
Array of PreviewImage
Gives a list of the views of the product
PreviewName
String
The identifier for the view
ImageUrl
String
The URL to download the preview image
Status
Integer
0 if new, 1 if updated, 2 if cancelled
SuppliersCustomerId
String
A reference or ID to the retailer in the supplier's system
SuppliersCustomerId2
String
A secondary identifier if needed
OrderReference
String
The retailer's order reference
PaymentReference
String
The retailer's payment reference
ExpectedDispatch
Date Time string
The date that the order is expected to be shipped by
ExpectedDelivery
Date Time string
The date that the order is expected to be delivered by
SuppliersDeliveryRef
String
A reference to identify the shipping method in the supplier's system
Reprint
Boolean
Indicates whether this item is a reprint (due to damages or a fault)
ReprintReason
String
The reason for the reprint
FreeOfCharge
Boolean
Signifies whether the print should be free of charge (because of a fault)
DeliveryNoteUrl
String
A URL to download a Delivery Note if specified
Example Response
{ "OrderId": 12345, "CustomerId": 1, "CustomerName": "xxxxxx", "DeliveryAddress": { "FirstName": "xxxx", "LastName": "xxxx", "AddressLine1": "xxxx", "AddressLine2": "xxxx", "AddressLine3": "xxxx", "City": "xxxx", "PostCode": "xxxxxx", "CountryCode": "GB", "Email": null, "Tel": null, "Updated": false }, "OrderItems": [ { "OrderItemId": 123, "ProductCode": "xxxxxxxx", "ProductName": "xxxxxxxx", "ProductWidth": 0, "ProductLength": 0, "ProductHeight": 0, "SupplierProductRef": "xxxx", "Quantity": 1, "PrintRuns": [ { "PrintRunId": 1234, "ProcessName": "xxxx", "SubstrateName": "xxxxxx", "PartName": null, "Pages": 1, "Updated": false, "PrintQty": 1, "PrintFileUrl": "http://localhost:51945/v2.0/Image/GetImage?xxxxxxx" } ], "PersonalisationItems": [ { "PersonalisationId": 1234, "Type": "Image", "Name": "xxxxxx", "Value": "https://api.custombrandco.com/v2.0/Image/GetImage?xxxxx", "AlternativeValue": "xxxx" }, { "PersonalisationId": 1234, "Type": "Text", "Name": "xxxxx", "Value": "xxxxx", "AlternativeValue": null } ], "PreviewImages": [ { "PreviewName": "123454", "ImageUrl": "https://api.custombrandco.com/v1.7/viewdsi.ashx?previewsetid=xxxx&imgtype=jpg" } ], "Status": 0 } ], "SuppliersCustomerId": "xxxx", "SuppliersCustomerId2": null, "OrderReference": "xxxx", "PaymentReference": "xxxxx", "ExpectedDispatch": "2020-06-18T01:27:00.467", "ExpectedDelivery": "2020-06-22T01:27:00.467", "SuppliersDeliveryRef": "xxxxxx", "Reprint": false, "ReprintReason": null, "FreeOfCharge": false }
GetOrdersInProgress
GET /Supplier/GetOrdersInProgress
Description
Get all live orders currently in production.Security
[Header] AuthKeyParameters
OlderThan
Optional
Date Time string
Can specify to only get orders that are older than this date
Example Request
GET /v2.0/Supplier/GetFile HTTP/1.1 Host: api.custombrandco.com AuthKey: xxxx
curl --location --request GET 'http://api.custombrandco.com/v2.0/Supplier/GetFile' \ --header 'AuthKey: xxxx'
var client = new RestClient("http://api.custombrandco.com/v2.0/Supplier/GetFile"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("AuthKey", "xxxx"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Supplier/GetFile", "method": "GET", "timeout": 0, "headers": { "AuthKey": "xxxx" }, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
Array of Order IDs
Example Response
[1345,54321]
SetOrderProcessed
GET /Supplier/SetOrderProcessed
Description
Tells Custom Brand Co that the order has been downloaded and is now in production.Security
[Header] AuthKeyParameters
OrderId
Required
Integer
The identifier of the order
SupplierReference
Optional
String
The Suppliers reference for the order
Example Request
GET /v2.0/Supplier/SetOrderProcessed?orderId=xxxx&supplierReference=xxxx HTTP/1.1 Host: api.custombrandco.com AuthKey: xxxx
curl --location --request GET 'http://api.custombrandco.com/v2.0/Supplier/SetOrderProcessed?orderId=xxxx&supplierReference=xxxx' \ --header 'AuthKey: xxxx'
var client = new RestClient("http://api.custombrandco.com/v2.0/Supplier/SetOrderProcessed?orderId=xxxx&supplierReference=xxxx"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("AuthKey", "xxxx"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Supplier/SetOrderProcessed?orderId=xxxx&supplierReference=xxxx", "method": "GET", "timeout": 0, "headers": { "AuthKey": "xxxx" }, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
None (Status OK)
Example Response
SetOrderShipped
POST /Supplier/SetOrderShipped
Description
Ships the specified order with the option to include tracking information.Security
[Header] AuthKeyParameters
OrderId
Required
Integer
The identifier of the order
TrackingRef
Optional
String
The courier's consignment reference
CourierName
Optional
String
The name of the courier the item was shipped with
TrackingUrl
Optional
String
The tracking URL for the item, with tracking number entered if available
Example Request
POST /v2.0/Supplier/SetOrderItemShipped HTTP/1.1 Host: api.custombrandco.com AuthKey: xxxx Content-Type: application/json { "OrderId": 0, "TrackingRef": "xxxx" }
curl --location --request POST 'http://api.custombrandco.com/v2.0/Supplier/SetOrderItemShipped' \ --header 'AuthKey: xxxx' \ --header 'Content-Type: application/json' \ --data-raw '{ "OrderId": 0, "TrackingRef": "xxxx" }'
var client = new RestClient("http://api.custombrandco.com/v2.0/Supplier/SetOrderItemShipped"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("AuthKey", "xxxx"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{'OrderId': 0,'TrackingRef': 'xxxx'}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Supplier/SetOrderItemShipped", "method": "POST", "timeout": 0, "headers": { "AuthKey": "xxxx", "Content-Type": "application/json" }, "data": JSON.stringify({"OrderId":0,"TrackingRef":"xxxx"}), }; $.ajax(settings).done(function (response) { console.log(response); });
Response
None (Status OK)
Example Response
CancelItem
GET /Supplier/CancelItem
Description
Cancels the specified order item using the Custom Brand Co Orderitem Id.Security
[Header] AuthKeyParameters
OrderItemId
Required
Integer
The identifier of the item
Example Request
GET /v2.0/Supplier/CancelItem?orderItemId=xxxx HTTP/1.1 Host: api.custombrandco.com AuthKey: xxxx
curl --location --request GET 'http://api.custombrandco.com/v2.0/Supplier/CancelItem?orderItemId=xxxx' \ --header 'AuthKey: xxxx'
var client = new RestClient("http://api.custombrandco.com/v2.0/Supplier/CancelItem?orderItemId=xxxx"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("AuthKey", "xxxx"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
var settings = { "url": "http://api.custombrandco.com/v2.0/Supplier/CancelItem?orderItemId=xxxx", "method": "GET", "timeout": 0, "headers": { "AuthKey": "xxxx" }, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
Boolean
If the cancellation was successful
Example Response
true