GET https://admin.threekit.com/api/orders
Retrieves the list of orders by query parameters. For each entry the following information will be available.
- id - Order ID
- shortId - Order short ID
- orgId - Organization ID
- customerId - Customer ID (If present)
- originOrgId - ID of the original Organization
- platform - eCommerce Platform data (If present)
- metadata - Metadata (If present)
- items - Deprecated, This only exists for backwards compatibility. Please use 'cart' instead
- cart - Items included in the order. This will be an array of objects with each object containing the id of the configuration of an item,the count and any arbitrary metadata associated with the configuration. NOTE - This is a replacement for the 'items' field and should be used for future cases
- derivative - Derivative of this order (If present)
- createdAt - The time this order was created
- updatedAt - The last time this order was updated at (If present)
- status - The status of this order
REST Endpoint
GET https://admin.threekit.com/api/orders?bearer_token=[bearer_token]&orgId=[orgId]&shortId=[shortId]&originOrgId=[originOrgId]&platform=[platform]
Query Parameters
Name |
In |
Type |
Required |
Description |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
orgId |
query |
string |
false |
Organization which owns the order. |
shortId |
query |
string |
false |
Short ID of the order. |
originOrgId |
query |
string |
false |
Organization the order originated from. This can be either the organization which owns the ordered product or a reseller. |
platform |
query |
string |
false |
Retrieve orders by platform data. Must be passed in as a stringified and encoded JSON since it will be passed as a query string parameter. |
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
Successful get request, response body will include the list of orders |
None |
401 |
Unauthorized |
The token provided is not authorized to make the request or the token is invalid. |
None |
403 |
Forbidden |
No token was provided in the query string of the request |
None |
Example Implementations
Code
CURL
curl --request GET \
--url https://admin.threekit.com/api/orders \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/orders",
"headers": {
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
{
"orders": [
{
"createdAt": "2020-01-17T14:34:46.702Z",
"customerId": null,
"derivative": null,
"id": "caba3a4b-e03a-4407-b081-3e396b9d9d45",
"metadata": null,
"orgId": "9159a0ac-6e2f-44b3-b522-863ba8bed070",
"originOrgId": "9159a0ac-6e2f-44b3-b522-863ba8bed070",
"platform": {},
"shortId": "esths7EA",
"status": "Processing",
"updatedAt": null
},
{
"createdAt": "2020-01-17T14:41:08.784Z",
"customerId": null,
"derivative": null,
"id": "2d7d922e-cc09-4c4e-9b95-a457fdee2b47",
"items": [
{
"id": "dghfuisghi",
"count": 9
},
{
"id": "shgfuihswi",
"count": 7
}
],
"cart": [
{
"configurationId": "dghfuisghi",
"count": 9
},
{
"configurationId": "shgfuihswi",
"count": 7
}
],
"metadata": null,
"orgId": "8927abec-3f2f-4bee-8896-ff7dfa156a98",
"originOrgId": "8927abec-3f2f-4bee-8896-ff7dfa156a98",
"platform": {
"id": 1.4385787685746897e+34,
"platform": "some platform",
"storeName": "some store"
},
"shortId": "VcAEt7Uc",
"status": "Processing",
"updatedAt": null
}
]
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "no_token_found_error",
"message": "No access token provided in the request"
}
}
POST https://admin.threekit.com/api/orders
Creates an order and generates an UUID as well as a shortID which can be used to retrieve the order. Any token (public or private) can be used to create an order. NOTE - 'items' has been deprecated and replaced by 'cart'. In order to maintain backwards compatibility, items will still be populated with incoming data. However it will converted to the correct format and also saved in 'cart'. If the data is in incorrect format, it will not be touched. Please ensure that 'cart' field is used instead of 'items' field.
REST Endpoint
POST https://admin.threekit.com/api/orders?bearer_token=[bearer_token]
Query Parameters
Name |
In |
Type |
Required |
Description |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
body |
body |
createBody |
true |
Order creation information. |
Body Parameters
{
"name": "string",
"customerId": "string",
"originOrgId": "string",
"platform": {
"id": "string",
"platform": "string",
"storeName": "string"
},
"metadata": {},
"items": [
{
"id": "string",
"count": 0
}
],
"cart": [
{
"configurationId": "string",
"count": 0,
"metadata": {}
}
],
"derivative": {},
"status": "List",
"orgId": "string"
}
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
Returns an order and its information |
None |
401 |
Unauthorized |
The token provided is not authorized to make the request or the token is invalid. |
None |
403 |
Forbidden |
No token was provided in the query string of the request |
None |
Example Implementations
Code
CURL
curl --request POST \
--url https://admin.threekit.com/api/orders \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: application/json' \
--data '{"name":"string","customerId":"string","originOrgId":"string","platform":{"id":"string","platform":"string","storeName":"string"},"metadata":{},"items":[{"id":"string","count":0}],"cart":[{"configurationId":"string","count":0,"metadata":{}}],"derivative":{},"status":"List","orgId":"string"}'
Node.JS
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/orders",
"headers": {
"content-type": "application/json",
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
name: 'string',
customerId: 'string',
originOrgId: 'string',
platform: { id: 'string', platform: 'string', storeName: 'string' },
metadata: {},
items: [ { id: 'string', count: 0 } ],
cart: [ { configurationId: 'string', count: 0, metadata: {} } ],
derivative: {},
status: 'List',
orgId: 'string'
}));
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"name\":\"string\",\"customerId\":\"string\",\"originOrgId\":\"string\",\"platform\":{\"id\":\"string\",\"platform\":\"string\",\"storeName\":\"string\"},\"metadata\":{},\"items\":[{\"id\":\"string\",\"count\":0}],\"cart\":[{\"configurationId\":\"string\",\"count\":0,\"metadata\":{}}],\"derivative\":{},\"status\":\"List\",\"orgId\":\"string\"}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
{
"id": "d5c5ada4-12c3-43cb-8960-7ea45f250763",
"shortId": "ULeat7Uc",
"orgId": "fb9d21e2-6270-4037-aca8-7072e40d8485",
"customerId": null,
"originOrgId": "fb9d21e2-6270-4037-aca8-7072e40d8485",
"platform": {
"id": 1.4385787685746897e+34,
"platform": "some platform",
"storeName": "some store"
},
"metadata": null,
"items": [
{
"id": "dghfuisghi",
"count": 9
},
{
"id": "shgfuihswi",
"count": 7
}
],
"cart": [
{
"configurationId": "dghfuisghi",
"count": 9
},
{
"configurationId": "shgfuihswi",
"count": 7
}
],
"derivative": null,
"createdAt": "2020-01-17T14:41:08.784Z",
"updatedAt": null,
"status": "Processing"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "no_token_found_error",
"message": "No access token provided in the request"
}
}
GET https://admin.threekit.com/api/orders/{id/shortId}
Retrieves an order from its ID or short ID. Only works for orders belonging to the token's organization.
REST Endpoint
GET https://admin.threekit.com/api/orders/{id/shortId}?bearer_token=[bearer_token]&fullConfiguration=[fullConfiguration]
Query Parameters
Name |
In |
Type |
Required |
Description |
id/shortId |
path |
string |
true |
ID or short ID of the order to be retrieved |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
fullConfiguration |
query |
boolean |
false |
Fetches detailed information about the configuration, specifically item name and item metadata for part references. NOTE - The current implementation assumes that the format of the variant field is identical to how the player stores configuration. For a custom format, there is a possibility that it may not work |
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
Returns an order and its information. If the fullConfiguration query parameter is provided, the items field will be exploded to contain more information about the configurations, including item name and item metadata for part references |
None |
401 |
Unauthorized |
The token provided is not authorized to make the request or the token is invalid. |
None |
403 |
Forbidden |
User provides the ID of an order which cannot be edited using a public token |
None |
404 |
Not Found |
No order was found for the given ID |
None |
Example Implementations
Code
CURL
curl --request GET \
--url https://admin.threekit.com/api/orders/string \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/orders/string",
"headers": {
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/orders/string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
{
"id": "f69b9057-2920-4333-a33b-8e0800f285677",
"shortId": "ULeat7wc",
"orgId": "df7e9678-b0e9-4a9b-add7-fbfedeebc55b",
"customerId": null,
"originOrgId": "129cd532-eb1c-4a18-83e9-0e6bfa4218a7",
"platform": {
"id": 1.4385787685746897e+34,
"platform": "some platform",
"storeName": "some store"
},
"metadata": null,
"items": [
{
"id": "dghfuisghi",
"count": 9
},
{
"id": "shgfuihswi",
"count": 7
}
],
"cart": [
{
"configurationId": "dghfuisghi",
"count": 9
},
{
"configurationId": "shgfuihswi",
"count": 7
}
],
"derivative": null,
"createdAt": "2020-01-17T14:41:08.784Z",
"updatedAt": null,
"status": "In Progress"
}
{
"id": "0063b3fa-79d3-443a-a069-31f53df36ea6",
"shortId": "PnIq17wc",
"orgId": "df7e9678-b0e9-4a9b-add7-fbfedeebc55b",
"customerId": null,
"originOrgId": "129cd532-eb1c-4a18-83e9-0e6bfa4218a7",
"platform": {
"id": 1.4385787685746897e+34,
"platform": "some platform",
"storeName": "some store"
},
"metadata": null,
"items": [
{
"id": "dghfuisghi",
"count": 9,
"configuration": {
"id": "59facf1a-d3d4-41fd-8e05-9da2fc3369f8",
"shortId": "dghfuisghi",
"productId": "6c18ba20-5c82-4b6e-b2e7-6547103f3145",
"productVersion": "v1",
"variant": {
"exampleStringAttr1": "exampleAttrValue1",
"exampleStringAttr2": "exampleAttr2Value1",
"exampleStringAttr3": "exampleAttr3Value1",
"examplePartRef1": {
"type": "item",
"assetId": "25044da7-0d28-4e5b-8ab2-aeb9bd980f39",
"configuration": "",
"itemName": "Example Part Reference Name",
"itemMetadata": "Example Part Reference Metadata"
}
}
}
}
],
"cart": [
{
"configurationId": "dghfuisghi",
"count": 9
}
],
"derivative": null,
"createdAt": "2020-01-17T14:41:08.784Z",
"updatedAt": null,
"status": "New"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "order_not_found_error",
"message": "Order not found"
}
}
PUT https://admin.threekit.com/api/orders/{id/shortId}
Updates an existing order from its ID or short ID. Only works for orders belonging to the token's organization. This API accepts conditionally accepts both tokens a) If the order status is 'List' or 'In Cart', either public or private token can be used to update the order details b) If the order status is 'New', 'In Progress' or 'Complete', only a private token can be used to update the order details
REST Endpoint
PUT https://admin.threekit.com/api/orders/{id/shortId}?bearer_token=[bearer_token]
Query Parameters
Name |
In |
Type |
Required |
Description |
id/shortId |
path |
string |
true |
ID or short ID of the order to be modified |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
body |
body |
updateBody |
true |
Order update information. |
Body Parameters
{
"name": "string",
"status": "List",
"metadata": {},
"derivative": {}
}
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
Returns the modified order and its information |
None |
401 |
Unauthorized |
The token provided is not authorized to make the request or the token is invalid. |
None |
403 |
Forbidden |
User provides the ID of an order which cannot be edited using a public token |
None |
404 |
Not Found |
No order was found for the given ID |
None |
Example Implementations
Code
CURL
curl --request PUT \
--url https://admin.threekit.com/api/orders/string \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: application/json' \
--data '{"name":"string","status":"List","metadata":{},"derivative":{}}'
Node.JS
var http = require("https");
var options = {
"method": "PUT",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/orders/string",
"headers": {
"content-type": "application/json",
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ name: 'string', status: 'List', metadata: {}, derivative: {} }));
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/orders/string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\"name\":\"string\",\"status\":\"List\",\"metadata\":{},\"derivative\":{}}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
{
"id": "4889a614-655b-4367-8525-cc9d22df948d",
"shortId": "UL3LdUc3",
"orgId": "2eb52a9e-79cc-4e0a-be6e-fb69cbedf9d4",
"customerId": null,
"originOrgId": "9ecebbe0-3195-4c75-87ea-208e01ece915",
"platform": {
"id": 1.4385787685746897e+34,
"platform": "some platform",
"storeName": "some store"
},
"metadata": null,
"items": [
{
"id": "dghfuisghi",
"count": 9
},
{
"id": "shgfuihswi",
"count": 7
}
],
"cart": [
{
"configurationId": "dghfuisghi",
"count": 9
},
{
"configurationId": "shgfuihswi",
"count": 7
}
],
"derivative": null,
"createdAt": "2020-01-17T14:41:08.784Z",
"updatedAt": "2020-01-18T14:41:08.784Z",
"status": "Processing"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "order_not_found_error",
"message": "Order not found"
}
}
POST https://admin.threekit.com/api/orders/{id/shortId}/items
Add items to an existing order using its ID or short ID. Only works for orders belonging to the token's organization. This API conditionally accepts both tokens a) If the order status is 'List' or 'In Cart', either public or private token can be used to update the order details b) If the order status is 'New', 'In Progress' or 'Complete', only a private token can be used to update the order details
REST Endpoint
POST https://admin.threekit.com/api/orders/{id/shortId}/items?bearer_token=[bearer_token]
Query Parameters
Name |
In |
Type |
Required |
Description |
id/shortId |
path |
string |
true |
ID or short ID of the order to add items to |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
body |
body |
object |
true |
Array of items to be added. |
» items |
body |
[object] |
false |
Items related to this order. This should be an array of objects. Each object should contain a configuration id and a count. See example schema for the format. |
»» id |
body |
string |
false |
ID of the item configuration (stored in configurations-service). It can either be the UUID or shortId. |
»» count |
body |
number |
false |
Total number of the configured item in the order |
Body Parameters
{
"items": [
{
"id": "string",
"count": 0
}
]
}
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
Returns the modified order and its information |
None |
401 |
Unauthorized |
The token provided is not authorized to make the request or the token is invalid. |
None |
403 |
Forbidden |
User provides the ID of an order which cannot be edited using a public token |
None |
404 |
Not Found |
No order was found for the given ID |
None |
Example Implementations
Code
CURL
curl --request POST \
--url https://admin.threekit.com/api/orders/string/items \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: application/json' \
--data '{"items":[{"id":"string","count":0}]}'
Node.JS
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/orders/string/items",
"headers": {
"content-type": "application/json",
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ items: [ { id: 'string', count: 0 } ] }));
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/orders/string/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"items\":[{\"id\":\"string\",\"count\":0}]}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
{
"id": "4889a614-655b-4367-8525-cc9d22df948d",
"shortId": "UL3LdUc3",
"orgId": "2eb52a9e-79cc-4e0a-be6e-fb69cbedf9d4",
"customerId": null,
"originOrgId": "9ecebbe0-3195-4c75-87ea-208e01ece915",
"platform": {
"id": 1.4385787685746897e+34,
"platform": "some platform",
"storeName": "some store"
},
"metadata": null,
"items": [
{
"id": "dghfuisghi",
"count": 9
},
{
"id": "shgfuihswi",
"count": 7
}
],
"cart": [
{
"configurationId": "dghfuisghi",
"count": 9
},
{
"configurationId": "shgfuihswi",
"count": 7
}
],
"derivative": null,
"createdAt": "2020-01-17T14:41:08.784Z",
"updatedAt": "2020-01-18T14:41:08.784Z",
"status": "Processing"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "order_not_found_error",
"message": "Order not found"
}
}
PUT https://admin.threekit.com/api/orders/{id/shortId}/items
Remove items from an existing order using its ID or short ID. Only works for orders belonging to the token's organization. This API conditionally accepts both tokens a) If the order status is 'List' or 'In Cart', either public or private token can be used to update the order details b) If the order status is 'New', 'In Progress' or 'Complete', only a private token can be used to update the order details
REST Endpoint
PUT https://admin.threekit.com/api/orders/{id/shortId}/items?bearer_token=[bearer_token]
Query Parameters
Name |
In |
Type |
Required |
Description |
id/shortId |
path |
string |
true |
ID or short ID of the order to remove items from |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
body |
body |
object |
true |
Array of items to be removed. |
» items |
body |
[object] |
false |
Items related to this order. This should be an array of objects. Each object should contain a configuration id and a count. See example schema for the format |
»» id |
body |
string |
false |
ID of the item configuration (stored in configurations-service). It can either be the UUID or shortId. |
»» count |
body |
number |
false |
Total number of the configured item in the order |
Body Parameters
{
"items": [
{
"id": "string",
"count": 0
}
]
}
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
Returns the modified order and its information |
None |
401 |
Unauthorized |
The token provided is not authorized to make the request or the token is invalid. |
None |
403 |
Forbidden |
User provides the ID of an order which cannot be edited using a public token |
None |
404 |
Not Found |
No order was found for the given ID |
None |
Example Implementations
Code
CURL
curl --request PUT \
--url https://admin.threekit.com/api/orders/string/items \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: application/json' \
--data '{"items":[{"id":"string","count":0}]}'
Node.JS
var http = require("https");
var options = {
"method": "PUT",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/orders/string/items",
"headers": {
"content-type": "application/json",
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ items: [ { id: 'string', count: 0 } ] }));
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/orders/string/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\"items\":[{\"id\":\"string\",\"count\":0}]}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
{
"id": "4889a614-655b-4367-8525-cc9d22df948d",
"shortId": "UL3LdUc3",
"orgId": "2eb52a9e-79cc-4e0a-be6e-fb69cbedf9d4",
"customerId": null,
"originOrgId": "9ecebbe0-3195-4c75-87ea-208e01ece915",
"platform": {
"id": 1.4385787685746897e+34,
"platform": "some platform",
"storeName": "some store"
},
"metadata": null,
"items": [
{
"id": "dghfuisghi",
"count": 9
},
{
"id": "shgfuihswi",
"count": 7
}
],
"cart": [
{
"configurationId": "dghfuisghi",
"count": 9
},
{
"configurationId": "shgfuihswi",
"count": 7
}
],
"derivative": null,
"createdAt": "2020-01-17T14:41:08.784Z",
"updatedAt": "2020-01-18T14:41:08.784Z",
"status": "Processing"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "order_not_found_error",
"message": "Order not found"
}
}
Schemas
createBody
{
"name": "string",
"customerId": "string",
"originOrgId": "string",
"platform": {
"id": "string",
"platform": "string",
"storeName": "string"
},
"metadata": {},
"items": [
{
"id": "string",
"count": 0
}
],
"cart": [
{
"configurationId": "string",
"count": 0,
"metadata": {}
}
],
"derivative": {},
"status": "List",
"orgId": "string"
}
Properties
Name |
Type |
Required |
Restrictions |
Description |
name |
string |
false |
none |
Name of the order. It can only be maximum 255 characters long |
customerId |
string |
false |
none |
ID of the customer. |
originOrgId |
string |
false |
none |
ID of the original organization. |
platform |
object |
false |
none |
Platform details. This will be an object and contain the e-commerce order ID, platform name and the store name in the e-Commerce platform. See example body schema for the format |
» id |
string |
false |
none |
E-Commerce ID of the order. |
» platform |
string |
false |
none |
E-Commerce platform name where the order was placed. |
» storeName |
string |
false |
none |
none |
metadata |
object |
false |
none |
Metadata related to this order. Attribute keys with valid attribute option values. |
items |
[object] |
false |
none |
Deprecated, This only exists for backwards compatibility. Please use 'cart' instead |
» id |
string |
false |
none |
ID of the item configuration (stored in configurations-service). It can either be the UUID or shortId. |
» count |
number |
false |
none |
Total number of the configured item in the order |
cart |
[object] |
false |
none |
Items related to this order. This should be an array of objects. Each object should contain a configuration id and a count. Arbitary metadata can be optionally added to each object . See example schema for the format. |
» configurationId |
string |
false |
none |
ID of the item configuration (stored in configurations-service). It can either be the UUID or shortId. |
» count |
number |
false |
none |
Total number of the configured item in the order |
» metadata |
object |
false |
none |
Arbitrary metadata associated with the configured item |
derivative |
object |
false |
none |
Derivative related to this order. Attribute keys with valid attribute option values. |
status |
string |
false |
none |
Status of this order. Default value of the status is 'New' |
orgId |
string |
false |
none |
Organization which owns the order. |
Enumerated Values
Property |
Value |
status |
List |
status |
In Cart |
status |
New |
status |
In Progress |
status |
Complete |
updateBody
{
"name": "string",
"status": "List",
"metadata": {},
"derivative": {}
}
Properties
Name |
Type |
Required |
Restrictions |
Description |
name |
string |
false |
none |
Name of the order. It can only be maximum 255 characters long |
status |
string |
false |
none |
Status of this order. |
metadata |
object |
false |
none |
Metadata related to this order. Attribute keys with valid attribute option values. |
derivative |
object |
false |
none |
Derivative related to this order. Attribute keys with valid attribute option values. |
Enumerated Values
Property |
Value |
status |
List |
status |
In Cart |
status |
New |
status |
In Progress |
status |
Complete |