Import a schedule of values with its billing history into an empty draft
const url = 'https://app.buildworkpro.com/api/v1/pay-apps/1/schedule-import';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Header Parameters
Section titled “ Header Parameters ”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.
Request Body
Section titled “ Request Body ”object
object
Responses
Section titled “ Responses ”Imported
object
object
The draft’s number after the import, in the project’s own format.
The approved change orders the import created, one per change-order row.
The project’s original contract value, when this import wrote it. Null when it was left alone.
object
The project’s original contract before the import, or null when it had none.
True when an existing value was replaced because useSheetContract was true.
object
Server-generated request identifier
object
Opaque cursor for the next page; null when no more results
Whether more pages are available after this one
Items in this page
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
object
URL identifying the problem type
Short human-readable summary
HTTP status code
Human-readable explanation
Server-generated request identifier
Validation error array (422 only)
object
Field path that failed validation
Validation error code
Human-readable validation message
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}Error
object
URL identifying the problem type
Short human-readable summary
HTTP status code
Human-readable explanation
Server-generated request identifier
Validation error array (422 only)
object
Field path that failed validation
Validation error code
Human-readable validation message
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}Error
object
URL identifying the problem type
Short human-readable summary
HTTP status code
Human-readable explanation
Server-generated request identifier
Validation error array (422 only)
object
Field path that failed validation
Validation error code
Human-readable validation message
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}Error
object
URL identifying the problem type
Short human-readable summary
HTTP status code
Human-readable explanation
Server-generated request identifier
Validation error array (422 only)
object
Field path that failed validation
Validation error code
Human-readable validation message
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}