# Retrieve Single Invoice

<mark style="color:green;">`GET`</mark> `/invoice/{identifier}`

Get detailed information for a specific invoice by its identifier.

{% hint style="warning" %}
The **identifier** should be an **id** or **uuid**
{% endhint %}

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| X-API-KEY    | `<token>`          |

**Response**

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

```json
{
    "id": 0,
    "uuid": "string",
    "currency": "string",
    "tx_hash": "string",
    "address": "string",
    "amount": 0,
    "amount_usd": 0,
    "received_amount": 0,
    "received_amount_usd": 0,
    "label": "string",
    "postback_url": "https://example.com/postback",
    "success_url": "https://example.com/success",
    "fail_url": "https://example.com/fail",
    "created_at": "2019-08-24T14:15:22Z",
    "expires_at": "2019-08-24T14:15:22Z",
    "status": "paid"
  }
```

{% endtab %}

{% tab title="400" %}

```json
{
    "detail": "Invalid identifier format. Must be an integer ID or a valid UUID4"
}
```

{% endtab %}

{% tab title="404" %}

```json
{
    "detail": "Invoice does not exist"
}
```

{% endtab %}

{% tab title="422" %}

```json
{
    "detail": [
        {
            "loc": [],
            "msg": "string",
            "type": "string"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

**Example**

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

```bash
curl -X GET "https://api.nord-pay.com/invoice/your-invoice-id-or-uuid" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: YOUR_API_KEY"
```

{% endtab %}

{% tab title="Python (requests)" %}

```python
import requests

def get_invoice(identifier):
    url = f"https://api.nord-pay.com/invoice/{identifier}"
    headers = {
        "Content-Type": "application/json",
        "X-API-KEY": "YOUR_API_KEY"
    }
    resp = requests.get(url, headers=headers)
    resp.raise_for_status()
    return resp.json()

# usage:
invoice = get_invoice("your-invoice-id-or-uuid")
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
function getInvoice(string $identifier): array {
    $ch = curl_init("https://api.nord-pay.com/invoice/{$identifier}");
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER     => [
            "Content-Type: application/json",
            "X-API-KEY: YOUR_API_KEY"
        ],
    ]);
    $response = curl_exec($ch);
    curl_close($ch);
    return json_decode($response, true);
}

// usage:
$invoice = getInvoice("your-invoice-id-or-uuid");
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
async function loadInvoice(identifier) {
  const response = await fetch(`https://api.nord-pay.com/invoice/${identifier}`, {
    method: "GET",
    headers: {
      "Content-Type": "application/json",
      "X-API-KEY": "YOUR_API_KEY"
    }
  });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json();
}

// usage:
loadInvoice("your-invoice-id-or-uuid").then(invoice => {
  // work with invoice
});
```

{% endtab %}

{% tab title="Node.js (axios)" %}

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

async function getInvoice(identifier) {
  const { data } = await axios.get(
    `https://api.nord-pay.com/invoice/${identifier}`, 
    { headers: {
        'Content-Type': 'application/json',
        'X-API-KEY': 'YOUR_API_KEY'
      }
    }
  );
  return data;
}

// usage:
getInvoice("your-invoice-id-or-uuid").then(invoice => {
  // work with invoice
});
```

{% endtab %}
{% endtabs %}
