Skip to main content

Cancel Contract

Cancel a contract that hasn't been paid yet.

When a contract can be cancelled
Only contracts in Approved status can be cancelled. After a successful cancellation, the status changes to Cancelled.

When cancellation is rejected

  • The contract is in any other status, for example Escrow, Released, Completed, or already Cancelled.
  • The buyer has started a bank transfer and processed Done (you received bank_transfer.buyer_acknowledged). The money may already be on its way, so the contract can't be cancelled.

To cancel a contract, call the following endpoint:

Endpoint POST {{BaseUrl}}/apps/api/contracts/cancel Curl:

curl --location '{{BaseUrl}}/apps/api/contracts/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--data '{
"contractId": "CNT-2601-00100002",
"reason": "Wrong order"
}'
FieldTypeRequiredDescription
contractIdstringYesThe contract ID returned by Create Contract.
reasonstringYesWhy the contract is being cancelled.

Response

{
"data": {
"contractId": "CNT-2601-00100002",
"status": "Cancelled"
},
"message": "ExternalContractCancelledSuccessfully",
"status": 200,
"validationErrors": []
}
HTTPMessageCause
404ReasonRequiredNo reason is provided in request
404ContractNotFoundNo contract with this ID
409ContractAlreadyCancelledContract is already cancelled
409CanNotCancelContractContract status doesn't allow cancellation
400ContractCancelPaymentInProgressContract has a payment in progress

After cancellation​

The contract status changes to Cancelled, and WePay sends the contract.cancelled webhook. See Webhook Notifications.