Projects
- 2-3 minutes to read
In the context of BackOffice, a project is what the user creates as part of an order. Projects allow you to save the personalization results of every line item in your Customer's Canvas account by associating the order from the e-commerce system with the user in this system.
Let's look at how you can work with projects using the Storefront SDK.
Creating projects
When a user creates an order in an e-commerce system, a single project for every line item in the order is created in BackOffice.
Projects usually contain:
- The product reference it is based on.
- One or more designs personalized in the editor.
- Information about the item quantity.
- Variable data if needed.
- Other auxiliary data.
To create a project, you must pass the Projects data to the Projects_CreateWithSingleItem endpoint. Since this API does not allow for changing project properties, you can use this endpoint to recreate a project and overwrite its properties.
Project statuses
A project's workflow includes the following project statuses:
- New: every new project gets the New status.
- Confirmed: if the order is correct and paid, you confirm it and move the project status to Confirmed.
- Rejected: when you need to cancel the order processing, you move the project status to Rejected.
- Active: when you start processing the order, you move the project status to Active.
- Completed: when you have fulfilled the order, you can mark the project as complete.
You can switch project statuses through both the BackOffice panel and the Storefront API.
To get information about project statuses, you can use the endpoints Projects_GetAllStatuses and Projects_GetAllTransitions. You can switch from one status to another using the Projects_ChangeStatus endpoint, which changes statuses according to the list of their possible transitions.
If you need to forcibly switch the project to an arbitrary status, use the Projects_ForceStatus endpoint.
Browsing projects
To browse projects in your Customer's Canvas account, navigate to the Projects section, where all the projects are listed.
To check the properties of a single project, click an item in this list.
To do the same through the Storefront API, use the Projects_GetAll endpoint to retrieve the list of projects from the specified Storefront. This endpoint supports filtering by project status, creation date, owner, and other parameters.
The Projects_Get endpoint returns project properties for the specified ID. The main properties are:
- id - the project identifier.
- name - the project name.
- productReference - the product template, i.e., an external reference to a Customer's Canvas product specification.
- storefrontId - the storefront identifier.
- orderId - the order identifier in the e-commerce system.
- orderLineItemIndex - the line item index in the order for which the project was created.
- customerName - the customer name in the e-commerce system.
- status - the project status code.
Rendering print files
The rendering of print files is the most important operation of processing the projects.
When you first open a project in your Customer's Canvas account and click the Download link, the PDF creation process begins. As soon as the file is ready, the PDF download begins.
To generate and download a print file through the Storefront API, use the Projects_GetProjectPdfUrl endpoint.