

# ListInvoiceUnits
<a name="API_invoicing_ListInvoiceUnits"></a>

This fetches a list of all invoice unit definitions for a given account, as of the provided `AsOf` date.

## Request Syntax
<a name="API_invoicing_ListInvoiceUnits_RequestSyntax"></a>

```
{
   "AsOf": number,
   "Filters": { 
      "Accounts": [ "string" ],
      "BillSourceAccounts": [ "string" ],
      "InvoiceReceivers": [ "string" ],
      "Names": [ "string" ]
   },
   "MaxResults": number,
   "NextToken": "string"
}
```

## Request Parameters
<a name="API_invoicing_ListInvoiceUnits_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [AsOf](#API_invoicing_ListInvoiceUnits_RequestSyntax) **   <a name="awscostmanagement-invoicing_ListInvoiceUnits-request-AsOf"></a>
 The state of an invoice unit at a specified time. You can see legacy invoice units that are currently deleted if the `AsOf` time is set to before it was deleted. If an `AsOf` is not provided, the default value is the current time.   
Type: Timestamp  
Required: No

 ** [Filters](#API_invoicing_ListInvoiceUnits_RequestSyntax) **   <a name="awscostmanagement-invoicing_ListInvoiceUnits-request-Filters"></a>
 An optional input to the list API. If multiple filters are specified, the returned list will be a configuration that match all of the provided filters. Supported filter types are `InvoiceReceivers`, `Names`, and `Accounts`.   
Type: [Filters](API_invoicing_Filters.md) object  
Required: No

 ** [MaxResults](#API_invoicing_ListInvoiceUnits_RequestSyntax) **   <a name="awscostmanagement-invoicing_ListInvoiceUnits-request-MaxResults"></a>
The maximum number of invoice units that can be returned.   
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 500.  
Required: No

 ** [NextToken](#API_invoicing_ListInvoiceUnits_RequestSyntax) **   <a name="awscostmanagement-invoicing_ListInvoiceUnits-request-NextToken"></a>
The next token used to indicate where the returned list should start from.   
Type: String  
Length Constraints: Minimum length of 1.  
Pattern: `[\S\s]*`   
Required: No

## Response Syntax
<a name="API_invoicing_ListInvoiceUnits_ResponseSyntax"></a>

```
{
   "InvoiceUnits": [ 
      { 
         "Description": "string",
         "InvoiceReceiver": "string",
         "InvoiceUnitArn": "string",
         "LastModified": number,
         "Name": "string",
         "Rule": { 
            "BillSourceAccounts": [ "string" ],
            "LinkedAccounts": [ "string" ]
         },
         "TaxInheritanceDisabled": boolean
      }
   ],
   "NextToken": "string"
}
```

## Response Elements
<a name="API_invoicing_ListInvoiceUnits_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [InvoiceUnits](#API_invoicing_ListInvoiceUnits_ResponseSyntax) **   <a name="awscostmanagement-invoicing_ListInvoiceUnits-response-InvoiceUnits"></a>
 An invoice unit is a set of mutually exclusive accounts that correspond to your business entity.   
Type: Array of [InvoiceUnit](API_invoicing_InvoiceUnit.md) objects

 ** [NextToken](#API_invoicing_ListInvoiceUnits_ResponseSyntax) **   <a name="awscostmanagement-invoicing_ListInvoiceUnits-response-NextToken"></a>
The next token used to indicate where the returned list should start from.   
Type: String  
Length Constraints: Minimum length of 1.  
Pattern: `[\S\s]*` 

## Errors
<a name="API_invoicing_ListInvoiceUnits_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient access to perform this action.    
 ** resourceName **   
You don't have sufficient access to perform this action. 
HTTP Status Code: 400

 ** InternalServerException **   
The processing request failed because of an unknown error, exception, or failure.     
 ** retryAfterSeconds **   
The processing request failed because of an unknown error, exception, or failure.
HTTP Status Code: 500

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 400

 ** ValidationException **   
 The input fails to satisfy the constraints specified by an AWS service.     
 ** fieldList **   
 The input fails to satisfy the constraints specified by an AWS service.   
 ** reason **   
You don't have sufficient access to perform this action.   
 ** resourceName **   
You don't have sufficient access to perform this action. 
HTTP Status Code: 400

## See Also
<a name="API_invoicing_ListInvoiceUnits_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/invoicing-2024-12-01/ListInvoiceUnits) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/invoicing-2024-12-01/ListInvoiceUnits) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/invoicing-2024-12-01/ListInvoiceUnits) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/invoicing-2024-12-01/ListInvoiceUnits) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/invoicing-2024-12-01/ListInvoiceUnits) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/invoicing-2024-12-01/ListInvoiceUnits) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/invoicing-2024-12-01/ListInvoiceUnits) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/invoicing-2024-12-01/ListInvoiceUnits) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/invoicing-2024-12-01/ListInvoiceUnits) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/invoicing-2024-12-01/ListInvoiceUnits) 