# NFT - Get invoice infos (GET)

## REQUEST

The query is an HTTP <mark style="color:blue;">**GET**</mark> request where your provided api key will be used as an http header.

{% tabs %}
{% tab title="END POINT" %}

<https://usdc.nonstopay.net/api/client-invoice-info/get/>
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="HEADERS" %}
API-KEY (Use the api key we’ve sent to you here).
{% endtab %}

{% tab title="Example" %}
“API-KEY: 0d8d8e89a6cdcd”
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="QUERY PARAMS" %}

<table><thead><tr><th width="205">Parameter name</th><th width="126">Example</th><th>Info</th></tr></thead><tbody><tr><td>id</td><td>185</td><td>The invoice ID sent through the callback</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## RESPONSE

Our service will return a <mark style="color:yellow;">**JSON**</mark> object.

<details>

<summary>For errors</summary>

* 50001 : API-KEY required
* 50002 : id required
* 50007 : invalid API-KEY
* 50010 : No IP is linked to your account. Please enter them in your profile page and API block
* 50011 : This invoice belongs to another merchant

</details>

#### Example :&#x20;

```json
{ “errorCode”: 50002, “errorMessage” : “id required” }
```

<details>

<summary>On a success response</summary>

* 0 :&#x20;
  * "merchant\_id": "1",

    "invoice\_id": "1689",

    "data":

    { "status": "invoice:paid", "id": 1736, "devise": "USD", "amount": 5, "description": "Payment of the invoice has been made successfully", "callbackJson": null, "fiat\_amount": 409.71, "fiat\_currency": "INR", "totalAmount": 4, “totalCurrency” : “USDC”, "datetime": "2023-04-12 19:09:48" }

</details>

#### Example :&#x20;

```json
{"errorCode": 0,"merchant_id": "1", "invoice_id": "1689","data": {"status": "invoice:paid","id":
1736,"devise": "USDC","amount": 5,"description": "Payment of the invoice has been made
successfully","callbackJson": null,"fiat_amount": 409.71,"fiat_currency": "INR","totalAmount":
4,“totalCurrency” : “USDC”,"datetime": "2023-04-12 19:09:48"}}
```

***

## SAMPLE REQUEST CODE

```php
<?php
    // First, please install the php-curl-class library through composer
    // git repository: https://github.com/php-curl-class/php-curl-class
    // Installation: composer require php-curl-class/php-curl-class
    require __DIR__ . '/vendor/autoload.php';
    
    use Curl\Curl;
    
    $API_KEY = ''; // Your API-KEY (We sent it to you)
    
    // URL to get an invoice status (IP-restricted call)
    $url = 'https://usdc.nonstopay.net/api/invoice/status/';
    /*
    * Data to POST
    */
    $data = [
     'id' => 185
    ];
    
    $curl = new Curl();
    $curl->setHeader('Content-Type', 'application/json');
    $curl->setHeader('API-KEY', $API_KEY);
    $curl->post($url, $data);
    if ($curl->error) {
        echo 'Error: ' . $curl->errorMessage . "\n";
    } else {
        echo 'Data server received via POST:' . "\n";
        if( $curl->response->errorCode == 0 ){
            var_dump( $curl->response);
             /*
             Response example :
             {
             “errorCode”:0,
             “merchant_id”: 1,
             “invoice_id”:185,
             “data”:
             ‘{
             "status":"invoice:paid",
            "id":185,
            "devise":"USDC",
            "amount":100,
            "description":"Payment of the invoice has been made
            successfully",",
             "callbackJson":null,
            "fiat_amount":100,
            "fiat_currency":"USD",
            "datetime":"2023-04-16 10:51:22"
             }’
             }
             */
        }else{
            var_dump( $curl->response);
             /*
             Response example :
             {“errorCode”:50007, “errorMessage”: “invalid API-KEY”}
             */
        }
    }

```


---

# 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://docs.nonstopay.net/payin-nft-api-documentation/ii-how-to-use-the-api/nft-get-invoice-infos-get.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.
