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

# Factura Individual (v2)

GET https://api.megaport.com/v2/company/${companyId}/invoice/${invoiceId}

Devuelve la factura para el `companyId` e `invoiceId` especificados en formato JSON.

Utilice el endpoint Detalles de la Empresa `/v2/company/companyUid` para encontrar el `companyId`.

Reference: https://es.megaport.ferndocs.com/es/api-reference/invoices/single-invoice-v-2

## Servers

- `https://api.megaport.com` (Entorno de producción, default)
- `https://api-staging.megaport.com` (Entorno de pruebas (solo pruebas, se restablece cada 24 horas))

## Request

### Path parameters

- `companyId` (string, required)
- `invoiceId` (string, required)

## Response

### 200

Factura Única (v2) / Factura Única (v2)

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

## Types

### V2CompanyCompanyIdInvoiceInvoiceIdGetResponsesContentApplicationJsonSchemaData

- `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 V2CompanyCompanyIdInvoiceInvoiceIdGetResponsesContentApplicationJsonSchemaDataLineItemsItems, 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)

### V2CompanyCompanyIdInvoiceInvoiceIdGetResponsesContentApplicationJsonSchemaDataLineItemsItems

- `billableCode` (string, optional)
- `chargePeriod` (V2CompanyCompanyIdInvoiceInvoiceIdGetResponsesContentApplicationJsonSchemaDataLineItemsItemsChargePeriod, 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)

### V2CompanyCompanyIdInvoiceInvoiceIdGetResponsesContentApplicationJsonSchemaDataLineItemsItemsChargePeriod

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

## Examples

**Response**

```json
{
  "data": {
    "companyId": "49768",
    "companyName": "InnovoEdge",
    "consumerId": "49768",
    "createDate": 1704153600000,
    "currencyEnum": "USD",
    "dueAmount": 0,
    "dueDate": 1706745600000,
    "grandTotal": 4331.21,
    "invoiceId": 199152,
    "invoiceNumber": "USA00049464",
    "lineItemTotal": 3803.23,
    "lineItems": [
      {
        "billableCode": "Port",
        "chargePeriod": {
          "end": 1706659200000,
          "start": 1704067200000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/01/2024 to 31/01/2024",
        "description": "prueba-tac-puerto-socio-sub MEGAPORT recurrente",
        "end": 1706659200000,
        "managedAccountReference": "10128",
        "nominalDueDate": 0,
        "productName": "tac-test-port-partner-sub",
        "productUid": "1d925af8-3ac1-46b1-85f0-3c6f4381cf7f",
        "promocode": "",
        "rateLimit": "",
        "shortProductUid": "1d925af8",
        "size": "",
        "speed": "1000",
        "start": 1704067200000,
        "tax": 34.69,
        "taxRate": 0.064,
        "unitPrice": 540
      },
      {
        "billableCode": "Port",
        "chargePeriod": {
          "end": 1706659200000,
          "start": 1704067200000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/01/2024 to 31/01/2024",
        "description": "puerto-de-prueba-tac-para-administrado-desde-raíz MEGAPORT recurrente",
        "end": 1706659200000,
        "managedAccountReference": "10128",
        "nominalDueDate": 0,
        "productName": "tac-test-port-for-managed-from-root",
        "productUid": "8982eac0-b2f3-4bfe-8862-f74013b7e1e5",
        "promocode": "",
        "rateLimit": "",
        "shortProductUid": "8982eac0",
        "size": "",
        "speed": "1000",
        "start": 1704067200000,
        "tax": 37.04,
        "taxRate": 0.082,
        "unitPrice": 450
      },
      {
        "billableCode": "MCR",
        "chargePeriod": {
          "end": 1703980800000,
          "start": 1701388800000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/12/2023 to 31/12/2023",
        "description": "135415 tac-test-mcr-child-1 (pospago)",
        "end": 1703980800000,
        "managedAccountReference": "10128",
        "nominalDueDate": 0,
        "productName": "tac-test-mcr-child-1",
        "productUid": "08639167-b07f-408b-beda-a6eb1ca87a50",
        "promocode": "",
        "rateLimit": "",
        "shortProductUid": "08639167",
        "size": "",
        "speed": "1000",
        "start": 1701388800000,
        "tax": 2.16,
        "taxRate": 0.004,
        "unitPrice": 540
      },
      {
        "billableCode": "VXC",
        "chargePeriod": {
          "end": 1703980800000,
          "start": 1674259200000
        },
        "chargeType": "",
        "chargedFromTo": "From 21/01/2023 to 31/12/2023",
        "description": "146050 tac-test-vxc-service-key-TravCo2 (postpago)",
        "end": 1703980800000,
        "managedAccountReference": "12",
        "nominalDueDate": 0,
        "productName": "tac-test-vxc-service-key-TravCo2",
        "productUid": "52795ab6-9ba4-4035-bb48-b818fc3ca78a",
        "promocode": "",
        "rateLimit": "13",
        "shortProductUid": "52795ab6",
        "size": "",
        "speed": "",
        "start": 1674259200000,
        "tax": 35.67,
        "taxRate": 0.5004,
        "unitPrice": 129.25
      },
      {
        "billableCode": "MCR",
        "chargePeriod": {
          "end": 1703980800000,
          "start": 1701388800000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/12/2023 to 31/12/2023",
        "description": "135421 tac-test-mcr-child-2 (pospago)",
        "end": 1703980800000,
        "managedAccountReference": "12",
        "nominalDueDate": 0,
        "productName": "tac-test-mcr-child-2",
        "productUid": "801b2b69-82b2-4453-9e3f-bb1cb2c02be9",
        "promocode": "",
        "rateLimit": "",
        "shortProductUid": "801b2b69",
        "size": "",
        "speed": "1000",
        "start": 1701388800000,
        "tax": 48.79,
        "taxRate": 0.09,
        "unitPrice": 540
      },
      {
        "billableCode": "VXC",
        "chargePeriod": {
          "end": 1703980800000,
          "start": 1701388800000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/12/2023 to 31/12/2023",
        "description": "146406 tac-test-vxc-service-key-partner-root (postpago)",
        "end": 1703980800000,
        "managedAccountReference": "",
        "nominalDueDate": 0,
        "productName": "tac-test-vxc-service-key-partner-root",
        "productUid": "a69d851d-d5f9-44b8-a02a-c47fcd8e58f1",
        "promocode": "",
        "rateLimit": "100",
        "shortProductUid": "a69d851d",
        "size": "",
        "speed": "",
        "start": 1701388800000,
        "tax": 30.6,
        "taxRate": 0.4179,
        "unitPrice": 139
      },
      {
        "billableCode": "MCR",
        "chargePeriod": {
          "end": 1703980800000,
          "start": 1701388800000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/12/2023 to 31/12/2023",
        "description": "135407 tac-prueba-mcr-socio-raíz (postpago)",
        "end": 1703980800000,
        "managedAccountReference": "",
        "nominalDueDate": 0,
        "productName": "tac-test-mcr-partner-root",
        "productUid": "4edfa0b0-062b-428d-8b37-04da13bcc7cd",
        "promocode": "",
        "rateLimit": "",
        "shortProductUid": "4edfa0b0",
        "size": "",
        "speed": "1000",
        "start": 1701388800000,
        "tax": 46.89,
        "taxRate": 0.0865,
        "unitPrice": 540
      },
      {
        "billableCode": "VXC",
        "chargePeriod": {
          "end": 1703980800000,
          "start": 1701388800000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/12/2023 to 31/12/2023",
        "description": "146408 tac-test-vxc-sk-single-1 (postpago)",
        "end": 1703980800000,
        "managedAccountReference": "",
        "nominalDueDate": 0,
        "productName": "tac-test-vxc-sk-single-1",
        "productUid": "17278e21-0cad-4c73-ac8c-7f2ba9a50534",
        "promocode": "",
        "rateLimit": "446",
        "shortProductUid": "17278e21",
        "size": "",
        "speed": "",
        "start": 1701388800000,
        "tax": 60.28,
        "taxRate": 0.4179,
        "unitPrice": 273.94
      },
      {
        "billableCode": "VXC",
        "chargePeriod": {
          "end": 1703980800000,
          "start": 1701388800000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/12/2023 to 31/12/2023",
        "description": "164739 pb-vxc-prueba-nueva (pospago)",
        "end": 1703980800000,
        "managedAccountReference": "",
        "nominalDueDate": 0,
        "productName": "pb-vxc-test-new",
        "productUid": "79e0b484-9366-46b4-9b62-fa10d8f6d372",
        "promocode": "",
        "rateLimit": "50",
        "shortProductUid": "79e0b484",
        "size": "",
        "speed": "",
        "start": 1701388800000,
        "tax": 64.05,
        "taxRate": 0.4179,
        "unitPrice": 291.04
      },
      {
        "billableCode": "VXC",
        "chargePeriod": {
          "end": 1703980800000,
          "start": 1701388800000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/12/2023 to 31/12/2023",
        "description": "165474 pb-prueba-nueva-aprobaciónN (postpago)",
        "end": 1703980800000,
        "managedAccountReference": "",
        "nominalDueDate": 0,
        "productName": "pb-test-new-approvalN",
        "productUid": "d025aed2-1834-4b04-8391-1e0a59b316a2",
        "promocode": "",
        "rateLimit": "50",
        "shortProductUid": "d025aed2",
        "size": "",
        "speed": "",
        "start": 1701388800000,
        "tax": 49.85,
        "taxRate": 0.4879,
        "unitPrice": 112
      },
      {
        "billableCode": "VXC",
        "chargePeriod": {
          "end": 1703980800000,
          "start": 1701388800000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/12/2023 to 31/12/2023",
        "description": "146494 tac-test-vxc-multi-2 (postpago)",
        "end": 1703980800000,
        "managedAccountReference": "",
        "nominalDueDate": 0,
        "productName": "tac-test-vxc-multi-2",
        "productUid": "78295309-5d69-4516-ac44-616777d1b75c",
        "promocode": "",
        "rateLimit": "100",
        "shortProductUid": "78295309",
        "size": "",
        "speed": "",
        "start": 1701388800000,
        "tax": 58.98,
        "taxRate": 0.5279,
        "unitPrice": 124
      },
      {
        "billableCode": "VXC",
        "chargePeriod": {
          "end": 1703980800000,
          "start": 1701388800000
        },
        "chargeType": "",
        "chargedFromTo": "From 1/12/2023 to 31/12/2023",
        "description": "146495 tac-test-vxc-multi-3 (pospago)",
        "end": 1703980800000,
        "managedAccountReference": "",
        "nominalDueDate": 0,
        "productName": "tac-test-vxc-multi-3",
        "productUid": "0f44faa9-7b02-4cf8-b18c-e882c13060b3",
        "promocode": "",
        "rateLimit": "100",
        "shortProductUid": "0f44faa9",
        "size": "",
        "speed": "",
        "start": 1701388800000,
        "tax": 58.98,
        "taxRate": 0.5279,
        "unitPrice": 124
      }
    ],
    "marketCurrencyEnum": "USD",
    "marketGrandTotal": 4331.21,
    "marketLineItemTotal": 3803.23,
    "marketTaxTotal": 527.98,
    "mixedCurrency": false,
    "previousInvoiceDate": 0,
    "previousInvoiceId": 0,
    "supplierId": "1558",
    "taxRate": 0,
    "taxTotal": 527.98
  },
  "message": "Factura encontrada USA00049464",
  "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/v2/company/$companyId/invoice/$invoiceId"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.megaport.com/v2/company/$companyId/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/v2/company/$companyId/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/v2/company/$companyId/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/v2/company/$companyId/invoice/$invoiceId")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.megaport.com/v2/company/$companyId/invoice/$invoiceId');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.megaport.com/v2/company/$companyId/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/v2/company/$companyId/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()
```