All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openapitools.client.api.AccountsApi Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
* 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 org.openapitools.client.model.Account;
import org.openapitools.client.model.AccountCreateRequest;
import org.openapitools.client.model.AccountPatchRequest;
import org.openapitools.client.model.AccountPreviewRequest;
import org.openapitools.client.model.AccountPreviewResponse;
import java.math.BigDecimal;
import org.openapitools.client.model.ErrorResponse;
import org.openapitools.client.model.GenerateBillingDocumentsAccountRequest;
import org.openapitools.client.model.GenerateBillingDocumentsAccountResponse;
import org.openapitools.client.model.ListAccountResponse;

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 AccountsApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;
    public AccountsApi() {
    this(Configuration.getDefaultApiClient());
    }

    public AccountsApi(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 createAccountCall(AccountCreateRequest accountCreateRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 = accountCreateRequest;

        // create path and map variables
            String localVarPath = "/accounts";


        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 (accountFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields));
                    }

                    if (subscriptionsFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscriptions.fields[]", subscriptionsFields));
                    }

                    if (subscriptionPlansFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields));
                    }

                    if (subscriptionItemsFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields));
                    }

                    if (invoiceOwnerAccountFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields));
                    }

                    if (planFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields));
                    }

                    if (paymentMethodsFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_methods.fields[]", paymentMethodsFields));
                    }

                    if (paymentsFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payments.fields[]", paymentsFields));
                    }

                    if (billingDocumentsFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_documents.fields[]", billingDocumentsFields));
                    }

                    if (billingDocumentItemsFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_document_items.fields[]", billingDocumentItemsFields));
                    }

                    if (billToFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields));
                    }

                    if (soldToFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sold_to.fields[]", soldToFields));
                    }

                    if (defaultPaymentMethodFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "default_payment_method.fields[]", defaultPaymentMethodFields));
                    }

                    if (usageRecordsFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "usage_records.fields[]", usageRecordsFields));
                    }

                    if (invoicesFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoices.fields[]", invoicesFields));
                    }

                    if (creditMemosFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memos.fields[]", creditMemosFields));
                    }

                    if (debitMemosFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "debit_memos.fields[]", debitMemosFields));
                    }

                    if (prepaidBalanceFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields));
                    }

                    if (transactionsFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields));
                    }

                    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 createAccountValidateBeforeCall(AccountCreateRequest accountCreateRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 'accountCreateRequest' is set
                        if (accountCreateRequest == null) {
                        throw new ApiException("Missing the required parameter 'accountCreateRequest' when calling createAccount(Async)");
                        }

                return createAccountCall(accountCreateRequest, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
            }

        private ApiResponse createAccountWithHttpInfo(AccountCreateRequest accountCreateRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 = createAccountValidateBeforeCall(accountCreateRequest, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, 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 createAccountAsync(AccountCreateRequest accountCreateRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 = createAccountValidateBeforeCall(accountCreateRequest, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, 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 CreateAccountParams {
                    private final AccountCreateRequest accountCreateRequest;
            private Headers headers;
            /*
        * Check for list params
            */
                private GetByIdQueryParams getByIdQueryParams;
                    private List fields;
                    private List accountFields;
                    private List subscriptionsFields;
                    private List subscriptionPlansFields;
                    private List subscriptionItemsFields;
                    private List invoiceOwnerAccountFields;
                    private List planFields;
                    private List paymentMethodsFields;
                    private List paymentsFields;
                    private List billingDocumentsFields;
                    private List billingDocumentItemsFields;
                    private List billToFields;
                    private List soldToFields;
                    private List defaultPaymentMethodFields;
                    private List usageRecordsFields;
                    private List invoicesFields;
                    private List creditMemosFields;
                    private List debitMemosFields;
                    private List prepaidBalanceFields;
                    private List transactionsFields;
                    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 CreateAccountParams(AccountCreateRequest accountCreateRequest) {
                    this.accountCreateRequest = accountCreateRequest;
                }
                    /**
                    * Set getByIdQueryParams
                    * @param getByIdQueryParams GetByIdQueryParams
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams 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 CreateAccountParams
            */
            public CreateAccountParams 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`, `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 CreateAccountParams
                    */
                    public CreateAccountParams fields(List fields) {
                    this.fields = fields;
                    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 CreateAccountParams
                    */
                    public CreateAccountParams accountFields(List accountFields) {
                    this.accountFields = accountFields;
                    return this;
                    }
                    /**
                    * Set subscriptionsFields
                    * @param subscriptionsFields 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`, `subscription_number`, `state`, `account_id`, `invoice_owner_account_id`, `auto_renew`, `version`, `initial_term`, `current_term`, `renewal_term`, `start_date`, `end_date`, `description`, `contract_effective`, `service_activation`, `customer_acceptance`, `invoice_separately`, `latest_version`, `payment_terms`, `billing_document_settings`, `bill_to_id`, `sold_to_id`, `contracted_mrr`, `currency`, `cancel_reason`, `last_booking_date`, `order_number`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams subscriptionsFields(List subscriptionsFields) {
                    this.subscriptionsFields = subscriptionsFields;
                    return this;
                    }
                    /**
                    * Set subscriptionPlansFields
                    * @param subscriptionPlansFields 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`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams subscriptionPlansFields(List subscriptionPlansFields) {
                    this.subscriptionPlansFields = subscriptionPlansFields;
                    return this;
                    }
                    /**
                    * Set subscriptionItemsFields
                    * @param subscriptionItemsFields 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`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams subscriptionItemsFields(List subscriptionItemsFields) {
                    this.subscriptionItemsFields = subscriptionItemsFields;
                    return this;
                    }
                    /**
                    * Set invoiceOwnerAccountFields
                    * @param invoiceOwnerAccountFields 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 CreateAccountParams
                    */
                    public CreateAccountParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) {
                    this.invoiceOwnerAccountFields = invoiceOwnerAccountFields;
                    return this;
                    }
                    /**
                    * Set planFields
                    * @param planFields 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`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams planFields(List planFields) {
                    this.planFields = planFields;
                    return this;
                    }
                    /**
                    * Set paymentMethodsFields
                    * @param paymentMethodsFields 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`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams paymentMethodsFields(List paymentMethodsFields) {
                    this.paymentMethodsFields = paymentMethodsFields;
                    return this;
                    }
                    /**
                    * Set paymentsFields
                    * @param paymentsFields 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`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams paymentsFields(List paymentsFields) {
                    this.paymentsFields = paymentsFields;
                    return this;
                    }
                    /**
                    * Set billingDocumentsFields
                    * @param billingDocumentsFields 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`, `balance`, `description`, `state`, `tax`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams billingDocumentsFields(List billingDocumentsFields) {
                    this.billingDocumentsFields = billingDocumentsFields;
                    return this;
                    }
                    /**
                    * Set billingDocumentItemsFields
                    * @param billingDocumentItemsFields 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`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `name`, `quantity`, `recognized_revenue_account`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_inclusive`, `unit_amount`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams billingDocumentItemsFields(List billingDocumentItemsFields) {
                    this.billingDocumentItemsFields = billingDocumentItemsFields;
                    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 CreateAccountParams
                    */
                    public CreateAccountParams billToFields(List billToFields) {
                    this.billToFields = billToFields;
                    return this;
                    }
                    /**
                    * Set soldToFields
                    * @param soldToFields 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 CreateAccountParams
                    */
                    public CreateAccountParams soldToFields(List soldToFields) {
                    this.soldToFields = soldToFields;
                    return this;
                    }
                    /**
                    * Set defaultPaymentMethodFields
                    * @param defaultPaymentMethodFields 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`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams defaultPaymentMethodFields(List defaultPaymentMethodFields) {
                    this.defaultPaymentMethodFields = defaultPaymentMethodFields;
                    return this;
                    }
                    /**
                    * Set usageRecordsFields
                    * @param usageRecordsFields 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`, `account_number`, `subscription_item_id`, `subscription_item_number`, `subscription_id`, `subscription_number`, `unit_of_measure`, `description`, `end_time`, `state`, `start_time`, `quantity`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams usageRecordsFields(List usageRecordsFields) {
                    this.usageRecordsFields = usageRecordsFields;
                    return this;
                    }
                    /**
                    * Set invoicesFields
                    * @param invoicesFields 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 CreateAccountParams
                    */
                    public CreateAccountParams invoicesFields(List invoicesFields) {
                    this.invoicesFields = invoicesFields;
                    return this;
                    }
                    /**
                    * Set creditMemosFields
                    * @param creditMemosFields 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`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams creditMemosFields(List creditMemosFields) {
                    this.creditMemosFields = creditMemosFields;
                    return this;
                    }
                    /**
                    * Set debitMemosFields
                    * @param debitMemosFields 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`, `balance`, `due_date`, `debit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `posted_by_id`, `state`, `reason_code`, `paid`, `past_due`, `billing_document_settings`, `payment_terms`, `bill_to_id`, `invoice_id`, `currency`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams debitMemosFields(List debitMemosFields) {
                    this.debitMemosFields = debitMemosFields;
                    return this;
                    }
                    /**
                    * Set prepaidBalanceFields
                    * @param prepaidBalanceFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams prepaidBalanceFields(List prepaidBalanceFields) {
                    this.prepaidBalanceFields = prepaidBalanceFields;
                    return this;
                    }
                    /**
                    * Set transactionsFields
                    * @param transactionsFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `transaction_date`, `type`, `quantity`          </details> (optional)
                    * @return CreateAccountParams
                    */
                    public CreateAccountParams transactionsFields(List transactionsFields) {
                    this.transactionsFields = transactionsFields;
                    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 CreateAccountParams
                    */
                    public CreateAccountParams 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 CreateAccountParams
                    */
                    public CreateAccountParams 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 CreateAccountParams
                    */
                    public CreateAccountParams pageSize(Integer pageSize) {
                    this.pageSize = pageSize;
                    return this;
                    }
                }

            /**
            * Create an account
            * Creates a new account object.
                * @param accountCreateRequest  (required)
            * @return Account
                * @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 CreateAccountParams createAccountParams(AccountCreateRequest accountCreateRequest) { return new CreateAccountParams(accountCreateRequest); } public Account createAccount(AccountCreateRequest accountCreateRequest) throws ApiException { CreateAccountParams params = new CreateAccountParams(accountCreateRequest); return executeCreateAccountAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse createAccountWithHttpInfo(AccountCreateRequest accountCreateRequest) throws ApiException { CreateAccountParams params = new CreateAccountParams(accountCreateRequest); return executeCreateAccountAPICall(params); } **/ /** Legacy Query Params Requests **/ public Account createAccount( AccountCreateRequest accountCreateRequest , List expand) throws ApiException { CreateAccountParams params = new CreateAccountParams(accountCreateRequest); params.expand(expand); return executeCreateAccountAPICall(params).getData(); } /* * add header methods */ public Account createAccount(AccountCreateRequest accountCreateRequest ,List expand,Headers headers) throws ApiException { CreateAccountParams params = new CreateAccountParams(accountCreateRequest) .expand(expand) .headers(headers); return executeCreateAccountAPICall(params).getData(); } /** * Create an account * Creates a new account object. * @param params CreateAccountParams * @return Account * @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 Account create(CreateAccountParams params) throws ApiException { return executeCreateAccountAPICall(params).getData(); } public ApiResponse createWithHttpInfo(CreateAccountParams params) throws ApiException { return executeCreateAccountAPICall(params); } ApiResponse executeCreateAccountAPICall(CreateAccountParams params) throws ApiException { return createAccountWithHttpInfo(params.accountCreateRequest, params.fields, params.accountFields, params.subscriptionsFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.invoiceOwnerAccountFields, params.planFields, params.paymentMethodsFields, params.paymentsFields, params.billingDocumentsFields, params.billingDocumentItemsFields, params.billToFields, params.soldToFields, params.defaultPaymentMethodFields, params.usageRecordsFields, params.invoicesFields, params.creditMemosFields, params.debitMemosFields, params.prepaidBalanceFields, params.transactionsFields, 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 deleteAccountCall(String accountId, 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 = "/accounts/{account_id}" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.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 deleteAccountValidateBeforeCall(String accountId, 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 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling deleteAccount(Async)"); } return deleteAccountCall(accountId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse deleteAccountWithHttpInfo(String accountId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = deleteAccountValidateBeforeCall(accountId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); return localVarApiClient.execute(localVarCall); } private okhttp3.Call deleteAccountAsync(String accountId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteAccountValidateBeforeCall(accountId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } public static class DeleteAccountParams { private final String accountId; 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 DeleteAccountParams(String accountId) { this.accountId = accountId; } /** * Set headers * @param headers Headers * @return DeleteAccountParams */ public DeleteAccountParams 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 account * Permanently deletes an account. It cannot be undone. * @param accountId Identifier for the account, either `account_number` or `account_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 DeleteAccountParams deleteAccountParams(String accountId) { return new DeleteAccountParams(accountId); } public void deleteAccount(String accountId) throws ApiException { DeleteAccountParams params = new DeleteAccountParams(accountId); executeDeleteAccountAPICall(params); } /** * Expose HTTP info public ApiResponse deleteAccountWithHttpInfo(String accountId) throws ApiException { DeleteAccountParams params = new DeleteAccountParams(accountId); return executeDeleteAccountAPICall(params); } **/ /** Legacy Query Params Requests **/ /* * add header methods */ public void deleteAccount(String accountId ,Headers headers) throws ApiException { DeleteAccountParams params = new DeleteAccountParams(accountId) .headers(headers); executeDeleteAccountAPICall(params); } /** * Delete an account * Permanently deletes an account. It cannot be undone. * @param params DeleteAccountParams * @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(DeleteAccountParams params) throws ApiException { executeDeleteAccountAPICall(params).getData(); } public ApiResponse deleteWithHttpInfo(DeleteAccountParams params) throws ApiException { return executeDeleteAccountAPICall(params); } ApiResponse executeDeleteAccountAPICall(DeleteAccountParams params) throws ApiException { return deleteAccountWithHttpInfo(params.accountId, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call generateBillingDocumentsCall(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest, 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 = generateBillingDocumentsAccountRequest; // create path and map variables String localVarPath = "/accounts/{account_id}/bill" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.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 = { "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 generateBillingDocumentsValidateBeforeCall(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest, 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 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling generateBillingDocuments(Async)"); } // verify the required parameter 'generateBillingDocumentsAccountRequest' is set if (generateBillingDocumentsAccountRequest == null) { throw new ApiException("Missing the required parameter 'generateBillingDocumentsAccountRequest' when calling generateBillingDocuments(Async)"); } return generateBillingDocumentsCall(accountId, generateBillingDocumentsAccountRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse generateBillingDocumentsWithHttpInfo(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = generateBillingDocumentsValidateBeforeCall(accountId, generateBillingDocumentsAccountRequest, 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 generateBillingDocumentsAsync(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = generateBillingDocumentsValidateBeforeCall(accountId, generateBillingDocumentsAccountRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class GenerateBillingDocumentsParams { private final String accountId; private final GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest; 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 GenerateBillingDocumentsParams(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest) { this.accountId = accountId; this.generateBillingDocumentsAccountRequest = generateBillingDocumentsAccountRequest; } /** * Set headers * @param headers Headers * @return GenerateBillingDocumentsParams */ public GenerateBillingDocumentsParams 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; } } /** * Generate billing documents for an account * Creates billing documents for an account. * @param accountId Identifier for the account, either `account_number` or `account_id` (required) * @param generateBillingDocumentsAccountRequest (required) * @return GenerateBillingDocumentsAccountResponse * @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.
* 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 GenerateBillingDocumentsParams generateBillingDocumentsParams(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest) { return new GenerateBillingDocumentsParams(accountId, generateBillingDocumentsAccountRequest); } public GenerateBillingDocumentsAccountResponse generateBillingDocuments(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest) throws ApiException { GenerateBillingDocumentsParams params = new GenerateBillingDocumentsParams(accountId, generateBillingDocumentsAccountRequest); return executeGenerateBillingDocumentsAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse generateBillingDocumentsWithHttpInfo(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest) throws ApiException { GenerateBillingDocumentsParams params = new GenerateBillingDocumentsParams(accountId, generateBillingDocumentsAccountRequest); return executeGenerateBillingDocumentsAPICall(params); } **/ /** Legacy Query Params Requests **/ /* * add header methods */ public GenerateBillingDocumentsAccountResponse generateBillingDocuments(String accountId , GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest ,Headers headers) throws ApiException { GenerateBillingDocumentsParams params = new GenerateBillingDocumentsParams(accountId, generateBillingDocumentsAccountRequest) .headers(headers); return executeGenerateBillingDocumentsAPICall(params).getData(); } /** * Generate billing documents for an account * Creates billing documents for an account. * @param params GenerateBillingDocumentsParams * @return GenerateBillingDocumentsAccountResponse * @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.
* 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 GenerateBillingDocumentsAccountResponse generateBillingDocuments(GenerateBillingDocumentsParams params) throws ApiException { return executeGenerateBillingDocumentsAPICall(params).getData(); } public ApiResponse generateBillingDocumentsWithHttpInfo(GenerateBillingDocumentsParams params) throws ApiException { return executeGenerateBillingDocumentsAPICall(params); } ApiResponse executeGenerateBillingDocumentsAPICall(GenerateBillingDocumentsParams params) throws ApiException { return generateBillingDocumentsWithHttpInfo(params.accountId, params.generateBillingDocumentsAccountRequest, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call getAccountCall(String accountId, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 = "/accounts/{account_id}" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.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 (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (subscriptionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscriptions.fields[]", subscriptionsFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (paymentMethodsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_methods.fields[]", paymentMethodsFields)); } if (paymentsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payments.fields[]", paymentsFields)); } if (billingDocumentsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_documents.fields[]", billingDocumentsFields)); } if (billingDocumentItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_document_items.fields[]", billingDocumentItemsFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (soldToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sold_to.fields[]", soldToFields)); } if (defaultPaymentMethodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "default_payment_method.fields[]", defaultPaymentMethodFields)); } if (usageRecordsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "usage_records.fields[]", usageRecordsFields)); } if (invoicesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoices.fields[]", invoicesFields)); } if (creditMemosFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memos.fields[]", creditMemosFields)); } if (debitMemosFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "debit_memos.fields[]", debitMemosFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } 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 getAccountValidateBeforeCall(String accountId, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling getAccount(Async)"); } return getAccountCall(accountId, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getAccountWithHttpInfo(String accountId, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 = getAccountValidateBeforeCall(accountId, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, 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 getAccountAsync(String accountId, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 = getAccountValidateBeforeCall(accountId, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, 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 GetAccountParams { private final String accountId; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List accountFields; private List subscriptionsFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List invoiceOwnerAccountFields; private List planFields; private List paymentMethodsFields; private List paymentsFields; private List billingDocumentsFields; private List billingDocumentItemsFields; private List billToFields; private List soldToFields; private List defaultPaymentMethodFields; private List usageRecordsFields; private List invoicesFields; private List creditMemosFields; private List debitMemosFields; private List prepaidBalanceFields; private List transactionsFields; 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 GetAccountParams(String accountId) { this.accountId = accountId; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return GetAccountParams */ public GetAccountParams 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 GetAccountParams */ public GetAccountParams 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`, `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 GetAccountParams */ public GetAccountParams fields(List fields) { this.fields = fields; 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 GetAccountParams */ public GetAccountParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set subscriptionsFields * @param subscriptionsFields 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`, `subscription_number`, `state`, `account_id`, `invoice_owner_account_id`, `auto_renew`, `version`, `initial_term`, `current_term`, `renewal_term`, `start_date`, `end_date`, `description`, `contract_effective`, `service_activation`, `customer_acceptance`, `invoice_separately`, `latest_version`, `payment_terms`, `billing_document_settings`, `bill_to_id`, `sold_to_id`, `contracted_mrr`, `currency`, `cancel_reason`, `last_booking_date`, `order_number` </details> (optional) * @return GetAccountParams */ public GetAccountParams subscriptionsFields(List subscriptionsFields) { this.subscriptionsFields = subscriptionsFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields 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`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return GetAccountParams */ public GetAccountParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields 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`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return GetAccountParams */ public GetAccountParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields 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 GetAccountParams */ public GetAccountParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields 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`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return GetAccountParams */ public GetAccountParams planFields(List planFields) { this.planFields = planFields; return this; } /** * Set paymentMethodsFields * @param paymentMethodsFields 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`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return GetAccountParams */ public GetAccountParams paymentMethodsFields(List paymentMethodsFields) { this.paymentMethodsFields = paymentMethodsFields; return this; } /** * Set paymentsFields * @param paymentsFields 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`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return GetAccountParams */ public GetAccountParams paymentsFields(List paymentsFields) { this.paymentsFields = paymentsFields; return this; } /** * Set billingDocumentsFields * @param billingDocumentsFields 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`, `balance`, `description`, `state`, `tax` </details> (optional) * @return GetAccountParams */ public GetAccountParams billingDocumentsFields(List billingDocumentsFields) { this.billingDocumentsFields = billingDocumentsFields; return this; } /** * Set billingDocumentItemsFields * @param billingDocumentItemsFields 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`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `name`, `quantity`, `recognized_revenue_account`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_inclusive`, `unit_amount` </details> (optional) * @return GetAccountParams */ public GetAccountParams billingDocumentItemsFields(List billingDocumentItemsFields) { this.billingDocumentItemsFields = billingDocumentItemsFields; 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 GetAccountParams */ public GetAccountParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set soldToFields * @param soldToFields 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 GetAccountParams */ public GetAccountParams soldToFields(List soldToFields) { this.soldToFields = soldToFields; return this; } /** * Set defaultPaymentMethodFields * @param defaultPaymentMethodFields 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`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return GetAccountParams */ public GetAccountParams defaultPaymentMethodFields(List defaultPaymentMethodFields) { this.defaultPaymentMethodFields = defaultPaymentMethodFields; return this; } /** * Set usageRecordsFields * @param usageRecordsFields 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`, `account_number`, `subscription_item_id`, `subscription_item_number`, `subscription_id`, `subscription_number`, `unit_of_measure`, `description`, `end_time`, `state`, `start_time`, `quantity` </details> (optional) * @return GetAccountParams */ public GetAccountParams usageRecordsFields(List usageRecordsFields) { this.usageRecordsFields = usageRecordsFields; return this; } /** * Set invoicesFields * @param invoicesFields 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 GetAccountParams */ public GetAccountParams invoicesFields(List invoicesFields) { this.invoicesFields = invoicesFields; return this; } /** * Set creditMemosFields * @param creditMemosFields 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`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency` </details> (optional) * @return GetAccountParams */ public GetAccountParams creditMemosFields(List creditMemosFields) { this.creditMemosFields = creditMemosFields; return this; } /** * Set debitMemosFields * @param debitMemosFields 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`, `balance`, `due_date`, `debit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `posted_by_id`, `state`, `reason_code`, `paid`, `past_due`, `billing_document_settings`, `payment_terms`, `bill_to_id`, `invoice_id`, `currency` </details> (optional) * @return GetAccountParams */ public GetAccountParams debitMemosFields(List debitMemosFields) { this.debitMemosFields = debitMemosFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return GetAccountParams */ public GetAccountParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return GetAccountParams */ public GetAccountParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; 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 GetAccountParams */ public GetAccountParams 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 GetAccountParams */ public GetAccountParams 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 GetAccountParams */ public GetAccountParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Retrieve an account * Retrieves the account with the given ID. * @param accountId Identifier for the account, either `account_number` or `account_id` (required) * @return Account * @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.
* 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 GetAccountParams getAccountParams(String accountId) { return new GetAccountParams(accountId); } public Account getAccount(String accountId) throws ApiException { GetAccountParams params = new GetAccountParams(accountId); return executeGetAccountAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getAccountWithHttpInfo(String accountId) throws ApiException { GetAccountParams params = new GetAccountParams(accountId); return executeGetAccountAPICall(params); } **/ /** Legacy Query Params Requests **/ public Account getAccount( String accountId , List expand) throws ApiException { GetAccountParams params = new GetAccountParams(accountId); params.expand(expand); return executeGetAccountAPICall(params).getData(); } /* * add header methods */ public Account getAccount(String accountId ,List expand,Headers headers) throws ApiException { GetAccountParams params = new GetAccountParams(accountId) .expand(expand) .headers(headers); return executeGetAccountAPICall(params).getData(); } /** * Retrieve an account * Retrieves the account with the given ID. * @param params GetAccountParams * @return Account * @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.
* 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 Account get(GetAccountParams params) throws ApiException { return executeGetAccountAPICall(params).getData(); } public ApiResponse getWithHttpInfo(GetAccountParams params) throws ApiException { return executeGetAccountAPICall(params); } ApiResponse executeGetAccountAPICall(GetAccountParams params) throws ApiException { return getAccountWithHttpInfo(params.accountId, params.fields, params.accountFields, params.subscriptionsFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.invoiceOwnerAccountFields, params.planFields, params.paymentMethodsFields, params.paymentsFields, params.billingDocumentsFields, params.billingDocumentItemsFields, params.billToFields, params.soldToFields, params.defaultPaymentMethodFields, params.usageRecordsFields, params.invoicesFields, params.creditMemosFields, params.debitMemosFields, params.prepaidBalanceFields, params.transactionsFields, 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 getAccountsCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 = "/accounts"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (cursor != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (sort != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sort[]", sort)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (fields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (subscriptionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscriptions.fields[]", subscriptionsFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (paymentMethodsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_methods.fields[]", paymentMethodsFields)); } if (paymentsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payments.fields[]", paymentsFields)); } if (billingDocumentsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_documents.fields[]", billingDocumentsFields)); } if (billingDocumentItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_document_items.fields[]", billingDocumentItemsFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (soldToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sold_to.fields[]", soldToFields)); } if (defaultPaymentMethodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "default_payment_method.fields[]", defaultPaymentMethodFields)); } if (usageRecordsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "usage_records.fields[]", usageRecordsFields)); } if (invoicesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoices.fields[]", invoicesFields)); } if (creditMemosFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memos.fields[]", creditMemosFields)); } if (debitMemosFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "debit_memos.fields[]", debitMemosFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } 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 getAccountsValidateBeforeCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { return getAccountsCall(cursor, expand, filter, sort, pageSize, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getAccountsWithHttpInfo(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getAccountsValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, 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 getAccountsAsync(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAccountsValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class GetAccountsParams { private Headers headers; /* * Check for list params */ private ListQueryParams listQueryParams; private String cursor; private List expand; private List filter; private List sort; private Integer pageSize; private List fields; private List accountFields; private List subscriptionsFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List invoiceOwnerAccountFields; private List planFields; private List paymentMethodsFields; private List paymentsFields; private List billingDocumentsFields; private List billingDocumentItemsFields; private List billToFields; private List soldToFields; private List defaultPaymentMethodFields; private List usageRecordsFields; private List invoicesFields; private List creditMemosFields; private List debitMemosFields; private List prepaidBalanceFields; private List transactionsFields; 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 GetAccountsParams() { } /** * Set listQueryParams * @param listQueryParams ListQueryParams * @return GetAccountsParams */ public GetAccountsParams listQueryParams(ListQueryParams listQueryParams) { this.listQueryParams = listQueryParams; if (cursor != null) { this.cursor = listQueryParams.getCursor(); } if (expand != null) { this.expand = listQueryParams.getExpand(); } if (filter != null) { this.filter = listQueryParams.getFilter(); } if (sort != null) { this.sort = listQueryParams.getSort(); } if (pageSize != null) { this.pageSize = listQueryParams.getPageSize(); } return this; } /** * Set headers * @param headers Headers * @return GetAccountsParams */ public GetAccountsParams 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 cursor * @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional) * @return GetAccountsParams */ public GetAccountsParams cursor(String cursor) { this.cursor = cursor; 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 GetAccountsParams */ public GetAccountsParams 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 Tutorials for detailed instructions. (optional) * @return GetAccountsParams */ public GetAccountsParams filter(List filter) { this.filter = filter; return this; } /** * Set sort * @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `account_number.asc`) or descending (e.g. `account_number.desc`). You cannot sort on properties that are arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional) * @return GetAccountsParams */ public GetAccountsParams sort(List sort) { this.sort = sort; 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 GetAccountsParams */ public GetAccountsParams pageSize(Integer pageSize) { this.pageSize = pageSize; 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`, `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 GetAccountsParams */ public GetAccountsParams fields(List fields) { this.fields = fields; 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 GetAccountsParams */ public GetAccountsParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set subscriptionsFields * @param subscriptionsFields 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`, `subscription_number`, `state`, `account_id`, `invoice_owner_account_id`, `auto_renew`, `version`, `initial_term`, `current_term`, `renewal_term`, `start_date`, `end_date`, `description`, `contract_effective`, `service_activation`, `customer_acceptance`, `invoice_separately`, `latest_version`, `payment_terms`, `billing_document_settings`, `bill_to_id`, `sold_to_id`, `contracted_mrr`, `currency`, `cancel_reason`, `last_booking_date`, `order_number` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams subscriptionsFields(List subscriptionsFields) { this.subscriptionsFields = subscriptionsFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields 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`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields 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`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields 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 GetAccountsParams */ public GetAccountsParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields 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`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams planFields(List planFields) { this.planFields = planFields; return this; } /** * Set paymentMethodsFields * @param paymentMethodsFields 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`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams paymentMethodsFields(List paymentMethodsFields) { this.paymentMethodsFields = paymentMethodsFields; return this; } /** * Set paymentsFields * @param paymentsFields 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`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams paymentsFields(List paymentsFields) { this.paymentsFields = paymentsFields; return this; } /** * Set billingDocumentsFields * @param billingDocumentsFields 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`, `balance`, `description`, `state`, `tax` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams billingDocumentsFields(List billingDocumentsFields) { this.billingDocumentsFields = billingDocumentsFields; return this; } /** * Set billingDocumentItemsFields * @param billingDocumentItemsFields 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`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `name`, `quantity`, `recognized_revenue_account`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_inclusive`, `unit_amount` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams billingDocumentItemsFields(List billingDocumentItemsFields) { this.billingDocumentItemsFields = billingDocumentItemsFields; 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 GetAccountsParams */ public GetAccountsParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set soldToFields * @param soldToFields 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 GetAccountsParams */ public GetAccountsParams soldToFields(List soldToFields) { this.soldToFields = soldToFields; return this; } /** * Set defaultPaymentMethodFields * @param defaultPaymentMethodFields 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`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams defaultPaymentMethodFields(List defaultPaymentMethodFields) { this.defaultPaymentMethodFields = defaultPaymentMethodFields; return this; } /** * Set usageRecordsFields * @param usageRecordsFields 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`, `account_number`, `subscription_item_id`, `subscription_item_number`, `subscription_id`, `subscription_number`, `unit_of_measure`, `description`, `end_time`, `state`, `start_time`, `quantity` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams usageRecordsFields(List usageRecordsFields) { this.usageRecordsFields = usageRecordsFields; return this; } /** * Set invoicesFields * @param invoicesFields 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 GetAccountsParams */ public GetAccountsParams invoicesFields(List invoicesFields) { this.invoicesFields = invoicesFields; return this; } /** * Set creditMemosFields * @param creditMemosFields 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`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams creditMemosFields(List creditMemosFields) { this.creditMemosFields = creditMemosFields; return this; } /** * Set debitMemosFields * @param debitMemosFields 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`, `balance`, `due_date`, `debit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `posted_by_id`, `state`, `reason_code`, `paid`, `past_due`, `billing_document_settings`, `payment_terms`, `bill_to_id`, `invoice_id`, `currency` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams debitMemosFields(List debitMemosFields) { this.debitMemosFields = debitMemosFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return GetAccountsParams */ public GetAccountsParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; return this; } } /** * List accounts * Returns a dictionary with a data property that contains an array of accounts, starting after the cursor, if used. Each entry in the array is a separate account object. If no more accounts are available, the resulting array will be empty. This request should never return an error. * @return ListAccountResponse * @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.
* 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 GetAccountsParams getAccountsParams() { return new GetAccountsParams(); } public ListAccountResponse getAccounts() throws ApiException { GetAccountsParams params = new GetAccountsParams(); return executeGetAccountsAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getAccountsWithHttpInfo() throws ApiException { GetAccountsParams params = new GetAccountsParams(); return executeGetAccountsAPICall(params); } **/ /** Legacy Query Params Requests **/ public ListAccountResponse getAccounts(String cursor, List expand, List filter) throws ApiException { GetAccountsParams params = new GetAccountsParams(); params.cursor(cursor); params.expand(expand); params.filter(filter); return executeGetAccountsAPICall(params).getData(); } /* * add header methods */ public ListAccountResponse getAccounts(String cursor,List expand,List filter,Headers headers) throws ApiException { GetAccountsParams params = new GetAccountsParams() .cursor(cursor) .expand(expand) .filter(filter) .headers(headers); return executeGetAccountsAPICall(params).getData(); } /** * List accounts * Returns a dictionary with a data property that contains an array of accounts, starting after the cursor, if used. Each entry in the array is a separate account object. If no more accounts are available, the resulting array will be empty. This request should never return an error. * @param params GetAccountsParams * @return ListAccountResponse * @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.
* 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 ListAccountResponse list(GetAccountsParams params) throws ApiException { return executeGetAccountsAPICall(params).getData(); } public ApiResponse listWithHttpInfo(GetAccountsParams params) throws ApiException { return executeGetAccountsAPICall(params); } ApiResponse executeGetAccountsAPICall(GetAccountsParams params) throws ApiException { return getAccountsWithHttpInfo(params.cursor, params.expand, params.filter, params.sort, params.pageSize, params.fields, params.accountFields, params.subscriptionsFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.invoiceOwnerAccountFields, params.planFields, params.paymentMethodsFields, params.paymentsFields, params.billingDocumentsFields, params.billingDocumentItemsFields, params.billToFields, params.soldToFields, params.defaultPaymentMethodFields, params.usageRecordsFields, params.invoicesFields, params.creditMemosFields, params.debitMemosFields, params.prepaidBalanceFields, params.transactionsFields, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call previewAccountCall(String accountId, AccountPreviewRequest accountPreviewRequest, 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 = accountPreviewRequest; // create path and map variables String localVarPath = "/accounts/{account_id}/preview" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.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 = { "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 previewAccountValidateBeforeCall(String accountId, AccountPreviewRequest accountPreviewRequest, 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 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling previewAccount(Async)"); } // verify the required parameter 'accountPreviewRequest' is set if (accountPreviewRequest == null) { throw new ApiException("Missing the required parameter 'accountPreviewRequest' when calling previewAccount(Async)"); } return previewAccountCall(accountId, accountPreviewRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse previewAccountWithHttpInfo(String accountId, AccountPreviewRequest accountPreviewRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = previewAccountValidateBeforeCall(accountId, accountPreviewRequest, 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 previewAccountAsync(String accountId, AccountPreviewRequest accountPreviewRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = previewAccountValidateBeforeCall(accountId, accountPreviewRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class PreviewAccountParams { private final String accountId; private final AccountPreviewRequest accountPreviewRequest; 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 PreviewAccountParams(String accountId, AccountPreviewRequest accountPreviewRequest) { this.accountId = accountId; this.accountPreviewRequest = accountPreviewRequest; } /** * Set headers * @param headers Headers * @return PreviewAccountParams */ public PreviewAccountParams 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; } } /** * Preview an account * Generates a preview of future invoice and credit memo items for a customer account. Previewing a customer account shows you how much a single customer will be invoiced from the most recent invoice to a specific end of term date in the future. <br/> Previewing a customer account only calculates taxes for charges if you use <a href='https://knowledgecenter.zuora.com/Billing/Taxes/A_Zuora_Tax' target='_blank'>Zuora Tax</a> and the price associated with the invoice item is tax inclusive; otherwise, it does not calculate taxes. * @param accountId Identifier for the account, either `account_number` or `account_id` (required) * @param accountPreviewRequest (required) * @return AccountPreviewResponse * @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.
* 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 PreviewAccountParams previewAccountParams(String accountId, AccountPreviewRequest accountPreviewRequest) { return new PreviewAccountParams(accountId, accountPreviewRequest); } public AccountPreviewResponse previewAccount(String accountId, AccountPreviewRequest accountPreviewRequest) throws ApiException { PreviewAccountParams params = new PreviewAccountParams(accountId, accountPreviewRequest); return executePreviewAccountAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse previewAccountWithHttpInfo(String accountId, AccountPreviewRequest accountPreviewRequest) throws ApiException { PreviewAccountParams params = new PreviewAccountParams(accountId, accountPreviewRequest); return executePreviewAccountAPICall(params); } **/ /** Legacy Query Params Requests **/ /* * add header methods */ public AccountPreviewResponse previewAccount(String accountId , AccountPreviewRequest accountPreviewRequest ,Headers headers) throws ApiException { PreviewAccountParams params = new PreviewAccountParams(accountId, accountPreviewRequest) .headers(headers); return executePreviewAccountAPICall(params).getData(); } /** * Preview an account * Generates a preview of future invoice and credit memo items for a customer account. Previewing a customer account shows you how much a single customer will be invoiced from the most recent invoice to a specific end of term date in the future. <br/> Previewing a customer account only calculates taxes for charges if you use <a href='https://knowledgecenter.zuora.com/Billing/Taxes/A_Zuora_Tax' target='_blank'>Zuora Tax</a> and the price associated with the invoice item is tax inclusive; otherwise, it does not calculate taxes. * @param params PreviewAccountParams * @return AccountPreviewResponse * @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.
* 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 AccountPreviewResponse previewAccount(PreviewAccountParams params) throws ApiException { return executePreviewAccountAPICall(params).getData(); } public ApiResponse previewAccountWithHttpInfo(PreviewAccountParams params) throws ApiException { return executePreviewAccountAPICall(params); } ApiResponse executePreviewAccountAPICall(PreviewAccountParams params) throws ApiException { return previewAccountWithHttpInfo(params.accountId, params.accountPreviewRequest, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call updateAccountCall(String accountId, AccountPatchRequest accountPatchRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 = accountPatchRequest; // create path and map variables String localVarPath = "/accounts/{account_id}" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.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 (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (subscriptionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscriptions.fields[]", subscriptionsFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (paymentMethodsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_methods.fields[]", paymentMethodsFields)); } if (paymentsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payments.fields[]", paymentsFields)); } if (billingDocumentsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_documents.fields[]", billingDocumentsFields)); } if (billingDocumentItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_document_items.fields[]", billingDocumentItemsFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (soldToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sold_to.fields[]", soldToFields)); } if (defaultPaymentMethodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "default_payment_method.fields[]", defaultPaymentMethodFields)); } if (usageRecordsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "usage_records.fields[]", usageRecordsFields)); } if (invoicesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoices.fields[]", invoicesFields)); } if (creditMemosFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memos.fields[]", creditMemosFields)); } if (debitMemosFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "debit_memos.fields[]", debitMemosFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } 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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateAccountValidateBeforeCall(String accountId, AccountPatchRequest accountPatchRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling updateAccount(Async)"); } // verify the required parameter 'accountPatchRequest' is set if (accountPatchRequest == null) { throw new ApiException("Missing the required parameter 'accountPatchRequest' when calling updateAccount(Async)"); } return updateAccountCall(accountId, accountPatchRequest, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse updateAccountWithHttpInfo(String accountId, AccountPatchRequest accountPatchRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 = updateAccountValidateBeforeCall(accountId, accountPatchRequest, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, 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 updateAccountAsync(String accountId, AccountPatchRequest accountPatchRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, 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 = updateAccountValidateBeforeCall(accountId, accountPatchRequest, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, 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 UpdateAccountParams { private final String accountId; private final AccountPatchRequest accountPatchRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List accountFields; private List subscriptionsFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List invoiceOwnerAccountFields; private List planFields; private List paymentMethodsFields; private List paymentsFields; private List billingDocumentsFields; private List billingDocumentItemsFields; private List billToFields; private List soldToFields; private List defaultPaymentMethodFields; private List usageRecordsFields; private List invoicesFields; private List creditMemosFields; private List debitMemosFields; private List prepaidBalanceFields; private List transactionsFields; 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 UpdateAccountParams(String accountId, AccountPatchRequest accountPatchRequest) { this.accountId = accountId; this.accountPatchRequest = accountPatchRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return UpdateAccountParams */ public UpdateAccountParams 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 UpdateAccountParams */ public UpdateAccountParams 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`, `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 UpdateAccountParams */ public UpdateAccountParams fields(List fields) { this.fields = fields; 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 UpdateAccountParams */ public UpdateAccountParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set subscriptionsFields * @param subscriptionsFields 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`, `subscription_number`, `state`, `account_id`, `invoice_owner_account_id`, `auto_renew`, `version`, `initial_term`, `current_term`, `renewal_term`, `start_date`, `end_date`, `description`, `contract_effective`, `service_activation`, `customer_acceptance`, `invoice_separately`, `latest_version`, `payment_terms`, `billing_document_settings`, `bill_to_id`, `sold_to_id`, `contracted_mrr`, `currency`, `cancel_reason`, `last_booking_date`, `order_number` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams subscriptionsFields(List subscriptionsFields) { this.subscriptionsFields = subscriptionsFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields 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`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields 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`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields 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 UpdateAccountParams */ public UpdateAccountParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields 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`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams planFields(List planFields) { this.planFields = planFields; return this; } /** * Set paymentMethodsFields * @param paymentMethodsFields 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`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams paymentMethodsFields(List paymentMethodsFields) { this.paymentMethodsFields = paymentMethodsFields; return this; } /** * Set paymentsFields * @param paymentsFields 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`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams paymentsFields(List paymentsFields) { this.paymentsFields = paymentsFields; return this; } /** * Set billingDocumentsFields * @param billingDocumentsFields 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`, `balance`, `description`, `state`, `tax` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams billingDocumentsFields(List billingDocumentsFields) { this.billingDocumentsFields = billingDocumentsFields; return this; } /** * Set billingDocumentItemsFields * @param billingDocumentItemsFields 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`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `name`, `quantity`, `recognized_revenue_account`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_inclusive`, `unit_amount` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams billingDocumentItemsFields(List billingDocumentItemsFields) { this.billingDocumentItemsFields = billingDocumentItemsFields; 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 UpdateAccountParams */ public UpdateAccountParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set soldToFields * @param soldToFields 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 UpdateAccountParams */ public UpdateAccountParams soldToFields(List soldToFields) { this.soldToFields = soldToFields; return this; } /** * Set defaultPaymentMethodFields * @param defaultPaymentMethodFields 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`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams defaultPaymentMethodFields(List defaultPaymentMethodFields) { this.defaultPaymentMethodFields = defaultPaymentMethodFields; return this; } /** * Set usageRecordsFields * @param usageRecordsFields 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`, `account_number`, `subscription_item_id`, `subscription_item_number`, `subscription_id`, `subscription_number`, `unit_of_measure`, `description`, `end_time`, `state`, `start_time`, `quantity` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams usageRecordsFields(List usageRecordsFields) { this.usageRecordsFields = usageRecordsFields; return this; } /** * Set invoicesFields * @param invoicesFields 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 UpdateAccountParams */ public UpdateAccountParams invoicesFields(List invoicesFields) { this.invoicesFields = invoicesFields; return this; } /** * Set creditMemosFields * @param creditMemosFields 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`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams creditMemosFields(List creditMemosFields) { this.creditMemosFields = creditMemosFields; return this; } /** * Set debitMemosFields * @param debitMemosFields 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`, `balance`, `due_date`, `debit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `posted_by_id`, `state`, `reason_code`, `paid`, `past_due`, `billing_document_settings`, `payment_terms`, `bill_to_id`, `invoice_id`, `currency` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams debitMemosFields(List debitMemosFields) { this.debitMemosFields = debitMemosFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return UpdateAccountParams */ public UpdateAccountParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; 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 UpdateAccountParams */ public UpdateAccountParams 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 UpdateAccountParams */ public UpdateAccountParams 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 UpdateAccountParams */ public UpdateAccountParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Update an account * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @param accountId Identifier for the account, either `account_number` or `account_id` (required) * @param accountPatchRequest (required) * @return Account * @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.
* 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 UpdateAccountParams updateAccountParams(String accountId, AccountPatchRequest accountPatchRequest) { return new UpdateAccountParams(accountId, accountPatchRequest); } public Account updateAccount(String accountId, AccountPatchRequest accountPatchRequest) throws ApiException { UpdateAccountParams params = new UpdateAccountParams(accountId, accountPatchRequest); return executeUpdateAccountAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse updateAccountWithHttpInfo(String accountId, AccountPatchRequest accountPatchRequest) throws ApiException { UpdateAccountParams params = new UpdateAccountParams(accountId, accountPatchRequest); return executeUpdateAccountAPICall(params); } **/ /** Legacy Query Params Requests **/ public Account updateAccount( String accountId , AccountPatchRequest accountPatchRequest , List expand) throws ApiException { UpdateAccountParams params = new UpdateAccountParams(accountId, accountPatchRequest); params.expand(expand); return executeUpdateAccountAPICall(params).getData(); } /* * add header methods */ public Account updateAccount(String accountId , AccountPatchRequest accountPatchRequest ,List expand,Headers headers) throws ApiException { UpdateAccountParams params = new UpdateAccountParams(accountId, accountPatchRequest) .expand(expand) .headers(headers); return executeUpdateAccountAPICall(params).getData(); } /** * Update an account * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @param params UpdateAccountParams * @return Account * @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.
* 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 Account update(UpdateAccountParams params) throws ApiException { return executeUpdateAccountAPICall(params).getData(); } public ApiResponse updateWithHttpInfo(UpdateAccountParams params) throws ApiException { return executeUpdateAccountAPICall(params); } ApiResponse executeUpdateAccountAPICall(UpdateAccountParams params) throws ApiException { return updateAccountWithHttpInfo(params.accountId, params.accountPatchRequest, params.fields, params.accountFields, params.subscriptionsFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.invoiceOwnerAccountFields, params.planFields, params.paymentMethodsFields, params.paymentsFields, params.billingDocumentsFields, params.billingDocumentItemsFields, params.billToFields, params.soldToFields, params.defaultPaymentMethodFields, params.usageRecordsFields, params.invoicesFields, params.creditMemosFields, params.debitMemosFields, params.prepaidBalanceFields, params.transactionsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy