Skip to content

Import a schedule of values with its billing history into an empty draft

POST
/pay-apps/{id}/schedule-import
curl --request POST \
--url https://app.buildworkpro.com/api/v1/pay-apps/1/schedule-import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "rows": [ { "itemNumber": "example", "description": "example", "scheduledValue": 1, "isChangeOrder": true, "previousApplications": 1, "thisPeriod": 1, "materialsStored": 1 } ], "sheetMode": "sent", "applicationNumber": 1, "retainagePercent": 1, "source": "paste", "periodStart": "example", "periodEnd": "example", "useSheetContract": true, "comparedWithSheet": true }'

Loads a whole schedule of values, with what has been billed so far, into a pay application in one request, for a job that is being brought in part-way through billing. Three conditions must hold or the answer is 409: the pay application is a draft, it has no line items, and it is the only pay application on its project (voided ones do not count). A project that already has approved change orders takes no import. sheetMode says what the rows are: “sent” is the last application already sent (previous becomes previous + this period + stored, and this period starts at zero), “current” is the application being billed now (columns kept as given). A change-order row beside at least one base row becomes an approved change order, which also needs the change_orders:write and change_orders:approve scopes. Change-order rows are refused with 409 when the project already has change orders. If the project already has an original contract value that differs from the sheet’s base lines, the answer is 409 with code contract_mismatch, projectContract and sheetContract, until useSheetContract is true; sending useSheetContract: true also needs the projects:write scope, because it can replace the project’s original contract value. A missing scope is answered 403 with each one named, and nothing is written. Everything is written or nothing is. Requires pay_apps:write.

id
required
integer
Idempotency-Key
string format: uuid
<= 255 characters

Idempotent retry key for mutating operations. The first request with a given key executes normally and BuildWorkPro caches the response. Replaying the same key with the same request body (method + path + JSON body, SHA-256 hashed) returns the cached response without re-executing the mutation. Replaying with a DIFFERENT body returns 409 idempotency_key_reused. The cache TTL is 24 hours; after expiry the key is treated as a new operation. Keys are tenant-scoped. Recommended: a fresh UUID v4 per logical operation.

Media type application/json
object
rows
required
Array<object>
>= 1 items <= 250 items
object
itemNumber
required
string
>= 1 characters <= 20 characters
description
required
string
>= 1 characters <= 500 characters
scheduledValue
required
number
>= -9999999999.99 <= 9999999999.99
isChangeOrder
required
boolean
previousApplications
required
number | null
>= -9999999999.99 <= 9999999999.99
thisPeriod
number | null
>= -9999999999.99 <= 9999999999.99
materialsStored
number | null
>= -9999999999.99 <= 9999999999.99
sheetMode
required
string
Allowed values: sent current
applicationNumber
required
integer
>= 1 <= 99
retainagePercent
required
number
<= 100
source
required
string
Allowed values: paste upload read
periodStart
string
periodEnd
string
useSheetContract
boolean
comparedWithSheet
boolean

Imported

Media type application/json
object
data
required
object
payAppId
required
integer
payAppNumber
required

The draft’s number after the import, in the project’s own format.

string
lineItemCount
required
integer
changeOrderIds
required

The approved change orders the import created, one per change-order row.

Array<integer>
contractAnchor
required

The project’s original contract value, when this import wrote it. Null when it was left alone.

object
from
required

The project’s original contract before the import, or null when it had none.

string | null
to
required
string
replaced
required

True when an existing value was replaced because useSheetContract was true.

boolean
meta
required
object
request_id

Server-generated request identifier

string
pagination
object
cursor
required

Opaque cursor for the next page; null when no more results

string | null
has_more
required

Whether more pages are available after this one

boolean
count
required

Items in this page

integer
Example generated
{
"data": {
"payAppId": 1,
"payAppNumber": "example",
"lineItemCount": 1,
"changeOrderIds": [
1
],
"contractAnchor": {
"from": "example",
"to": "example",
"replaced": true
}
},
"meta": {
"request_id": "example",
"pagination": {
"cursor": "example",
"has_more": true,
"count": 1
}
}
}

Error

Media type application/problem+json
object
type
required

URL identifying the problem type

string format: uri
title
required

Short human-readable summary

string
status
required

HTTP status code

integer
detail

Human-readable explanation

string
request_id

Server-generated request identifier

string
errors

Validation error array (422 only)

Array<object>
object
field
required

Field path that failed validation

string
code
required

Validation error code

string
message
required

Human-readable validation message

string
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}

Error

Media type application/problem+json
object
type
required

URL identifying the problem type

string format: uri
title
required

Short human-readable summary

string
status
required

HTTP status code

integer
detail

Human-readable explanation

string
request_id

Server-generated request identifier

string
errors

Validation error array (422 only)

Array<object>
object
field
required

Field path that failed validation

string
code
required

Validation error code

string
message
required

Human-readable validation message

string
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}

Error

Media type application/problem+json
object
type
required

URL identifying the problem type

string format: uri
title
required

Short human-readable summary

string
status
required

HTTP status code

integer
detail

Human-readable explanation

string
request_id

Server-generated request identifier

string
errors

Validation error array (422 only)

Array<object>
object
field
required

Field path that failed validation

string
code
required

Validation error code

string
message
required

Human-readable validation message

string
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}

Error

Media type application/problem+json
object
type
required

URL identifying the problem type

string format: uri
title
required

Short human-readable summary

string
status
required

HTTP status code

integer
detail

Human-readable explanation

string
request_id

Server-generated request identifier

string
errors

Validation error array (422 only)

Array<object>
object
field
required

Field path that failed validation

string
code
required

Validation error code

string
message
required

Human-readable validation message

string
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}