Skip to main content

Orders API

  1. Ovreview
  2. List of endpoints
  3. Error codes
  4. Retrieve all orders
  5. Retrieve an order by code
  6. Retrieve an order by ID
  7. Register an order

1. Overview

The Zakeke Orders API is a comprehensive collection of endpoints designed to facilitate the seamless management of orders within the Zakeke ecosystem. This robust set of APIs encompasses retrieval functions for accessing order information as well as registration capabilities for the integration and synchronization of orders within your platform.

2. List of endpoints

The following are the enpoints available for the Orders API.

Please Note

All the endpoints have the following base url: https://api.zakeke.com/


warning

All API calls need to be authenticated and authorized via an S2S-type oAuth token. For all the details see the Authentication and Authorization section.


MethodEndpointDescription
GET/v2/ordersAll orders for customized products placed by customers.
GET/v2/order/{orderCode} Retrieve an order given its code.
GET/v2/orders/{order}Retrieve an order given its ID in Zakeke.
POST/v2/orderRegister an order.

In the following sections we will provide details of each endpoint with a description of the information they provide and the operations they follow.

3. Error codes

In RESTful API calls, such as those made to Zakeke, HTTP status codes are crucial for indicating the outcome of API requests. Codes in the 2xx range signify successful operations, 4xx errors denote client-side issues, and 5xx errors indicate server-side problems. This system allows developers to quickly identify and address issues with API interactions, enhancing the efficiency of integrating with Zakeke's services.

For certain status codes, Zakeke includes an error message in the response body to elucidate the cause of the error. This is particularly useful when a single status code, like 404 Not Found or 400 Bad Request, could indicate various issues. These messages help developers pinpoint the specific problem, facilitating a more efficient troubleshooting process when integrating with Zakeke's APIs.

4. Retrieve all orders

This endpoint returns all orders placed by customers, from newest to oldest.

Request

GET https://api.zakeke.com/v2/orders

For the endpoint it is possible to specify parameters to perform pagination of the result. Pagination of the result is particularly important to obtain optimal performance in the presence of a large number of orders.

warning

Use pagination parameters and an optimal page size (maximum 100 items per page) to maintain good performance when running the API.

The following are the parameters you can use in query string for pagination:

ParameterData typeDescription
pageSizeintegerThe page size of the result.
pageNumberintegerThe number of the page to return. The first page will have pageNumber = 1

Response

The API call returns a JSON with the following structure:

[
{
"id": 0,
"code": "string",
"orderNumber": "string",
"salesChannel": {
"id": 0,
"url": "string",
"platform": "string"
},
"items": [
{
"code": "string",
"productSku": "string",
"productName": "string",
"productTemplateId": "string",
"thumbnail": "string",
"quantity": 0,
"design": "string",
"preDesignedTemplateName": "string",
"printFilesStatus": "string",
"printingFilesZip": "string",
"printingFiles": [
{
"type": "string",
"url": "string"
}
],
"price": {
"value": 0,
"currency": "string"
}
}
],
"orderDate": "string"
}
]

Each item of the array in the JSON result is an object that represents an order and whose properties have the following meaning:

ParameterData typeDescription
idintegerUnique identifier generated by Zakeke for the order.
codestringIdentification code assigned by the merchant to the order.
orderNumberstringIdentification code assigned by the ecommerce to the order.
salesChannelobjectObject that reports the data of the sales channel on which the order has been executed, if any.
itemsarrayDetails on customized products ordered.
orderDatestringDate and time the order has been placed.

Sales Channels allows you to connect and manage multiple commerce channels to your Zakeke account. Sales channels are the different platforms where you sell your customizable products, such as Shopify, WooCommerce, Etsy, etc.. This feature allows you to share all customizable products, including the ones with variants, among several platforms and manage all your orders and stores from a single Zakeke account instead of creating a separate account for each platform. If the order has been placed on a sales channel, for that sales channel the salesChannel property will be an object with the following structure:

{
"id": 0,
"url": "https://....",
"platform": "string"
}

where:

ParameterData typeDescription
idintegerNumeric code that uniquely identifies the sales channel within Zakeke.
urlstringURL to the sales channel web site.
platformstringThe ecommerce platform for the sales channel (Shopify, WooCommerce, etc.)

For each custom product ordered, the items property array will contain an object with the following structure:

{
"code": "string",
"productSku": "string",
"productName": "string",
"productTemplateId": "string",
"thumbnail": "string",
"quantity": 0,
"design": "string",
"preDesignedTemplateName": "string",
"printFilesStatus": "string",
"printingFilesZip": "string",
"printingFiles": [
{
"type": "string",
"url": "string"
}
],
"price": {
"value": 0,
"currency": "string"
}
}

where:

ParameterData typeDescription
codestringOrder detail identification code assigned by the ecommerce.
productSkustringThe SKU code that identifies the customized product in ecommerce.
productNamestringThe customized product name.
productTemplateIdstringCode that identifies the product in the POD (Print on demand) system from which it derives, if any
thumbnailstringA preview image URL of the customized product.
quantityintegerThe number of products ordered.
designstringThe design id for the customized product.
preDesignedTemplateNamestringIf the product has been customized starting from a pre-designed template, reports the name of the pre-designed template used.
printFilesStatusstringThe status of the print-ready file production process. It can be: INPROCESS or READY.
printingFilesZipstringAfter the print-ready files are generated, it will report the URL of the zip file containing all the files.
printingFilesarrayAfter the print-ready files are generated, it will contain the list of all the files, with the type (SVG, PNG, PDF, etc.) and URL for each of them.
priceobjectThe total amount of the order and the currency in which it is expressed.

Furthermore, in the case of using pagination parameters (strongly recommended), the response also returns the following two custom headers:

ParameterData typeDescription
X-Total-CountintegerThe total number of orders.
X-Has-More-PagesbooleanThere is a page following the current one.

Naturally, HTTP headers have textual content but they can be interpreted in the indicated data type.

HTTP Response Codes

CodeNameDescription
200OKAPI Call completed successfully. The response body contains the order list.
401UnauthorizedUnauthorized user. Check the token used for the call.
403ForbiddenUnauthenticated user. Check the token used for the call.

Examples

Example 1 Get the first 20 orders.

curl -X GET https://api.zakeke.com/v2/orders?pageSize=20&pageNumber=1 \
-H "Accept: application/json" \
-H "Authorization: Bearer <Access-Token>"

The response will have the body with the first 20 orders and the following custom headers:

X-Total-Count: "71" X-Has-More-Pages: "True"

5. Retrieve an order by code

This endpoint allows you to obtain the details of an order starting from its code. By code we mean the unique identifier that allows the merchant to find the order in their ecommerce system.

Request

GET https://api.zakeke.com/v2/order/{orderCode}

The orderCode parameter is the order identifier used by the merchant to find an order on the ecommerce.

Response

The response provides a JSON object representing the order having the code specified in the request, if it exists. The object will have the exact same structure as a single array item returned in response to the call to get all orders.

HTTP Response Codes

CodeNameDescription
200OKAPI Call completed successfully. The response body contains the requested order.
401UnauthorizedUnauthorized user. Check the token used for the call.
403ForbiddenUnauthenticated user. Check the token used for the call.
404Not FoundNo order was found with the code that matches the request.

6. Retrieve an order by ID

This endpoint allows you to obtain the details of an order starting from its ID in Zakeke.

Request

GET https://api.zakeke.com/v2/orders/{orderID}

The orderID parameter is the unique identifier generated by Zakeke for the order.

Response

The response provides a JSON object representing the order having the ID specified in the request, if it exists. The object will have the exact same structure as a single array item returned in response to the call to get all orders.

HTTP Response Codes

CodeNameDescription
200OKAPI Call completed successfully. The response body contains the requested order.
401UnauthorizedUnauthorized user. Check the token used for the call.
403ForbiddenUnauthenticated user. Check the token used for the call.
404Not FoundNo order was found with the ID that matches the request.

7. Register an order

This endpoint allows you to register an order in Zakeke.

Request

POST http://api.zakeke.com/v2/order

The API call expects a JSON with the following structure in the body:

{
"orderCode": "string",
"orderDate": "2023-11-03T09:13:38.437Z",
"sessionID": "string",
"total": 0,
"details": [
{
"orderDetailCode": "string",
"sku": "string",
"designID": "string",
"modelUnitPrice": 0,
"designUnitPrice": 0,
"quantity": 0,
"designModificationID": "string"
}
],
"compositionDetails": [
{
"orderDetailCode": "string",
"composition": "string",
"unitPrice": 0,
"quantity": 0
}
]
}

where:

PropertyData typeDescription
orderCodestringUnique identifier of the order on the e-commerce.
orderDatestringOrder date in ISO 8601 format.
sessionIDstringThe e-commerce session identifier.
totalmoneyThe total order amount.
detailsarrayList of customized product details.
compositionDetailsarrayLsit of configured product details.

For each of the customized product ordered, the object in the details array has the following structure:

{
"orderDetailCode": "string",
"sku": "string",
"designID": "string",
"modelUnitPrice": 0,
"designUnitPrice": 0,
"quantity": 0,
"designModificationID": "string"
}

where:

PropertyData typeDescription
orderDetailCodestringThe ID on your system for the line item.
skustringUnique identifier that the ordered product has in ecommerce.
designIDstringUnique design identifier provided by Zakeke.
modelUnitPricemoneyProduct unit price without the design price.
designUnitPricemoneyUnit price applied to customization.
quantityintegerQuantity of products ordered.
designModificationIDstringIdentifier assigned by Zakeke for the particular instance of fields values in the case of an order with the Names and Numbers tool or for the bulk purchase with a different print file for each ordered variations

For each of the configured product ordered, the object in the compositionDetails array has the following structure:

{
"orderDetailCode": "string",
"composition": "string",
"unitPrice": 0,
"quantity": 0
}

where:

PropertyData typeDescription
orderDetailCodestringThe ID on your system for the line item.
compositionstringThe product configuration identifier for the product that the line item belongs to.
unitPricemoneyThe unit price of the product, including the configuration price, after discounts have been applied. Must be in the base currency set in the Zakeke API settings.
quantityintegerThe number of products that were purchased.