> 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 Única (v3)

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

Devuelve la factura para el `companyUid`, `supplierId` e `invoiceId` especificados en formato JSON.

Puede encontrar el `companyUid` y `supplierId` en los siguientes endpoints de Megaport:

- `companyUid` se devuelve en el endpoint de Lista de Productos GET `/v2/products` o en el endpoint de Claves API GET `/v2/auth/apikeys`.
    
- `supplierId` es el "firstPartyId" devuelto en el endpoint de Mercados de Facturación GET `/v2/market` para el proveedor relevante.
    

**Nota:** Se devuelve un error 401 si el usuario no tiene permisos de Finanzas en la empresa especificada. Para más información, consulte [Administración de Roles de Usuario](https://docs.megaport.com/portal-admin/user-management/roles/).

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

## 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

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

## Response

### 200

Factura Única (v3) / Factura Única (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": "Puerto 1 MEGAPORT recurrente",
        "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": "Puerto 2 MEGAPUERTO recurrente",
        "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": "Factura encontrada 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()
```