Skip to content

upsertService

WRITE

Upsert service.

POST /api/v1/items/upsertService
curl -X POST '<your-host>/api/v1/items/upsertService' \
  -H 'Authorization: Bearer <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "string",
    "name": "string",
    "replenishmentSystem": "Buy",
    "defaultMethodType": "Purchase to Order",
    "itemTrackingType": "string",
    "unitOfMeasureCode": "string",
    "revision": "string",
    "_operation": "create"
  }'
Response
{
  "active": true,
  "assignee": "string",
  "companyId": "string",
  "createdAt": "string",
  "createdBy": "string",
  "customFields": "…",
  "defaultMethodType": "Purchase to Order",
  "description": "string",
  "externalId": "…",
  "id": "string",
  "itemPostingGroupId": "string",
  "itemTrackingType": "Inventory",
  "name": "string",
  "notes": "…",
  "readableId": "string",
  "readableIdWithRevision": "string",
  "replenishmentSystem": "Buy",
  "revision": "string",
  "revisions": "…",
  "supplierIds": "string",
  "suppliers": [
    "string"
  ],
  "tags": [
    "string"
  ],
  "thumbnailPath": "string",
  "unitOfMeasure": "string",
  "unitOfMeasureCode": "string",
  "updatedAt": "string",
  "updatedBy": "string"
}

Parameters

ParameterType

Required. 'create' inserts a new record, 'update' modifies the existing record with this id.

"create""update"
"Purchase to Order""Pull from Inventory""Make to Order"
min length 1max length 255
min length 1max length 255
"Buy""Make"
min length 1
min length 1
> 0
"NotManaged""Fixed Duration""Calculated""Set on Receipt"
"Before""After"
min 0

Input schema

schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "readableId": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string"
    },
    "mpn": {
      "type": "string"
    },
    "replenishmentSystem": {
      "type": "string",
      "enum": [
        "Buy",
        "Make"
      ]
    },
    "defaultMethodType": {
      "type": "string",
      "enum": [
        "Purchase to Order",
        "Pull from Inventory",
        "Make to Order"
      ]
    },
    "itemTrackingType": {
      "type": "string",
      "const": "Non-Inventory"
    },
    "postingGroupId": {
      "type": "string"
    },
    "unitOfMeasureCode": {
      "type": "string",
      "minLength": 1
    },
    "unitCost": {
      "type": "number",
      "minimum": 0
    },
    "defaultStorageUnitId": {
      "type": "string"
    },
    "shelfLifeMode": {
      "type": "string",
      "enum": [
        "NotManaged",
        "Fixed Duration",
        "Calculated",
        "Set on Receipt"
      ]
    },
    "shelfLifeDays": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "shelfLifeTriggerProcessId": {
      "type": "string"
    },
    "shelfLifeTriggerTiming": {
      "type": "string",
      "enum": [
        "Before",
        "After"
      ]
    },
    "shelfLifeCalculateFromBom": {
      "type": "boolean"
    },
    "revision": {
      "type": "string",
      "minLength": 1
    },
    "customFields": {},
    "_operation": {
      "type": "string",
      "enum": [
        "create",
        "update"
      ],
      "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."
    }
  },
  "required": [
    "id",
    "name",
    "replenishmentSystem",
    "defaultMethodType",
    "itemTrackingType",
    "unitOfMeasureCode",
    "revision",
    "_operation"
  ]
}