Skip to content

resolveBuyUnitCost

WRITE

What a "Purchase to Order" quote material's unit cost IS: a typed cost wins, anything else re-resolves from supplier price breaks.

POST /api/v1/shared/resolveBuyUnitCost
curl -X POST '<your-host>/api/v1/shared/resolveBuyUnitCost' \
  -H 'Authorization: Bearer <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "material": {},
    "requestedQty": 0,
    "priceMap": {}
  }'
Response
0

Parameters

ParameterType

Input schema

schema
{
  "type": "object",
  "properties": {
    "material": {
      "type": "object",
      "properties": {
        "itemId": {
          "type": "string"
        },
        "unitCost": {
          "type": "number"
        },
        "unitCostSource": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "itemId",
        "unitCost"
      ]
    },
    "requestedQty": {
      "type": "number"
    },
    "priceMap": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "priceBreaks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "quantity": {
                  "type": "number"
                },
                "unitPrice": {
                  "type": "number"
                }
              },
              "required": [
                "quantity",
                "unitPrice"
              ]
            }
          },
          "fallbackUnitPrice": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "priceBreaks",
          "fallbackUnitPrice"
        ]
      }
    }
  },
  "required": [
    "material",
    "requestedQty",
    "priceMap"
  ]
}