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

com.zuora.api.OrdersApi Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
 * Zuora API Reference
 * REST API reference for the Zuora Billing, Payments, and Central Platform! Check out the [REST API Overview](https://www.zuora.com/developer/api-references/api/overview/).
 *
 * The version of the OpenAPI document: 2024-05-20
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.zuora.api;

import com.zuora.ApiCallback;
import com.zuora.ApiClient;
import com.zuora.ApiException;
import com.zuora.ApiResponse;
import com.zuora.Configuration;
import com.zuora.Pair;
import com.zuora.ProgressRequestBody;
import com.zuora.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import java.math.BigDecimal;
import com.zuora.model.CreateOrderResponseOrderAction;
import com.zuora.model.CreateOrderResponseOrderMetric;
import com.zuora.model.OrderStatus;
import com.zuora.model.CancelOrderRequest;
import com.zuora.model.CancelOrderResponse;
import com.zuora.model.CommonErrorResponse;
import com.zuora.model.CommonResponse;
import com.zuora.model.CreateOrderAsyncRequest;
import com.zuora.model.CreateOrderAsyncResponse;
import com.zuora.model.CreateOrderRequest;
import com.zuora.model.CreateOrderResponse;
import com.zuora.model.GetAsyncOrderJobResponse;
import com.zuora.model.GetOrderResponse;
import com.zuora.model.GetOrdersResponse;
import java.time.LocalDate;
import com.zuora.model.PreviewOrderAsyncRequest;
import com.zuora.model.PreviewOrderAsyncResponse;
import com.zuora.model.PreviewOrderRequest;
import com.zuora.model.PreviewOrderResponse;
import com.zuora.model.ProxyUnauthorizedResponse;
import com.zuora.model.RevertOrderRequest;
import com.zuora.model.RevertOrderResponse;
import com.zuora.model.UpdateOrderCustomFieldsRequest;
import com.zuora.model.UpdateOrderRequest;
import com.zuora.model.UpdateOrderTriggerDatesRequest;
import com.zuora.model.UpdateOrderTriggerDatesResponse;
import com.zuora.model.UpdateSubscriptionCustomFieldsRequest;

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 orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = "/v1/orders/{orderNumber}/activate"
            .replace("{" + "orderNumber" + "}", localVarApiClient.escapeString(orderNumber.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

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

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

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

        if (zuoraTrackId != null) {
            localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
        }

        if (zuoraEntityIds != null) {
            localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
        }

        if (zuoraVersion != null) {
            localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
        }

        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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call activateOrderValidateBeforeCall(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'orderNumber' is set
        if (orderNumber == null) {
            throw new ApiException("Missing the required parameter 'orderNumber' when calling activateOrder(Async)");
        }

        return activateOrderCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback);

    }

            /**
            * Activate an order
            * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing.  Activate order is only available for draft orders. 
                * @param orderNumber Order number of a order in which you are to activate. (required)
                * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it.  (optional)
                * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.  (optional)
                * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken).  (optional)
                * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`).  (optional)
                * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header.  (optional)
                * @param zuoraVersion The minor version of the Zuora REST API.   (optional, default to 2024-05-20)
                * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs.  (optional)
                * @return CreateOrderResponse
            * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
                * @http.response.details
                
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected CreateOrderResponse activateOrder(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = activateOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse activateOrderWithHttpInfo(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = activateOrderValidateBeforeCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call activateOrderAsync(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = activateOrderValidateBeforeCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class ActivateOrderApi { private final String orderNumber; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private ActivateOrderApi(String orderNumber) { this.orderNumber = orderNumber; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return ActivateOrderApi */ public ActivateOrderApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return ActivateOrderApi */ public ActivateOrderApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return ActivateOrderApi */ public ActivateOrderApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return ActivateOrderApi */ public ActivateOrderApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return ActivateOrderApi */ public ActivateOrderApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return ActivateOrderApi */ public ActivateOrderApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return ActivateOrderApi */ public ActivateOrderApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for activateOrder * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return activateOrderCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute activateOrder request * @return CreateOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public CreateOrderResponse execute() throws ApiException { ApiResponse localVarResp = activateOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute activateOrder request with HTTP info returned * @return ApiResponse<CreateOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return activateOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); } /** * Execute activateOrder request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return activateOrderAsync(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * Activate an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. Activate order is only available for draft orders. * @param orderNumber Order number of a order in which you are to activate. (required) * @return ActivateOrderApi */ public ActivateOrderApi activateOrderApi(String orderNumber) { return new ActivateOrderApi(orderNumber); } private okhttp3.Call cancelOrderCall(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, CancelOrderRequest body, 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 = body; // create path and map variables String localVarPath = "/v1/orders/{orderNumber}/cancel" .replace("{" + "orderNumber" + "}", localVarApiClient.escapeString(orderNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call cancelOrderValidateBeforeCall(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, CancelOrderRequest body, final ApiCallback _callback) throws ApiException { // verify the required parameter 'orderNumber' is set if (orderNumber == null) { throw new ApiException("Missing the required parameter 'orderNumber' when calling cancelOrder(Async)"); } return cancelOrderCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, body, _callback); } /** * Cancel an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** Cancellation is only valid for draft or scheduled orders. If the order is not in draft or scheduled status, the API returns an error. The Scheduled Orders feature is in the Early Adopter phase. We are actively soliciting feedback from a small set of early adopters before releasing it as generally available. If you want to join this early adopter program, submit a request at <a href=\"https://support.zuora.com/hc/en-us\" target=\"_blank\">Zuora Global Support</a>. * @param orderNumber The order number of the draft order you wish to cancel. (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @param body (optional) * @return CancelOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected CancelOrderResponse cancelOrder(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, CancelOrderRequest body) throws ApiException { ApiResponse localVarResp = cancelOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, body); return localVarResp.getData(); } private ApiResponse cancelOrderWithHttpInfo(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, CancelOrderRequest body) throws ApiException { okhttp3.Call localVarCall = cancelOrderValidateBeforeCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, body, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call cancelOrderAsync(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, CancelOrderRequest body, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = cancelOrderValidateBeforeCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, body, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class CancelOrderApi { private final String orderNumber; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private CancelOrderRequest body; private CancelOrderApi(String orderNumber) { this.orderNumber = orderNumber; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return CancelOrderApi */ public CancelOrderApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return CancelOrderApi */ public CancelOrderApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return CancelOrderApi */ public CancelOrderApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return CancelOrderApi */ public CancelOrderApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return CancelOrderApi */ public CancelOrderApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return CancelOrderApi */ public CancelOrderApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return CancelOrderApi */ public CancelOrderApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Set body * @param body (optional) * @return CancelOrderApi */ public CancelOrderApi body(CancelOrderRequest body) { this.body = body; return this; } /** * Build call for cancelOrder * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return cancelOrderCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, body, _callback); } /** * Execute cancelOrder request * @return CancelOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public CancelOrderResponse execute() throws ApiException { ApiResponse localVarResp = cancelOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, body); return localVarResp.getData(); } /** * Execute cancelOrder request with HTTP info returned * @return ApiResponse<CancelOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return cancelOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, body); } /** * Execute cancelOrder request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return cancelOrderAsync(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, body, _callback); } } /** * Cancel an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** Cancellation is only valid for draft or scheduled orders. If the order is not in draft or scheduled status, the API returns an error. The Scheduled Orders feature is in the Early Adopter phase. We are actively soliciting feedback from a small set of early adopters before releasing it as generally available. If you want to join this early adopter program, submit a request at <a href=\"https://support.zuora.com/hc/en-us\" target=\"_blank\">Zuora Global Support</a>. * @param orderNumber The order number of the draft order you wish to cancel. (required) * @return CancelOrderApi */ public CancelOrderApi cancelOrderApi(String orderNumber) { return new CancelOrderApi(orderNumber); } private okhttp3.Call createOrderCall(CreateOrderRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean returnIds, String zuoraVersion, 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 = body; // create path and map variables String localVarPath = "/v1/orders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (returnIds != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("returnIds", returnIds)); } 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 (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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(CreateOrderRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean returnIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createOrder(Async)"); } return createOrderCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Create an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. You can use this operation to create subscriptions and make changes to subscriptions by creating orders. You can also use this operation to create order line items by creating orders. The following tutorials demonstrate how to use this operation: * [Create a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/A_Create_a_Subscription) * [Add a Product to a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/A_Add_a_Product_to_a_Subscription) * [Create a Ramp Deal](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Ramps_and_Ramp_Metrics/B_Create_a_Ramp_Deal) * [Add a Product Mid-Interval Update on a Ramp Deal](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Ramps_and_Ramp_Metrics/E_Update_a_Product_in_a_Ramp_Deal) * [Add a Product in a Ramp Deal](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Ramps_and_Ramp_Metrics/C_Add_a_Product_in_a_Ramp_Deal) * [Change the Terms and Conditions of a Ramp Deal](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Ramps_and_Ramp_Metrics/D_Change_the_Terms_and_Conditions_of_a_Ramp_Deal_and_Update_the_Ramp) * [Change the Owner of a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Change_the_Owner_of_a_Subscription) * [Change the Terms and Conditions of a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Change_the_Terms_and_Conditions_of_a_Subscription) * [Renew a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Renew_a_Subscription) * [Renew a Subscription and Upgrade a Product](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Renew_a_Subscription_and_Upgrade_a_Product) * [Replace a Product in a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Replace_a_Product_in_a_Subscription) * [Update a Product in a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Update_a_Product_in_a_Subscription) * [Cancel a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/D_Cancel_a_Subscription) * [Remove a Product from a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/D_Remove_a_Product_from_a_Subscription) * [Create a sales order line item without fulfillments](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AC_Create_a_sales_order_line_item_without_fulfillments) * [Create a sales order line item with fulfillments](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AD_Create_a_sales_order_line_item_with_fulfillments) * [Create an order line item with a new subscription](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AE_Create_an_order_line_item_with_a_new_subscription) * [Create a return order line item without fulfillments](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AF_Create_a_return_order_line_item_without_fulfillments) * [Create a return order line item with fulfillments](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/Create_a_return_order_line_item_with_fulfillments) **Note:** If you received a timeout error message when creating an order, the call is still running in the backend and the order will be created. The limit of orders allowed on a subscription is 1000. The limit of order line items allowed in an order is 100. Zuora has the following limits on the Orders synchronous API to prevent performance degradation: * Up to 50 subscriptions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed on a single subscription in a [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. If you have an Order that exceeds any limits of the above, Zuora recommends you use the following asynchronous API operations: * [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) * [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) Zuora has the following limits on the Orders asynchronous API operations to prevent performance degradation: * Up to 300 subscriptions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed on a single subscription in a [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. **Note:** When you are to suspend a subcription (via the `suspend` order action), if in the same \"Create an order\" call you are to perform other subsequent order actions on the supscription to suspend, you must first resume the subscription (via a `resume` order action). **Note:** When using this operation to create an account, create a subscription, run billing, and collect payment in a single call, if any error occurs during the call, such as a payment processing failure and a tax engine failure, then all the other steps will be rolled back. This means that the invoice will not be generated, the subscription will not be created, and the account will not be created. * @param body (required) * @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param returnIds Specify whether to return IDs associated with the numbers returned in the \"Create an order\" operation. (optional, default to false) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return CreateOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected CreateOrderResponse createOrder(CreateOrderRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean returnIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = createOrderWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse createOrderWithHttpInfo(CreateOrderRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean returnIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = createOrderValidateBeforeCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call createOrderAsync(CreateOrderRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean returnIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createOrderValidateBeforeCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class CreateOrderApi { private final CreateOrderRequest body; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private Boolean returnIds; private String zuoraVersion; private String zuoraOrgIds; private CreateOrderApi(CreateOrderRequest body) { this.body = body; } /** * Set idempotencyKey * @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional) * @return CreateOrderApi */ public CreateOrderApi idempotencyKey(String idempotencyKey) { this.idempotencyKey = idempotencyKey; return this; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return CreateOrderApi */ public CreateOrderApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return CreateOrderApi */ public CreateOrderApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return CreateOrderApi */ public CreateOrderApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return CreateOrderApi */ public CreateOrderApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return CreateOrderApi */ public CreateOrderApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set returnIds * @param returnIds Specify whether to return IDs associated with the numbers returned in the \"Create an order\" operation. (optional, default to false) * @return CreateOrderApi */ public CreateOrderApi returnIds(Boolean returnIds) { this.returnIds = returnIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return CreateOrderApi */ public CreateOrderApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return CreateOrderApi */ public CreateOrderApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for createOrder * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return createOrderCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute createOrder request * @return CreateOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public CreateOrderResponse execute() throws ApiException { ApiResponse localVarResp = createOrderWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute createOrder request with HTTP info returned * @return ApiResponse<CreateOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return createOrderWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds); } /** * Execute createOrder request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return createOrderAsync(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds, _callback); } private String getTrackId(final Map> headers) { if (zuoraTrackId != null) { return zuoraTrackId; } else if (headers.containsKey("zuora-request-id") && headers.get("zuora-request-id") != null && !headers.get("zuora-request-id").isEmpty()) { return headers.get("zuora-request-id").get(0); } return null; } private boolean isNumberVersion(String zuoraVersion) { try { Double.parseDouble(zuoraVersion); return true; } catch (Exception e) { return false; } } public CreateOrderResponse executeWithOrderMetrics() throws ApiException { if (zuoraVersion != null && isNumberVersion(zuoraVersion) && Double.compare(Double.parseDouble(zuoraVersion), 223.0) < 0) { throw new ApiException("Zuora-Version must be equal to or greater than 223.0"); } final ApiResponse localVarResp = createOrderWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds); final String trackId = getTrackId(localVarResp.getHeaders()); CreateOrderResponse createOrderResponse = localVarResp.getData(); try { if (createOrderResponse.getSuccess() && OrderStatus.COMPLETED.equals(createOrderResponse.getStatus()) && createOrderResponse.getSubscriptions() != null) { GetOrderResponse getOrderResponse = getOrderApi(createOrderResponse.getOrderNumber()) .authorization(authorization) .acceptEncoding(acceptEncoding) .zuoraEntityIds(zuoraEntityIds) .zuoraVersion(zuoraVersion) .zuoraTrackId(trackId) .contentEncoding(contentEncoding) .zuoraOrgIds(zuoraOrgIds) .execute(); if (getOrderResponse.getSuccess()) { getOrderResponse.getOrder().getSubscriptions().forEach(sub -> { List responseOrderActions = new ArrayList<>(); if (sub.getOrderActions() != null) { sub.getOrderActions().forEach(orderAction -> { if (orderAction.getOrderMetrics() != null) { CreateOrderResponseOrderAction responseOrderAction = new CreateOrderResponseOrderAction(); responseOrderAction.setId(orderAction.getId()); responseOrderAction.setType(orderAction.getType()); List orderMetrics = new ArrayList<>(); orderAction.getOrderMetrics().forEach(orderMetric -> { CreateOrderResponseOrderMetric createOrderResponseOrderMetric = new CreateOrderResponseOrderMetric(); createOrderResponseOrderMetric.setChargeNumber(orderMetric.getChargeNumber()); createOrderResponseOrderMetric.setQuantity(orderMetric.getQuantity()); createOrderResponseOrderMetric.setMrr(orderMetric.getMrr()); createOrderResponseOrderMetric.setTcv(orderMetric.getTcv()); createOrderResponseOrderMetric.setTcb(orderMetric.getTcb()); orderMetrics.add(createOrderResponseOrderMetric); }); responseOrderAction.setOrderMetrics(orderMetrics); responseOrderActions.add(responseOrderAction); } }); createOrderResponse.getSubscriptions().forEach(subscription -> { if (subscription.getSubscriptionNumber().equals(sub.getSubscriptionNumber())) { subscription.setOrderActions(responseOrderActions); } }); } }); } } } catch (Exception e) { e.printStackTrace(); } return createOrderResponse; } } /** * Create an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. You can use this operation to create subscriptions and make changes to subscriptions by creating orders. You can also use this operation to create order line items by creating orders. The following tutorials demonstrate how to use this operation: * [Create a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/A_Create_a_Subscription) * [Add a Product to a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/A_Add_a_Product_to_a_Subscription) * [Create a Ramp Deal](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Ramps_and_Ramp_Metrics/B_Create_a_Ramp_Deal) * [Add a Product Mid-Interval Update on a Ramp Deal](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Ramps_and_Ramp_Metrics/E_Update_a_Product_in_a_Ramp_Deal) * [Add a Product in a Ramp Deal](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Ramps_and_Ramp_Metrics/C_Add_a_Product_in_a_Ramp_Deal) * [Change the Terms and Conditions of a Ramp Deal](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Ramps_and_Ramp_Metrics/D_Change_the_Terms_and_Conditions_of_a_Ramp_Deal_and_Update_the_Ramp) * [Change the Owner of a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Change_the_Owner_of_a_Subscription) * [Change the Terms and Conditions of a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Change_the_Terms_and_Conditions_of_a_Subscription) * [Renew a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Renew_a_Subscription) * [Renew a Subscription and Upgrade a Product](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Renew_a_Subscription_and_Upgrade_a_Product) * [Replace a Product in a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Replace_a_Product_in_a_Subscription) * [Update a Product in a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/C_Update_a_Product_in_a_Subscription) * [Cancel a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/D_Cancel_a_Subscription) * [Remove a Product from a Subscription](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AC_Orders_Tutorials/D_Remove_a_Product_from_a_Subscription) * [Create a sales order line item without fulfillments](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AC_Create_a_sales_order_line_item_without_fulfillments) * [Create a sales order line item with fulfillments](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AD_Create_a_sales_order_line_item_with_fulfillments) * [Create an order line item with a new subscription](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AE_Create_an_order_line_item_with_a_new_subscription) * [Create a return order line item without fulfillments](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AF_Create_a_return_order_line_item_without_fulfillments) * [Create a return order line item with fulfillments](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/Create_a_return_order_line_item_with_fulfillments) **Note:** If you received a timeout error message when creating an order, the call is still running in the backend and the order will be created. The limit of orders allowed on a subscription is 1000. The limit of order line items allowed in an order is 100. Zuora has the following limits on the Orders synchronous API to prevent performance degradation: * Up to 50 subscriptions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed on a single subscription in a [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. If you have an Order that exceeds any limits of the above, Zuora recommends you use the following asynchronous API operations: * [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) * [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) Zuora has the following limits on the Orders asynchronous API operations to prevent performance degradation: * Up to 300 subscriptions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed on a single subscription in a [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. **Note:** When you are to suspend a subcription (via the `suspend` order action), if in the same \"Create an order\" call you are to perform other subsequent order actions on the supscription to suspend, you must first resume the subscription (via a `resume` order action). **Note:** When using this operation to create an account, create a subscription, run billing, and collect payment in a single call, if any error occurs during the call, such as a payment processing failure and a tax engine failure, then all the other steps will be rolled back. This means that the invoice will not be generated, the subscription will not be created, and the account will not be created. * @param body (required) * @return CreateOrderApi */ public CreateOrderApi createOrderApi(CreateOrderRequest body) { return new CreateOrderApi(body); } private okhttp3.Call createOrderAsynchronouslyCall(CreateOrderAsyncRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean returnIds, String zuoraVersion, 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 = body; // create path and map variables String localVarPath = "/v1/async/orders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (returnIds != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("returnIds", returnIds)); } 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 (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 createOrderAsynchronouslyValidateBeforeCall(CreateOrderAsyncRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean returnIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createOrderAsynchronously(Async)"); } return createOrderAsynchronouslyCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Create an order asynchronously * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. In the case where a normal \"Create an order\" operation call will time out, use this operation instead to create an order asynchronously. A job will be creating the order in the back end; the job ID will be returned for tracking the job status and result. Note that this operation doesn't support auto-refund and invoice write-off during subscription cancellation. Use the \"Create an order\" operation instead. The limit of orders allowed on a subscription is 1000. The limit of order line items allowed in an order is 100. Zuora has the following limits on the Orders synchronous API to prevent performance degradation: * Up to 50 subscriptions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed on a single subscription in a [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. If you have an Order that exceeds any limits of the above, Zuora recommends you use the following asynchronous API operations: * [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) * [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) Zuora has the following limits on the Orders asynchronous API operations to prevent performance degradation: * Up to 300 subscriptions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed on a single subscription in a [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * @param body (required) * @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param returnIds Specify whether to return IDs for the [Get job status and response](https://www.zuora.com/developer/api-references/api/operation/Get_JobStatusAndResponse) operation. If you set this query parameter to `true`, the corresponding IDs, which are associated with the numbers returned in this operation, can be returned in the \"Get job status and response\" response body. (optional, default to false) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return CreateOrderAsyncResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
202 Accepted * Content-Encoding -
* Location - URL for accessing the job result, in the format of `/async-jobs/{jobId}`. For example, `/async-jobs/2c90a02d676688200167770ce20601b6`
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected CreateOrderAsyncResponse createOrderAsynchronously(CreateOrderAsyncRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean returnIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = createOrderAsynchronouslyWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse createOrderAsynchronouslyWithHttpInfo(CreateOrderAsyncRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean returnIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = createOrderAsynchronouslyValidateBeforeCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call createOrderAsynchronouslyAsync(CreateOrderAsyncRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean returnIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createOrderAsynchronouslyValidateBeforeCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class CreateOrderAsynchronouslyApi { private final CreateOrderAsyncRequest body; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private Boolean returnIds; private String zuoraVersion; private String zuoraOrgIds; private CreateOrderAsynchronouslyApi(CreateOrderAsyncRequest body) { this.body = body; } /** * Set idempotencyKey * @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional) * @return CreateOrderAsynchronouslyApi */ public CreateOrderAsynchronouslyApi idempotencyKey(String idempotencyKey) { this.idempotencyKey = idempotencyKey; return this; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return CreateOrderAsynchronouslyApi */ public CreateOrderAsynchronouslyApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return CreateOrderAsynchronouslyApi */ public CreateOrderAsynchronouslyApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return CreateOrderAsynchronouslyApi */ public CreateOrderAsynchronouslyApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return CreateOrderAsynchronouslyApi */ public CreateOrderAsynchronouslyApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return CreateOrderAsynchronouslyApi */ public CreateOrderAsynchronouslyApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set returnIds * @param returnIds Specify whether to return IDs for the [Get job status and response](https://www.zuora.com/developer/api-references/api/operation/Get_JobStatusAndResponse) operation. If you set this query parameter to `true`, the corresponding IDs, which are associated with the numbers returned in this operation, can be returned in the \"Get job status and response\" response body. (optional, default to false) * @return CreateOrderAsynchronouslyApi */ public CreateOrderAsynchronouslyApi returnIds(Boolean returnIds) { this.returnIds = returnIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return CreateOrderAsynchronouslyApi */ public CreateOrderAsynchronouslyApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return CreateOrderAsynchronouslyApi */ public CreateOrderAsynchronouslyApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for createOrderAsynchronously * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
202 Accepted * Content-Encoding -
* Location - URL for accessing the job result, in the format of `/async-jobs/{jobId}`. For example, `/async-jobs/2c90a02d676688200167770ce20601b6`
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return createOrderAsynchronouslyCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute createOrderAsynchronously request * @return CreateOrderAsyncResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
202 Accepted * Content-Encoding -
* Location - URL for accessing the job result, in the format of `/async-jobs/{jobId}`. For example, `/async-jobs/2c90a02d676688200167770ce20601b6`
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public CreateOrderAsyncResponse execute() throws ApiException { ApiResponse localVarResp = createOrderAsynchronouslyWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute createOrderAsynchronously request with HTTP info returned * @return ApiResponse<CreateOrderAsyncResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
202 Accepted * Content-Encoding -
* Location - URL for accessing the job result, in the format of `/async-jobs/{jobId}`. For example, `/async-jobs/2c90a02d676688200167770ce20601b6`
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return createOrderAsynchronouslyWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds); } /** * Execute createOrderAsynchronously request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
202 Accepted * Content-Encoding -
* Location - URL for accessing the job result, in the format of `/async-jobs/{jobId}`. For example, `/async-jobs/2c90a02d676688200167770ce20601b6`
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return createOrderAsynchronouslyAsync(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, returnIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * Create an order asynchronously * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. In the case where a normal \"Create an order\" operation call will time out, use this operation instead to create an order asynchronously. A job will be creating the order in the back end; the job ID will be returned for tracking the job status and result. Note that this operation doesn't support auto-refund and invoice write-off during subscription cancellation. Use the \"Create an order\" operation instead. The limit of orders allowed on a subscription is 1000. The limit of order line items allowed in an order is 100. Zuora has the following limits on the Orders synchronous API to prevent performance degradation: * Up to 50 subscriptions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed on a single subscription in a [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. If you have an Order that exceeds any limits of the above, Zuora recommends you use the following asynchronous API operations: * [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) * [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) Zuora has the following limits on the Orders asynchronous API operations to prevent performance degradation: * Up to 300 subscriptions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed on a single subscription in a [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * @param body (required) * @return CreateOrderAsynchronouslyApi */ public CreateOrderAsynchronouslyApi createOrderAsynchronouslyApi(CreateOrderAsyncRequest body) { return new CreateOrderAsynchronouslyApi(body); } private okhttp3.Call deleteOrderCall(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = "/v1/orders/{orderNumber}" .replace("{" + "orderNumber" + "}", localVarApiClient.escapeString(orderNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'orderNumber' is set if (orderNumber == null) { throw new ApiException("Missing the required parameter 'orderNumber' when calling deleteOrder(Async)"); } return deleteOrderCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Delete an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Deletes a specified order. * All the subscriptions changed by this order are deleted. After the deletion, the subscriptions are rolled back to the previous version. * All the order line items created in this order are deleted. You are not allowed to delete an order if the charges that are affected by this order are invoiced. * @param orderNumber The number of the order to be deleted. (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return CommonResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected CommonResponse deleteOrder(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = deleteOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse deleteOrderWithHttpInfo(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call deleteOrderAsync(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class DeleteOrderApi { private final String orderNumber; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private DeleteOrderApi(String orderNumber) { this.orderNumber = orderNumber; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return DeleteOrderApi */ public DeleteOrderApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return DeleteOrderApi */ public DeleteOrderApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return DeleteOrderApi */ public DeleteOrderApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return DeleteOrderApi */ public DeleteOrderApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return DeleteOrderApi */ public DeleteOrderApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return DeleteOrderApi */ public DeleteOrderApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return DeleteOrderApi */ public DeleteOrderApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for deleteOrder * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return deleteOrderCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute deleteOrder request * @return CommonResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public CommonResponse execute() throws ApiException { ApiResponse localVarResp = deleteOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute deleteOrder request with HTTP info returned * @return ApiResponse<CommonResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return deleteOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); } /** * Execute deleteOrder request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return deleteOrderAsync(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * Delete an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Deletes a specified order. * All the subscriptions changed by this order are deleted. After the deletion, the subscriptions are rolled back to the previous version. * All the order line items created in this order are deleted. You are not allowed to delete an order if the charges that are affected by this order are invoiced. * @param orderNumber The number of the order to be deleted. (required) * @return DeleteOrderApi */ public DeleteOrderApi deleteOrderApi(String orderNumber) { return new DeleteOrderApi(orderNumber); } private okhttp3.Call getJobStatusAndResponseCall(String jobId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, 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 = "/v1/async-jobs/{jobId}" .replace("{" + "jobId" + "}", localVarApiClient.escapeString(jobId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 getJobStatusAndResponseValidateBeforeCall(String jobId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'jobId' is set if (jobId == null) { throw new ApiException("Missing the required parameter 'jobId' when calling getJobStatusAndResponse(Async)"); } return getJobStatusAndResponseCall(jobId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback); } /** * Retrieve the status and response of a job * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Get the status and response of an asynchronous job. Currently, an asynchronous job created by \"Create an order asynchronously\" or \"Preview an order asynchronously\" is supported. * @param jobId UUID of the asynchronous job created by an asynchronous API operation. (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetAsyncOrderJobResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 OK * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected GetAsyncOrderJobResponse getJobStatusAndResponse(String jobId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = getJobStatusAndResponseWithHttpInfo(jobId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse getJobStatusAndResponseWithHttpInfo(String jobId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getJobStatusAndResponseValidateBeforeCall(jobId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getJobStatusAndResponseAsync(String jobId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getJobStatusAndResponseValidateBeforeCall(jobId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class GetJobStatusAndResponseApi { private final String jobId; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraVersion; private String zuoraOrgIds; private GetJobStatusAndResponseApi(String jobId) { this.jobId = jobId; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return GetJobStatusAndResponseApi */ public GetJobStatusAndResponseApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return GetJobStatusAndResponseApi */ public GetJobStatusAndResponseApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return GetJobStatusAndResponseApi */ public GetJobStatusAndResponseApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return GetJobStatusAndResponseApi */ public GetJobStatusAndResponseApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return GetJobStatusAndResponseApi */ public GetJobStatusAndResponseApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetJobStatusAndResponseApi */ public GetJobStatusAndResponseApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for getJobStatusAndResponse * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 OK * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getJobStatusAndResponseCall(jobId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute getJobStatusAndResponse request * @return GetAsyncOrderJobResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 OK * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public GetAsyncOrderJobResponse execute() throws ApiException { ApiResponse localVarResp = getJobStatusAndResponseWithHttpInfo(jobId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute getJobStatusAndResponse request with HTTP info returned * @return ApiResponse<GetAsyncOrderJobResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 OK * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return getJobStatusAndResponseWithHttpInfo(jobId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds); } /** * Execute getJobStatusAndResponse request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 OK * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getJobStatusAndResponseAsync(jobId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback); } } /** * Retrieve the status and response of a job * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Get the status and response of an asynchronous job. Currently, an asynchronous job created by \"Create an order asynchronously\" or \"Preview an order asynchronously\" is supported. * @param jobId UUID of the asynchronous job created by an asynchronous API operation. (required) * @return GetJobStatusAndResponseApi */ public GetJobStatusAndResponseApi getJobStatusAndResponseApi(String jobId) { return new GetJobStatusAndResponseApi(jobId); } private okhttp3.Call getOrderCall(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean getAccountDetails, String zuoraVersion, 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 = "/v1/orders/{orderNumber}" .replace("{" + "orderNumber" + "}", localVarApiClient.escapeString(orderNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (getAccountDetails != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("getAccountDetails", getAccountDetails)); } if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean getAccountDetails, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'orderNumber' is set if (orderNumber == null) { throw new ApiException("Missing the required parameter 'orderNumber' when calling getOrder(Async)"); } return getOrderCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, getAccountDetails, zuoraVersion, zuoraOrgIds, _callback); } /** * Retrieve an order * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves the detailed information about a specified order. * @param orderNumber The order number to be retrieved. (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param getAccountDetails Retrieves the details of an account of the Order. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected GetOrderResponse getOrder(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean getAccountDetails, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = getOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, getAccountDetails, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse getOrderWithHttpInfo(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean getAccountDetails, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getOrderValidateBeforeCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, getAccountDetails, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getOrderAsync(String orderNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Boolean getAccountDetails, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getOrderValidateBeforeCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, getAccountDetails, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class GetOrderApi { private final String orderNumber; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private Boolean getAccountDetails; private String zuoraVersion; private String zuoraOrgIds; private GetOrderApi(String orderNumber) { this.orderNumber = orderNumber; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return GetOrderApi */ public GetOrderApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return GetOrderApi */ public GetOrderApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return GetOrderApi */ public GetOrderApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return GetOrderApi */ public GetOrderApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return GetOrderApi */ public GetOrderApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set getAccountDetails * @param getAccountDetails Retrieves the details of an account of the Order. (optional) * @return GetOrderApi */ public GetOrderApi getAccountDetails(Boolean getAccountDetails) { this.getAccountDetails = getAccountDetails; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return GetOrderApi */ public GetOrderApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrderApi */ public GetOrderApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for getOrder * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getOrderCall(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, getAccountDetails, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute getOrder request * @return GetOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public GetOrderResponse execute() throws ApiException { ApiResponse localVarResp = getOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, getAccountDetails, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute getOrder request with HTTP info returned * @return ApiResponse<GetOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return getOrderWithHttpInfo(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, getAccountDetails, zuoraVersion, zuoraOrgIds); } /** * Execute getOrder request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getOrderAsync(orderNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, getAccountDetails, zuoraVersion, zuoraOrgIds, _callback); } } /** * Retrieve an order * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves the detailed information about a specified order. * @param orderNumber The order number to be retrieved. (required) * @return GetOrderApi */ public GetOrderApi getOrderApi(String orderNumber) { return new GetOrderApi(orderNumber); } private okhttp3.Call getOrdersCall(String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, 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 = "/v1/orders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (page != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); } if (dateFilterOption != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("dateFilterOption", dateFilterOption)); } if (startDate != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startDate", startDate)); } if (endDate != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("endDate", endDate)); } if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { return getOrdersCall(acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } /** * List orders * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves information about all orders in your tenant. By default, it returns the first page of the orders. * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1) * @param pageSize The number of records returned per page in the response. (optional, default to 20) * @param dateFilterOption The date type to filter on. This field value can be orderDate or updatedDate. Default is orderDate. (optional) * @param startDate The result will only contain the orders with the date of dateFilterOption later than or equal to this date. (optional) * @param endDate The result will only contains orders with the date of dateFilterOption earlier than or equal to this date. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected GetOrdersResponse getOrders(String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = getOrdersWithHttpInfo(acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse getOrdersWithHttpInfo(String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getOrdersValidateBeforeCall(acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getOrdersAsync(String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getOrdersValidateBeforeCall(acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class GetOrdersApi { private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private Integer page; private Integer pageSize; private String dateFilterOption; private LocalDate startDate; private LocalDate endDate; private String zuoraVersion; private String zuoraOrgIds; private GetOrdersApi() { } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return GetOrdersApi */ public GetOrdersApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return GetOrdersApi */ public GetOrdersApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return GetOrdersApi */ public GetOrdersApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return GetOrdersApi */ public GetOrdersApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return GetOrdersApi */ public GetOrdersApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set page * @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1) * @return GetOrdersApi */ public GetOrdersApi page(Integer page) { this.page = page; return this; } /** * Set pageSize * @param pageSize The number of records returned per page in the response. (optional, default to 20) * @return GetOrdersApi */ public GetOrdersApi pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } /** * Set dateFilterOption * @param dateFilterOption The date type to filter on. This field value can be orderDate or updatedDate. Default is orderDate. (optional) * @return GetOrdersApi */ public GetOrdersApi dateFilterOption(String dateFilterOption) { this.dateFilterOption = dateFilterOption; return this; } /** * Set startDate * @param startDate The result will only contain the orders with the date of dateFilterOption later than or equal to this date. (optional) * @return GetOrdersApi */ public GetOrdersApi startDate(LocalDate startDate) { this.startDate = startDate; return this; } /** * Set endDate * @param endDate The result will only contains orders with the date of dateFilterOption earlier than or equal to this date. (optional) * @return GetOrdersApi */ public GetOrdersApi endDate(LocalDate endDate) { this.endDate = endDate; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return GetOrdersApi */ public GetOrdersApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrdersApi */ public GetOrdersApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for getOrders * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getOrdersCall(acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute getOrders request * @return GetOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public GetOrdersResponse execute() throws ApiException { ApiResponse localVarResp = getOrdersWithHttpInfo(acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute getOrders request with HTTP info returned * @return ApiResponse<GetOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return getOrdersWithHttpInfo(acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); } /** * Execute getOrders request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getOrdersAsync(acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } } /** * List orders * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves information about all orders in your tenant. By default, it returns the first page of the orders. * @return GetOrdersApi */ public GetOrdersApi getOrdersApi() { return new GetOrdersApi(); } private okhttp3.Call getOrdersByInvoiceOwnerCall(String accountNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, 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 = "/v1/orders/invoiceOwner/{accountNumber}" .replace("{" + "accountNumber" + "}", localVarApiClient.escapeString(accountNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (page != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); } if (dateFilterOption != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("dateFilterOption", dateFilterOption)); } if (startDate != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startDate", startDate)); } if (endDate != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("endDate", endDate)); } if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 getOrdersByInvoiceOwnerValidateBeforeCall(String accountNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountNumber' is set if (accountNumber == null) { throw new ApiException("Missing the required parameter 'accountNumber' when calling getOrdersByInvoiceOwner(Async)"); } return getOrdersByInvoiceOwnerCall(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } /** * List orders of an invoice owner * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves the detailed information about all orders for a specified invoice owner. **Note**: You cannot retrieve detailed information about draft orders or scheduled orders through this operation. * @param accountNumber The invoice owner account number. (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1) * @param pageSize The number of records returned per page in the response. (optional, default to 20) * @param dateFilterOption The date type to filter on. This field value can be orderDate or updatedDate. Default is orderDate. (optional) * @param startDate The result will only contain the orders with the date of dateFilterOption later than or equal to this date. (optional) * @param endDate The result will only contain the orders with the date of dateFilterOption earlier than or equal to this date. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected GetOrdersResponse getOrdersByInvoiceOwner(String accountNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = getOrdersByInvoiceOwnerWithHttpInfo(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse getOrdersByInvoiceOwnerWithHttpInfo(String accountNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getOrdersByInvoiceOwnerValidateBeforeCall(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getOrdersByInvoiceOwnerAsync(String accountNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getOrdersByInvoiceOwnerValidateBeforeCall(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class GetOrdersByInvoiceOwnerApi { private final String accountNumber; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private Integer page; private Integer pageSize; private String dateFilterOption; private LocalDate startDate; private LocalDate endDate; private String zuoraVersion; private String zuoraOrgIds; private GetOrdersByInvoiceOwnerApi(String accountNumber) { this.accountNumber = accountNumber; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set page * @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi page(Integer page) { this.page = page; return this; } /** * Set pageSize * @param pageSize The number of records returned per page in the response. (optional, default to 20) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } /** * Set dateFilterOption * @param dateFilterOption The date type to filter on. This field value can be orderDate or updatedDate. Default is orderDate. (optional) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi dateFilterOption(String dateFilterOption) { this.dateFilterOption = dateFilterOption; return this; } /** * Set startDate * @param startDate The result will only contain the orders with the date of dateFilterOption later than or equal to this date. (optional) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi startDate(LocalDate startDate) { this.startDate = startDate; return this; } /** * Set endDate * @param endDate The result will only contain the orders with the date of dateFilterOption earlier than or equal to this date. (optional) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi endDate(LocalDate endDate) { this.endDate = endDate; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for getOrdersByInvoiceOwner * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getOrdersByInvoiceOwnerCall(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute getOrdersByInvoiceOwner request * @return GetOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public GetOrdersResponse execute() throws ApiException { ApiResponse localVarResp = getOrdersByInvoiceOwnerWithHttpInfo(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute getOrdersByInvoiceOwner request with HTTP info returned * @return ApiResponse<GetOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return getOrdersByInvoiceOwnerWithHttpInfo(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); } /** * Execute getOrdersByInvoiceOwner request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getOrdersByInvoiceOwnerAsync(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } } /** * List orders of an invoice owner * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves the detailed information about all orders for a specified invoice owner. **Note**: You cannot retrieve detailed information about draft orders or scheduled orders through this operation. * @param accountNumber The invoice owner account number. (required) * @return GetOrdersByInvoiceOwnerApi */ public GetOrdersByInvoiceOwnerApi getOrdersByInvoiceOwnerApi(String accountNumber) { return new GetOrdersByInvoiceOwnerApi(accountNumber); } private okhttp3.Call getOrdersBySubscriptionNumberCall(String subscriptionNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, 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 = "/v1/orders/subscription/{subscriptionNumber}" .replace("{" + "subscriptionNumber" + "}", localVarApiClient.escapeString(subscriptionNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (page != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); } if (dateFilterOption != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("dateFilterOption", dateFilterOption)); } if (startDate != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startDate", startDate)); } if (endDate != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("endDate", endDate)); } if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 getOrdersBySubscriptionNumberValidateBeforeCall(String subscriptionNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'subscriptionNumber' is set if (subscriptionNumber == null) { throw new ApiException("Missing the required parameter 'subscriptionNumber' when calling getOrdersBySubscriptionNumber(Async)"); } return getOrdersBySubscriptionNumberCall(subscriptionNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } /** * List orders by subscription number * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves the detailed information about all orders except for the pending orders for a specified subscription. * @param subscriptionNumber The subscription number. (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1) * @param pageSize The number of records returned per page in the response. (optional, default to 20) * @param dateFilterOption The date type to filter on. This field value can be 'orderDate' or 'updatedDate'. Default is orderDate. (optional) * @param startDate The result will only contain the orders with the date of 'dateFilterOption' later than or equal to this date. (optional) * @param endDate The result will only contain the orders with the date of 'dateFilterOption' earlier than or equal to this date. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected GetOrdersResponse getOrdersBySubscriptionNumber(String subscriptionNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = getOrdersBySubscriptionNumberWithHttpInfo(subscriptionNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse getOrdersBySubscriptionNumberWithHttpInfo(String subscriptionNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getOrdersBySubscriptionNumberValidateBeforeCall(subscriptionNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getOrdersBySubscriptionNumberAsync(String subscriptionNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getOrdersBySubscriptionNumberValidateBeforeCall(subscriptionNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class GetOrdersBySubscriptionNumberApi { private final String subscriptionNumber; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private Integer page; private Integer pageSize; private String dateFilterOption; private LocalDate startDate; private LocalDate endDate; private String zuoraVersion; private String zuoraOrgIds; private GetOrdersBySubscriptionNumberApi(String subscriptionNumber) { this.subscriptionNumber = subscriptionNumber; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set page * @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi page(Integer page) { this.page = page; return this; } /** * Set pageSize * @param pageSize The number of records returned per page in the response. (optional, default to 20) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } /** * Set dateFilterOption * @param dateFilterOption The date type to filter on. This field value can be 'orderDate' or 'updatedDate'. Default is orderDate. (optional) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi dateFilterOption(String dateFilterOption) { this.dateFilterOption = dateFilterOption; return this; } /** * Set startDate * @param startDate The result will only contain the orders with the date of 'dateFilterOption' later than or equal to this date. (optional) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi startDate(LocalDate startDate) { this.startDate = startDate; return this; } /** * Set endDate * @param endDate The result will only contain the orders with the date of 'dateFilterOption' earlier than or equal to this date. (optional) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi endDate(LocalDate endDate) { this.endDate = endDate; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for getOrdersBySubscriptionNumber * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getOrdersBySubscriptionNumberCall(subscriptionNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute getOrdersBySubscriptionNumber request * @return GetOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public GetOrdersResponse execute() throws ApiException { ApiResponse localVarResp = getOrdersBySubscriptionNumberWithHttpInfo(subscriptionNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute getOrdersBySubscriptionNumber request with HTTP info returned * @return ApiResponse<GetOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return getOrdersBySubscriptionNumberWithHttpInfo(subscriptionNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); } /** * Execute getOrdersBySubscriptionNumber request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getOrdersBySubscriptionNumberAsync(subscriptionNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } } /** * List orders by subscription number * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves the detailed information about all orders except for the pending orders for a specified subscription. * @param subscriptionNumber The subscription number. (required) * @return GetOrdersBySubscriptionNumberApi */ public GetOrdersBySubscriptionNumberApi getOrdersBySubscriptionNumberApi(String subscriptionNumber) { return new GetOrdersBySubscriptionNumberApi(subscriptionNumber); } private okhttp3.Call getOrdersBySubscriptionOwnerCall(String accountNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, 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 = "/v1/orders/subscriptionOwner/{accountNumber}" .replace("{" + "accountNumber" + "}", localVarApiClient.escapeString(accountNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (page != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); } if (dateFilterOption != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("dateFilterOption", dateFilterOption)); } if (startDate != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startDate", startDate)); } if (endDate != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("endDate", endDate)); } if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 getOrdersBySubscriptionOwnerValidateBeforeCall(String accountNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountNumber' is set if (accountNumber == null) { throw new ApiException("Missing the required parameter 'accountNumber' when calling getOrdersBySubscriptionOwner(Async)"); } return getOrdersBySubscriptionOwnerCall(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } /** * List orders of a subscription owner * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves the detailed information about all orders for a specified subscription owner. Any orders containing the changes on the subscriptions owned by this account are returned. **Note**: You cannot retrieve detailed information about draft orders or scheduled orders through this operation. * @param accountNumber The subscription owner account number. (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1) * @param pageSize The number of records returned per page in the response. (optional, default to 20) * @param dateFilterOption The date type to filter on. This field value can be 'orderDate' or 'updatedDate'. Default is orderDate. (optional) * @param startDate The result will only contain the orders with the date of 'dateFilterOption' later than or equal to this date. (optional) * @param endDate The result will only contain the orders with the date of 'dateFilterOption' earlier than or equal to this date. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected GetOrdersResponse getOrdersBySubscriptionOwner(String accountNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = getOrdersBySubscriptionOwnerWithHttpInfo(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse getOrdersBySubscriptionOwnerWithHttpInfo(String accountNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getOrdersBySubscriptionOwnerValidateBeforeCall(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getOrdersBySubscriptionOwnerAsync(String accountNumber, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String dateFilterOption, LocalDate startDate, LocalDate endDate, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getOrdersBySubscriptionOwnerValidateBeforeCall(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class GetOrdersBySubscriptionOwnerApi { private final String accountNumber; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private Integer page; private Integer pageSize; private String dateFilterOption; private LocalDate startDate; private LocalDate endDate; private String zuoraVersion; private String zuoraOrgIds; private GetOrdersBySubscriptionOwnerApi(String accountNumber) { this.accountNumber = accountNumber; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set page * @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi page(Integer page) { this.page = page; return this; } /** * Set pageSize * @param pageSize The number of records returned per page in the response. (optional, default to 20) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } /** * Set dateFilterOption * @param dateFilterOption The date type to filter on. This field value can be 'orderDate' or 'updatedDate'. Default is orderDate. (optional) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi dateFilterOption(String dateFilterOption) { this.dateFilterOption = dateFilterOption; return this; } /** * Set startDate * @param startDate The result will only contain the orders with the date of 'dateFilterOption' later than or equal to this date. (optional) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi startDate(LocalDate startDate) { this.startDate = startDate; return this; } /** * Set endDate * @param endDate The result will only contain the orders with the date of 'dateFilterOption' earlier than or equal to this date. (optional) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi endDate(LocalDate endDate) { this.endDate = endDate; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for getOrdersBySubscriptionOwner * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getOrdersBySubscriptionOwnerCall(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute getOrdersBySubscriptionOwner request * @return GetOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public GetOrdersResponse execute() throws ApiException { ApiResponse localVarResp = getOrdersBySubscriptionOwnerWithHttpInfo(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute getOrdersBySubscriptionOwner request with HTTP info returned * @return ApiResponse<GetOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return getOrdersBySubscriptionOwnerWithHttpInfo(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds); } /** * Execute getOrdersBySubscriptionOwner request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getOrdersBySubscriptionOwnerAsync(accountNumber, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, dateFilterOption, startDate, endDate, zuoraVersion, zuoraOrgIds, _callback); } } /** * List orders of a subscription owner * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves the detailed information about all orders for a specified subscription owner. Any orders containing the changes on the subscriptions owned by this account are returned. **Note**: You cannot retrieve detailed information about draft orders or scheduled orders through this operation. * @param accountNumber The subscription owner account number. (required) * @return GetOrdersBySubscriptionOwnerApi */ public GetOrdersBySubscriptionOwnerApi getOrdersBySubscriptionOwnerApi(String accountNumber) { return new GetOrdersBySubscriptionOwnerApi(accountNumber); } private okhttp3.Call getPendingOrdersBySubscriptionNumberCall(String subscriptionKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = "/v1/orders/subscription/{subscription-key}/pending" .replace("{" + "subscription-key" + "}", localVarApiClient.escapeString(subscriptionKey.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 getPendingOrdersBySubscriptionNumberValidateBeforeCall(String subscriptionKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'subscriptionKey' is set if (subscriptionKey == null) { throw new ApiException("Missing the required parameter 'subscriptionKey' when calling getPendingOrdersBySubscriptionNumber(Async)"); } return getPendingOrdersBySubscriptionNumberCall(subscriptionKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * List pending orders by subscription number * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves the detailed information about all pending orders for a specified subscription. * @param subscriptionKey Subscription number. For example, A-S00000135. (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected GetOrdersResponse getPendingOrdersBySubscriptionNumber(String subscriptionKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = getPendingOrdersBySubscriptionNumberWithHttpInfo(subscriptionKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse getPendingOrdersBySubscriptionNumberWithHttpInfo(String subscriptionKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getPendingOrdersBySubscriptionNumberValidateBeforeCall(subscriptionKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getPendingOrdersBySubscriptionNumberAsync(String subscriptionKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getPendingOrdersBySubscriptionNumberValidateBeforeCall(subscriptionKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class GetPendingOrdersBySubscriptionNumberApi { private final String subscriptionKey; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private GetPendingOrdersBySubscriptionNumberApi(String subscriptionKey) { this.subscriptionKey = subscriptionKey; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return GetPendingOrdersBySubscriptionNumberApi */ public GetPendingOrdersBySubscriptionNumberApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return GetPendingOrdersBySubscriptionNumberApi */ public GetPendingOrdersBySubscriptionNumberApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return GetPendingOrdersBySubscriptionNumberApi */ public GetPendingOrdersBySubscriptionNumberApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return GetPendingOrdersBySubscriptionNumberApi */ public GetPendingOrdersBySubscriptionNumberApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return GetPendingOrdersBySubscriptionNumberApi */ public GetPendingOrdersBySubscriptionNumberApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return GetPendingOrdersBySubscriptionNumberApi */ public GetPendingOrdersBySubscriptionNumberApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return GetPendingOrdersBySubscriptionNumberApi */ public GetPendingOrdersBySubscriptionNumberApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for getPendingOrdersBySubscriptionNumber * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getPendingOrdersBySubscriptionNumberCall(subscriptionKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute getPendingOrdersBySubscriptionNumber request * @return GetOrdersResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public GetOrdersResponse execute() throws ApiException { ApiResponse localVarResp = getPendingOrdersBySubscriptionNumberWithHttpInfo(subscriptionKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute getPendingOrdersBySubscriptionNumber request with HTTP info returned * @return ApiResponse<GetOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return getPendingOrdersBySubscriptionNumberWithHttpInfo(subscriptionKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); } /** * Execute getPendingOrdersBySubscriptionNumber request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getPendingOrdersBySubscriptionNumberAsync(subscriptionKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * List pending orders by subscription number * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. Retrieves the detailed information about all pending orders for a specified subscription. * @param subscriptionKey Subscription number. For example, A-S00000135. (required) * @return GetPendingOrdersBySubscriptionNumberApi */ public GetPendingOrdersBySubscriptionNumberApi getPendingOrdersBySubscriptionNumberApi(String subscriptionKey) { return new GetPendingOrdersBySubscriptionNumberApi(subscriptionKey); } private okhttp3.Call previewOrderCall(PreviewOrderRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = body; // create path and map variables String localVarPath = "/v1/orders/preview"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); 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 (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 previewOrderValidateBeforeCall(PreviewOrderRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling previewOrder(Async)"); } return previewOrderCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Preview an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. **Note:** You cannot preview offers through this operation. Retrieves the preview of the charge 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. #### Billing preview behavior regarding draft invoices By default, the billing preview behavior regarding draft invoices is as below: * When you preview billing for your order and the order contains subscriptions only, the draft invoices are excluded. * When you preview billing for your order and the order contains order line items only, the draft invoices are included. * When you preview billing for an order that contains both subscriptions order line items, the draft invoices are included for both subscriptions and order line items. However, if you want to always exclude the draft invoices in billing preview, submit a request at [Zuora Global Support](https://support.zuora.com). #### Limits on Orders API The limit of orders allowed on a subscription is 1000. The limit of order line items allowed in an order is 100. Zuora has the following limits on the Orders synchronous API to prevent performance degradation: * Up to 50 subscriptions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed on a single subscription in a [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. If you have an Order that exceeds any limits of the above, Zuora recommends you use the following asynchronous API operations: * [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) * [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) Zuora has the following limits on the Orders asynchronous API operations to prevent performance degradation: * Up to 300 subscriptions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed on a single subscription in a [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * @param body (required) * @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return PreviewOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected PreviewOrderResponse previewOrder(PreviewOrderRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = previewOrderWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse previewOrderWithHttpInfo(PreviewOrderRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = previewOrderValidateBeforeCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call previewOrderAsync(PreviewOrderRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = previewOrderValidateBeforeCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class PreviewOrderApi { private final PreviewOrderRequest body; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private PreviewOrderApi(PreviewOrderRequest body) { this.body = body; } /** * Set idempotencyKey * @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional) * @return PreviewOrderApi */ public PreviewOrderApi idempotencyKey(String idempotencyKey) { this.idempotencyKey = idempotencyKey; return this; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return PreviewOrderApi */ public PreviewOrderApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return PreviewOrderApi */ public PreviewOrderApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return PreviewOrderApi */ public PreviewOrderApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return PreviewOrderApi */ public PreviewOrderApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return PreviewOrderApi */ public PreviewOrderApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return PreviewOrderApi */ public PreviewOrderApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return PreviewOrderApi */ public PreviewOrderApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for previewOrder * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return previewOrderCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute previewOrder request * @return PreviewOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public PreviewOrderResponse execute() throws ApiException { ApiResponse localVarResp = previewOrderWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute previewOrder request with HTTP info returned * @return ApiResponse<PreviewOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return previewOrderWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); } /** * Execute previewOrder request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return previewOrderAsync(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * Preview an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. **Note:** You cannot preview offers through this operation. Retrieves the preview of the charge 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. #### Billing preview behavior regarding draft invoices By default, the billing preview behavior regarding draft invoices is as below: * When you preview billing for your order and the order contains subscriptions only, the draft invoices are excluded. * When you preview billing for your order and the order contains order line items only, the draft invoices are included. * When you preview billing for an order that contains both subscriptions order line items, the draft invoices are included for both subscriptions and order line items. However, if you want to always exclude the draft invoices in billing preview, submit a request at [Zuora Global Support](https://support.zuora.com). #### Limits on Orders API The limit of orders allowed on a subscription is 1000. The limit of order line items allowed in an order is 100. Zuora has the following limits on the Orders synchronous API to prevent performance degradation: * Up to 50 subscriptions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed on a single subscription in a [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. If you have an Order that exceeds any limits of the above, Zuora recommends you use the following asynchronous API operations: * [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) * [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) Zuora has the following limits on the Orders asynchronous API operations to prevent performance degradation: * Up to 300 subscriptions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed on a single subscription in a [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * @param body (required) * @return PreviewOrderApi */ public PreviewOrderApi previewOrderApi(PreviewOrderRequest body) { return new PreviewOrderApi(body); } private okhttp3.Call previewOrderAsynchronouslyCall(PreviewOrderAsyncRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = body; // create path and map variables String localVarPath = "/v1/async/orders/preview"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); 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 (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 previewOrderAsynchronouslyValidateBeforeCall(PreviewOrderAsyncRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling previewOrderAsynchronously(Async)"); } return previewOrderAsynchronouslyCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Preview an order asynchronously * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. Orders is now generally available as of Zuora Billing Release 284 (August 2020). If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. **Note:** You cannot preview offers through this operation. In the case where a normal \"Preview an order\" operation call will time out, use this operation instead to preview an order asynchronously. A job will be previewing the order in the back end; the job ID will be returned for tracking the job status and result. #### Billing preview behavior regarding draft invoices By default, the billing preview behavior regarding draft invoices is as below: * When you preview billing for your order and the order contains subscriptions only, the draft invoices are excluded. * When you preview billing for your order and the order contains order line items only, the draft invoices are included. * When you preview billing for an order that contains both subscriptions order line items, the draft invoices are included for both subscriptions and order line items. However, if you want to always exclude the draft invoices in billing preview, submit a request at [Zuora Global Support](https://support.zuora.com). #### Limits on Orders API The limit of orders allowed on a subscription is 1000. The limit of order line items allowed in an order is 100. Zuora has the following limits on the Orders synchronous API to prevent performance degradation: * Up to 50 subscriptions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed on a single subscription in a [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. If you have an Order that exceeds any limits of the above, Zuora recommends you use the following asynchronous API operations: * [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) * [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) Zuora has the following limits on the Orders asynchronous API operations to prevent performance degradation: * Up to 300 subscriptions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed on a single subscription in a [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * @param body (required) * @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return PreviewOrderAsyncResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
202 Accepted * Content-Encoding -
* Location - URL for accessing the job result, in the format of `/async-jobs/{jobId}`. For example, `/async-jobs/2c90a02d676688200167770ce20601b6`
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected PreviewOrderAsyncResponse previewOrderAsynchronously(PreviewOrderAsyncRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = previewOrderAsynchronouslyWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse previewOrderAsynchronouslyWithHttpInfo(PreviewOrderAsyncRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = previewOrderAsynchronouslyValidateBeforeCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call previewOrderAsynchronouslyAsync(PreviewOrderAsyncRequest body, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = previewOrderAsynchronouslyValidateBeforeCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class PreviewOrderAsynchronouslyApi { private final PreviewOrderAsyncRequest body; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private PreviewOrderAsynchronouslyApi(PreviewOrderAsyncRequest body) { this.body = body; } /** * Set idempotencyKey * @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional) * @return PreviewOrderAsynchronouslyApi */ public PreviewOrderAsynchronouslyApi idempotencyKey(String idempotencyKey) { this.idempotencyKey = idempotencyKey; return this; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return PreviewOrderAsynchronouslyApi */ public PreviewOrderAsynchronouslyApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return PreviewOrderAsynchronouslyApi */ public PreviewOrderAsynchronouslyApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return PreviewOrderAsynchronouslyApi */ public PreviewOrderAsynchronouslyApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return PreviewOrderAsynchronouslyApi */ public PreviewOrderAsynchronouslyApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return PreviewOrderAsynchronouslyApi */ public PreviewOrderAsynchronouslyApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return PreviewOrderAsynchronouslyApi */ public PreviewOrderAsynchronouslyApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return PreviewOrderAsynchronouslyApi */ public PreviewOrderAsynchronouslyApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for previewOrderAsynchronously * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
202 Accepted * Content-Encoding -
* Location - URL for accessing the job result, in the format of `/async-jobs/{jobId}`. For example, `/async-jobs/2c90a02d676688200167770ce20601b6`
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return previewOrderAsynchronouslyCall(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute previewOrderAsynchronously request * @return PreviewOrderAsyncResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
202 Accepted * Content-Encoding -
* Location - URL for accessing the job result, in the format of `/async-jobs/{jobId}`. For example, `/async-jobs/2c90a02d676688200167770ce20601b6`
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public PreviewOrderAsyncResponse execute() throws ApiException { ApiResponse localVarResp = previewOrderAsynchronouslyWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute previewOrderAsynchronously request with HTTP info returned * @return ApiResponse<PreviewOrderAsyncResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
202 Accepted * Content-Encoding -
* Location - URL for accessing the job result, in the format of `/async-jobs/{jobId}`. For example, `/async-jobs/2c90a02d676688200167770ce20601b6`
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return previewOrderAsynchronouslyWithHttpInfo(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); } /** * Execute previewOrderAsynchronously request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
202 Accepted * Content-Encoding -
* Location - URL for accessing the job result, in the format of `/async-jobs/{jobId}`. For example, `/async-jobs/2c90a02d676688200167770ce20601b6`
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return previewOrderAsynchronouslyAsync(body, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * Preview an order asynchronously * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. Orders is now generally available as of Zuora Billing Release 284 (August 2020). If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. **Note:** The [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature is now generally available to all Zuora customers. You need to enable the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature to access the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AA_Overview_of_Order_Line_Items) feature. As of Zuora Billing Release 313 (November 2021), new customers who onboard on [Orders](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders) will have the [Order Line Items](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items) feature enabled by default. **Note:** You cannot preview offers through this operation. In the case where a normal \"Preview an order\" operation call will time out, use this operation instead to preview an order asynchronously. A job will be previewing the order in the back end; the job ID will be returned for tracking the job status and result. #### Billing preview behavior regarding draft invoices By default, the billing preview behavior regarding draft invoices is as below: * When you preview billing for your order and the order contains subscriptions only, the draft invoices are excluded. * When you preview billing for your order and the order contains order line items only, the draft invoices are included. * When you preview billing for an order that contains both subscriptions order line items, the draft invoices are included for both subscriptions and order line items. However, if you want to always exclude the draft invoices in billing preview, submit a request at [Zuora Global Support](https://support.zuora.com). #### Limits on Orders API The limit of orders allowed on a subscription is 1000. The limit of order line items allowed in an order is 100. Zuora has the following limits on the Orders synchronous API to prevent performance degradation: * Up to 50 subscriptions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed in a single [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. * Up to 50 order actions are allowed on a single subscription in a [Create an order](https://www.zuora.com/developer/api-references/api/operation/Post_Order) or [Preview an order](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrder) operation call. If you have an Order that exceeds any limits of the above, Zuora recommends you use the following asynchronous API operations: * [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) * [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) Zuora has the following limits on the Orders asynchronous API operations to prevent performance degradation: * Up to 300 subscriptions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed in a single [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * Up to 300 order actions are allowed on a single subscription in a [Create an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_CreateOrderAsynchronously) or [Preview an order asynchronously](https://www.zuora.com/developer/api-references/api/operation/Post_PreviewOrderAsynchronously) operation call. * @param body (required) * @return PreviewOrderAsynchronouslyApi */ public PreviewOrderAsynchronouslyApi previewOrderAsynchronouslyApi(PreviewOrderAsyncRequest body) { return new PreviewOrderAsynchronouslyApi(body); } private okhttp3.Call revertOrderCall(String orderNumber, RevertOrderRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = body; // create path and map variables String localVarPath = "/v1/orders/{orderNumber}/revert" .replace("{" + "orderNumber" + "}", localVarApiClient.escapeString(orderNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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 revertOrderValidateBeforeCall(String orderNumber, RevertOrderRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'orderNumber' is set if (orderNumber == null) { throw new ApiException("Missing the required parameter 'orderNumber' when calling revertOrder(Async)"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling revertOrder(Async)"); } return revertOrderCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Revert an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. You also need to enable SingleVersionedSubscription to revert an order. **Note:** Revert is only valid if order status is Completed. Subscription is in one of the following statuses: Active, Suspended, Cancelled. You can only revert an order for a subscription; an order containing multiple subscriptions cannot be reverted. * @param orderNumber The order number of the order you wish to revert. (required) * @param body (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return RevertOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected RevertOrderResponse revertOrder(String orderNumber, RevertOrderRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = revertOrderWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse revertOrderWithHttpInfo(String orderNumber, RevertOrderRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = revertOrderValidateBeforeCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call revertOrderAsync(String orderNumber, RevertOrderRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = revertOrderValidateBeforeCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class RevertOrderApi { private final String orderNumber; private final RevertOrderRequest body; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private RevertOrderApi(String orderNumber, RevertOrderRequest body) { this.orderNumber = orderNumber; this.body = body; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return RevertOrderApi */ public RevertOrderApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return RevertOrderApi */ public RevertOrderApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return RevertOrderApi */ public RevertOrderApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return RevertOrderApi */ public RevertOrderApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return RevertOrderApi */ public RevertOrderApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return RevertOrderApi */ public RevertOrderApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return RevertOrderApi */ public RevertOrderApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for revertOrder * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return revertOrderCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute revertOrder request * @return RevertOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public RevertOrderResponse execute() throws ApiException { ApiResponse localVarResp = revertOrderWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute revertOrder request with HTTP info returned * @return ApiResponse<RevertOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return revertOrderWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); } /** * Execute revertOrder request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return revertOrderAsync(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * Revert an order * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. You also need to enable SingleVersionedSubscription to revert an order. **Note:** Revert is only valid if order status is Completed. Subscription is in one of the following statuses: Active, Suspended, Cancelled. You can only revert an order for a subscription; an order containing multiple subscriptions cannot be reverted. * @param orderNumber The order number of the order you wish to revert. (required) * @param body (required) * @return RevertOrderApi */ public RevertOrderApi revertOrderApi(String orderNumber, RevertOrderRequest body) { return new RevertOrderApi(orderNumber, body); } private okhttp3.Call updateOrderCall(String orderNumber, UpdateOrderRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = body; // create path and map variables String localVarPath = "/v1/orders/{orderNumber}" .replace("{" + "orderNumber" + "}", localVarApiClient.escapeString(orderNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateOrderValidateBeforeCall(String orderNumber, UpdateOrderRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'orderNumber' is set if (orderNumber == null) { throw new ApiException("Missing the required parameter 'orderNumber' when calling updateOrder(Async)"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling updateOrder(Async)"); } return updateOrderCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Update an order * **Notes:** - This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. - Update an order is only valid for draft or scheduled orders. The Scheduled Orders feature is in the Early Adopter phase. We are actively soliciting feedback from a small set of early adopters before releasing it as generally available. If you want to join this early adopter program, submit a request at <a href=\"https://support.zuora.com/hc/en-us\" target=\"_blank\">Zuora Global Support</a>. - This operation doesn't support auto-refund and invoice write-off during subscription cancellation. Use the \"Create an order\" operation instead. - You must provide full payload when using the \"Update an order\" operation. That is, if you want to edit one order action, you need to provide all other order actions in the payload. Otherwise, the other order actions will be removed. * @param orderNumber Order number of a order in which you are to update. (required) * @param body (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return CreateOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected CreateOrderResponse updateOrder(String orderNumber, UpdateOrderRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = updateOrderWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse updateOrderWithHttpInfo(String orderNumber, UpdateOrderRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = updateOrderValidateBeforeCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call updateOrderAsync(String orderNumber, UpdateOrderRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateOrderValidateBeforeCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class UpdateOrderApi { private final String orderNumber; private final UpdateOrderRequest body; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private UpdateOrderApi(String orderNumber, UpdateOrderRequest body) { this.orderNumber = orderNumber; this.body = body; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return UpdateOrderApi */ public UpdateOrderApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return UpdateOrderApi */ public UpdateOrderApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return UpdateOrderApi */ public UpdateOrderApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return UpdateOrderApi */ public UpdateOrderApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return UpdateOrderApi */ public UpdateOrderApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return UpdateOrderApi */ public UpdateOrderApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return UpdateOrderApi */ public UpdateOrderApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for updateOrder * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return updateOrderCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute updateOrder request * @return CreateOrderResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public CreateOrderResponse execute() throws ApiException { ApiResponse localVarResp = updateOrderWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute updateOrder request with HTTP info returned * @return ApiResponse<CreateOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return updateOrderWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); } /** * Execute updateOrder request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return updateOrderAsync(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * Update an order * **Notes:** - This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. - Update an order is only valid for draft or scheduled orders. The Scheduled Orders feature is in the Early Adopter phase. We are actively soliciting feedback from a small set of early adopters before releasing it as generally available. If you want to join this early adopter program, submit a request at <a href=\"https://support.zuora.com/hc/en-us\" target=\"_blank\">Zuora Global Support</a>. - This operation doesn't support auto-refund and invoice write-off during subscription cancellation. Use the \"Create an order\" operation instead. - You must provide full payload when using the \"Update an order\" operation. That is, if you want to edit one order action, you need to provide all other order actions in the payload. Otherwise, the other order actions will be removed. * @param orderNumber Order number of a order in which you are to update. (required) * @param body (required) * @return UpdateOrderApi */ public UpdateOrderApi updateOrderApi(String orderNumber, UpdateOrderRequest body) { return new UpdateOrderApi(orderNumber, body); } private okhttp3.Call updateOrderCustomFieldsCall(String orderNumber, UpdateOrderCustomFieldsRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = body; // create path and map variables String localVarPath = "/v1/orders/{orderNumber}/customFields" .replace("{" + "orderNumber" + "}", localVarApiClient.escapeString(orderNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateOrderCustomFieldsValidateBeforeCall(String orderNumber, UpdateOrderCustomFieldsRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'orderNumber' is set if (orderNumber == null) { throw new ApiException("Missing the required parameter 'orderNumber' when calling updateOrderCustomFields(Async)"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling updateOrderCustomFields(Async)"); } return updateOrderCustomFieldsCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Update order custom fields * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** To update the custom fields of an order line item, you must use the \"Update an order line item\" or \"Update order line items\" operation. Updates the custom fields of a specified order. * @param orderNumber The order number. (required) * @param body (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return CommonResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected CommonResponse updateOrderCustomFields(String orderNumber, UpdateOrderCustomFieldsRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = updateOrderCustomFieldsWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse updateOrderCustomFieldsWithHttpInfo(String orderNumber, UpdateOrderCustomFieldsRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = updateOrderCustomFieldsValidateBeforeCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call updateOrderCustomFieldsAsync(String orderNumber, UpdateOrderCustomFieldsRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateOrderCustomFieldsValidateBeforeCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class UpdateOrderCustomFieldsApi { private final String orderNumber; private final UpdateOrderCustomFieldsRequest body; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private UpdateOrderCustomFieldsApi(String orderNumber, UpdateOrderCustomFieldsRequest body) { this.orderNumber = orderNumber; this.body = body; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return UpdateOrderCustomFieldsApi */ public UpdateOrderCustomFieldsApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return UpdateOrderCustomFieldsApi */ public UpdateOrderCustomFieldsApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return UpdateOrderCustomFieldsApi */ public UpdateOrderCustomFieldsApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return UpdateOrderCustomFieldsApi */ public UpdateOrderCustomFieldsApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return UpdateOrderCustomFieldsApi */ public UpdateOrderCustomFieldsApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return UpdateOrderCustomFieldsApi */ public UpdateOrderCustomFieldsApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return UpdateOrderCustomFieldsApi */ public UpdateOrderCustomFieldsApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for updateOrderCustomFields * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return updateOrderCustomFieldsCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute updateOrderCustomFields request * @return CommonResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public CommonResponse execute() throws ApiException { ApiResponse localVarResp = updateOrderCustomFieldsWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute updateOrderCustomFields request with HTTP info returned * @return ApiResponse<CommonResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return updateOrderCustomFieldsWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); } /** * Execute updateOrderCustomFields request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return updateOrderCustomFieldsAsync(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * Update order custom fields * **Note:** This feature is only available if you have the [Order Metrics](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Order_Metrics) feature enabled. As of Zuora Billing Release 284, Orders is generally available and the Order Metrics feature is no longer available as a standalone feature. If you are an existing Subscribe and Amend customer and want Order Metrics only, you must turn on [Orders Harmonization](https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Orders_Harmonization/Orders_Harmonization). You can still keep the existing Subscribe and Amend API integrations to create and manage subscriptions. **Note:** To update the custom fields of an order line item, you must use the \"Update an order line item\" or \"Update order line items\" operation. Updates the custom fields of a specified order. * @param orderNumber The order number. (required) * @param body (required) * @return UpdateOrderCustomFieldsApi */ public UpdateOrderCustomFieldsApi updateOrderCustomFieldsApi(String orderNumber, UpdateOrderCustomFieldsRequest body) { return new UpdateOrderCustomFieldsApi(orderNumber, body); } private okhttp3.Call updateOrderTriggerDatesCall(String orderNumber, UpdateOrderTriggerDatesRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = body; // create path and map variables String localVarPath = "/v1/orders/{orderNumber}/triggerDates" .replace("{" + "orderNumber" + "}", localVarApiClient.escapeString(orderNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateOrderTriggerDatesValidateBeforeCall(String orderNumber, UpdateOrderTriggerDatesRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'orderNumber' is set if (orderNumber == null) { throw new ApiException("Missing the required parameter 'orderNumber' when calling updateOrderTriggerDates(Async)"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling updateOrderTriggerDates(Async)"); } return updateOrderTriggerDatesCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Update order action trigger dates * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. Updates the triggering dates for either of the following order actions: * CreateSubscription * AddProduct * UpdateProduct * RemoveProduct * RenewSubscription * TermsAndConditions * @param orderNumber Order number of a pending order in which you are to update an order action's triggering dates. (required) * @param body (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return UpdateOrderTriggerDatesResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected UpdateOrderTriggerDatesResponse updateOrderTriggerDates(String orderNumber, UpdateOrderTriggerDatesRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = updateOrderTriggerDatesWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse updateOrderTriggerDatesWithHttpInfo(String orderNumber, UpdateOrderTriggerDatesRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = updateOrderTriggerDatesValidateBeforeCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call updateOrderTriggerDatesAsync(String orderNumber, UpdateOrderTriggerDatesRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateOrderTriggerDatesValidateBeforeCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class UpdateOrderTriggerDatesApi { private final String orderNumber; private final UpdateOrderTriggerDatesRequest body; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private UpdateOrderTriggerDatesApi(String orderNumber, UpdateOrderTriggerDatesRequest body) { this.orderNumber = orderNumber; this.body = body; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return UpdateOrderTriggerDatesApi */ public UpdateOrderTriggerDatesApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return UpdateOrderTriggerDatesApi */ public UpdateOrderTriggerDatesApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return UpdateOrderTriggerDatesApi */ public UpdateOrderTriggerDatesApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return UpdateOrderTriggerDatesApi */ public UpdateOrderTriggerDatesApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return UpdateOrderTriggerDatesApi */ public UpdateOrderTriggerDatesApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return UpdateOrderTriggerDatesApi */ public UpdateOrderTriggerDatesApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return UpdateOrderTriggerDatesApi */ public UpdateOrderTriggerDatesApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for updateOrderTriggerDates * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return updateOrderTriggerDatesCall(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute updateOrderTriggerDates request * @return UpdateOrderTriggerDatesResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public UpdateOrderTriggerDatesResponse execute() throws ApiException { ApiResponse localVarResp = updateOrderTriggerDatesWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute updateOrderTriggerDates request with HTTP info returned * @return ApiResponse<UpdateOrderTriggerDatesResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return updateOrderTriggerDatesWithHttpInfo(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); } /** * Execute updateOrderTriggerDates request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return updateOrderTriggerDatesAsync(orderNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * Update order action trigger dates * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. Updates the triggering dates for either of the following order actions: * CreateSubscription * AddProduct * UpdateProduct * RemoveProduct * RenewSubscription * TermsAndConditions * @param orderNumber Order number of a pending order in which you are to update an order action's triggering dates. (required) * @param body (required) * @return UpdateOrderTriggerDatesApi */ public UpdateOrderTriggerDatesApi updateOrderTriggerDatesApi(String orderNumber, UpdateOrderTriggerDatesRequest body) { return new UpdateOrderTriggerDatesApi(orderNumber, body); } private okhttp3.Call updateSubscriptionCustomFieldsCall(String subscriptionNumber, UpdateSubscriptionCustomFieldsRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = body; // create path and map variables String localVarPath = "/v1/subscriptions/{subscriptionNumber}/customFields" .replace("{" + "subscriptionNumber" + "}", localVarApiClient.escapeString(subscriptionNumber.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (acceptEncoding != null) { localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding)); } if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } if (zuoraTrackId != null) { localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (zuoraVersion != null) { localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion)); } 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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateSubscriptionCustomFieldsValidateBeforeCall(String subscriptionNumber, UpdateSubscriptionCustomFieldsRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'subscriptionNumber' is set if (subscriptionNumber == null) { throw new ApiException("Missing the required parameter 'subscriptionNumber' when calling updateSubscriptionCustomFields(Async)"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling updateSubscriptionCustomFields(Async)"); } return updateSubscriptionCustomFieldsCall(subscriptionNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Update subscription custom fields * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. Updates the custom fields of a specified subscription. * @param subscriptionNumber The subscription number to be updated. (required) * @param body (required) * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return CommonResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ protected CommonResponse updateSubscriptionCustomFields(String subscriptionNumber, UpdateSubscriptionCustomFieldsRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { ApiResponse localVarResp = updateSubscriptionCustomFieldsWithHttpInfo(subscriptionNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } private ApiResponse updateSubscriptionCustomFieldsWithHttpInfo(String subscriptionNumber, UpdateSubscriptionCustomFieldsRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = updateSubscriptionCustomFieldsValidateBeforeCall(subscriptionNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call updateSubscriptionCustomFieldsAsync(String subscriptionNumber, UpdateSubscriptionCustomFieldsRequest body, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateSubscriptionCustomFieldsValidateBeforeCall(subscriptionNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class UpdateSubscriptionCustomFieldsApi { private final String subscriptionNumber; private final UpdateSubscriptionCustomFieldsRequest body; private String acceptEncoding; private String contentEncoding; private String authorization; private String zuoraTrackId; private String zuoraEntityIds; private String zuoraVersion; private String zuoraOrgIds; private UpdateSubscriptionCustomFieldsApi(String subscriptionNumber, UpdateSubscriptionCustomFieldsRequest body) { this.subscriptionNumber = subscriptionNumber; this.body = body; } /** * Set acceptEncoding * @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional) * @return UpdateSubscriptionCustomFieldsApi */ public UpdateSubscriptionCustomFieldsApi acceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; return this; } /** * Set contentEncoding * @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional) * @return UpdateSubscriptionCustomFieldsApi */ public UpdateSubscriptionCustomFieldsApi contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } /** * Set authorization * @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional) * @return UpdateSubscriptionCustomFieldsApi */ public UpdateSubscriptionCustomFieldsApi authorization(String authorization) { this.authorization = authorization; return this; } /** * Set zuoraTrackId * @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional) * @return UpdateSubscriptionCustomFieldsApi */ public UpdateSubscriptionCustomFieldsApi zuoraTrackId(String zuoraTrackId) { this.zuoraTrackId = zuoraTrackId; return this; } /** * Set zuoraEntityIds * @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional) * @return UpdateSubscriptionCustomFieldsApi */ public UpdateSubscriptionCustomFieldsApi zuoraEntityIds(String zuoraEntityIds) { this.zuoraEntityIds = zuoraEntityIds; return this; } /** * Set zuoraVersion * @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20) * @return UpdateSubscriptionCustomFieldsApi */ public UpdateSubscriptionCustomFieldsApi zuoraVersion(String zuoraVersion) { this.zuoraVersion = zuoraVersion; return this; } /** * Set zuoraOrgIds * @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional) * @return UpdateSubscriptionCustomFieldsApi */ public UpdateSubscriptionCustomFieldsApi zuoraOrgIds(String zuoraOrgIds) { this.zuoraOrgIds = zuoraOrgIds; return this; } /** * Build call for updateSubscriptionCustomFields * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return updateSubscriptionCustomFieldsCall(subscriptionNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } /** * Execute updateSubscriptionCustomFields request * @return CommonResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public CommonResponse execute() throws ApiException { ApiResponse localVarResp = updateSubscriptionCustomFieldsWithHttpInfo(subscriptionNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); return localVarResp.getData(); } /** * Execute updateSubscriptionCustomFields request with HTTP info returned * @return ApiResponse<CommonResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ private ApiResponse executeWithHttpInfo() throws ApiException { return updateSubscriptionCustomFieldsWithHttpInfo(subscriptionNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds); } /** * Execute updateSubscriptionCustomFields request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
400 Invalid input * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
401 * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* WWW-Authenticate - The value of this header is: ``` Basic realm=Zuora API, ZSession realm=Zuora API, Bearer realm=Zuora API ```
* Zuora-Request-Id -
* Zuora-Track-Id -
403 Unauthorized * Content-Encoding -
* RateLimit-Limit -
* RateLimit-Remaining -
* RateLimit-Reset -
* Zuora-Request-Id -
* Zuora-Track-Id -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return updateSubscriptionCustomFieldsAsync(subscriptionNumber, body, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback); } } /** * Update subscription custom fields * **Note:** This operation is only available if you have the [Orders](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/AA_Overview_of_Orders#Orders) feature enabled. If you are an existing Zuora <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Subscribe_and_Amend\" target=\"_blank\">Subscribe and Amend</a> customer, we recommend you enable <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/A_Overview_of_Orders_Harmonization\" target=\"_blank\">Orders Harmonization</a> to access the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders/AA_Overview_of_Orders/A_Overview_of_Orders\" target=\"_blank\">Orders</a> feature. With Orders, you can access both existing functions for subscription and billing management and the <a href=\"https://knowledgecenter.zuora.com/Zuora_Billing/Subscriptions/Subscriptions/Orders_Harmonization/P_FAQ_about_Orders_Harmonization#New+features+through+Orders\" target=\"_blank\">new features</a> on Zuora Billing. Updates the custom fields of a specified subscription. * @param subscriptionNumber The subscription number to be updated. (required) * @param body (required) * @return UpdateSubscriptionCustomFieldsApi */ public UpdateSubscriptionCustomFieldsApi updateSubscriptionCustomFieldsApi(String subscriptionNumber, UpdateSubscriptionCustomFieldsRequest body) { return new UpdateSubscriptionCustomFieldsApi(subscriptionNumber, body); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy