---
title: "Create/Update orders."
method: POST
path: "/order/upsert"
tags: ["Orders|Order"]
---

# Create/Update orders.

`POST /order/upsert`

This method can be used to create and update orders.

An attempt is made to find an existing order based on the selected primary key and value of the key provided.
If one is found, it will be adjusted. Otherwise, a new order is created. If you want, you can remove missing
entries from the upsert request by setting the 'deleteMissing' flag to true.

## Request body

- StandardOrderUpsertRequest
  - `records` object[] — The records. This Parameter is optional.
    - `keyField` string — This parameter specifies the name of the unique key used to distinctly assign each dataset in the API. | Value | Description | |----------------|-----------------------------| | id | The internal order ID | | reference | geoCapture order number | | external_reference | Customer order number |
    - `data` OrderUpsertRequestRecordData
      - `id` integer — The internal id of the order
      - `reference` string — The internal reference for the order (max. 64 characters)
      - `orderType` string — The order type. This parameter is optional. The allowed value and default is 'ORDER'
      - `externalReference` string — The customer order number (max. 64 characters)
      - `status` string — The order state | Value | | ------------------------ | | ARRIVAL | | ASSIGNED | | CREATED | | DEPARTURE | | FINISHED | | NEAREST_POSITION | | OPENED_BY_USER | | READ | | REJECTED | | SIGNED | | STARTED |
      - `subject` string — Order subject (max. 255 characters)
      - `text` string — Order description
      - `orderDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `duration` integer — The order duration
      - `priority` string — order priority | Value | | ------------------------ | | LOW | | NORMAL | | HIGH |
      - `targetDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `externalAddressId` string — The external customer id.
      - `name` string — The name1 address addition. (max. 255 characters)
      - `name2` string — The name2 address addition. (max. 255 characters)
      - `name3` string — The name3 address addition. (max. 255 characters)
      - `street` string — The street (max. 255 characters)
      - `zipCode` string — The zip code
      - `city` string — The city
      - `countryCode` string — The country code
      - `latLng` number[] — Represents a geo coordinate. An array of two double values, representing the latitude and longitude.
      - `contactPersonName` string — The contact person name (max. 255 characters)
      - `contactPersonEmail` string — The contact person email (max. 255 characters)
      - `contactPersonPhoneNumber` string — The contact person phone number (max. 64 characters)
      - `contactPersonMobileNumber` string — The contact person mobile phone number (max. 64 characters)
      - `customerOrderReference` string — The customer order reference (max. 64 characters)
      - `offerReference` string — The offer reference (max. 255 characters)
      - `category` integer — The id of the order category. You need to provide this Parameter or the categoryExternalId.
      - `categoryExternalId` string — The external id of the order category (Used if category not provided).
      - `type` string — | Values | | -------------- | | PROJECT | | CUSTOM_PROJECT |
      - `project` integer — The id of the project.
      - `projectReferenceSign` string — The reference sign of the project (Used if project not provided).
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `provinceCode` string — The province Code.
      - `performanceFields` object[]
        - `name` string — The name of the performance field.
        - `value` number — The value of the performance field.
      - `openingHours` DynamicWeekdayTime — Represents dynamic weekday times ~~~ JSON format: ~~~ {"MO":[["08:00","13:00"],["15:00","18:00"]],"WE":[["08:00","13:00"],["15:00","18:00"]],"FR":[["08:00","13:00"],["15:00","18:00"]]} ~~~
        - `MO` array[]
          - string[] — Represents dynamic weekday times
        - `TU` array[]
          - string[] — Represents dynamic weekday times
        - `WE` array[]
          - string[] — Represents dynamic weekday times
        - `TH` array[]
          - string[] — Represents dynamic weekday times
        - `FR` array[]
          - string[] — Represents dynamic weekday times
        - `SA` array[]
          - string[] — Represents dynamic weekday times
        - `SU` array[]
          - string[] — Represents dynamic weekday times
      - `planningType` string — Order Planning Type. (TRACKER, EMPLOYEE, RESOURCE_PLANNING)
      - `assignedTrackerId` integer — Tracker to which the order is assigned. Only valid if planningType is TRACKER.
      - `assignedEmployeeId` integer — Employee to which the order is assigned. Only valid if planningType is EMPLOYEE.
      - `requiredQualificationIds` integer[] — The required qualifications for this order.
      - `rejectQualificationIds` integer[] — The unwated qualifications for this order.
      - `requireOneQualificationIds` integer[] — A list of qualifications for this order of which at least one is required.
  - `deleteMissing` boolean — Do you want to delete all orders missing from this request? This Parameter is optional. (default=false)
  - `dryRun` boolean — Simulate the operation. (No records will be created or changed) This Parameter is optional.

## Response `200`

Success Response:

- StandardOrderUpsertResponse
  - `createdOrders` object[] — The created orders.
    - `id` integer — The internal id of the order
    - `reference` string — The internal reference for the order (max. 64 characters)
    - `orderType` string — The order type. This parameter is optional. The allowed value and default is 'ORDER'
    - `externalReference` string — The customer order number (max. 64 characters)
    - `status` string — The order state | Value | | ------------------------ | | ARRIVAL | | ASSIGNED | | CREATED | | DEPARTURE | | FINISHED | | NEAREST_POSITION | | OPENED_BY_USER | | READ | | REJECTED | | SIGNED | | STARTED |
    - `subject` string — Order subject (max. 255 characters)
    - `text` string — Order description
    - `orderDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `duration` integer — The order duration
    - `priority` string — order priority | Value | | ------------------------ | | LOW | | NORMAL | | HIGH |
    - `targetDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `externalAddressId` string — The external customer id.
    - `name` string — The name1 address addition. (max. 255 characters)
    - `name2` string — The name2 address addition. (max. 255 characters)
    - `name3` string — The name3 address addition. (max. 255 characters)
    - `street` string — The street (max. 255 characters)
    - `zipCode` string — The zip code
    - `city` string — The city
    - `countryCode` string — The country code
    - `latLng` number[] — Represents a geo coordinate. An array of two double values, representing the latitude and longitude.
    - `contactPersonName` string — The contact person name (max. 255 characters)
    - `contactPersonEmail` string — The contact person email (max. 255 characters)
    - `contactPersonPhoneNumber` string — The contact person phone number (max. 64 characters)
    - `contactPersonMobileNumber` string — The contact person mobile phone number (max. 64 characters)
    - `customerOrderReference` string — The customer order reference (max. 64 characters)
    - `offerReference` string — The offer reference (max. 255 characters)
    - `category` integer — The id of the order category. You need to provide this Parameter or the categoryExternalId.
    - `categoryExternalId` string — The external id of the order category (Used if category not provided).
    - `type` string — | Values | | -------------- | | PROJECT | | CUSTOM_PROJECT |
    - `project` integer — The id of the project.
    - `projectReferenceSign` string — The reference sign of the project (Used if project not provided).
    - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `provinceCode` string — The province Code.
    - `performanceFields` object[]
      - `name` string — The name of the performance field.
      - `value` number — The value of the performance field.
    - `openingHours` DynamicWeekdayTime — Represents dynamic weekday times ~~~ JSON format: ~~~ {"MO":[["08:00","13:00"],["15:00","18:00"]],"WE":[["08:00","13:00"],["15:00","18:00"]],"FR":[["08:00","13:00"],["15:00","18:00"]]} ~~~
      - `MO` array[]
        - string[] — Represents dynamic weekday times
      - `TU` array[]
        - string[] — Represents dynamic weekday times
      - `WE` array[]
        - string[] — Represents dynamic weekday times
      - `TH` array[]
        - string[] — Represents dynamic weekday times
      - `FR` array[]
        - string[] — Represents dynamic weekday times
      - `SA` array[]
        - string[] — Represents dynamic weekday times
      - `SU` array[]
        - string[] — Represents dynamic weekday times
    - `planningType` string — Order Planning Type. (TRACKER, EMPLOYEE, RESOURCE_PLANNING)
    - `assignedTrackerId` integer — Tracker to which the order is assigned. Only valid if planningType is TRACKER.
    - `assignedEmployeeId` integer — Employee to which the order is assigned. Only valid if planningType is EMPLOYEE.
    - `requiredQualifications` object[] — The required qualifications for this order.
      - `id` integer — The internal id of the qualification.
      - `name` string — The name of the qualification.
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `rejectQualifications` object[] — The unwated qualifications for this order.
      - `id` integer — The internal id of the qualification.
      - `name` string — The name of the qualification.
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `requireOneQualifications` object[] — A list of qualifications for this order of which at least one is required.
      - `id` integer — The internal id of the qualification.
      - `name` string — The name of the qualification.
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
  - `updatedOrders` object[] — The changed orders.
    - `id` integer — The internal id of the order
    - `reference` string — The internal reference for the order (max. 64 characters)
    - `orderType` string — The order type. This parameter is optional. The allowed value and default is 'ORDER'
    - `externalReference` string — The customer order number (max. 64 characters)
    - `status` string — The order state | Value | | ------------------------ | | ARRIVAL | | ASSIGNED | | CREATED | | DEPARTURE | | FINISHED | | NEAREST_POSITION | | OPENED_BY_USER | | READ | | REJECTED | | SIGNED | | STARTED |
    - `subject` string — Order subject (max. 255 characters)
    - `text` string — Order description
    - `orderDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `duration` integer — The order duration
    - `priority` string — order priority | Value | | ------------------------ | | LOW | | NORMAL | | HIGH |
    - `targetDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `externalAddressId` string — The external customer id.
    - `name` string — The name1 address addition. (max. 255 characters)
    - `name2` string — The name2 address addition. (max. 255 characters)
    - `name3` string — The name3 address addition. (max. 255 characters)
    - `street` string — The street (max. 255 characters)
    - `zipCode` string — The zip code
    - `city` string — The city
    - `countryCode` string — The country code
    - `latLng` number[] — Represents a geo coordinate. An array of two double values, representing the latitude and longitude.
    - `contactPersonName` string — The contact person name (max. 255 characters)
    - `contactPersonEmail` string — The contact person email (max. 255 characters)
    - `contactPersonPhoneNumber` string — The contact person phone number (max. 64 characters)
    - `contactPersonMobileNumber` string — The contact person mobile phone number (max. 64 characters)
    - `customerOrderReference` string — The customer order reference (max. 64 characters)
    - `offerReference` string — The offer reference (max. 255 characters)
    - `category` integer — The id of the order category. You need to provide this Parameter or the categoryExternalId.
    - `categoryExternalId` string — The external id of the order category (Used if category not provided).
    - `type` string — | Values | | -------------- | | PROJECT | | CUSTOM_PROJECT |
    - `project` integer — The id of the project.
    - `projectReferenceSign` string — The reference sign of the project (Used if project not provided).
    - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `provinceCode` string — The province Code.
    - `performanceFields` object[]
      - `name` string — The name of the performance field.
      - `value` number — The value of the performance field.
    - `openingHours` DynamicWeekdayTime — Represents dynamic weekday times ~~~ JSON format: ~~~ {"MO":[["08:00","13:00"],["15:00","18:00"]],"WE":[["08:00","13:00"],["15:00","18:00"]],"FR":[["08:00","13:00"],["15:00","18:00"]]} ~~~
      - `MO` array[]
        - string[] — Represents dynamic weekday times
      - `TU` array[]
        - string[] — Represents dynamic weekday times
      - `WE` array[]
        - string[] — Represents dynamic weekday times
      - `TH` array[]
        - string[] — Represents dynamic weekday times
      - `FR` array[]
        - string[] — Represents dynamic weekday times
      - `SA` array[]
        - string[] — Represents dynamic weekday times
      - `SU` array[]
        - string[] — Represents dynamic weekday times
    - `planningType` string — Order Planning Type. (TRACKER, EMPLOYEE, RESOURCE_PLANNING)
    - `assignedTrackerId` integer — Tracker to which the order is assigned. Only valid if planningType is TRACKER.
    - `assignedEmployeeId` integer — Employee to which the order is assigned. Only valid if planningType is EMPLOYEE.
    - `requiredQualifications` object[] — The required qualifications for this order.
      - `id` integer — The internal id of the qualification.
      - `name` string — The name of the qualification.
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `rejectQualifications` object[] — The unwated qualifications for this order.
      - `id` integer — The internal id of the qualification.
      - `name` string — The name of the qualification.
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `requireOneQualifications` object[] — A list of qualifications for this order of which at least one is required.
      - `id` integer — The internal id of the qualification.
      - `name` string — The name of the qualification.
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
  - `deletedOrders` object[] — The deleted orders.
    - `id` integer — The internal id of the order
    - `reference` string — The internal reference for the order (max. 64 characters)
    - `orderType` string — The order type. This parameter is optional. The allowed value and default is 'ORDER'
    - `externalReference` string — The customer order number (max. 64 characters)
    - `status` string — The order state | Value | | ------------------------ | | ARRIVAL | | ASSIGNED | | CREATED | | DEPARTURE | | FINISHED | | NEAREST_POSITION | | OPENED_BY_USER | | READ | | REJECTED | | SIGNED | | STARTED |
    - `subject` string — Order subject (max. 255 characters)
    - `text` string — Order description
    - `orderDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `duration` integer — The order duration
    - `priority` string — order priority | Value | | ------------------------ | | LOW | | NORMAL | | HIGH |
    - `targetDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `externalAddressId` string — The external customer id.
    - `name` string — The name1 address addition. (max. 255 characters)
    - `name2` string — The name2 address addition. (max. 255 characters)
    - `name3` string — The name3 address addition. (max. 255 characters)
    - `street` string — The street (max. 255 characters)
    - `zipCode` string — The zip code
    - `city` string — The city
    - `countryCode` string — The country code
    - `latLng` number[] — Represents a geo coordinate. An array of two double values, representing the latitude and longitude.
    - `contactPersonName` string — The contact person name (max. 255 characters)
    - `contactPersonEmail` string — The contact person email (max. 255 characters)
    - `contactPersonPhoneNumber` string — The contact person phone number (max. 64 characters)
    - `contactPersonMobileNumber` string — The contact person mobile phone number (max. 64 characters)
    - `customerOrderReference` string — The customer order reference (max. 64 characters)
    - `offerReference` string — The offer reference (max. 255 characters)
    - `category` integer — The id of the order category. You need to provide this Parameter or the categoryExternalId.
    - `categoryExternalId` string — The external id of the order category (Used if category not provided).
    - `type` string — | Values | | -------------- | | PROJECT | | CUSTOM_PROJECT |
    - `project` integer — The id of the project.
    - `projectReferenceSign` string — The reference sign of the project (Used if project not provided).
    - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `provinceCode` string — The province Code.
    - `performanceFields` object[]
      - `name` string — The name of the performance field.
      - `value` number — The value of the performance field.
    - `openingHours` DynamicWeekdayTime — Represents dynamic weekday times ~~~ JSON format: ~~~ {"MO":[["08:00","13:00"],["15:00","18:00"]],"WE":[["08:00","13:00"],["15:00","18:00"]],"FR":[["08:00","13:00"],["15:00","18:00"]]} ~~~
      - `MO` array[]
        - string[] — Represents dynamic weekday times
      - `TU` array[]
        - string[] — Represents dynamic weekday times
      - `WE` array[]
        - string[] — Represents dynamic weekday times
      - `TH` array[]
        - string[] — Represents dynamic weekday times
      - `FR` array[]
        - string[] — Represents dynamic weekday times
      - `SA` array[]
        - string[] — Represents dynamic weekday times
      - `SU` array[]
        - string[] — Represents dynamic weekday times
    - `planningType` string — Order Planning Type. (TRACKER, EMPLOYEE, RESOURCE_PLANNING)
    - `assignedTrackerId` integer — Tracker to which the order is assigned. Only valid if planningType is TRACKER.
    - `assignedEmployeeId` integer — Employee to which the order is assigned. Only valid if planningType is EMPLOYEE.
    - `requiredQualifications` object[] — The required qualifications for this order.
      - `id` integer — The internal id of the qualification.
      - `name` string — The name of the qualification.
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `rejectQualifications` object[] — The unwated qualifications for this order.
      - `id` integer — The internal id of the qualification.
      - `name` string — The name of the qualification.
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `requireOneQualifications` object[] — A list of qualifications for this order of which at least one is required.
      - `id` integer — The internal id of the qualification.
      - `name` string — The name of the qualification.
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx

---

[API](https://skmtc.net/geocapture/apis/geocapture-api.md) · [All operations](https://skmtc.net/geocapture/apis/geocapture-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/geocapture/geocapture-api/versions/869b05603541/schema)
