> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://en.megaport.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://en.megaport.ferndocs.com/_mcp/server.

# Single Invoice (v3)

GET https://api.megaport.com/v3/company/{companyUid}/supplier/{supplierId}/invoice/{invoiceid}

Returns the invoice for the specified `companyUid`, `supplierId`, and `invoiceId` in JSON format.

You can find the `companyUid` and `supplierId` from the following Megaport endpoints:

- `companyUid` is returned in the GET Product List `/v2/products` endpoint or the GET API Keys `/v2/auth/apikeys` endpoint.
    
- `supplierId` is the "firstPartyId" returned in the GET Billing Markets `/v2/market` endpoint for the relevant supplier.
    

**Note:** A 401 error is returned if the user does not have Finance permissions in the specified company. For more information, see [Managing User Roles](https://docs.megaport.com/portal-admin/user-management/roles/).

Reference: https://en.megaport.ferndocs.com/api-reference/invoices/single-invoice-v-3

## Servers

- `https://api.megaport.com` (Production environment, default)
- `https://api-staging.megaport.com` (Staging environment (test only, reset every 24 hours))

## Request

### Path parameters

- `companyUid` (string, required)
- `supplierId` (string, required)
- `invoiceid` (string, required)

## Response

### 200

Single Invoice (v3) / Single Invoice (v3)

- `data` (V3CompanyCompanyUidSupplierSupplierIdInvoiceInvoiceidGetResponsesContentApplicationJsonSchemaData, optional)
- `message` (string, optional)
- `terms` (string, optional)

## Types

### V3CompanyCompanyUidSupplierSupplierIdInvoiceInvoiceidGetResponsesContentApplicationJsonSchemaData

- `companyId` (string, optional)
- `companyName` (string, optional)
- `consumerId` (string, optional)
- `createDate` (double, optional)
- `currencyEnum` (string, optional)
- `dueAmount` (double, optional)
- `dueDate` (double, optional)
- `grandTotal` (double, optional)
- `invoiceId` (double, optional)
- `invoiceNumber` (string, optional)
- `lineItemTotal` (double, optional)
- `lineItems` (list of V3CompanyCompanyUidSupplierSupplierIdInvoiceInvoiceidGetResponsesContentApplicationJsonSchemaDataLineItemsItems, optional)
- `marketCurrencyEnum` (string, optional)
- `marketGrandTotal` (double, optional)
- `marketLineItemTotal` (double, optional)
- `marketTaxTotal` (double, optional)
- `mixedCurrency` (boolean, optional)
- `previousInvoiceDate` (double, optional)
- `previousInvoiceId` (double, optional)
- `supplierId` (string, optional)
- `taxRate` (double, optional)
- `taxTotal` (double, optional)

### V3CompanyCompanyUidSupplierSupplierIdInvoiceInvoiceidGetResponsesContentApplicationJsonSchemaDataLineItemsItems

- `billableCode` (string, optional)
- `chargePeriod` (V3CompanyCompanyUidSupplierSupplierIdInvoiceInvoiceidGetResponsesContentApplicationJsonSchemaDataLineItemsItemsChargePeriod, optional)
- `chargeType` (string, optional)
- `chargedFromTo` (string, optional)
- `description` (string, optional)
- `end` (double, optional)
- `managedAccountReference` (string, optional)
- `nominalDueDate` (double, optional)
- `productName` (string, optional)
- `productUid` (string, optional)
- `promocode` (string, optional)
- `rateLimit` (string, optional)
- `shortProductUid` (string, optional)
- `size` (string, optional)
- `speed` (string, optional)
- `start` (double, optional)
- `tax` (double, optional)
- `taxRate` (double, optional)
- `unitPrice` (double, optional)

### V3CompanyCompanyUidSupplierSupplierIdInvoiceInvoiceidGetResponsesContentApplicationJsonSchemaDataLineItemsItemsChargePeriod

- `end` (double, optional)
- `start` (double, optional)

## Examples

**Response**

```json
{
  "data": {
    "companyId": "1",
    "companyName": "Netflix",
    "consumerId": "1",
    "createDate": 1698796800000,
    "currencyEnum": "AUD",
    "dueAmount": 0,
    "dueDate": 1701388800000,
    "grandTotal": 2420,
    "invoiceId": 1,
    "invoiceNumber": "AUS00012345",
    "lineItemTotal": 2200,
    "lineItems": [
      {
        "billableCode": "Port",
        "chargePeriod": {
          "end": 1701302400000,
          "start": 1698796800000
        },
        "chargeType": "",
        "chargedFromTo": "From 11/1/2023 to 11/30/2023",
        "description": "Port 1 MEGAPORT recurring",
        "end": 1701302400000,
        "managedAccountReference": "",
        "nominalDueDate": 0,
        "productName": "",
        "productUid": "",
        "promocode": "",
        "rateLimit": "",
        "shortProductUid": "1234abcd",
        "size": "",
        "speed": "",
        "start": 1698796800000,
        "tax": 110,
        "taxRate": 0.1,
        "unitPrice": 1100
      },
      {
        "billableCode": "Port",
        "chargePeriod": {
          "end": 1701302400000,
          "start": 1698796800000
        },
        "chargeType": "",
        "chargedFromTo": "From 11/1/2023 to 11/30/2023",
        "description": "Port 2 MEGAPORT recurring",
        "end": 1701302400000,
        "managedAccountReference": "",
        "nominalDueDate": 0,
        "productName": "",
        "productUid": "",
        "promocode": "",
        "rateLimit": "",
        "shortProductUid": "abcd1234",
        "size": "",
        "speed": "",
        "start": 1698796800000,
        "tax": 110,
        "taxRate": 0.1,
        "unitPrice": 1100
      }
    ],
    "marketCurrencyEnum": "AUD",
    "marketGrandTotal": 2420,
    "marketLineItemTotal": 2200,
    "marketTaxTotal": 220,
    "mixedCurrency": false,
    "previousInvoiceDate": 1696291200000,
    "previousInvoiceId": 2,
    "supplierId": "808",
    "taxRate": 0.1,
    "taxTotal": 220
  },
  "message": "Found invoice AUS00012345",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python
import requests

url = "https://api.megaport.com/v3/company/companyUid/supplier/supplierId/invoice/invoiceid"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.megaport.com/v3/company/companyUid/supplier/supplierId/invoice/invoiceid';
const options = {method: 'GET'};

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

```go
package main

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

func main() {

	url := "https://api.megaport.com/v3/company/companyUid/supplier/supplierId/invoice/invoiceid"

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

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

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

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

}
```

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

url = URI("https://api.megaport.com/v3/company/companyUid/supplier/supplierId/invoice/invoiceid")

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

request = Net::HTTP::Get.new(url)

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

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

HttpResponse<String> response = Unirest.get("https://api.megaport.com/v3/company/companyUid/supplier/supplierId/invoice/invoiceid")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.megaport.com/v3/company/companyUid/supplier/supplierId/invoice/invoiceid');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/company/companyUid/supplier/supplierId/invoice/invoiceid");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/company/companyUid/supplier/supplierId/invoice/invoiceid")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```