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

org.openapitools.client.api.OrdersApi 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 java.math.BigDecimal;
import org.openapitools.client.model.ErrorResponse;
import org.openapitools.client.model.Order;
import org.openapitools.client.model.OrderCancelResponse;
import org.openapitools.client.model.OrderCancellationRequest;
import org.openapitools.client.model.OrderCreateRequest;
import org.openapitools.client.model.OrderListResponse;
import org.openapitools.client.model.OrderPreviewCreateRequest;
import org.openapitools.client.model.OrderPreviewResponse;

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

    public OrdersApi(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 activateOrderCall(String orderId, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = "/orders/{order_id}/activate"
                .replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.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 (orderFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "order.fields[]", orderFields));
                    }

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

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

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

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

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

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

                    if (pageSize != null) {
                localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
                    }

                    if (zuoraTrackId != null) {
                    localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
                    }

                    if (async != null) {
                    localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
                    }

                    if (zuoraCacheEnabled != null) {
                    localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
                    }

                    if (zuoraEntityIds != null) {
                    localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
                    }

                    if (idempotencyKey != null) {
                    localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
                    }

                    if (acceptEncoding != null) {
                    localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
                    }

                    if (contentEncoding != null) {
                    localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
                    }

                    if (zuoraOrgIds != null) {
                    localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
                    }

            final String[] localVarAccepts = {
                "application/json"
            };
            final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
            if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
            }

            final String[] localVarContentTypes = {
            };
            final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
            if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
            }

            String[] localVarAuthNames = new String[] { "bearerAuth" };
            return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
            }

            @SuppressWarnings("rawtypes")
            private okhttp3.Call activateOrderValidateBeforeCall(String orderId, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 'orderId' is set
                        if (orderId == null) {
                        throw new ApiException("Missing the required parameter 'orderId' when calling activateOrder(Async)");
                        }

                return activateOrderCall(orderId, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
            }

        private ApiResponse activateOrderWithHttpInfo(String orderId, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = activateOrderValidateBeforeCall(orderId, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, 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 activateOrderAsync(String orderId, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = activateOrderValidateBeforeCall(orderId, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, 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 ActivateOrderParams {
                    private final String orderId;
            private Headers headers;
            /*
        * Check for list params
            */
                private GetByIdQueryParams getByIdQueryParams;
                    private List fields;
                    private List orderFields;
                    private List orderActionsFields;
                    private List subscriptionsFields;
                    private List lineItemsFields;
                    private List subscriptionPlansFields;
                    private List subscriptionItemsFields;
                    private List invoiceItemsFields;
                    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 ActivateOrderParams(String orderId) {
                    this.orderId = orderId;
                }
                    /**
                    * Set getByIdQueryParams
                    * @param getByIdQueryParams GetByIdQueryParams
                    * @return ActivateOrderParams
                    */
                    public ActivateOrderParams 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 ActivateOrderParams
            */
            public ActivateOrderParams 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`, `account_id`, `order_number`, `order_date`, `state`, `category`, `description`, `scheduled_date`, `scheduled_date_policy`, `line_items`, `subscriptions`          </details> (optional)
                    * @return ActivateOrderParams
                    */
                    public ActivateOrderParams fields(List fields) {
                    this.fields = fields;
                    return this;
                    }
                    /**
                    * Set orderFields
                    * @param orderFields 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`, `order_number`, `order_date`, `state`, `category`, `description`, `scheduled_date`, `scheduled_date_policy`, `line_items`, `subscriptions`          </details> (optional)
                    * @return ActivateOrderParams
                    */
                    public ActivateOrderParams orderFields(List orderFields) {
                    this.orderFields = orderFields;
                    return this;
                    }
                    /**
                    * Set orderActionsFields
                    * @param orderActionsFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `type`, `action_id`, `sequence`, `start_on`, `subscription_plans`, `renew`, `terms`, `cancel`, `pause`, `resume`, `order`          </details> (optional)
                    * @return ActivateOrderParams
                    */
                    public ActivateOrderParams orderActionsFields(List orderActionsFields) {
                    this.orderActionsFields = orderActionsFields;
                    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`, `actions`          </details> (optional)
                    * @return ActivateOrderParams
                    */
                    public ActivateOrderParams subscriptionsFields(List subscriptionsFields) {
                    this.subscriptionsFields = subscriptionsFields;
                    return this;
                    }
                    /**
                    * Set lineItemsFields
                    * @param lineItemsFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `total`, `subtotal`, `quantity_fulfilled`, `quantity_pending_fulfillment`, `unit_of_measure`, `accounting_code`, `adjustment_liability_account`, `unit_amount`, `target_date`, `billing_rule`, `contract_asset_account`, `contract_liability_account`, `description`, `discount_total`, `revenue`, `discount_unit_amount`, `discount_percent`, `category`, `name`, `item_number`, `type`, `list_price`, `list_unit_price`, `original_order_date`, `original_order_id`, `original_order_line_item_id`, `original_order_line_item_number`, `original_order_number`, `product_code`, `price_id`, `purchase_order_number`, `quantity`, `quantity_available_for_return`, `related_subscription_number`, `requires_fulfillment`, `sold_to_id`, `original_sold_to_id`, `tax_code`, `tax_inclusive`, `end_date`, `start_date`, `unbilled_receivables_account`, `state`, `order_id`          </details> (optional)
                    * @return ActivateOrderParams
                    */
                    public ActivateOrderParams lineItemsFields(List lineItemsFields) {
                    this.lineItemsFields = lineItemsFields;
                    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`, `subscription_items`          </details> (optional)
                    * @return ActivateOrderParams
                    */
                    public ActivateOrderParams 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 ActivateOrderParams
                    */
                    public ActivateOrderParams subscriptionItemsFields(List subscriptionItemsFields) {
                    this.subscriptionItemsFields = subscriptionItemsFields;
                    return this;
                    }
                    /**
                    * Set invoiceItemsFields
                    * @param invoiceItemsFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `booking_reference`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `invoice_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `accounting_code`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `document_item_date`          </details> (optional)
                    * @return ActivateOrderParams
                    */
                    public ActivateOrderParams invoiceItemsFields(List invoiceItemsFields) {
                    this.invoiceItemsFields = invoiceItemsFields;
                    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 ActivateOrderParams
                    */
                    public ActivateOrderParams 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 ActivateOrderParams
                    */
                    public ActivateOrderParams 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 ActivateOrderParams
                    */
                    public ActivateOrderParams pageSize(Integer pageSize) {
                    this.pageSize = pageSize;
                    return this;
                    }
                }

            /**
            * Activate an order
            * Activates a draft order.
                * @param orderId Identifier for the order, either `order_number` or `order_id` (required)
            * @return Order
                * @http.response.details
                
Status Code Description Response Headers
200 Default Response -
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public ActivateOrderParams activateOrderParams(String orderId) { return new ActivateOrderParams(orderId); } public Order activateOrder(String orderId) throws ApiException { ActivateOrderParams params = new ActivateOrderParams(orderId); return executeActivateOrderAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse activateOrderWithHttpInfo(String orderId) throws ApiException { ActivateOrderParams params = new ActivateOrderParams(orderId); return executeActivateOrderAPICall(params); } **/ /** Legacy Query Params Requests **/ public Order activateOrder( String orderId , List expand) throws ApiException { ActivateOrderParams params = new ActivateOrderParams(orderId); params.expand(expand); return executeActivateOrderAPICall(params).getData(); } /* * add header methods */ public Order activateOrder(String orderId ,List expand,Headers headers) throws ApiException { ActivateOrderParams params = new ActivateOrderParams(orderId) .expand(expand) .headers(headers); return executeActivateOrderAPICall(params).getData(); } /** * Activate an order * Activates a draft order. * @param params ActivateOrderParams * @return Order * @http.response.details
Status Code Description Response Headers
200 Default Response -
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public Order activateOrder(ActivateOrderParams params) throws ApiException { return executeActivateOrderAPICall(params).getData(); } public ApiResponse activateOrderWithHttpInfo(ActivateOrderParams params) throws ApiException { return executeActivateOrderAPICall(params); } ApiResponse executeActivateOrderAPICall(ActivateOrderParams params) throws ApiException { return activateOrderWithHttpInfo(params.orderId, params.fields, params.orderFields, params.orderActionsFields, params.subscriptionsFields, params.lineItemsFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.invoiceItemsFields, 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 cancelOrderCall(String orderId, OrderCancellationRequest orderCancellationRequest, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = orderCancellationRequest; // create path and map variables String localVarPath = "/orders/{order_id}/cancel" .replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.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 (orderFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "order.fields[]", orderFields)); } if (orderActionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "order_actions.fields[]", orderActionsFields)); } if (subscriptionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscriptions.fields[]", subscriptionsFields)); } if (lineItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "line_items.fields[]", lineItemsFields)); } 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 (invoiceItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_items.fields[]", invoiceItemsFields)); } 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 cancelOrderValidateBeforeCall(String orderId, OrderCancellationRequest orderCancellationRequest, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling cancelOrder(Async)"); } // verify the required parameter 'orderCancellationRequest' is set if (orderCancellationRequest == null) { throw new ApiException("Missing the required parameter 'orderCancellationRequest' when calling cancelOrder(Async)"); } return cancelOrderCall(orderId, orderCancellationRequest, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse cancelOrderWithHttpInfo(String orderId, OrderCancellationRequest orderCancellationRequest, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = cancelOrderValidateBeforeCall(orderId, orderCancellationRequest, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, 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 cancelOrderAsync(String orderId, OrderCancellationRequest orderCancellationRequest, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = cancelOrderValidateBeforeCall(orderId, orderCancellationRequest, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, 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 CancelOrderParams { private final String orderId; private final OrderCancellationRequest orderCancellationRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List orderFields; private List orderActionsFields; private List subscriptionsFields; private List lineItemsFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List invoiceItemsFields; 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 CancelOrderParams(String orderId, OrderCancellationRequest orderCancellationRequest) { this.orderId = orderId; this.orderCancellationRequest = orderCancellationRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return CancelOrderParams */ public CancelOrderParams 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 CancelOrderParams */ public CancelOrderParams 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`, `account_id`, `order_number`, `order_date`, `state`, `category`, `description`, `scheduled_date`, `scheduled_date_policy`, `line_items`, `subscriptions` </details> (optional) * @return CancelOrderParams */ public CancelOrderParams fields(List fields) { this.fields = fields; return this; } /** * Set orderFields * @param orderFields 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`, `order_number`, `order_date`, `state`, `category`, `description`, `scheduled_date`, `scheduled_date_policy`, `line_items`, `subscriptions` </details> (optional) * @return CancelOrderParams */ public CancelOrderParams orderFields(List orderFields) { this.orderFields = orderFields; return this; } /** * Set orderActionsFields * @param orderActionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `type`, `action_id`, `sequence`, `start_on`, `subscription_plans`, `renew`, `terms`, `cancel`, `pause`, `resume`, `order` </details> (optional) * @return CancelOrderParams */ public CancelOrderParams orderActionsFields(List orderActionsFields) { this.orderActionsFields = orderActionsFields; 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`, `actions` </details> (optional) * @return CancelOrderParams */ public CancelOrderParams subscriptionsFields(List subscriptionsFields) { this.subscriptionsFields = subscriptionsFields; return this; } /** * Set lineItemsFields * @param lineItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `total`, `subtotal`, `quantity_fulfilled`, `quantity_pending_fulfillment`, `unit_of_measure`, `accounting_code`, `adjustment_liability_account`, `unit_amount`, `target_date`, `billing_rule`, `contract_asset_account`, `contract_liability_account`, `description`, `discount_total`, `revenue`, `discount_unit_amount`, `discount_percent`, `category`, `name`, `item_number`, `type`, `list_price`, `list_unit_price`, `original_order_date`, `original_order_id`, `original_order_line_item_id`, `original_order_line_item_number`, `original_order_number`, `product_code`, `price_id`, `purchase_order_number`, `quantity`, `quantity_available_for_return`, `related_subscription_number`, `requires_fulfillment`, `sold_to_id`, `original_sold_to_id`, `tax_code`, `tax_inclusive`, `end_date`, `start_date`, `unbilled_receivables_account`, `state`, `order_id` </details> (optional) * @return CancelOrderParams */ public CancelOrderParams lineItemsFields(List lineItemsFields) { this.lineItemsFields = lineItemsFields; 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`, `subscription_items` </details> (optional) * @return CancelOrderParams */ public CancelOrderParams 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 CancelOrderParams */ public CancelOrderParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set invoiceItemsFields * @param invoiceItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `booking_reference`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `invoice_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `accounting_code`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `document_item_date` </details> (optional) * @return CancelOrderParams */ public CancelOrderParams invoiceItemsFields(List invoiceItemsFields) { this.invoiceItemsFields = invoiceItemsFields; 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 CancelOrderParams */ public CancelOrderParams 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 CancelOrderParams */ public CancelOrderParams 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 CancelOrderParams */ public CancelOrderParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Cancel an order * Cancels a draft order. * @param orderId Identifier for the order, either `order_number` or `order_id` (required) * @param orderCancellationRequest (required) * @return OrderCancelResponse * @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 CancelOrderParams cancelOrderParams(String orderId, OrderCancellationRequest orderCancellationRequest) { return new CancelOrderParams(orderId, orderCancellationRequest); } public OrderCancelResponse cancelOrder(String orderId, OrderCancellationRequest orderCancellationRequest) throws ApiException { CancelOrderParams params = new CancelOrderParams(orderId, orderCancellationRequest); return executeCancelOrderAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse cancelOrderWithHttpInfo(String orderId, OrderCancellationRequest orderCancellationRequest) throws ApiException { CancelOrderParams params = new CancelOrderParams(orderId, orderCancellationRequest); return executeCancelOrderAPICall(params); } **/ /** Legacy Query Params Requests **/ public OrderCancelResponse cancelOrder( String orderId , OrderCancellationRequest orderCancellationRequest , List expand) throws ApiException { CancelOrderParams params = new CancelOrderParams(orderId, orderCancellationRequest); params.expand(expand); return executeCancelOrderAPICall(params).getData(); } /* * add header methods */ public OrderCancelResponse cancelOrder(String orderId , OrderCancellationRequest orderCancellationRequest ,List expand,Headers headers) throws ApiException { CancelOrderParams params = new CancelOrderParams(orderId, orderCancellationRequest) .expand(expand) .headers(headers); return executeCancelOrderAPICall(params).getData(); } /** * Cancel an order * Cancels a draft order. * @param params CancelOrderParams * @return OrderCancelResponse * @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 OrderCancelResponse cancelOrder(CancelOrderParams params) throws ApiException { return executeCancelOrderAPICall(params).getData(); } public ApiResponse cancelOrderWithHttpInfo(CancelOrderParams params) throws ApiException { return executeCancelOrderAPICall(params); } ApiResponse executeCancelOrderAPICall(CancelOrderParams params) throws ApiException { return cancelOrderWithHttpInfo(params.orderId, params.orderCancellationRequest, params.fields, params.orderFields, params.orderActionsFields, params.subscriptionsFields, params.lineItemsFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.invoiceItemsFields, 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 createOrderCall(OrderCreateRequest orderCreateRequest, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = orderCreateRequest; // create path and map variables String localVarPath = "/orders"; 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 (orderFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "order.fields[]", orderFields)); } if (orderActionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "order_actions.fields[]", orderActionsFields)); } if (subscriptionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscriptions.fields[]", subscriptionsFields)); } if (lineItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "line_items.fields[]", lineItemsFields)); } 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 (invoiceItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_items.fields[]", invoiceItemsFields)); } 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 createOrderValidateBeforeCall(OrderCreateRequest orderCreateRequest, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 'orderCreateRequest' is set if (orderCreateRequest == null) { throw new ApiException("Missing the required parameter 'orderCreateRequest' when calling createOrder(Async)"); } return createOrderCall(orderCreateRequest, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse createOrderWithHttpInfo(OrderCreateRequest orderCreateRequest, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = createOrderValidateBeforeCall(orderCreateRequest, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, 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 createOrderAsync(OrderCreateRequest orderCreateRequest, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = createOrderValidateBeforeCall(orderCreateRequest, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, 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 CreateOrderParams { private final OrderCreateRequest orderCreateRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List orderFields; private List orderActionsFields; private List subscriptionsFields; private List lineItemsFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List invoiceItemsFields; 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 CreateOrderParams(OrderCreateRequest orderCreateRequest) { this.orderCreateRequest = orderCreateRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return CreateOrderParams */ public CreateOrderParams 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 CreateOrderParams */ public CreateOrderParams 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`, `account_id`, `order_number`, `order_date`, `state`, `category`, `description`, `scheduled_date`, `scheduled_date_policy`, `line_items`, `subscriptions` </details> (optional) * @return CreateOrderParams */ public CreateOrderParams fields(List fields) { this.fields = fields; return this; } /** * Set orderFields * @param orderFields 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`, `order_number`, `order_date`, `state`, `category`, `description`, `scheduled_date`, `scheduled_date_policy`, `line_items`, `subscriptions` </details> (optional) * @return CreateOrderParams */ public CreateOrderParams orderFields(List orderFields) { this.orderFields = orderFields; return this; } /** * Set orderActionsFields * @param orderActionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `type`, `action_id`, `sequence`, `start_on`, `subscription_plans`, `renew`, `terms`, `cancel`, `pause`, `resume`, `order` </details> (optional) * @return CreateOrderParams */ public CreateOrderParams orderActionsFields(List orderActionsFields) { this.orderActionsFields = orderActionsFields; 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`, `actions` </details> (optional) * @return CreateOrderParams */ public CreateOrderParams subscriptionsFields(List subscriptionsFields) { this.subscriptionsFields = subscriptionsFields; return this; } /** * Set lineItemsFields * @param lineItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `total`, `subtotal`, `quantity_fulfilled`, `quantity_pending_fulfillment`, `unit_of_measure`, `accounting_code`, `adjustment_liability_account`, `unit_amount`, `target_date`, `billing_rule`, `contract_asset_account`, `contract_liability_account`, `description`, `discount_total`, `revenue`, `discount_unit_amount`, `discount_percent`, `category`, `name`, `item_number`, `type`, `list_price`, `list_unit_price`, `original_order_date`, `original_order_id`, `original_order_line_item_id`, `original_order_line_item_number`, `original_order_number`, `product_code`, `price_id`, `purchase_order_number`, `quantity`, `quantity_available_for_return`, `related_subscription_number`, `requires_fulfillment`, `sold_to_id`, `original_sold_to_id`, `tax_code`, `tax_inclusive`, `end_date`, `start_date`, `unbilled_receivables_account`, `state`, `order_id` </details> (optional) * @return CreateOrderParams */ public CreateOrderParams lineItemsFields(List lineItemsFields) { this.lineItemsFields = lineItemsFields; 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`, `subscription_items` </details> (optional) * @return CreateOrderParams */ public CreateOrderParams 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 CreateOrderParams */ public CreateOrderParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set invoiceItemsFields * @param invoiceItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `booking_reference`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `invoice_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `accounting_code`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `document_item_date` </details> (optional) * @return CreateOrderParams */ public CreateOrderParams invoiceItemsFields(List invoiceItemsFields) { this.invoiceItemsFields = invoiceItemsFields; 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 CreateOrderParams */ public CreateOrderParams 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 CreateOrderParams */ public CreateOrderParams 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 CreateOrderParams */ public CreateOrderParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Create an order * You can use this operation to create subscriptions and make changes to existing subscriptions. You can also use this operation to create order line items. <p> Note that the following limitations apply to this operation: <ul> <li>Up to 50 subscriptions are allowed in a single call.</li> <li>Up to 100 order line items are allowed in an order.</li> <li>Up to 1000 orders are allowed on a subscription.</li> </ul> * @param orderCreateRequest (required) * @return Order * @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 CreateOrderParams createOrderParams(OrderCreateRequest orderCreateRequest) { return new CreateOrderParams(orderCreateRequest); } public Order createOrder(OrderCreateRequest orderCreateRequest) throws ApiException { CreateOrderParams params = new CreateOrderParams(orderCreateRequest); return executeCreateOrderAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse createOrderWithHttpInfo(OrderCreateRequest orderCreateRequest) throws ApiException { CreateOrderParams params = new CreateOrderParams(orderCreateRequest); return executeCreateOrderAPICall(params); } **/ /** Legacy Query Params Requests **/ public Order createOrder( OrderCreateRequest orderCreateRequest , List expand) throws ApiException { CreateOrderParams params = new CreateOrderParams(orderCreateRequest); params.expand(expand); return executeCreateOrderAPICall(params).getData(); } /* * add header methods */ public Order createOrder(OrderCreateRequest orderCreateRequest ,List expand,Headers headers) throws ApiException { CreateOrderParams params = new CreateOrderParams(orderCreateRequest) .expand(expand) .headers(headers); return executeCreateOrderAPICall(params).getData(); } /** * Create an order * You can use this operation to create subscriptions and make changes to existing subscriptions. You can also use this operation to create order line items. <p> Note that the following limitations apply to this operation: <ul> <li>Up to 50 subscriptions are allowed in a single call.</li> <li>Up to 100 order line items are allowed in an order.</li> <li>Up to 1000 orders are allowed on a subscription.</li> </ul> * @param params CreateOrderParams * @return Order * @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 Order create(CreateOrderParams params) throws ApiException { return executeCreateOrderAPICall(params).getData(); } public ApiResponse createWithHttpInfo(CreateOrderParams params) throws ApiException { return executeCreateOrderAPICall(params); } ApiResponse executeCreateOrderAPICall(CreateOrderParams params) throws ApiException { return createOrderWithHttpInfo(params.orderCreateRequest, params.fields, params.orderFields, params.orderActionsFields, params.subscriptionsFields, params.lineItemsFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.invoiceItemsFields, 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 createOrderPreviewCall(OrderPreviewCreateRequest orderPreviewCreateRequest, 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 = orderPreviewCreateRequest; // create path and map variables String localVarPath = "/orders/preview"; 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 createOrderPreviewValidateBeforeCall(OrderPreviewCreateRequest orderPreviewCreateRequest, 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 'orderPreviewCreateRequest' is set if (orderPreviewCreateRequest == null) { throw new ApiException("Missing the required parameter 'orderPreviewCreateRequest' when calling createOrderPreview(Async)"); } return createOrderPreviewCall(orderPreviewCreateRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse createOrderPreviewWithHttpInfo(OrderPreviewCreateRequest orderPreviewCreateRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = createOrderPreviewValidateBeforeCall(orderPreviewCreateRequest, 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 createOrderPreviewAsync(OrderPreviewCreateRequest orderPreviewCreateRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createOrderPreviewValidateBeforeCall(orderPreviewCreateRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class CreateOrderPreviewParams { private final OrderPreviewCreateRequest orderPreviewCreateRequest; 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 CreateOrderPreviewParams(OrderPreviewCreateRequest orderPreviewCreateRequest) { this.orderPreviewCreateRequest = orderPreviewCreateRequest; } /** * Set headers * @param headers Headers * @return CreateOrderPreviewParams */ public CreateOrderPreviewParams 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 order * Retrieves the preview of the order delta metrics and invoice items of a specified order. Preview for subscriptions and order line items are both supported. This operation is only an order preview and no order is created. <p> Note that the following limitations apply to this operation: <ul> <li>Up to 50 subscriptions are allowed in a single call.</li> <li>Up to 100 order line items are allowed in an order preview.</li> </ul> * @param orderPreviewCreateRequest (required) * @return OrderPreviewResponse * @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 CreateOrderPreviewParams createOrderPreviewParams(OrderPreviewCreateRequest orderPreviewCreateRequest) { return new CreateOrderPreviewParams(orderPreviewCreateRequest); } public OrderPreviewResponse createOrderPreview(OrderPreviewCreateRequest orderPreviewCreateRequest) throws ApiException { CreateOrderPreviewParams params = new CreateOrderPreviewParams(orderPreviewCreateRequest); return executeCreateOrderPreviewAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse createOrderPreviewWithHttpInfo(OrderPreviewCreateRequest orderPreviewCreateRequest) throws ApiException { CreateOrderPreviewParams params = new CreateOrderPreviewParams(orderPreviewCreateRequest); return executeCreateOrderPreviewAPICall(params); } **/ /** Legacy Query Params Requests **/ /* * add header methods */ public OrderPreviewResponse createOrderPreview(OrderPreviewCreateRequest orderPreviewCreateRequest ,Headers headers) throws ApiException { CreateOrderPreviewParams params = new CreateOrderPreviewParams(orderPreviewCreateRequest) .headers(headers); return executeCreateOrderPreviewAPICall(params).getData(); } /** * Preview an order * Retrieves the preview of the order delta metrics and invoice items of a specified order. Preview for subscriptions and order line items are both supported. This operation is only an order preview and no order is created. <p> Note that the following limitations apply to this operation: <ul> <li>Up to 50 subscriptions are allowed in a single call.</li> <li>Up to 100 order line items are allowed in an order preview.</li> </ul> * @param params CreateOrderPreviewParams * @return OrderPreviewResponse * @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 OrderPreviewResponse preview(CreateOrderPreviewParams params) throws ApiException { return executeCreateOrderPreviewAPICall(params).getData(); } public ApiResponse previewWithHttpInfo(CreateOrderPreviewParams params) throws ApiException { return executeCreateOrderPreviewAPICall(params); } ApiResponse executeCreateOrderPreviewAPICall(CreateOrderPreviewParams params) throws ApiException { return createOrderPreviewWithHttpInfo(params.orderPreviewCreateRequest, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call deleteOrderCall(String orderId, 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 = "/orders/{order_id}" .replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.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 deleteOrderValidateBeforeCall(String orderId, 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 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)"); } return deleteOrderCall(orderId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse deleteOrderWithHttpInfo(String orderId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); return localVarApiClient.execute(localVarCall); } private okhttp3.Call deleteOrderAsync(String orderId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } public static class DeleteOrderParams { private final String orderId; 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 DeleteOrderParams(String orderId) { this.orderId = orderId; } /** * Set headers * @param headers Headers * @return DeleteOrderParams */ public DeleteOrderParams 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 order * Deletes an order. * @param orderId Identifier for the order, either `order_number` or `order_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 DeleteOrderParams deleteOrderParams(String orderId) { return new DeleteOrderParams(orderId); } public void deleteOrder(String orderId) throws ApiException { DeleteOrderParams params = new DeleteOrderParams(orderId); executeDeleteOrderAPICall(params); } /** * Expose HTTP info public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { DeleteOrderParams params = new DeleteOrderParams(orderId); return executeDeleteOrderAPICall(params); } **/ /** Legacy Query Params Requests **/ /* * add header methods */ public void deleteOrder(String orderId ,Headers headers) throws ApiException { DeleteOrderParams params = new DeleteOrderParams(orderId) .headers(headers); executeDeleteOrderAPICall(params); } /** * Delete an order * Deletes an order. * @param params DeleteOrderParams * @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 deleteOrder(DeleteOrderParams params) throws ApiException { executeDeleteOrderAPICall(params).getData(); } public ApiResponse deleteOrderWithHttpInfo(DeleteOrderParams params) throws ApiException { return executeDeleteOrderAPICall(params); } ApiResponse executeDeleteOrderAPICall(DeleteOrderParams params) throws ApiException { return deleteOrderWithHttpInfo(params.orderId, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call getOrderCall(String orderId, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = "/orders/{order_id}" .replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.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 (orderFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "order.fields[]", orderFields)); } if (orderActionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "order_actions.fields[]", orderActionsFields)); } if (subscriptionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscriptions.fields[]", subscriptionsFields)); } if (lineItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "line_items.fields[]", lineItemsFields)); } 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 (invoiceItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_items.fields[]", invoiceItemsFields)); } 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 getOrderValidateBeforeCall(String orderId, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling getOrder(Async)"); } return getOrderCall(orderId, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getOrderWithHttpInfo(String orderId, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = getOrderValidateBeforeCall(orderId, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, 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 getOrderAsync(String orderId, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = getOrderValidateBeforeCall(orderId, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, 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 GetOrderParams { private final String orderId; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List orderFields; private List orderActionsFields; private List subscriptionsFields; private List lineItemsFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List invoiceItemsFields; 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 GetOrderParams(String orderId) { this.orderId = orderId; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return GetOrderParams */ public GetOrderParams 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 GetOrderParams */ public GetOrderParams 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`, `account_id`, `order_number`, `order_date`, `state`, `category`, `description`, `scheduled_date`, `scheduled_date_policy`, `line_items`, `subscriptions` </details> (optional) * @return GetOrderParams */ public GetOrderParams fields(List fields) { this.fields = fields; return this; } /** * Set orderFields * @param orderFields 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`, `order_number`, `order_date`, `state`, `category`, `description`, `scheduled_date`, `scheduled_date_policy`, `line_items`, `subscriptions` </details> (optional) * @return GetOrderParams */ public GetOrderParams orderFields(List orderFields) { this.orderFields = orderFields; return this; } /** * Set orderActionsFields * @param orderActionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `type`, `action_id`, `sequence`, `start_on`, `subscription_plans`, `renew`, `terms`, `cancel`, `pause`, `resume`, `order` </details> (optional) * @return GetOrderParams */ public GetOrderParams orderActionsFields(List orderActionsFields) { this.orderActionsFields = orderActionsFields; 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`, `actions` </details> (optional) * @return GetOrderParams */ public GetOrderParams subscriptionsFields(List subscriptionsFields) { this.subscriptionsFields = subscriptionsFields; return this; } /** * Set lineItemsFields * @param lineItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `total`, `subtotal`, `quantity_fulfilled`, `quantity_pending_fulfillment`, `unit_of_measure`, `accounting_code`, `adjustment_liability_account`, `unit_amount`, `target_date`, `billing_rule`, `contract_asset_account`, `contract_liability_account`, `description`, `discount_total`, `revenue`, `discount_unit_amount`, `discount_percent`, `category`, `name`, `item_number`, `type`, `list_price`, `list_unit_price`, `original_order_date`, `original_order_id`, `original_order_line_item_id`, `original_order_line_item_number`, `original_order_number`, `product_code`, `price_id`, `purchase_order_number`, `quantity`, `quantity_available_for_return`, `related_subscription_number`, `requires_fulfillment`, `sold_to_id`, `original_sold_to_id`, `tax_code`, `tax_inclusive`, `end_date`, `start_date`, `unbilled_receivables_account`, `state`, `order_id` </details> (optional) * @return GetOrderParams */ public GetOrderParams lineItemsFields(List lineItemsFields) { this.lineItemsFields = lineItemsFields; 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`, `subscription_items` </details> (optional) * @return GetOrderParams */ public GetOrderParams 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 GetOrderParams */ public GetOrderParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set invoiceItemsFields * @param invoiceItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `booking_reference`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `invoice_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `accounting_code`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `document_item_date` </details> (optional) * @return GetOrderParams */ public GetOrderParams invoiceItemsFields(List invoiceItemsFields) { this.invoiceItemsFields = invoiceItemsFields; 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 GetOrderParams */ public GetOrderParams 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 GetOrderParams */ public GetOrderParams 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 GetOrderParams */ public GetOrderParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Retrieve an order * Use this operation to retrieve the detailed information about a specific order. * @param orderId Identifier for the order, either `order_number` or `order_id` (required) * @return Order * @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 GetOrderParams getOrderParams(String orderId) { return new GetOrderParams(orderId); } public Order getOrder(String orderId) throws ApiException { GetOrderParams params = new GetOrderParams(orderId); return executeGetOrderAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getOrderWithHttpInfo(String orderId) throws ApiException { GetOrderParams params = new GetOrderParams(orderId); return executeGetOrderAPICall(params); } **/ /** Legacy Query Params Requests **/ public Order getOrder( String orderId , List expand) throws ApiException { GetOrderParams params = new GetOrderParams(orderId); params.expand(expand); return executeGetOrderAPICall(params).getData(); } /* * add header methods */ public Order getOrder(String orderId ,List expand,Headers headers) throws ApiException { GetOrderParams params = new GetOrderParams(orderId) .expand(expand) .headers(headers); return executeGetOrderAPICall(params).getData(); } /** * Retrieve an order * Use this operation to retrieve the detailed information about a specific order. * @param params GetOrderParams * @return Order * @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 Order get(GetOrderParams params) throws ApiException { return executeGetOrderAPICall(params).getData(); } public ApiResponse getWithHttpInfo(GetOrderParams params) throws ApiException { return executeGetOrderAPICall(params); } ApiResponse executeGetOrderAPICall(GetOrderParams params) throws ApiException { return getOrderWithHttpInfo(params.orderId, params.fields, params.orderFields, params.orderActionsFields, params.subscriptionsFields, params.lineItemsFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.invoiceItemsFields, 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 getOrdersCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, 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 = "/orders"; 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 (orderFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "order.fields[]", orderFields)); } if (orderActionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "order_actions.fields[]", orderActionsFields)); } if (subscriptionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscriptions.fields[]", subscriptionsFields)); } if (lineItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "line_items.fields[]", lineItemsFields)); } 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 (invoiceItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_items.fields[]", invoiceItemsFields)); } 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 getOrdersValidateBeforeCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { return getOrdersCall(cursor, expand, filter, sort, pageSize, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getOrdersWithHttpInfo(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getOrdersValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, 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 getOrdersAsync(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List orderFields, List orderActionsFields, List subscriptionsFields, List lineItemsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getOrdersValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, orderFields, orderActionsFields, subscriptionsFields, lineItemsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceItemsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class GetOrdersParams { 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 orderFields; private List orderActionsFields; private List subscriptionsFields; private List lineItemsFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List invoiceItemsFields; 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 GetOrdersParams() { } /** * Set listQueryParams * @param listQueryParams ListQueryParams * @return GetOrdersParams */ public GetOrdersParams 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 GetOrdersParams */ public GetOrdersParams 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 GetOrdersParams */ public GetOrdersParams 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 GetOrdersParams */ public GetOrdersParams 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 GetOrdersParams */ public GetOrdersParams 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 GetOrdersParams */ public GetOrdersParams 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 GetOrdersParams */ public GetOrdersParams 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`, `account_id`, `order_number`, `order_date`, `state`, `category`, `description`, `scheduled_date`, `scheduled_date_policy`, `line_items`, `subscriptions` </details> (optional) * @return GetOrdersParams */ public GetOrdersParams fields(List fields) { this.fields = fields; return this; } /** * Set orderFields * @param orderFields 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`, `order_number`, `order_date`, `state`, `category`, `description`, `scheduled_date`, `scheduled_date_policy`, `line_items`, `subscriptions` </details> (optional) * @return GetOrdersParams */ public GetOrdersParams orderFields(List orderFields) { this.orderFields = orderFields; return this; } /** * Set orderActionsFields * @param orderActionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `type`, `action_id`, `sequence`, `start_on`, `subscription_plans`, `renew`, `terms`, `cancel`, `pause`, `resume`, `order` </details> (optional) * @return GetOrdersParams */ public GetOrdersParams orderActionsFields(List orderActionsFields) { this.orderActionsFields = orderActionsFields; 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`, `actions` </details> (optional) * @return GetOrdersParams */ public GetOrdersParams subscriptionsFields(List subscriptionsFields) { this.subscriptionsFields = subscriptionsFields; return this; } /** * Set lineItemsFields * @param lineItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `total`, `subtotal`, `quantity_fulfilled`, `quantity_pending_fulfillment`, `unit_of_measure`, `accounting_code`, `adjustment_liability_account`, `unit_amount`, `target_date`, `billing_rule`, `contract_asset_account`, `contract_liability_account`, `description`, `discount_total`, `revenue`, `discount_unit_amount`, `discount_percent`, `category`, `name`, `item_number`, `type`, `list_price`, `list_unit_price`, `original_order_date`, `original_order_id`, `original_order_line_item_id`, `original_order_line_item_number`, `original_order_number`, `product_code`, `price_id`, `purchase_order_number`, `quantity`, `quantity_available_for_return`, `related_subscription_number`, `requires_fulfillment`, `sold_to_id`, `original_sold_to_id`, `tax_code`, `tax_inclusive`, `end_date`, `start_date`, `unbilled_receivables_account`, `state`, `order_id` </details> (optional) * @return GetOrdersParams */ public GetOrdersParams lineItemsFields(List lineItemsFields) { this.lineItemsFields = lineItemsFields; 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`, `subscription_items` </details> (optional) * @return GetOrdersParams */ public GetOrdersParams 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 GetOrdersParams */ public GetOrdersParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set invoiceItemsFields * @param invoiceItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `booking_reference`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `invoice_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `accounting_code`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `document_item_date` </details> (optional) * @return GetOrdersParams */ public GetOrdersParams invoiceItemsFields(List invoiceItemsFields) { this.invoiceItemsFields = invoiceItemsFields; return this; } } /** * List orders * Lists all or a subset of orders in your tenant. * @return OrderListResponse * @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 GetOrdersParams getOrdersParams() { return new GetOrdersParams(); } public OrderListResponse getOrders() throws ApiException { GetOrdersParams params = new GetOrdersParams(); return executeGetOrdersAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getOrdersWithHttpInfo() throws ApiException { GetOrdersParams params = new GetOrdersParams(); return executeGetOrdersAPICall(params); } **/ /** Legacy Query Params Requests **/ public OrderListResponse getOrders(String cursor, List expand, List filter) throws ApiException { GetOrdersParams params = new GetOrdersParams(); params.cursor(cursor); params.expand(expand); params.filter(filter); return executeGetOrdersAPICall(params).getData(); } /* * add header methods */ public OrderListResponse getOrders(String cursor,List expand,List filter,Headers headers) throws ApiException { GetOrdersParams params = new GetOrdersParams() .cursor(cursor) .expand(expand) .filter(filter) .headers(headers); return executeGetOrdersAPICall(params).getData(); } /** * List orders * Lists all or a subset of orders in your tenant. * @param params GetOrdersParams * @return OrderListResponse * @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 OrderListResponse list(GetOrdersParams params) throws ApiException { return executeGetOrdersAPICall(params).getData(); } public ApiResponse listWithHttpInfo(GetOrdersParams params) throws ApiException { return executeGetOrdersAPICall(params); } ApiResponse executeGetOrdersAPICall(GetOrdersParams params) throws ApiException { return getOrdersWithHttpInfo(params.cursor, params.expand, params.filter, params.sort, params.pageSize, params.fields, params.orderFields, params.orderActionsFields, params.subscriptionsFields, params.lineItemsFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.invoiceItemsFields, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy