//native
type SageIntacct = {
token: string
}
/**
* Resume contract schedules
* Resumes a contract schedule releases the hold effective as of the resume date and allows the open periods to be available for posting or invoicing.
*/
export async function main(
auth: SageIntacct,
body: {
key: string
contractLineKeys: string
asOfDate: string
memo: string
resumeBilling: false | true
resumeRevenue: false | true
resumeExpense: false | true
revenueAdjustmentType?: 'template' | 'oneTime' | 'distributed' | 'walkForward'
}
) {
const url = new URL(
`https://api.intacct.com/ia/api/v1/workflows/contracts/contract/resume-schedules`
)
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.token
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 235 days ago