Skip to content

Drawdowns

The drawdown process is best suited for situations where you don’t know how many milestones you will need to do not know up front what the expected costs will be. For example a construction project with multiple phases.

List drawdowns for a transaction

A list of drawdowns can be retrieved by using the transaction query.

query transaction {
transaction(id: "4XTwDsioZZZFeOKKr5blO") {
id
drawdowns {
id
title
description
value
state
}
}
}

Create a drawdown

Drawdown requests are created after a transaction has been created and follows a similar process to milestones. The transaction should have the workflow field set to DRAWDOWN.

mutation drawdownCreate {
drawdownCreate(input: {
transactionId: "4XTwDsioZZZFeOKKr5blO"
title: "Title of the drawdown request"
description: "Description of the drawdown request"
value: 10000
}) {
id
state
}
}

Initiate a drawdown request

When drawdown is ready to be requested the drawdownRequest mutation should be called

mutation drawdownRequest {
drawdownRequest(id: "5Mbe7xDUoUdryvN4HNjhdm") {
state
}
}

Accept a drawdown

After a drawdown is requested it can be accepted using the drawdownApprove mutation. Once accepted value associated with the drawdown will be paid out to the seller.

mutation drawdownApprove {
drawdownApprove(id: "5Mbe7xDUoUdryvN4HNjhdm") {
state
}
}

Reject a drawdown

After a drawdown is requested it can be rejected using the drawdownDecline mutation.

mutation drawdownDecline {
drawdownDecline(id: "5Mbe7xDUoUdryvN4HNjhdm") {
state
}
}

Delete a drawdown

If a drawdown has been created but drawdownRequest has not yet been called. The drawdownDelete mutation can be used to remove the drawdown.

mutation drawdownDelete {
drawdownDelete(id: "5Mbe7xDUoUdryvN4HNjhdm") {
state
}
}