# HivelocityApi.InvoiceApi

All URIs are relative to *https://localhost/api/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
[**getInvoiceIdDetails**](InvoiceApi.md#getInvoiceIdDetails) | **GET** /invoice/{invoiceId}/details | Return detailed information for an invoice
[**getInvoiceIdResource**](InvoiceApi.md#getInvoiceIdResource) | **GET** /invoice/{invoiceId} | Return serialized data on a single invoice
[**getInvoicePdfResource**](InvoiceApi.md#getInvoicePdfResource) | **GET** /invoice/{invoiceId}/pdf-download | Return an Invoice PDF file in Base64 Encoded Format
[**getInvoiceResource**](InvoiceApi.md#getInvoiceResource) | **GET** /invoice/ | Return serialized data on all invoices
[**getInvoiceSearchResource**](InvoiceApi.md#getInvoiceSearchResource) | **GET** /invoice/search | Return results of invoice search
[**getInvoiceUnpaidResource**](InvoiceApi.md#getInvoiceUnpaidResource) | **GET** /invoice/unpaid | Return total balance of all unpaid invoices


<a name="getInvoiceIdDetails"></a>
# **getInvoiceIdDetails**
> InvoiceDetails getInvoiceIdDetails(invoiceId, opts)

Return detailed information for an invoice

Same data as the PDF file but serialized

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

var apiInstance = new HivelocityApi.InvoiceApi();

var invoiceId = 56; // Number | Invoice database ID

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getInvoiceIdDetails(invoiceId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **invoiceId** | **Number**| Invoice database ID | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**InvoiceDetails**](InvoiceDetails.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getInvoiceIdResource"></a>
# **getInvoiceIdResource**
> Invoice getInvoiceIdResource(invoiceId, opts)

Return serialized data on a single invoice

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

var apiInstance = new HivelocityApi.InvoiceApi();

var invoiceId = 56; // Number | Invoice database ID

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getInvoiceIdResource(invoiceId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **invoiceId** | **Number**| Invoice database ID | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**Invoice**](Invoice.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getInvoicePdfResource"></a>
# **getInvoicePdfResource**
> InvoicePDF getInvoicePdfResource(invoiceId, opts)

Return an Invoice PDF file in Base64 Encoded Format

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

var apiInstance = new HivelocityApi.InvoiceApi();

var invoiceId = 56; // Number | Invoice database ID

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getInvoicePdfResource(invoiceId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **invoiceId** | **Number**| Invoice database ID | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**InvoicePDF**](InvoicePDF.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getInvoiceResource"></a>
# **getInvoiceResource**
> [Invoice] getInvoiceResource(opts)

Return serialized data on all invoices

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

var apiInstance = new HivelocityApi.InvoiceApi();

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getInvoiceResource(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**[Invoice]**](Invoice.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getInvoiceSearchResource"></a>
# **getInvoiceSearchResource**
> InvoiceSeachResult getInvoiceSearchResource(opts)

Return results of invoice search

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

var apiInstance = new HivelocityApi.InvoiceApi();

var opts = { 
  'endDate': 56, // Number | The end date range
  'startDate': 56, // Number | The start date range
  'perPage': 10, // Number | Number of items per page.
  'page': 1, // Number | The page number of search.
  'q': "q_example", // String | Content search.
  'xFields': "xFields_example" // String | An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getInvoiceSearchResource(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **endDate** | **Number**| The end date range | [optional] 
 **startDate** | **Number**| The start date range | [optional] 
 **perPage** | **Number**| Number of items per page. | [optional] [default to 10]
 **page** | **Number**| The page number of search. | [optional] [default to 1]
 **q** | **String**| Content search. | [optional] 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**InvoiceSeachResult**](InvoiceSeachResult.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="getInvoiceUnpaidResource"></a>
# **getInvoiceUnpaidResource**
> InvoiceUnpaid getInvoiceUnpaidResource(opts)

Return total balance of all unpaid invoices

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

var apiInstance = new HivelocityApi.InvoiceApi();

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getInvoiceUnpaidResource(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**InvoiceUnpaid**](InvoiceUnpaid.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

