# GET:: Buscar dados de 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 => "GET",
  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 GET \
     --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: 'GET',
  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": 9189382,
  "status": "ACTIVE",
  "lastUpdate": "2022-03-21T14:27:58.2106288+00:00",
  "payerQuestion": null,
  "additionalInformation": null,
  "debtor": {
    "name": "Fulano de Tal",
    "cpf": null,
    "cnpj": "61360961000100",
    "city": "Barueri",
    "publicArea": "Avenida Brasil",
    "state": "SP",
    "postalCode": "01202003",
    "email": "contato@agilspotpay.com.br"
  },
  "amount": {
    "original": 15.63,
    "discount": {
      "discountDateFixed": [
        {
          "date": "2022-03-21T00:00:00",
          "amountPerc": "1.00"
        }
      ],
      "modality": "FIXED_VALUE_UNTIL_THE_DATES_INFORMED"
    },
    "abatement": null,
    "fine": null,
    "interest": null
  },
  "key": "testepix@agilspotpay.com.br",
  "receiver": {
    "name": "João da Silva",
    "cpf": null,
    "cnpj": "60904237000129",
    "postalCode": "01202003",
    "city": "Barueri",
    "publicArea": "Avenida Brasil",
    "state": "SP",
    "fantasyName": "Nome de Comercial"
  },
  "calendar": {
    "expirationAfterPayment": "10",
    "createdAt": "0001-01-01T00:00:00",
    "dueDate": "2022-03-22T00:00:00"
  },
  "createAt": "2022-03-21T14:27:58.2106288+00:00",
  "clientRequestId": "9b26edb7cf254db09f5449c94bf13abc",
  "transactionIdentification": "kk6g232xel65a0daee4dd13kk9189382",
  "transactionIdPayment": 0
}
```

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

```json
400 - Não Foi Possível Localizar A Cobrança
{
  "message": "Não foi possível localizar a cobrança associada ao parâmetro informado.",
  "errorCode": "VL002"
}
```
