# Delete unpaid transaction

Something terrible goes wrong and you want to delete an unpaid transaction, here is how to it, Chief  😉

<mark style="color:green;">`POST`</mark> `https://live.chimoney.io/api/v0.1/account/delete-unpaid-transaction`

Delete an unpaid transaction

#### Headers

| Name                                        | Type                        | Description |
| ------------------------------------------- | --------------------------- | ----------- |
| X-API-Key<mark style="color:red;">\*</mark> | API\_KEY\_FROM\_DEV\_PORTAL |             |

#### Request Body

| Name                                     | Type             | Description |
| ---------------------------------------- | ---------------- | ----------- |
| chiRef<mark style="color:red;">\*</mark> | chiRef to delete |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // success
}
```

{% endtab %}
{% endtabs %}

### <mark style="color:purple;">**#Javascript FETCH**</mark>

```javascript
var myHeaders = new Headers();
myHeaders.append("X-API-Key", "API_KEY_FROM_DEV_PORTAL");

var raw = "{\n    \"chiRef\": \"chiRef to delete\"\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://live.chimoney.io/api/v0.1/account/delete-unpaid-transaction", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

### <mark style="color:purple;">**#Python REQUESTS**</mark>

```python
import requests

url = "https://live.chimoney.io/api/v0.1/account/delete-unpaid-transaction"

payload = "{\n    \"chiRef\": \"chiRef to delete\"\n}"
headers = {
  'X-API-Key': 'API_KEY_FROM_DEV_PORTAL'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

### <mark style="color:purple;">**#PHP cURL**</mark>

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://live.chimoney.io/api/v0.1/account/delete-unpaid-transaction',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "chiRef": "chiRef to delete"
}',
  CURLOPT_HTTPHEADER => array(
    'X-API-Key: API_KEY_FROM_DEV_PORTAL'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% hint style="success" %}
Yay! It's done.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chimoney.gitbook.io/chimoney/api-docs/account/delete-unpaid-transaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
