> For the complete documentation index, see [llms.txt](https://doc.cess.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/storage_handler/cancel_purchase_action.md).

# Cancel Purchase Action

After a buyer locks a commission, if he wants to cancel the purchase during the lock-in period, he can call this transaction. The locked cess will then be returned to the buyer's wallet free balance.

```rust
/// Cancels a purchase action during the lock-in period and returns the locked funds to the buyer's wallet.
///
/// After a buyer locks a commission, they can call this transaction to cancel the purchase 
/// during the lock-in period. The locked funds will then be returned to the buyer's free balance.
///
/// # Arguments
///
/// * `token` - A reference to a string slice that holds the authentication token.
///
/// # Returns
///
/// This function returns a `Result` which is:
/// * `Ok((TxHash, CancelPurchaseAction))` - A tuple containing the transaction hash and the `CancelPurchaseAction` struct.
/// * `Err(Box<dyn std::error::Error>)` - An error if the transaction fails.
///
pub async fn cancel_purchase_action(
    &self,
    token: &str,
) -> Result<(TxHash, CancelPurchaseAction), Box<dyn std::error::Error>> 
```
