> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# List account invoices

GET https://api.postman.com/accounts/{accountId}/invoices

Gets all invoices for a Postman billing account filtered by the status of the invoice.

Reference: https://learning.postman.com/api-docs/api-reference/billing/get-account-invoices

## Authentication

- `x-api-key` header (required)

## Servers

- `https://api.postman.com` (https://api.postman.com, default)
- `https://api.eu.postman.com` (https://api.eu.postman.com)

## Request

### Path parameters

- `accountId` (string, required) — The account's ID.

### Query parameters

- `status` (enum, required) — The account's status.
  - Allowed values: `PAID`

## Response

### 200

Successful Response

- `data` (list of object, required) — A list of account invoices.
  - `id` (string, optional) — The invoice's ID.
  - `status` (string, optional) — The invoice's status.
  - `issuedAt` (date, optional) — The date on which the invoice was issued.
  - `totalAmount` (object, optional) — Information about the invoice's total billed amount.
    - `value` (integer, optional) — The amount billed.
    - `currency` (string, optional) — The currency of the billed amount. Currently only supports the `USD` value.
  - `links` (object, optional) — A [JSON API spec](https://jsonapi.org/format/#document-links) object containing hypermedia links.
    - `web` (object, optional) — An object containing web-based account references.
      - `href` (string, optional) — A URL where you can download the invoice in PDF and view details.

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "inv_7UDSYBJPGQU93N7M",
      "status": "PAID",
      "issuedAt": "2023-10-12",
      "totalAmount": {
        "value": 440,
        "currency": "USD"
      },
      "links": {
        "web": {
          "href": "https://pay.postman.com/invoices/pay?invoice_public_id=inv_7UDSYBJPGQU93N7M"
        }
      }
    }
  ]
}
```

**SDK Code**

```python Successful Response
import requests

url = "https://api.postman.com/accounts/123456/invoices"

querystring = {"status":"PAID"}

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Successful Response
const url = 'https://api.postman.com/accounts/123456/invoices?status=PAID';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Successful Response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/accounts/123456/invoices?status=PAID"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Successful Response
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/accounts/123456/invoices?status=PAID")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Successful Response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.postman.com/accounts/123456/invoices?status=PAID")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Successful Response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.postman.com/accounts/123456/invoices?status=PAID', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.postman.com/accounts/123456/invoices?status=PAID");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Successful Response
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/accounts/123456/invoices?status=PAID")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```