Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/
package org.openapitools.client.api;
import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.Headers;
import org.openapitools.client.model.ListQueryParams;
import org.openapitools.client.model.GetByIdQueryParams;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.math.BigDecimal;
import org.openapitools.client.model.CreditMemo;
import org.openapitools.client.model.ErrorResponse;
import org.openapitools.client.model.Invoice;
import org.openapitools.client.model.InvoiceCreateRequest;
import org.openapitools.client.model.InvoiceItemListResponse;
import org.openapitools.client.model.InvoiceListResponse;
import org.openapitools.client.model.InvoicePatchRequest;
import org.openapitools.client.model.InvoiceReverseRequest;
import org.openapitools.client.model.PayInvoiceRequest;
import org.openapitools.client.model.WriteOffRequest;
import org.openapitools.client.model.ErrorResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class InvoicesApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public InvoicesApi() {
this(Configuration.getDefaultApiClient());
}
public InvoicesApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
private okhttp3.Call cancelInvoiceCall(String invoiceId, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/invoices/{invoice_id}/cancel"
.replace("{" + "invoice_id" + "}", localVarApiClient.escapeString(invoiceId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (fields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields));
}
if (invoiceFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice.fields[]", invoiceFields));
}
if (invoiceItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_items.fields[]", invoiceItemsFields));
}
if (taxationItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "taxation_items.fields[]", taxationItemsFields));
}
if (accountFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields));
}
if (billToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields));
}
if (lineItemFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "line_item.fields[]", lineItemFields));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call cancelInvoiceValidateBeforeCall(String invoiceId, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'invoiceId' is set
if (invoiceId == null) {
throw new ApiException("Missing the required parameter 'invoiceId' when calling cancelInvoice(Async)");
}
return cancelInvoiceCall(invoiceId, fields, invoiceFields, invoiceItemsFields, taxationItemsFields, accountFields, billToFields, lineItemFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse cancelInvoiceWithHttpInfo(String invoiceId, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = cancelInvoiceValidateBeforeCall(invoiceId, fields, invoiceFields, invoiceItemsFields, taxationItemsFields, accountFields, billToFields, lineItemFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call cancelInvoiceAsync(String invoiceId, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = cancelInvoiceValidateBeforeCall(invoiceId, fields, invoiceFields, invoiceItemsFields, taxationItemsFields, accountFields, billToFields, lineItemFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public static class CancelInvoiceParams {
private final String invoiceId;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private List fields;
private List invoiceFields;
private List invoiceItemsFields;
private List taxationItemsFields;
private List accountFields;
private List billToFields;
private List lineItemFields;
private List expand;
private List filter;
private Integer pageSize;
private String zuoraTrackId;
private Boolean async;
private Boolean zuoraCacheEnabled;
private String zuoraEntityIds;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraOrgIds;
public CancelInvoiceParams(String invoiceId) {
this.invoiceId = invoiceId;
}
/**
* Set getByIdQueryParams
* @param getByIdQueryParams GetByIdQueryParams
* @return CancelInvoiceParams
*/
public CancelInvoiceParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) {
this.getByIdQueryParams = getByIdQueryParams;
if (expand != null) {
this.expand = getByIdQueryParams.getExpand();
}
if (filter != null) {
this.filter = getByIdQueryParams.getFilter();
}
if (pageSize != null) {
this.pageSize = getByIdQueryParams.getPageSize();
}
return this;
}
/**
* Set headers
* @param headers Headers
* @return CancelInvoiceParams
*/
public CancelInvoiceParams headers(Headers headers) {
this.headers = headers;
if (headers.getZuoraTrackId() != null) {
this.zuoraTrackId = headers.getZuoraTrackId();
}
if (headers.getAsync() != null) {
this.async = headers.getAsync();
}
if (headers.getZuoraCacheEnabled() != null) {
this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
}
if (headers.getZuoraEntityIds() != null) {
this.zuoraEntityIds = headers.getZuoraEntityIds();
}
if (headers.getIdempotencyKey() != null) {
this.idempotencyKey = headers.getIdempotencyKey();
}
if (headers.getAcceptEncoding() != null) {
this.acceptEncoding = headers.getAcceptEncoding();
}
if (headers.getContentEncoding() != null) {
this.contentEncoding = headers.getContentEncoding();
}
if (headers.getZuoraOrgIds() != null) {
this.zuoraOrgIds = headers.getZuoraOrgIds();
}
return this;
}
/**
* Set fields
* @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `state`, `balance`, `due_date`, `invoice_number`, `posted_by_id`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `paid`, `past_due`, `document_date`, `amount_paid`, `amount_refunded`, `payment_terms`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return CancelInvoiceParams
*/
public CancelInvoiceParams fields(List fields) {
this.fields = fields;
return this;
}
/**
* Set invoiceFields
* @param invoiceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `state`, `balance`, `due_date`, `invoice_number`, `posted_by_id`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `paid`, `past_due`, `document_date`, `amount_paid`, `amount_refunded`, `payment_terms`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return CancelInvoiceParams
*/
public CancelInvoiceParams invoiceFields(List invoiceFields) {
this.invoiceFields = invoiceFields;
return this;
}
/**
* Set invoiceItemsFields
* @param invoiceItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `booking_reference`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `invoice_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `accounting_code`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `document_item_date` </details> (optional)
* @return CancelInvoiceParams
*/
public CancelInvoiceParams invoiceItemsFields(List invoiceItemsFields) {
this.invoiceItemsFields = invoiceItemsFields;
return this;
}
/**
* Set taxationItemsFields
* @param taxationItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `amount_exempt`, `tax_date`, `jurisdiction`, `location_code`, `name`, `sales_tax_payable_account`, `tax_code`, `tax_code_name`, `tax_rate`, `tax_rate_name`, `tax_inclusive`, `tax_rate_type`, `amount_credited`, `amount_paid`, `remaining_balance` </details> (optional)
* @return CancelInvoiceParams
*/
public CancelInvoiceParams taxationItemsFields(List taxationItemsFields) {
this.taxationItemsFields = taxationItemsFields;
return this;
}
/**
* Set accountFields
* @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional)
* @return CancelInvoiceParams
*/
public CancelInvoiceParams accountFields(List accountFields) {
this.accountFields = accountFields;
return this;
}
/**
* Set billToFields
* @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional)
* @return CancelInvoiceParams
*/
public CancelInvoiceParams billToFields(List billToFields) {
this.billToFields = billToFields;
return this;
}
/**
* Set lineItemFields
* @param lineItemFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `total`, `subtotal`, `quantity_fulfilled`, `quantity_pending_fulfillment`, `unit_of_measure`, `accounting_code`, `adjustment_liability_account`, `unit_amount`, `target_date`, `billing_rule`, `contract_asset_account`, `contract_liability_account`, `description`, `discount_total`, `revenue`, `discount_unit_amount`, `discount_percent`, `category`, `name`, `item_number`, `type`, `list_price`, `list_unit_price`, `original_order_date`, `original_order_id`, `original_order_line_item_id`, `original_order_line_item_number`, `original_order_number`, `product_code`, `price_id`, `purchase_order_number`, `quantity`, `quantity_available_for_return`, `related_subscription_number`, `requires_fulfillment`, `sold_to_id`, `original_sold_to_id`, `tax_code`, `tax_inclusive`, `end_date`, `start_date`, `unbilled_receivables_account`, `state`, `order_id` </details> (optional)
* @return CancelInvoiceParams
*/
public CancelInvoiceParams lineItemFields(List lineItemFields) {
this.lineItemFields = lineItemFields;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional)
* @return CancelInvoiceParams
*/
public CancelInvoiceParams expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional)
* @return CancelInvoiceParams
*/
public CancelInvoiceParams filter(List filter) {
this.filter = filter;
return this;
}
/**
* Set pageSize
* @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional)
* @return CancelInvoiceParams
*/
public CancelInvoiceParams pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
}
/**
* Cancel an invoice
* Cancels an invoice. Only the invoice with the `draft` status can be canceled.
* @param invoiceId Identifier for the invoices, either `invoice_number` or `invoice_id` (required)
* @return Invoice
* @http.response.details
Status Code
Description
Response Headers
200
Default Response
-
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public CancelInvoiceParams cancelInvoiceParams(String invoiceId) {
return new CancelInvoiceParams(invoiceId);
}
public Invoice cancelInvoice(String invoiceId) throws ApiException {
CancelInvoiceParams params = new CancelInvoiceParams(invoiceId);
return executeCancelInvoiceAPICall(params).getData();
}
/**
* Expose HTTP info
public ApiResponse cancelInvoiceWithHttpInfo(String invoiceId) throws ApiException {
CancelInvoiceParams params = new CancelInvoiceParams(invoiceId);
return executeCancelInvoiceAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
public Invoice cancelInvoice( String invoiceId , List expand) throws ApiException {
CancelInvoiceParams params = new CancelInvoiceParams(invoiceId);
params.expand(expand);
return executeCancelInvoiceAPICall(params).getData();
}
/*
* add header methods
*/
public Invoice cancelInvoice(String invoiceId ,List expand,Headers headers) throws ApiException {
CancelInvoiceParams params = new CancelInvoiceParams(invoiceId)
.expand(expand)
.headers(headers);
return executeCancelInvoiceAPICall(params).getData();
}
/**
* Cancel an invoice
* Cancels an invoice. Only the invoice with the `draft` status can be canceled.
* @param params CancelInvoiceParams
* @return Invoice
* @http.response.details
Status Code
Description
Response Headers
200
Default Response
-
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public Invoice cancel(CancelInvoiceParams params) throws ApiException {
return executeCancelInvoiceAPICall(params).getData();
}
public ApiResponse cancelWithHttpInfo(CancelInvoiceParams params) throws ApiException {
return executeCancelInvoiceAPICall(params);
}
ApiResponse executeCancelInvoiceAPICall(CancelInvoiceParams params) throws ApiException {
return cancelInvoiceWithHttpInfo(params.invoiceId, params.fields, params.invoiceFields, params.invoiceItemsFields, params.taxationItemsFields, params.accountFields, params.billToFields, params.lineItemFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds);
}
private okhttp3.Call createInvoiceCall(InvoiceCreateRequest invoiceCreateRequest, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = invoiceCreateRequest;
// create path and map variables
String localVarPath = "/invoices";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (fields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields));
}
if (invoiceFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice.fields[]", invoiceFields));
}
if (invoiceItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_items.fields[]", invoiceItemsFields));
}
if (taxationItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "taxation_items.fields[]", taxationItemsFields));
}
if (accountFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields));
}
if (billToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields));
}
if (lineItemFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "line_item.fields[]", lineItemFields));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createInvoiceValidateBeforeCall(InvoiceCreateRequest invoiceCreateRequest, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'invoiceCreateRequest' is set
if (invoiceCreateRequest == null) {
throw new ApiException("Missing the required parameter 'invoiceCreateRequest' when calling createInvoice(Async)");
}
return createInvoiceCall(invoiceCreateRequest, fields, invoiceFields, invoiceItemsFields, taxationItemsFields, accountFields, billToFields, lineItemFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse createInvoiceWithHttpInfo(InvoiceCreateRequest invoiceCreateRequest, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = createInvoiceValidateBeforeCall(invoiceCreateRequest, fields, invoiceFields, invoiceItemsFields, taxationItemsFields, accountFields, billToFields, lineItemFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call createInvoiceAsync(InvoiceCreateRequest invoiceCreateRequest, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createInvoiceValidateBeforeCall(invoiceCreateRequest, fields, invoiceFields, invoiceItemsFields, taxationItemsFields, accountFields, billToFields, lineItemFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public static class CreateInvoiceParams {
private final InvoiceCreateRequest invoiceCreateRequest;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private List fields;
private List invoiceFields;
private List invoiceItemsFields;
private List taxationItemsFields;
private List accountFields;
private List billToFields;
private List lineItemFields;
private List expand;
private List filter;
private Integer pageSize;
private String zuoraTrackId;
private Boolean async;
private Boolean zuoraCacheEnabled;
private String zuoraEntityIds;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraOrgIds;
public CreateInvoiceParams(InvoiceCreateRequest invoiceCreateRequest) {
this.invoiceCreateRequest = invoiceCreateRequest;
}
/**
* Set getByIdQueryParams
* @param getByIdQueryParams GetByIdQueryParams
* @return CreateInvoiceParams
*/
public CreateInvoiceParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) {
this.getByIdQueryParams = getByIdQueryParams;
if (expand != null) {
this.expand = getByIdQueryParams.getExpand();
}
if (filter != null) {
this.filter = getByIdQueryParams.getFilter();
}
if (pageSize != null) {
this.pageSize = getByIdQueryParams.getPageSize();
}
return this;
}
/**
* Set headers
* @param headers Headers
* @return CreateInvoiceParams
*/
public CreateInvoiceParams headers(Headers headers) {
this.headers = headers;
if (headers.getZuoraTrackId() != null) {
this.zuoraTrackId = headers.getZuoraTrackId();
}
if (headers.getAsync() != null) {
this.async = headers.getAsync();
}
if (headers.getZuoraCacheEnabled() != null) {
this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
}
if (headers.getZuoraEntityIds() != null) {
this.zuoraEntityIds = headers.getZuoraEntityIds();
}
if (headers.getIdempotencyKey() != null) {
this.idempotencyKey = headers.getIdempotencyKey();
}
if (headers.getAcceptEncoding() != null) {
this.acceptEncoding = headers.getAcceptEncoding();
}
if (headers.getContentEncoding() != null) {
this.contentEncoding = headers.getContentEncoding();
}
if (headers.getZuoraOrgIds() != null) {
this.zuoraOrgIds = headers.getZuoraOrgIds();
}
return this;
}
/**
* Set fields
* @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `state`, `balance`, `due_date`, `invoice_number`, `posted_by_id`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `paid`, `past_due`, `document_date`, `amount_paid`, `amount_refunded`, `payment_terms`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return CreateInvoiceParams
*/
public CreateInvoiceParams fields(List fields) {
this.fields = fields;
return this;
}
/**
* Set invoiceFields
* @param invoiceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `state`, `balance`, `due_date`, `invoice_number`, `posted_by_id`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `paid`, `past_due`, `document_date`, `amount_paid`, `amount_refunded`, `payment_terms`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return CreateInvoiceParams
*/
public CreateInvoiceParams invoiceFields(List invoiceFields) {
this.invoiceFields = invoiceFields;
return this;
}
/**
* Set invoiceItemsFields
* @param invoiceItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `booking_reference`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `invoice_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `accounting_code`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `document_item_date` </details> (optional)
* @return CreateInvoiceParams
*/
public CreateInvoiceParams invoiceItemsFields(List invoiceItemsFields) {
this.invoiceItemsFields = invoiceItemsFields;
return this;
}
/**
* Set taxationItemsFields
* @param taxationItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `amount_exempt`, `tax_date`, `jurisdiction`, `location_code`, `name`, `sales_tax_payable_account`, `tax_code`, `tax_code_name`, `tax_rate`, `tax_rate_name`, `tax_inclusive`, `tax_rate_type`, `amount_credited`, `amount_paid`, `remaining_balance` </details> (optional)
* @return CreateInvoiceParams
*/
public CreateInvoiceParams taxationItemsFields(List taxationItemsFields) {
this.taxationItemsFields = taxationItemsFields;
return this;
}
/**
* Set accountFields
* @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional)
* @return CreateInvoiceParams
*/
public CreateInvoiceParams accountFields(List accountFields) {
this.accountFields = accountFields;
return this;
}
/**
* Set billToFields
* @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional)
* @return CreateInvoiceParams
*/
public CreateInvoiceParams billToFields(List billToFields) {
this.billToFields = billToFields;
return this;
}
/**
* Set lineItemFields
* @param lineItemFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `total`, `subtotal`, `quantity_fulfilled`, `quantity_pending_fulfillment`, `unit_of_measure`, `accounting_code`, `adjustment_liability_account`, `unit_amount`, `target_date`, `billing_rule`, `contract_asset_account`, `contract_liability_account`, `description`, `discount_total`, `revenue`, `discount_unit_amount`, `discount_percent`, `category`, `name`, `item_number`, `type`, `list_price`, `list_unit_price`, `original_order_date`, `original_order_id`, `original_order_line_item_id`, `original_order_line_item_number`, `original_order_number`, `product_code`, `price_id`, `purchase_order_number`, `quantity`, `quantity_available_for_return`, `related_subscription_number`, `requires_fulfillment`, `sold_to_id`, `original_sold_to_id`, `tax_code`, `tax_inclusive`, `end_date`, `start_date`, `unbilled_receivables_account`, `state`, `order_id` </details> (optional)
* @return CreateInvoiceParams
*/
public CreateInvoiceParams lineItemFields(List lineItemFields) {
this.lineItemFields = lineItemFields;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional)
* @return CreateInvoiceParams
*/
public CreateInvoiceParams expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional)
* @return CreateInvoiceParams
*/
public CreateInvoiceParams filter(List filter) {
this.filter = filter;
return this;
}
/**
* Set pageSize
* @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional)
* @return CreateInvoiceParams
*/
public CreateInvoiceParams pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
}
/**
* Create an invoice
* Creates an invoice for a subscription.
* @param invoiceCreateRequest (required)
* @return Invoice
* @http.response.details
Status Code
Description
Response Headers
201
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public CreateInvoiceParams createInvoiceParams(InvoiceCreateRequest invoiceCreateRequest) {
return new CreateInvoiceParams(invoiceCreateRequest);
}
public Invoice createInvoice(InvoiceCreateRequest invoiceCreateRequest) throws ApiException {
CreateInvoiceParams params = new CreateInvoiceParams(invoiceCreateRequest);
return executeCreateInvoiceAPICall(params).getData();
}
/**
* Expose HTTP info
public ApiResponse createInvoiceWithHttpInfo(InvoiceCreateRequest invoiceCreateRequest) throws ApiException {
CreateInvoiceParams params = new CreateInvoiceParams(invoiceCreateRequest);
return executeCreateInvoiceAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
public Invoice createInvoice( InvoiceCreateRequest invoiceCreateRequest , List expand) throws ApiException {
CreateInvoiceParams params = new CreateInvoiceParams(invoiceCreateRequest);
params.expand(expand);
return executeCreateInvoiceAPICall(params).getData();
}
/*
* add header methods
*/
public Invoice createInvoice(InvoiceCreateRequest invoiceCreateRequest ,List expand,Headers headers) throws ApiException {
CreateInvoiceParams params = new CreateInvoiceParams(invoiceCreateRequest)
.expand(expand)
.headers(headers);
return executeCreateInvoiceAPICall(params).getData();
}
/**
* Create an invoice
* Creates an invoice for a subscription.
* @param params CreateInvoiceParams
* @return Invoice
* @http.response.details
Status Code
Description
Response Headers
201
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public Invoice create(CreateInvoiceParams params) throws ApiException {
return executeCreateInvoiceAPICall(params).getData();
}
public ApiResponse createWithHttpInfo(CreateInvoiceParams params) throws ApiException {
return executeCreateInvoiceAPICall(params);
}
ApiResponse executeCreateInvoiceAPICall(CreateInvoiceParams params) throws ApiException {
return createInvoiceWithHttpInfo(params.invoiceCreateRequest, params.fields, params.invoiceFields, params.invoiceItemsFields, params.taxationItemsFields, params.accountFields, params.billToFields, params.lineItemFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds);
}
private okhttp3.Call deleteInvoiceCall(String invoiceId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/invoices/{invoice_id}"
.replace("{" + "invoice_id" + "}", localVarApiClient.escapeString(invoiceId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteInvoiceValidateBeforeCall(String invoiceId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'invoiceId' is set
if (invoiceId == null) {
throw new ApiException("Missing the required parameter 'invoiceId' when calling deleteInvoice(Async)");
}
return deleteInvoiceCall(invoiceId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse deleteInvoiceWithHttpInfo(String invoiceId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = deleteInvoiceValidateBeforeCall(invoiceId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
return localVarApiClient.execute(localVarCall);
}
private okhttp3.Call deleteInvoiceAsync(String invoiceId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteInvoiceValidateBeforeCall(invoiceId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
public static class DeleteInvoiceParams {
private final String invoiceId;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private String zuoraTrackId;
private Boolean async;
private Boolean zuoraCacheEnabled;
private String zuoraEntityIds;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraOrgIds;
public DeleteInvoiceParams(String invoiceId) {
this.invoiceId = invoiceId;
}
/**
* Set headers
* @param headers Headers
* @return DeleteInvoiceParams
*/
public DeleteInvoiceParams headers(Headers headers) {
this.headers = headers;
if (headers.getZuoraTrackId() != null) {
this.zuoraTrackId = headers.getZuoraTrackId();
}
if (headers.getAsync() != null) {
this.async = headers.getAsync();
}
if (headers.getZuoraCacheEnabled() != null) {
this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
}
if (headers.getZuoraEntityIds() != null) {
this.zuoraEntityIds = headers.getZuoraEntityIds();
}
if (headers.getIdempotencyKey() != null) {
this.idempotencyKey = headers.getIdempotencyKey();
}
if (headers.getAcceptEncoding() != null) {
this.acceptEncoding = headers.getAcceptEncoding();
}
if (headers.getContentEncoding() != null) {
this.contentEncoding = headers.getContentEncoding();
}
if (headers.getZuoraOrgIds() != null) {
this.zuoraOrgIds = headers.getZuoraOrgIds();
}
return this;
}
}
/**
* Delete an invoice
* Deletes an invoice that has not been canceled.
* @param invoiceId Identifier for the invoices, either `invoice_number` or `invoice_id` (required)
* @return
* @http.response.details
Status Code
Description
Response Headers
204
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public DeleteInvoiceParams deleteInvoiceParams(String invoiceId) {
return new DeleteInvoiceParams(invoiceId);
}
public void deleteInvoice(String invoiceId) throws ApiException {
DeleteInvoiceParams params = new DeleteInvoiceParams(invoiceId);
executeDeleteInvoiceAPICall(params);
}
/**
* Expose HTTP info
public ApiResponse deleteInvoiceWithHttpInfo(String invoiceId) throws ApiException {
DeleteInvoiceParams params = new DeleteInvoiceParams(invoiceId);
return executeDeleteInvoiceAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
/*
* add header methods
*/
public void deleteInvoice(String invoiceId ,Headers headers) throws ApiException {
DeleteInvoiceParams params = new DeleteInvoiceParams(invoiceId)
.headers(headers);
executeDeleteInvoiceAPICall(params);
}
/**
* Delete an invoice
* Deletes an invoice that has not been canceled.
* @param params DeleteInvoiceParams
* @return
* @http.response.details
Status Code
Description
Response Headers
204
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public void delete(DeleteInvoiceParams params) throws ApiException {
executeDeleteInvoiceAPICall(params).getData();
}
public ApiResponse deleteWithHttpInfo(DeleteInvoiceParams params) throws ApiException {
return executeDeleteInvoiceAPICall(params);
}
ApiResponse executeDeleteInvoiceAPICall(DeleteInvoiceParams params) throws ApiException {
return deleteInvoiceWithHttpInfo(params.invoiceId, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds);
}
private okhttp3.Call emailInvoiceCall(String invoiceId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/invoices/{invoice_id}/email"
.replace("{" + "invoice_id" + "}", localVarApiClient.escapeString(invoiceId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call emailInvoiceValidateBeforeCall(String invoiceId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'invoiceId' is set
if (invoiceId == null) {
throw new ApiException("Missing the required parameter 'invoiceId' when calling emailInvoice(Async)");
}
return emailInvoiceCall(invoiceId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse emailInvoiceWithHttpInfo(String invoiceId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = emailInvoiceValidateBeforeCall(invoiceId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
return localVarApiClient.execute(localVarCall);
}
private okhttp3.Call emailInvoiceAsync(String invoiceId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = emailInvoiceValidateBeforeCall(invoiceId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
public static class EmailInvoiceParams {
private final String invoiceId;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private String zuoraTrackId;
private Boolean async;
private Boolean zuoraCacheEnabled;
private String zuoraEntityIds;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraOrgIds;
public EmailInvoiceParams(String invoiceId) {
this.invoiceId = invoiceId;
}
/**
* Set headers
* @param headers Headers
* @return EmailInvoiceParams
*/
public EmailInvoiceParams headers(Headers headers) {
this.headers = headers;
if (headers.getZuoraTrackId() != null) {
this.zuoraTrackId = headers.getZuoraTrackId();
}
if (headers.getAsync() != null) {
this.async = headers.getAsync();
}
if (headers.getZuoraCacheEnabled() != null) {
this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
}
if (headers.getZuoraEntityIds() != null) {
this.zuoraEntityIds = headers.getZuoraEntityIds();
}
if (headers.getIdempotencyKey() != null) {
this.idempotencyKey = headers.getIdempotencyKey();
}
if (headers.getAcceptEncoding() != null) {
this.acceptEncoding = headers.getAcceptEncoding();
}
if (headers.getContentEncoding() != null) {
this.contentEncoding = headers.getContentEncoding();
}
if (headers.getZuoraOrgIds() != null) {
this.zuoraOrgIds = headers.getZuoraOrgIds();
}
return this;
}
}
/**
* Email an invoice
* Emails an email to your customer.
* @param invoiceId Identifier for the invoices, either `invoice_number` or `invoice_id` (required)
* @return
* @http.response.details
Status Code
Description
Response Headers
204
Default Response
-
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public EmailInvoiceParams emailInvoiceParams(String invoiceId) {
return new EmailInvoiceParams(invoiceId);
}
public void emailInvoice(String invoiceId) throws ApiException {
EmailInvoiceParams params = new EmailInvoiceParams(invoiceId);
executeEmailInvoiceAPICall(params);
}
/**
* Expose HTTP info
public ApiResponse emailInvoiceWithHttpInfo(String invoiceId) throws ApiException {
EmailInvoiceParams params = new EmailInvoiceParams(invoiceId);
return executeEmailInvoiceAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
/*
* add header methods
*/
public void emailInvoice(String invoiceId ,Headers headers) throws ApiException {
EmailInvoiceParams params = new EmailInvoiceParams(invoiceId)
.headers(headers);
executeEmailInvoiceAPICall(params);
}
/**
* Email an invoice
* Emails an email to your customer.
* @param params EmailInvoiceParams
* @return
* @http.response.details
Status Code
Description
Response Headers
204
Default Response
-
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public void emailInvoice(EmailInvoiceParams params) throws ApiException {
executeEmailInvoiceAPICall(params).getData();
}
public ApiResponse emailInvoiceWithHttpInfo(EmailInvoiceParams params) throws ApiException {
return executeEmailInvoiceAPICall(params);
}
ApiResponse executeEmailInvoiceAPICall(EmailInvoiceParams params) throws ApiException {
return emailInvoiceWithHttpInfo(params.invoiceId, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds);
}
private okhttp3.Call getInvoiceCall(String invoiceId, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/invoices/{invoice_id}"
.replace("{" + "invoice_id" + "}", localVarApiClient.escapeString(invoiceId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (fields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields));
}
if (invoiceFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice.fields[]", invoiceFields));
}
if (invoiceItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_items.fields[]", invoiceItemsFields));
}
if (taxationItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "taxation_items.fields[]", taxationItemsFields));
}
if (accountFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields));
}
if (billToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields));
}
if (lineItemFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "line_item.fields[]", lineItemFields));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInvoiceValidateBeforeCall(String invoiceId, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'invoiceId' is set
if (invoiceId == null) {
throw new ApiException("Missing the required parameter 'invoiceId' when calling getInvoice(Async)");
}
return getInvoiceCall(invoiceId, fields, invoiceFields, invoiceItemsFields, taxationItemsFields, accountFields, billToFields, lineItemFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse getInvoiceWithHttpInfo(String invoiceId, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getInvoiceValidateBeforeCall(invoiceId, fields, invoiceFields, invoiceItemsFields, taxationItemsFields, accountFields, billToFields, lineItemFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call getInvoiceAsync(String invoiceId, List fields, List invoiceFields, List invoiceItemsFields, List taxationItemsFields, List accountFields, List billToFields, List lineItemFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getInvoiceValidateBeforeCall(invoiceId, fields, invoiceFields, invoiceItemsFields, taxationItemsFields, accountFields, billToFields, lineItemFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public static class GetInvoiceParams {
private final String invoiceId;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private List fields;
private List invoiceFields;
private List invoiceItemsFields;
private List taxationItemsFields;
private List accountFields;
private List billToFields;
private List lineItemFields;
private List expand;
private List filter;
private Integer pageSize;
private String zuoraTrackId;
private Boolean async;
private Boolean zuoraCacheEnabled;
private String zuoraEntityIds;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraOrgIds;
public GetInvoiceParams(String invoiceId) {
this.invoiceId = invoiceId;
}
/**
* Set getByIdQueryParams
* @param getByIdQueryParams GetByIdQueryParams
* @return GetInvoiceParams
*/
public GetInvoiceParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) {
this.getByIdQueryParams = getByIdQueryParams;
if (expand != null) {
this.expand = getByIdQueryParams.getExpand();
}
if (filter != null) {
this.filter = getByIdQueryParams.getFilter();
}
if (pageSize != null) {
this.pageSize = getByIdQueryParams.getPageSize();
}
return this;
}
/**
* Set headers
* @param headers Headers
* @return GetInvoiceParams
*/
public GetInvoiceParams headers(Headers headers) {
this.headers = headers;
if (headers.getZuoraTrackId() != null) {
this.zuoraTrackId = headers.getZuoraTrackId();
}
if (headers.getAsync() != null) {
this.async = headers.getAsync();
}
if (headers.getZuoraCacheEnabled() != null) {
this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
}
if (headers.getZuoraEntityIds() != null) {
this.zuoraEntityIds = headers.getZuoraEntityIds();
}
if (headers.getIdempotencyKey() != null) {
this.idempotencyKey = headers.getIdempotencyKey();
}
if (headers.getAcceptEncoding() != null) {
this.acceptEncoding = headers.getAcceptEncoding();
}
if (headers.getContentEncoding() != null) {
this.contentEncoding = headers.getContentEncoding();
}
if (headers.getZuoraOrgIds() != null) {
this.zuoraOrgIds = headers.getZuoraOrgIds();
}
return this;
}
/**
* Set fields
* @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `state`, `balance`, `due_date`, `invoice_number`, `posted_by_id`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `paid`, `past_due`, `document_date`, `amount_paid`, `amount_refunded`, `payment_terms`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return GetInvoiceParams
*/
public GetInvoiceParams fields(List fields) {
this.fields = fields;
return this;
}
/**
* Set invoiceFields
* @param invoiceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `state`, `balance`, `due_date`, `invoice_number`, `posted_by_id`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `paid`, `past_due`, `document_date`, `amount_paid`, `amount_refunded`, `payment_terms`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return GetInvoiceParams
*/
public GetInvoiceParams invoiceFields(List invoiceFields) {
this.invoiceFields = invoiceFields;
return this;
}
/**
* Set invoiceItemsFields
* @param invoiceItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `booking_reference`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `invoice_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `accounting_code`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `document_item_date` </details> (optional)
* @return GetInvoiceParams
*/
public GetInvoiceParams invoiceItemsFields(List invoiceItemsFields) {
this.invoiceItemsFields = invoiceItemsFields;
return this;
}
/**
* Set taxationItemsFields
* @param taxationItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `amount_exempt`, `tax_date`, `jurisdiction`, `location_code`, `name`, `sales_tax_payable_account`, `tax_code`, `tax_code_name`, `tax_rate`, `tax_rate_name`, `tax_inclusive`, `tax_rate_type`, `amount_credited`, `amount_paid`, `remaining_balance` </details> (optional)
* @return GetInvoiceParams
*/
public GetInvoiceParams taxationItemsFields(List taxationItemsFields) {
this.taxationItemsFields = taxationItemsFields;
return this;
}
/**
* Set accountFields
* @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional)
* @return GetInvoiceParams
*/
public GetInvoiceParams accountFields(List accountFields) {
this.accountFields = accountFields;
return this;
}
/**
* Set billToFields
* @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional)
* @return GetInvoiceParams
*/
public GetInvoiceParams billToFields(List billToFields) {
this.billToFields = billToFields;
return this;
}
/**
* Set lineItemFields
* @param lineItemFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `total`, `subtotal`, `quantity_fulfilled`, `quantity_pending_fulfillment`, `unit_of_measure`, `accounting_code`, `adjustment_liability_account`, `unit_amount`, `target_date`, `billing_rule`, `contract_asset_account`, `contract_liability_account`, `description`, `discount_total`, `revenue`, `discount_unit_amount`, `discount_percent`, `category`, `name`, `item_number`, `type`, `list_price`, `list_unit_price`, `original_order_date`, `original_order_id`, `original_order_line_item_id`, `original_order_line_item_number`, `original_order_number`, `product_code`, `price_id`, `purchase_order_number`, `quantity`, `quantity_available_for_return`, `related_subscription_number`, `requires_fulfillment`, `sold_to_id`, `original_sold_to_id`, `tax_code`, `tax_inclusive`, `end_date`, `start_date`, `unbilled_receivables_account`, `state`, `order_id` </details> (optional)
* @return GetInvoiceParams
*/
public GetInvoiceParams lineItemFields(List lineItemFields) {
this.lineItemFields = lineItemFields;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional)
* @return GetInvoiceParams
*/
public GetInvoiceParams expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional)
* @return GetInvoiceParams
*/
public GetInvoiceParams filter(List filter) {
this.filter = filter;
return this;
}
/**
* Set pageSize
* @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional)
* @return GetInvoiceParams
*/
public GetInvoiceParams pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
}
/**
* Retrieve an invoice
* Retrieves the invoice with the given invoice ID.
* @param invoiceId Identifier for the invoices, either `invoice_number` or `invoice_id` (required)
* @return Invoice
* @http.response.details
Status Code
Description
Response Headers
200
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.