Importing Production Orders

This guide is for ERP partners receiving orders created in decoloop CPQ (WoonTotaal). Once an order has been imported into decoloop Production, your integration retrieves its order data through the Production API and marks it as handled after a successful ERP import.

This is a polling workflow: your ERP requests orders that are ready to import. The API does not push them to your system.

Workflow overview

StepResponsible systemAction
1decoloop CPQA project is ordered in WoonTotaal / decoloop CPQ.
2decoloop ProductionThe project is imported into Production and receives the Imported status.
3Your ERP integrationRetrieve projects with the Imported status.
4Your ERP integrationRetrieve the order specification for each project and import it into your ERP.
5Your ERP integrationChange the project's status to an agreed follow-up status, such as Handled by Import.

Imported means imported into decoloop Production, not into your ERP. Your integration starts at step 3. After the status update, the project no longer matches the Imported-status query, unless its status is later changed back.

Prerequisites

Before implementing the integration, arrange the following with your decoloop contact or account administrator:

  • A dedicated employee/account for API usage, with an email address, password, and access to the relevant Production data.
  • The API base URL for your environment. The examples below use https://api.decoloop.com; use the agreed test environment when developing the integration.
  • The numeric status value for Imported, or another status you agree to poll.
  • A different numeric status value for the follow-up status, such as Handled by Import, configured for your workflow.
  • A test order that has already reached decoloop Production.

Status values are not status IDs

The API expects a numeric statusValue, not a status record ID or a label such as Imported. Confirm both values for your environment. In the examples, 100 and 200 are illustrative values only, not defaults.

1. Authenticate

Use the dedicated account's email address and password to request a token from the SievalHub / decoloop API:

POST https://api.decoloop.com/api/token
Content-Type: application/json

{
  "emailAddress": "erp-integration@example.com",
  "password": "YOUR_PASSWORD"
}

Read access_token from the response and send it in the Authorization header on every Production API request:

Authorization: Bearer YOUR_ACCESS_TOKEN

Reuse the token until it expires; the token response includes an .expires timestamp. Obtain a new token when needed rather than authenticating for every project.

Keep authentication server-side

Run this integration on your backend. Store credentials securely and never expose passwords or bearer tokens in browser code, source control, or logs.

2. Find projects ready to import

Call GetProjectsForStatusValue with the numeric value of your agreed incoming status:

GET https://api.decoloop.com/production-api/Status/GetProjectsForStatusValue?statusValue=100
Authorization: Bearer YOUR_ACCESS_TOKEN

The response is an array of Production projects. An empty array means there are currently no matching projects; wait until your next polling cycle.

For each returned project:

  • id is the Production project ID. Pass this as productionProjectId in the following requests.
  • projectId is the WoonTotaal project ID. Do not use it in place of the Production project ID.
  • polygons contains the underlying production items.

The query matches a project when at least one of its production items (polygons) has the requested status. It does not imply that every item has that status.

See the Status API reference for the complete response schema and optional statusAssignedBefore filter.

3. Retrieve and import each order

Use ProjectExport/GetOrderSpec as the default endpoint for this integration. Make a separate request for each project returned in step 2. The example uses 12345 as the returned Production project id:

GET https://api.decoloop.com/production-api/ProjectExport/GetOrderSpec?productionProjectId=12345
Authorization: Bearer YOUR_ACCESS_TOKEN

The response contains:

  • productionProjectId: the Production project this specification belongs to. Keep this ID for deduplication and the status update in step 4.
  • orderSpec: the structured order specification to map into your ERP, including customer details, order items, configured materials and options, and bill-of-materials entries.

The status query only identifies projects to process; it does not replace this order-specification request. The sections below cover the main fields for an ERP integration, not every field. See GetOrderSpec in the ProjectExport API reference for the complete schema.

Order identity and references

These fields are inside orderSpec:

FieldMeaning / typical use
idThe source CPQ / WoonTotaal project ID. This is not the outer productionProjectId used by the Production API.
projectNumberThe human-readable CPQ project number, useful for order lookup and support.
reference and descriptionThe project's reference and description.
externalProjectReferenceA reference supplied by an external integration, when present.
referenceIdThe source project's UUID reference. Keep it if your integration needs to correlate CPQ records.
sentDateTimeWhen the project was sent, when available.

The flags isSent, isReadonly, and isInternal describe the source project. They do not indicate that your ERP has imported the order; use the Production status workflow for that handoff.

Customers and delivery

Select the ordering retailer/store using orderSpec.isInternal:

ConditionCustomer to use for your ERP's ordering account
orderSpec.isInternal is trueUse orderSpec.customer for the actual retailer/store.
orderSpec.isInternal is falseUse orderSpec.licenseeCustomer for the ordering retailer/store.

Both customer objects can include debtorCode, deliveryCode, name, company, mainAddress, and deliveryAddress. Map the account and debtor code from the customer selected above; do not always use orderSpec.customer regardless of the order context.

Delivery address priority:

  1. If orderSpec.deliveryAddress is filled, use it. The explicit project delivery address takes priority over the selected customer's address details.
  2. If it is empty, fall back to the address details of the same customer selected above: orderSpec.customer for internal orders, or orderSpec.licenseeCustomer for non-internal orders.

Address objects contain fields such as name, address, zip, city, countryCode, phoneNumber, and emailAddress. The project delivery address can also include extra address lines and a state. If neither the explicit delivery address nor the selected customer's address details provide a usable destination, flag the order for review rather than inventing one.

Order items

orderSpec.items[] contains the configured order items (CPQ polygons). For each item, the main fields are:

FieldsMeaning / typical use
id, referenceIdThe source CPQ item's ID and UUID reference, not a Production polygon ID. Store them when you need line-level traceability.
lineNumber, lineNumberSuffix, polygonNumberLine numbering and the item's human-readable number. Preserve the suffix when displaying line numbers.
descriptionThe item description, for example a room or location.
model, polygonType, productCategoryThe configured model, item type, and product category. These include identifiers, descriptions, and interface keys where configured.
width, heightDimensions in centimeters. Check isWidthEnabled and isHeightEnabled; not every product uses both dimensions.
productionMethodDescriptionA description of the item's production method.
materialsThe selected materials and their configured properties, explained below.
billOfMaterialsThe calculated article entries belonging to this item, explained below.

Selected materials and configured options

Each entry in orderSpec.items[].materials[] represents a material slot, such as the main fabric or lining:

  • Slot identification: name, categoryLinkId, interfaceKey, and isMainCategory identify the material's role in the product.
  • Selected material: material contains its id, supplierCode, eanCode, description, color, category, and supplier details where available.
  • Quantities: calcQuantity / calcQuantityNet and saleQuantity / saleQuantityNet distinguish calculated and sales quantities. extraSaleQuantity and quantityDescription provide additional quantity information. Do not treat all of these as interchangeable order quantities.
  • Configured options: properties[] holds the configuration values associated with that material slot.

For each property, propertyValue is the underlying value, while displayLabel and propertyValueLabel are human-readable labels. Use interfaceKey and valueInterfaceKey for ERP mappings where those keys have been configured and agreed, rather than relying on translated display text. The flags isVisible and isReadonly describe the property's UI behavior; a hidden or read-only property may still matter for production.

Bill of materials and prices

There are two levels of bill-of-materials entries:

  • orderSpec.billOfMaterials[] is the project-level roll-up of item articles, plus any project-level price elements.
  • orderSpec.items[].billOfMaterials[] contains the article breakdown for that individual item.

The project-level roll-up groups matching item articles and combines their quantities according to the calculation rules. Articles with the same code can still appear separately when their material, price, or other grouping details differ.

Use the project-level list for the order-wide article overview and the item-level lists when you need to trace articles to individual products. Do not add both levels together: that would double-count the rolled-up item articles. Conversely, reading only the item lists misses any additional project-level price elements.

Each entry can include code, description, eanCode, supplierCode, materialId, supplier, and category for article matching, plus quantity and unitDescription for the amount and unit. kind identifies the entry type. These are calculated article entries, which are distinct from the selected material slots and their configuration properties.

unitPrice and totalPrice always represent the price the retailer pays to the vendor/supplier (the owner of the CPQ instance), not the retailer's selling price to the end customer. This applies to both internal and non-internal orders.

For internal orders, isModified is true when an article has modified, order-specific prices. Preserve those price overrides when importing the order into your ERP rather than replacing them with standard catalog prices.

Mapping considerations

  • Project and item attributes hold additional configuration-specific data. Agree on their structure with your decoloop contact if your integration needs them; do not assume fixed keys across installations.
  • Keep source identifiers separate from Production identifiers and your own ERP order IDs.

Validate and map the order specification, then save the order in your ERP. Persist the outer productionProjectId alongside the ERP order so that a repeated request can be recognized instead of creating a duplicate order.

4. Mark the project as handled

Only after the order has been successfully saved in your ERP, call SetStatusForProject with the agreed follow-up status value:

POST https://api.decoloop.com/production-api/Status/SetStatusForProject
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

{
  "productionProjectId": 12345,
  "statusValue": 200
}

Check that the request succeeds. Once the project no longer has any production items with the incoming status, it will not appear in the next query for that status.

This updates all production items in the project

SetStatusForProject applies the status to all underlying production items, not only the items that matched your query. Agree on this project-level handoff before using it, especially if your workflow allows mixed item statuses. Do not mark a partially imported order as handled.

Polling and error handling

Repeat steps 2–4 at an interval agreed for your integration. Treat each project independently so that one failed order does not prevent other orders from being processed.

SituationRecommended behavior
No matching projectsWait until the next polling cycle.
Order-specification retrieval, validation, or ERP import failsRecord the project ID and error for investigation. Leave its status unchanged so it can be retried.
ERP import succeeds but the status update fails or times outKeep the saved ERP order and its Production project ID. On retry, recognize the existing order and retry the status update instead of creating a duplicate.
API returns 401 UnauthorizedCheck token expiry and obtain a new token if needed. If it still fails, verify the account's credentials and access rather than retrying indefinitely.
API returns 400 Bad RequestCheck the request, Production project ID, and configured numeric status values against the API reference.
Temporary network or server failureRetry with a delay and bounded backoff; do not mark an unsaved order as handled.

A status query is not a reservation of an order. Avoid overlapping polling runs, or coordinate workers in your own system. Make ERP imports idempotent: processing the same Production project again must not create another ERP order.

Test the complete handoff

Before enabling unattended imports:

  1. Order a test project in CPQ and confirm it has been imported into Production.
  2. Verify that the incoming-status query returns it.
  3. Retrieve its order specification with GetOrderSpec and confirm the mapped order data in your ERP.
  4. Update its status and verify it disappears from the incoming-status query.
  5. Test an import failure: the status should remain unchanged.
  6. Test a retry after the ERP save but before a successful status update: no duplicate ERP order should be created.

On this page