fillBidCostLinesFromSources
Requires permission biddesk:cost_sheet:edit.
Fills item lines of a draft cost sheet from the organization's own cost data (last purchase, average, standard), each with its evidence and recorded rate: the given lines, else every missing or stale item line. A MANUAL line is never overwritten. Returns how many lines were written and why each other was skipped. Refused with COST_SHEET_LOCKED when the sheet is not a draft, VERSION_CONFLICT when it changed first. Needs permission to view costs. Requires Bid Desk and permission to edit cost sheets.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation FillBidCostLinesFromSources($input: FillBidCostLinesInput!) {
fillBidCostLinesFromSources(input: $input) {
updatedCount
skipped {
lineId
reason
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation FillBidCostLinesFromSources($input: FillBidCostLinesInput!) {\n fillBidCostLinesFromSources(input: $input) {\n updatedCount\n skipped {\n lineId\n reason\n }\n }\n}",
"variables": {
"input": {
"costSheetId": "id",
"expectedVersion": 0
}
}
}
EOF
Variables:
{
"input": {
"costSheetId": "id",
"expectedVersion": 0
}
}
Response:
{
"data": {
"fillBidCostLinesFromSources": {
"updatedCount": 0,
"skipped": [
{
"lineId": "id",
"reason": "string"
}
]
}
}
}
fillBidCostLinesFromSources(
input: FillBidCostLinesInput!
): BidCostFillResult!
Arguments
fillBidCostLinesFromSources.input ● FillBidCostLinesInput! non-null input
The draft sheet, its version and optionally the lines.
Type
BidCostFillResult object
What filling a draft cost sheet from cost sources did: how many lines it wrote, and each line it skipped with why.