//native
type SageIntacct = {
token: string
}
/**
* Hold contract schedules
* Placing a contract schedule on hold temporarily pauses the revenue, billing, or expense schedule. This action sets the status of the schedule and its entries to onHold.
*/
export async function main(
auth: SageIntacct,
body: {
key: string
contractLineKeys: string
asOfDate: string
memo: string
holdBilling: false | true
holdRevenue: false | true
holdExpense: false | true
}
) {
const url = new URL(
`https://api.intacct.com/ia/api/v1/workflows/contracts/contract/hold-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