Listing Orders
The orders
GraphQL query provides a way to pull order data, programmatically, in a single API call. The query allows you to pull specific data on the orders you have access to.
In the following sections, we will describe how you can authenticate with the API. We will also provide an example query, the associated variables and a typical response from the API.
Authentication
The GraphQL API uses OAuth 2.0 authentication. A request for an OAuth token is made to the OAuth endpoint, which returns an access token. This token can then be used in requests made to the GraphQL API endpoint.
To make a request for a token, you will require an OAuth user to be set up in the KornitX platform. The user will require specific access and permissions depending on the API request. The permissions required for this request can be found in the “OAuth User Requirements” section below.
If you don’t have an OAuth user set up, please contact the support team, who will be happy to help. The support team will set up the OAuth user in the KornitX platform for you and supply you with the OAuth user client ID and client secret. These credentials can then be used to obtain a token from the OAuth token endpoint.
OAuth Token Endpoint - https://oauth.kornitx.net/token
The OAuth token can be obtained by making a POST to the above endpoint. The request type for the OAuth token is x-www-form-urlencoded
and must include the following form keys and values.
Key | Value |
---|---|
| The client ID of the OAuth user provided by the support team. |
| The client secret of the OAuth user provided by the support team. |
|
|
|
|
Example Response
{"token_type":"Bearer","expires_in":3600,"access_token":"..."}
OAuth User Requirements
To make the orders
request to the GraphQL API, the OAuth user must have:
Access to the company or companies that the orders relate to.
The
order-it.order-manager.view
user permission enabled.
The Orders GraphQL Query
Now we have the access token, we can now make the orders
request.
We will be making a POST request to the https://graphql.kornitx.net
endpoint.
The request will have 2 headers listed below.
Content-Type: “application/json”
Authorization: “Bearer [OAUTH_ACCESS_TOKEN]“
[OAUTH_ACCESS_TOKEN] should be replaced by the access token that was returned when we made the token request to the https://oauth.kornitx.net/token
endpoint.
Query
In this example, we will be listing details of the most recent 10 orders for a specific dropship. We will ask the API to return the following order information.
Order ID
Status Name
External Ref
As well as the following information on the items contained within each order.
ID
Description
SKU
Mapped SKU
Colour
Size
Quantity
External Ref
URL’s to the Item Artwork
However, the GraphQL API call can return numerous other pieces of information about the orders and order-items, details of which, can be found in the schema here - Order and here - OrderItem
Example Query
query ($filter: Json, $order: Json, $page: Int, $count: Int) {
core {
orders(filter: $filter, order: $order, page: $page, count: $count) {
pages {
pageCount
current
}
items {
id
status_name
external_ref
items {
items {
id
description
sku
mapped_sku
colour
size
quantity
external_ref
artwork {
client_url
}
}
}
}
}
}
}
Variables
The query contains references to 4 variables - $filter
, $order
, $page
and $count
. Descriptions of these variables can be found in the table below.
Variable Descriptions
Variable | Type | Description |
---|---|---|
|
| Allows you to filter the orders to just the ones you require. For example, by dropship ID. |
|
| The sort order the results are returned in. i.e. |
|
| The page number of the list of orders to be returned. i.e. if the are 100 orders in total and |
|
| How may orders should be returned in the response. |
Example Variables
{
"filter": {
"secondary_company_ref_id": 300056
},
"order": {
"id": "DESC"
},
"page": 1,
"count": 10
}
Response
A successful request will return the details we requested from the orders of the specified dropship. For the example we have been working with, the response data can be viewed below.
Example response
{
"data": {
"core": {
"orders": {
"pages": {
"pageCount": 17,
"current": 1
},
"items": [
{
"id": 45594880,
"status_name": "In Production",
"external_ref": "POS-DF3092",
"items": {
"items": [
{
"id": 81136042,
"description": "Pullover Hoodie for Adults – Customized",
"sku": "97200-PSTEST",
"mapped_sku": "97200-PSTEST",
"colour": "Black",
"size": "",
"quantity": 1,
"external_ref": "POS-D5FF02",
"artwork": [
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ83B8642B63E38810/print-artwork/single-3820491.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ83B8642B63E38810/print-artwork/single-3820491.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ83B8642B63E38810/print-artwork/multi.pdf"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82879781.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82879781_2036041.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82879781_2036042.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82879781_2036043.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82879781_2036044.png"
}
]
}
]
}
},
{
"id": 45594783,
"status_name": "Cancelled",
"external_ref": "POS-DF3092",
"items": {
"items": [
{
"id": 81135783,
"description": "Pullover Hoodie for Adults – Customized",
"sku": "97200-PSTEST",
"mapped_sku": "97200-PSTEST",
"colour": "Black",
"size": "",
"quantity": 1,
"external_ref": "POS-D5FF02",
"artwork": [
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ83B8642B63E38810/print-artwork/single-3820491.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ83B8642B63E38810/print-artwork/single-3820491.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ83B8642B63E38810/print-artwork/multi.pdf"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82879781.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82879781_2036041.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82879781_2036042.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82879781_2036043.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82879781_2036044.png"
}
]
}
]
}
},
{
"id": 45453571,
"status_name": "Pending Dispatch",
"external_ref": "POS-584551",
"items": {
"items": [
{
"id": 80888456,
"description": "Pullover Hoodie for Adults – Customized",
"sku": "97200-PSTEST",
"mapped_sku": "97200-PSTEST",
"colour": "Black",
"size": "",
"quantity": 10,
"external_ref": "POS-CB42A2",
"artwork": [
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZCBE712B163DD13BE/print-artwork/single-3820491.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZCBE712B163DD13BE/print-artwork/single-3820491.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZCBE712B163DD13BE/print-artwork/multi.pdf"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82676243.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82676243_2036041.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82676243_2036042.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82676243_2036043.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_82676243_2036044.png"
}
]
}
]
}
},
{
"id": 45199615,
"status_name": "In Production",
"external_ref": "POS-515ECD",
"items": {
"items": [
{
"id": 80446071,
"description": "Samsung Galaxy S20 Tough Case In Gloss",
"sku": "SGS20-TCB-CS-G-PSTEST",
"mapped_sku": "SGS20-TCB-CS-G-PSTEST",
"colour": "Front",
"size": "",
"quantity": 2,
"external_ref": "POS-7FDC30",
"artwork": [
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ70EA0C5A6341E09A/print-artwork/single-1.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ70EA0C5A6341E09A/print-artwork/single-1.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ70EA0C5A6341E09A/print-artwork/multi.pdf"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_75456212.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_75456212_1315778.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_75456212_1989615.png"
}
]
}
]
}
},
{
"id": 45144312,
"status_name": "Sent to supplier",
"external_ref": "POS-515ECD",
"items": {
"items": [
{
"id": 80350646,
"description": "Samsung Galaxy S20 Tough Case In Gloss",
"sku": "SGS20-TCB-CS-G-PSTEST",
"mapped_sku": "SGS20-TCB-CS-G-PSTEST",
"colour": "Front",
"size": "",
"quantity": 2,
"external_ref": "POS-7FDC30",
"artwork": [
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ70EA0C5A6341E09A/print-artwork/single-1.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ70EA0C5A6341E09A/print-artwork/single-1.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ70EA0C5A6341E09A/print-artwork/multi.pdf"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_75456212.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_75456212_1315778.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_75456212_1989615.png"
}
]
}
]
}
},
{
"id": 44799394,
"status_name": "In Production",
"external_ref": "POS-515ECD",
"items": {
"items": [
{
"id": 79750747,
"description": "Samsung Galaxy S20 Tough Case In Gloss",
"sku": "SGS20-TCB-CS-G-PSTEST",
"mapped_sku": "SGS20-TCB-CS-G-PSTEST",
"colour": "Front",
"size": "",
"quantity": 2,
"external_ref": "POS-7FDC30",
"artwork": [
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ70EA0C5A6341E09A/print-artwork/single-1.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ70EA0C5A6341E09A/print-artwork/single-1.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ70EA0C5A6341E09A/print-artwork/multi.pdf"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_75456212.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_75456212_1315778.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_75456212_1989615.png"
}
]
}
]
}
},
{
"id": 44368338,
"status_name": "In Production",
"external_ref": "TestTiborpauls123",
"items": {
"items": [
{
"id": 78871027,
"description": "AWDis Hooded Sweatshirt",
"sku": "Jh001-PSTEST",
"mapped_sku": "Jh001-PSTEST",
"colour": "Jet Black",
"size": "L",
"quantity": 1,
"external_ref": "POS-00A8F9",
"artwork": [
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950663.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950663.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950664.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950664.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-4499421.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-4499421.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/multi.pdf"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925458.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925459.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925460.png"
}
]
}
]
}
},
{
"id": 44119909,
"status_name": "In Production",
"external_ref": "Test2",
"items": {
"items": [
{
"id": 78293968,
"description": "AWDis Hooded Sweatshirt",
"sku": "Jh001-PSTEST",
"mapped_sku": "Jh001-PSTEST",
"colour": "Jet Black",
"size": "L",
"quantity": 1,
"external_ref": "POS-00A8F9",
"artwork": [
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950663.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950663.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950664.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950664.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-4499421.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-4499421.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/multi.pdf"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925458.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925459.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925460.png"
}
]
}
]
}
},
{
"id": 44119542,
"status_name": "In Production",
"external_ref": "POS-125262-1",
"items": {
"items": [
{
"id": 78293118,
"description": "AWDis Hooded Sweatshirt",
"sku": "Jh001-PSTEST",
"mapped_sku": "Jh001-PSTEST",
"colour": "Jet Black",
"size": "L",
"quantity": 1,
"external_ref": "POS-00A8F9",
"artwork": [
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950663.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950663.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950664.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950664.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-4499421.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-4499421.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/multi.pdf"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925458.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925459.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925460.png"
}
]
}
]
}
},
{
"id": 44072584,
"status_name": "In Production",
"external_ref": "POS-125262",
"items": {
"items": [
{
"id": 78210688,
"description": "AWDis Hooded Sweatshirt",
"sku": "Jh001-PSTEST",
"mapped_sku": "Jh001-PSTEST",
"colour": "Jet Black",
"size": "L",
"quantity": 1,
"external_ref": "POS-00A8F9",
"artwork": [
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950663.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950663.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950664.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-3950664.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-4499421.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/single-4499421.jpg"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/generated-assets-gateway3d-com/print-job/ZZ4C774690639B51B3/print-artwork/multi.pdf"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925458.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925459.png"
},
{
"client_url": "https://s3-eu-west-1.amazonaws.com/assets.easypromo3d.com/output/thumbnails/print-jobs/300056_79979204_1925460.png"
}
]
}
]
}
}
]
}
}
}
}