# DELETE:: Deletar uma cobrança imediata

## Endpoint de request

```
https://sandbox.agilspotpay.financehub.com.br/pix/v1/collection/immediate/{transactionId}
```

## Exemplo com as principais linguagem

Retorno em JSON com os dados do cadastro.

{% tabs %}
{% tab title="cPHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://sandbox.agilspotpay.financehub.com.br/pix/v1/collection/immediate/{transactionId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => [
    "accept: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}

{% tab title="cURL" %}

```shell
curl --request DELETE \
     --url https://sandbox.agilspotpay.financehub.com.br/pix/v1/collection/immediate/{transactionId} \
     --header 'accept: application/json'
```

{% endtab %}

{% tab title="NodeJs Axios" %}

```jsx
const axios = require('axios');

const options = {
  method: 'DELETE',
  url: 'https://sandbox.agilspotpay.financehub.com.br/pix/v1/collection/immediate/{transactionId}',
  headers: {accept: 'application/json'}
};

axios
  .request(options)
  .then(function (response) {
    console.log(response.data);
  })
  .catch(function (error) {
    console.error(error);
  });
```

{% endtab %}
{% endtabs %}

## **Modelo de retorno&#x20;**<mark style="color:green;">**200 OK**</mark>

```json
{
  "transactionId": 45854857,
  "status": 200,
  "message": "success"
}
```

## **Modelo de retorno&#x20;**<mark style="color:red;">**400 Error**</mark>

```json
400 - Value Cannot Be Null. (Parameter 'Source')
{
  "errorCode": "DE001",
  "description": "Value cannot be null. (Parameter 'source')"
}
```


---

# 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://agilspot-pay.gitbook.io/api-finance-hub/api-de-pix/cobranca-imediata-cob/delete-deletar-uma-cobranca-imediata.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.
