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

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

There is a newer version: 3.2.1
Show newest version
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/

package org.openapitools.client.api;

import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.Headers;
import org.openapitools.client.model.ListQueryParams;
import org.openapitools.client.model.GetByIdQueryParams;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;
import java.io.IOException;


import java.math.BigDecimal;
import org.openapitools.client.model.ErrorResponse;
import org.openapitools.client.model.Payment;
import org.openapitools.client.model.PaymentApplyUnapplyRequest;
import org.openapitools.client.model.PaymentCreateRequest;
import org.openapitools.client.model.PaymentListResponse;
import org.openapitools.client.model.PaymentPatchRequest;

import org.openapitools.client.model.ErrorResponse;

import java.lang.reflect.Type;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;

    public class PaymentsApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;
    public PaymentsApi() {
    this(Configuration.getDefaultApiClient());
    }

    public PaymentsApi(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 applyPaymentCall(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
        basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
        basePath = localBasePaths[localHostIndex];
        } else {
        basePath = null;
        }

        Object localVarPostBody = paymentApplyUnapplyRequest;

        // create path and map variables
            String localVarPath = "/payments/{payment_id}/apply"
                .replace("{" + "payment_id" + "}", localVarApiClient.escapeString(paymentId.toString()));


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            @SuppressWarnings("rawtypes")
            private okhttp3.Call applyPaymentValidateBeforeCall(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
                        // verify the required parameter 'paymentId' is set
                        if (paymentId == null) {
                        throw new ApiException("Missing the required parameter 'paymentId' when calling applyPayment(Async)");
                        }

                        // verify the required parameter 'paymentApplyUnapplyRequest' is set
                        if (paymentApplyUnapplyRequest == null) {
                        throw new ApiException("Missing the required parameter 'paymentApplyUnapplyRequest' when calling applyPayment(Async)");
                        }

                return applyPaymentCall(paymentId, paymentApplyUnapplyRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
            }

        private ApiResponse applyPaymentWithHttpInfo(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
            okhttp3.Call localVarCall = applyPaymentValidateBeforeCall(paymentId, paymentApplyUnapplyRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
                    try {
                    Type localVarReturnType = new TypeToken(){}.getType();
                    return localVarApiClient.execute(localVarCall, localVarReturnType);
                    } catch (ApiException e) {
                    e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
                    throw e;
                    }
            }

        private okhttp3.Call applyPaymentAsync(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
            okhttp3.Call localVarCall = applyPaymentValidateBeforeCall(paymentId, paymentApplyUnapplyRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
        Type localVarReturnType = new TypeToken(){}.getType();
            localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
            return localVarCall;
            }

        public static class ApplyPaymentParams {
                    private final String paymentId;
                    private final PaymentApplyUnapplyRequest paymentApplyUnapplyRequest;
            private Headers headers;
            /*
        * Check for list params
            */
                private GetByIdQueryParams getByIdQueryParams;
                    private List fields;
                    private List paymentFields;
                    private List accountFields;
                    private List paymentMethodFields;
                    private List paymentAppliedToFields;
                    private List paymentAppliedToItemsFields;
                    private List expand;
                    private List filter;
                    private Integer pageSize;
                    private String zuoraTrackId;
                    private Boolean async;
                    private Boolean zuoraCacheEnabled;
                    private String zuoraEntityIds;
                    private String idempotencyKey;
                    private String acceptEncoding;
                    private String contentEncoding;
                    private String zuoraOrgIds;
                public ApplyPaymentParams(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest) {
                    this.paymentId = paymentId;
                    this.paymentApplyUnapplyRequest = paymentApplyUnapplyRequest;
                }
                    /**
                    * Set getByIdQueryParams
                    * @param getByIdQueryParams GetByIdQueryParams
                    * @return ApplyPaymentParams
                    */
                    public ApplyPaymentParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) {
                    this.getByIdQueryParams = getByIdQueryParams;
                        if (expand != null) {
                        this.expand = getByIdQueryParams.getExpand();
                        }
                        if (filter != null) {
                        this.filter = getByIdQueryParams.getFilter();
                        }
                        if (pageSize != null) {
                        this.pageSize = getByIdQueryParams.getPageSize();
                        }
                    return this;
                    }
            /**
            * Set headers
            * @param headers Headers
            * @return ApplyPaymentParams
            */
            public ApplyPaymentParams headers(Headers headers) {
            this.headers = headers;
                if (headers.getZuoraTrackId() != null) {
                this.zuoraTrackId = headers.getZuoraTrackId();
                }
                if (headers.getAsync() != null) {
                this.async = headers.getAsync();
                }
                if (headers.getZuoraCacheEnabled() != null) {
                this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
                }
                if (headers.getZuoraEntityIds() != null) {
                this.zuoraEntityIds = headers.getZuoraEntityIds();
                }
                if (headers.getIdempotencyKey() != null) {
                this.idempotencyKey = headers.getIdempotencyKey();
                }
                if (headers.getAcceptEncoding() != null) {
                this.acceptEncoding = headers.getAcceptEncoding();
                }
                if (headers.getContentEncoding() != null) {
                this.contentEncoding = headers.getContentEncoding();
                }
                if (headers.getZuoraOrgIds() != null) {
                this.zuoraOrgIds = headers.getZuoraOrgIds();
                }
            return this;
            }
                    /**
                    * Set fields
                    * @param fields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions`          </details> (optional)
                    * @return ApplyPaymentParams
                    */
                    public ApplyPaymentParams fields(List fields) {
                    this.fields = fields;
                    return this;
                    }
                    /**
                    * Set paymentFields
                    * @param paymentFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions`          </details> (optional)
                    * @return ApplyPaymentParams
                    */
                    public ApplyPaymentParams paymentFields(List paymentFields) {
                    this.paymentFields = paymentFields;
                    return this;
                    }
                    /**
                    * Set accountFields
                    * @param accountFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id`          </details> (optional)
                    * @return ApplyPaymentParams
                    */
                    public ApplyPaymentParams accountFields(List accountFields) {
                    this.accountFields = accountFields;
                    return this;
                    }
                    /**
                    * Set paymentMethodFields
                    * @param paymentMethodFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit`          </details> (optional)
                    * @return ApplyPaymentParams
                    */
                    public ApplyPaymentParams paymentMethodFields(List paymentMethodFields) {
                    this.paymentMethodFields = paymentMethodFields;
                    return this;
                    }
                    /**
                    * Set paymentAppliedToFields
                    * @param paymentAppliedToFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `amount`, `billing_document_id`, `billing_document_type`, `id`, `state`          </details> (optional)
                    * @return ApplyPaymentParams
                    */
                    public ApplyPaymentParams paymentAppliedToFields(List paymentAppliedToFields) {
                    this.paymentAppliedToFields = paymentAppliedToFields;
                    return this;
                    }
                    /**
                    * Set paymentAppliedToItemsFields
                    * @param paymentAppliedToItemsFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `id`, `amount`, `billing_document_item_id`          </details> (optional)
                    * @return ApplyPaymentParams
                    */
                    public ApplyPaymentParams paymentAppliedToItemsFields(List paymentAppliedToItemsFields) {
                    this.paymentAppliedToItemsFields = paymentAppliedToItemsFields;
                    return this;
                    }
                    /**
                    * Set expand
                    * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional)
                    * @return ApplyPaymentParams
                    */
                    public ApplyPaymentParams expand(List expand) {
                    this.expand = expand;
                    return this;
                    }
                    /**
                    * Set filter
                    * @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions.                         Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional)
                    * @return ApplyPaymentParams
                    */
                    public ApplyPaymentParams filter(List filter) {
                    this.filter = filter;
                    return this;
                    }
                    /**
                    * Set pageSize
                    * @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional)
                    * @return ApplyPaymentParams
                    */
                    public ApplyPaymentParams pageSize(Integer pageSize) {
                    this.pageSize = pageSize;
                    return this;
                    }
                }

            /**
            * Apply a payment
            * Applies a payment to one or more invoices or debit memos.
                * @param paymentId Identifier for the payment, either `payment_number` or `payment_id` (required)
                * @param paymentApplyUnapplyRequest  (required)
            * @return Payment
                * @http.response.details
                
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public ApplyPaymentParams applyPaymentParams(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest) { return new ApplyPaymentParams(paymentId, paymentApplyUnapplyRequest); } public Payment applyPayment(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest) throws ApiException { ApplyPaymentParams params = new ApplyPaymentParams(paymentId, paymentApplyUnapplyRequest); return executeApplyPaymentAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse applyPaymentWithHttpInfo(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest) throws ApiException { ApplyPaymentParams params = new ApplyPaymentParams(paymentId, paymentApplyUnapplyRequest); return executeApplyPaymentAPICall(params); } **/ /** Legacy Query Params Requests **/ public Payment applyPayment( String paymentId , PaymentApplyUnapplyRequest paymentApplyUnapplyRequest , List expand) throws ApiException { ApplyPaymentParams params = new ApplyPaymentParams(paymentId, paymentApplyUnapplyRequest); params.expand(expand); return executeApplyPaymentAPICall(params).getData(); } /* * add header methods */ public Payment applyPayment(String paymentId , PaymentApplyUnapplyRequest paymentApplyUnapplyRequest ,List expand,Headers headers) throws ApiException { ApplyPaymentParams params = new ApplyPaymentParams(paymentId, paymentApplyUnapplyRequest) .expand(expand) .headers(headers); return executeApplyPaymentAPICall(params).getData(); } /** * Apply a payment * Applies a payment to one or more invoices or debit memos. * @param params ApplyPaymentParams * @return Payment * @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public Payment apply(ApplyPaymentParams params) throws ApiException { return executeApplyPaymentAPICall(params).getData(); } public ApiResponse applyWithHttpInfo(ApplyPaymentParams params) throws ApiException { return executeApplyPaymentAPICall(params); } ApiResponse executeApplyPaymentAPICall(ApplyPaymentParams params) throws ApiException { return applyPaymentWithHttpInfo(params.paymentId, params.paymentApplyUnapplyRequest, params.fields, params.paymentFields, params.accountFields, params.paymentMethodFields, params.paymentAppliedToFields, params.paymentAppliedToItemsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call cancelPaymentCall(String paymentId, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/payments/{payment_id}/cancel" .replace("{" + "payment_id" + "}", localVarApiClient.escapeString(paymentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (fields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields)); } if (paymentFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment.fields[]", paymentFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (paymentMethodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_method.fields[]", paymentMethodFields)); } if (paymentAppliedToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to.fields[]", paymentAppliedToFields)); } if (paymentAppliedToItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to_items.fields[]", paymentAppliedToItemsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call cancelPaymentValidateBeforeCall(String paymentId, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'paymentId' is set if (paymentId == null) { throw new ApiException("Missing the required parameter 'paymentId' when calling cancelPayment(Async)"); } return cancelPaymentCall(paymentId, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse cancelPaymentWithHttpInfo(String paymentId, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = cancelPaymentValidateBeforeCall(paymentId, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call cancelPaymentAsync(String paymentId, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = cancelPaymentValidateBeforeCall(paymentId, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class CancelPaymentParams { private final String paymentId; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List paymentFields; private List accountFields; private List paymentMethodFields; private List paymentAppliedToFields; private List paymentAppliedToItemsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public CancelPaymentParams(String paymentId) { this.paymentId = paymentId; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return CancelPaymentParams */ public CancelPaymentParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) { this.getByIdQueryParams = getByIdQueryParams; if (expand != null) { this.expand = getByIdQueryParams.getExpand(); } if (filter != null) { this.filter = getByIdQueryParams.getFilter(); } if (pageSize != null) { this.pageSize = getByIdQueryParams.getPageSize(); } return this; } /** * Set headers * @param headers Headers * @return CancelPaymentParams */ public CancelPaymentParams headers(Headers headers) { this.headers = headers; if (headers.getZuoraTrackId() != null) { this.zuoraTrackId = headers.getZuoraTrackId(); } if (headers.getAsync() != null) { this.async = headers.getAsync(); } if (headers.getZuoraCacheEnabled() != null) { this.zuoraCacheEnabled = headers.getZuoraCacheEnabled(); } if (headers.getZuoraEntityIds() != null) { this.zuoraEntityIds = headers.getZuoraEntityIds(); } if (headers.getIdempotencyKey() != null) { this.idempotencyKey = headers.getIdempotencyKey(); } if (headers.getAcceptEncoding() != null) { this.acceptEncoding = headers.getAcceptEncoding(); } if (headers.getContentEncoding() != null) { this.contentEncoding = headers.getContentEncoding(); } if (headers.getZuoraOrgIds() != null) { this.zuoraOrgIds = headers.getZuoraOrgIds(); } return this; } /** * Set fields * @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return CancelPaymentParams */ public CancelPaymentParams fields(List fields) { this.fields = fields; return this; } /** * Set paymentFields * @param paymentFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return CancelPaymentParams */ public CancelPaymentParams paymentFields(List paymentFields) { this.paymentFields = paymentFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return CancelPaymentParams */ public CancelPaymentParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set paymentMethodFields * @param paymentMethodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return CancelPaymentParams */ public CancelPaymentParams paymentMethodFields(List paymentMethodFields) { this.paymentMethodFields = paymentMethodFields; return this; } /** * Set paymentAppliedToFields * @param paymentAppliedToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `amount`, `billing_document_id`, `billing_document_type`, `id`, `state` </details> (optional) * @return CancelPaymentParams */ public CancelPaymentParams paymentAppliedToFields(List paymentAppliedToFields) { this.paymentAppliedToFields = paymentAppliedToFields; return this; } /** * Set paymentAppliedToItemsFields * @param paymentAppliedToItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `id`, `amount`, `billing_document_item_id` </details> (optional) * @return CancelPaymentParams */ public CancelPaymentParams paymentAppliedToItemsFields(List paymentAppliedToItemsFields) { this.paymentAppliedToItemsFields = paymentAppliedToItemsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return CancelPaymentParams */ public CancelPaymentParams expand(List expand) { this.expand = expand; return this; } /** * Set filter * @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional) * @return CancelPaymentParams */ public CancelPaymentParams filter(List filter) { this.filter = filter; return this; } /** * Set pageSize * @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional) * @return CancelPaymentParams */ public CancelPaymentParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Cancel a payment * Cancels an unapplied payment. * @param paymentId Identifier for the payment, either `payment_number` or `payment_id` (required) * @return Payment * @http.response.details
Status Code Description Response Headers
200 Default Response -
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public CancelPaymentParams cancelPaymentParams(String paymentId) { return new CancelPaymentParams(paymentId); } public Payment cancelPayment(String paymentId) throws ApiException { CancelPaymentParams params = new CancelPaymentParams(paymentId); return executeCancelPaymentAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse cancelPaymentWithHttpInfo(String paymentId) throws ApiException { CancelPaymentParams params = new CancelPaymentParams(paymentId); return executeCancelPaymentAPICall(params); } **/ /** Legacy Query Params Requests **/ public Payment cancelPayment( String paymentId , List expand) throws ApiException { CancelPaymentParams params = new CancelPaymentParams(paymentId); params.expand(expand); return executeCancelPaymentAPICall(params).getData(); } /* * add header methods */ public Payment cancelPayment(String paymentId ,List expand,Headers headers) throws ApiException { CancelPaymentParams params = new CancelPaymentParams(paymentId) .expand(expand) .headers(headers); return executeCancelPaymentAPICall(params).getData(); } /** * Cancel a payment * Cancels an unapplied payment. * @param params CancelPaymentParams * @return Payment * @http.response.details
Status Code Description Response Headers
200 Default Response -
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public Payment cancel(CancelPaymentParams params) throws ApiException { return executeCancelPaymentAPICall(params).getData(); } public ApiResponse cancelWithHttpInfo(CancelPaymentParams params) throws ApiException { return executeCancelPaymentAPICall(params); } ApiResponse executeCancelPaymentAPICall(CancelPaymentParams params) throws ApiException { return cancelPaymentWithHttpInfo(params.paymentId, params.fields, params.paymentFields, params.accountFields, params.paymentMethodFields, params.paymentAppliedToFields, params.paymentAppliedToItemsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call createPaymentCall(PaymentCreateRequest paymentCreateRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = paymentCreateRequest; // create path and map variables String localVarPath = "/payments"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (fields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields)); } if (paymentFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment.fields[]", paymentFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (paymentMethodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_method.fields[]", paymentMethodFields)); } if (paymentAppliedToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to.fields[]", paymentAppliedToFields)); } if (paymentAppliedToItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to_items.fields[]", paymentAppliedToItemsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createPaymentValidateBeforeCall(PaymentCreateRequest paymentCreateRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'paymentCreateRequest' is set if (paymentCreateRequest == null) { throw new ApiException("Missing the required parameter 'paymentCreateRequest' when calling createPayment(Async)"); } return createPaymentCall(paymentCreateRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse createPaymentWithHttpInfo(PaymentCreateRequest paymentCreateRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = createPaymentValidateBeforeCall(paymentCreateRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call createPaymentAsync(PaymentCreateRequest paymentCreateRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createPaymentValidateBeforeCall(paymentCreateRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class CreatePaymentParams { private final PaymentCreateRequest paymentCreateRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List paymentFields; private List accountFields; private List paymentMethodFields; private List paymentAppliedToFields; private List paymentAppliedToItemsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public CreatePaymentParams(PaymentCreateRequest paymentCreateRequest) { this.paymentCreateRequest = paymentCreateRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return CreatePaymentParams */ public CreatePaymentParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) { this.getByIdQueryParams = getByIdQueryParams; if (expand != null) { this.expand = getByIdQueryParams.getExpand(); } if (filter != null) { this.filter = getByIdQueryParams.getFilter(); } if (pageSize != null) { this.pageSize = getByIdQueryParams.getPageSize(); } return this; } /** * Set headers * @param headers Headers * @return CreatePaymentParams */ public CreatePaymentParams headers(Headers headers) { this.headers = headers; if (headers.getZuoraTrackId() != null) { this.zuoraTrackId = headers.getZuoraTrackId(); } if (headers.getAsync() != null) { this.async = headers.getAsync(); } if (headers.getZuoraCacheEnabled() != null) { this.zuoraCacheEnabled = headers.getZuoraCacheEnabled(); } if (headers.getZuoraEntityIds() != null) { this.zuoraEntityIds = headers.getZuoraEntityIds(); } if (headers.getIdempotencyKey() != null) { this.idempotencyKey = headers.getIdempotencyKey(); } if (headers.getAcceptEncoding() != null) { this.acceptEncoding = headers.getAcceptEncoding(); } if (headers.getContentEncoding() != null) { this.contentEncoding = headers.getContentEncoding(); } if (headers.getZuoraOrgIds() != null) { this.zuoraOrgIds = headers.getZuoraOrgIds(); } return this; } /** * Set fields * @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return CreatePaymentParams */ public CreatePaymentParams fields(List fields) { this.fields = fields; return this; } /** * Set paymentFields * @param paymentFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return CreatePaymentParams */ public CreatePaymentParams paymentFields(List paymentFields) { this.paymentFields = paymentFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return CreatePaymentParams */ public CreatePaymentParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set paymentMethodFields * @param paymentMethodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return CreatePaymentParams */ public CreatePaymentParams paymentMethodFields(List paymentMethodFields) { this.paymentMethodFields = paymentMethodFields; return this; } /** * Set paymentAppliedToFields * @param paymentAppliedToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `amount`, `billing_document_id`, `billing_document_type`, `id`, `state` </details> (optional) * @return CreatePaymentParams */ public CreatePaymentParams paymentAppliedToFields(List paymentAppliedToFields) { this.paymentAppliedToFields = paymentAppliedToFields; return this; } /** * Set paymentAppliedToItemsFields * @param paymentAppliedToItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `id`, `amount`, `billing_document_item_id` </details> (optional) * @return CreatePaymentParams */ public CreatePaymentParams paymentAppliedToItemsFields(List paymentAppliedToItemsFields) { this.paymentAppliedToItemsFields = paymentAppliedToItemsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return CreatePaymentParams */ public CreatePaymentParams expand(List expand) { this.expand = expand; return this; } /** * Set filter * @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional) * @return CreatePaymentParams */ public CreatePaymentParams filter(List filter) { this.filter = filter; return this; } /** * Set pageSize * @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional) * @return CreatePaymentParams */ public CreatePaymentParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Create a payment * Creates a new payment object. * @param paymentCreateRequest (required) * @return Payment * @http.response.details
Status Code Description Response Headers
201 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public CreatePaymentParams createPaymentParams(PaymentCreateRequest paymentCreateRequest) { return new CreatePaymentParams(paymentCreateRequest); } public Payment createPayment(PaymentCreateRequest paymentCreateRequest) throws ApiException { CreatePaymentParams params = new CreatePaymentParams(paymentCreateRequest); return executeCreatePaymentAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse createPaymentWithHttpInfo(PaymentCreateRequest paymentCreateRequest) throws ApiException { CreatePaymentParams params = new CreatePaymentParams(paymentCreateRequest); return executeCreatePaymentAPICall(params); } **/ /** Legacy Query Params Requests **/ public Payment createPayment( PaymentCreateRequest paymentCreateRequest , List expand) throws ApiException { CreatePaymentParams params = new CreatePaymentParams(paymentCreateRequest); params.expand(expand); return executeCreatePaymentAPICall(params).getData(); } /* * add header methods */ public Payment createPayment(PaymentCreateRequest paymentCreateRequest ,List expand,Headers headers) throws ApiException { CreatePaymentParams params = new CreatePaymentParams(paymentCreateRequest) .expand(expand) .headers(headers); return executeCreatePaymentAPICall(params).getData(); } /** * Create a payment * Creates a new payment object. * @param params CreatePaymentParams * @return Payment * @http.response.details
Status Code Description Response Headers
201 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public Payment create(CreatePaymentParams params) throws ApiException { return executeCreatePaymentAPICall(params).getData(); } public ApiResponse createWithHttpInfo(CreatePaymentParams params) throws ApiException { return executeCreatePaymentAPICall(params); } ApiResponse executeCreatePaymentAPICall(CreatePaymentParams params) throws ApiException { return createPaymentWithHttpInfo(params.paymentCreateRequest, params.fields, params.paymentFields, params.accountFields, params.paymentMethodFields, params.paymentAppliedToFields, params.paymentAppliedToItemsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call getPaymentCall(String paymentId, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/payments/{payment_id}" .replace("{" + "payment_id" + "}", localVarApiClient.escapeString(paymentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (fields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields)); } if (paymentFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment.fields[]", paymentFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (paymentMethodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_method.fields[]", paymentMethodFields)); } if (paymentAppliedToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to.fields[]", paymentAppliedToFields)); } if (paymentAppliedToItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to_items.fields[]", paymentAppliedToItemsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getPaymentValidateBeforeCall(String paymentId, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'paymentId' is set if (paymentId == null) { throw new ApiException("Missing the required parameter 'paymentId' when calling getPayment(Async)"); } return getPaymentCall(paymentId, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getPaymentWithHttpInfo(String paymentId, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getPaymentValidateBeforeCall(paymentId, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call getPaymentAsync(String paymentId, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getPaymentValidateBeforeCall(paymentId, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class GetPaymentParams { private final String paymentId; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List paymentFields; private List accountFields; private List paymentMethodFields; private List paymentAppliedToFields; private List paymentAppliedToItemsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public GetPaymentParams(String paymentId) { this.paymentId = paymentId; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return GetPaymentParams */ public GetPaymentParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) { this.getByIdQueryParams = getByIdQueryParams; if (expand != null) { this.expand = getByIdQueryParams.getExpand(); } if (filter != null) { this.filter = getByIdQueryParams.getFilter(); } if (pageSize != null) { this.pageSize = getByIdQueryParams.getPageSize(); } return this; } /** * Set headers * @param headers Headers * @return GetPaymentParams */ public GetPaymentParams headers(Headers headers) { this.headers = headers; if (headers.getZuoraTrackId() != null) { this.zuoraTrackId = headers.getZuoraTrackId(); } if (headers.getAsync() != null) { this.async = headers.getAsync(); } if (headers.getZuoraCacheEnabled() != null) { this.zuoraCacheEnabled = headers.getZuoraCacheEnabled(); } if (headers.getZuoraEntityIds() != null) { this.zuoraEntityIds = headers.getZuoraEntityIds(); } if (headers.getIdempotencyKey() != null) { this.idempotencyKey = headers.getIdempotencyKey(); } if (headers.getAcceptEncoding() != null) { this.acceptEncoding = headers.getAcceptEncoding(); } if (headers.getContentEncoding() != null) { this.contentEncoding = headers.getContentEncoding(); } if (headers.getZuoraOrgIds() != null) { this.zuoraOrgIds = headers.getZuoraOrgIds(); } return this; } /** * Set fields * @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return GetPaymentParams */ public GetPaymentParams fields(List fields) { this.fields = fields; return this; } /** * Set paymentFields * @param paymentFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return GetPaymentParams */ public GetPaymentParams paymentFields(List paymentFields) { this.paymentFields = paymentFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return GetPaymentParams */ public GetPaymentParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set paymentMethodFields * @param paymentMethodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return GetPaymentParams */ public GetPaymentParams paymentMethodFields(List paymentMethodFields) { this.paymentMethodFields = paymentMethodFields; return this; } /** * Set paymentAppliedToFields * @param paymentAppliedToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `amount`, `billing_document_id`, `billing_document_type`, `id`, `state` </details> (optional) * @return GetPaymentParams */ public GetPaymentParams paymentAppliedToFields(List paymentAppliedToFields) { this.paymentAppliedToFields = paymentAppliedToFields; return this; } /** * Set paymentAppliedToItemsFields * @param paymentAppliedToItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `id`, `amount`, `billing_document_item_id` </details> (optional) * @return GetPaymentParams */ public GetPaymentParams paymentAppliedToItemsFields(List paymentAppliedToItemsFields) { this.paymentAppliedToItemsFields = paymentAppliedToItemsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return GetPaymentParams */ public GetPaymentParams expand(List expand) { this.expand = expand; return this; } /** * Set filter * @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional) * @return GetPaymentParams */ public GetPaymentParams filter(List filter) { this.filter = filter; return this; } /** * Set pageSize * @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional) * @return GetPaymentParams */ public GetPaymentParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Retrieve a payment * Retrieves the payment with the given ID. * @param paymentId Identifier for the payment, either `payment_number` or `payment_id` (required) * @return Payment * @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public GetPaymentParams getPaymentParams(String paymentId) { return new GetPaymentParams(paymentId); } public Payment getPayment(String paymentId) throws ApiException { GetPaymentParams params = new GetPaymentParams(paymentId); return executeGetPaymentAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getPaymentWithHttpInfo(String paymentId) throws ApiException { GetPaymentParams params = new GetPaymentParams(paymentId); return executeGetPaymentAPICall(params); } **/ /** Legacy Query Params Requests **/ public Payment getPayment( String paymentId , List expand) throws ApiException { GetPaymentParams params = new GetPaymentParams(paymentId); params.expand(expand); return executeGetPaymentAPICall(params).getData(); } /* * add header methods */ public Payment getPayment(String paymentId ,List expand,Headers headers) throws ApiException { GetPaymentParams params = new GetPaymentParams(paymentId) .expand(expand) .headers(headers); return executeGetPaymentAPICall(params).getData(); } /** * Retrieve a payment * Retrieves the payment with the given ID. * @param params GetPaymentParams * @return Payment * @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public Payment get(GetPaymentParams params) throws ApiException { return executeGetPaymentAPICall(params).getData(); } public ApiResponse getWithHttpInfo(GetPaymentParams params) throws ApiException { return executeGetPaymentAPICall(params); } ApiResponse executeGetPaymentAPICall(GetPaymentParams params) throws ApiException { return getPaymentWithHttpInfo(params.paymentId, params.fields, params.paymentFields, params.accountFields, params.paymentMethodFields, params.paymentAppliedToFields, params.paymentAppliedToItemsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call getPaymentsCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/payments"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (cursor != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (sort != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sort[]", sort)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (fields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields)); } if (paymentFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment.fields[]", paymentFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (paymentMethodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_method.fields[]", paymentMethodFields)); } if (paymentAppliedToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to.fields[]", paymentAppliedToFields)); } if (paymentAppliedToItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to_items.fields[]", paymentAppliedToItemsFields)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getPaymentsValidateBeforeCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { return getPaymentsCall(cursor, expand, filter, sort, pageSize, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getPaymentsWithHttpInfo(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getPaymentsValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call getPaymentsAsync(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getPaymentsValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class GetPaymentsParams { private Headers headers; /* * Check for list params */ private ListQueryParams listQueryParams; private String cursor; private List expand; private List filter; private List sort; private Integer pageSize; private List fields; private List paymentFields; private List accountFields; private List paymentMethodFields; private List paymentAppliedToFields; private List paymentAppliedToItemsFields; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public GetPaymentsParams() { } /** * Set listQueryParams * @param listQueryParams ListQueryParams * @return GetPaymentsParams */ public GetPaymentsParams listQueryParams(ListQueryParams listQueryParams) { this.listQueryParams = listQueryParams; if (cursor != null) { this.cursor = listQueryParams.getCursor(); } if (expand != null) { this.expand = listQueryParams.getExpand(); } if (filter != null) { this.filter = listQueryParams.getFilter(); } if (sort != null) { this.sort = listQueryParams.getSort(); } if (pageSize != null) { this.pageSize = listQueryParams.getPageSize(); } return this; } /** * Set headers * @param headers Headers * @return GetPaymentsParams */ public GetPaymentsParams headers(Headers headers) { this.headers = headers; if (headers.getZuoraTrackId() != null) { this.zuoraTrackId = headers.getZuoraTrackId(); } if (headers.getAsync() != null) { this.async = headers.getAsync(); } if (headers.getZuoraCacheEnabled() != null) { this.zuoraCacheEnabled = headers.getZuoraCacheEnabled(); } if (headers.getZuoraEntityIds() != null) { this.zuoraEntityIds = headers.getZuoraEntityIds(); } if (headers.getIdempotencyKey() != null) { this.idempotencyKey = headers.getIdempotencyKey(); } if (headers.getAcceptEncoding() != null) { this.acceptEncoding = headers.getAcceptEncoding(); } if (headers.getContentEncoding() != null) { this.contentEncoding = headers.getContentEncoding(); } if (headers.getZuoraOrgIds() != null) { this.zuoraOrgIds = headers.getZuoraOrgIds(); } return this; } /** * Set cursor * @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional) * @return GetPaymentsParams */ public GetPaymentsParams cursor(String cursor) { this.cursor = cursor; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return GetPaymentsParams */ public GetPaymentsParams expand(List expand) { this.expand = expand; return this; } /** * Set filter * @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return GetPaymentsParams */ public GetPaymentsParams filter(List filter) { this.filter = filter; return this; } /** * Set sort * @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `account_number.asc`) or descending (e.g. `account_number.desc`). You cannot sort on properties that are arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional) * @return GetPaymentsParams */ public GetPaymentsParams sort(List sort) { this.sort = sort; return this; } /** * Set pageSize * @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional) * @return GetPaymentsParams */ public GetPaymentsParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } /** * Set fields * @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return GetPaymentsParams */ public GetPaymentsParams fields(List fields) { this.fields = fields; return this; } /** * Set paymentFields * @param paymentFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return GetPaymentsParams */ public GetPaymentsParams paymentFields(List paymentFields) { this.paymentFields = paymentFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return GetPaymentsParams */ public GetPaymentsParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set paymentMethodFields * @param paymentMethodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return GetPaymentsParams */ public GetPaymentsParams paymentMethodFields(List paymentMethodFields) { this.paymentMethodFields = paymentMethodFields; return this; } /** * Set paymentAppliedToFields * @param paymentAppliedToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `amount`, `billing_document_id`, `billing_document_type`, `id`, `state` </details> (optional) * @return GetPaymentsParams */ public GetPaymentsParams paymentAppliedToFields(List paymentAppliedToFields) { this.paymentAppliedToFields = paymentAppliedToFields; return this; } /** * Set paymentAppliedToItemsFields * @param paymentAppliedToItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `id`, `amount`, `billing_document_item_id` </details> (optional) * @return GetPaymentsParams */ public GetPaymentsParams paymentAppliedToItemsFields(List paymentAppliedToItemsFields) { this.paymentAppliedToItemsFields = paymentAppliedToItemsFields; return this; } } /** * List payments * Returns a dictionary with a data property that contains an array of payments, starting after the cursor, if used. Each entry in the array is a separate payment object. If no more payments are available, the resulting array will be empty. This request should never return an error. * @return PaymentListResponse * @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public GetPaymentsParams getPaymentsParams() { return new GetPaymentsParams(); } public PaymentListResponse getPayments() throws ApiException { GetPaymentsParams params = new GetPaymentsParams(); return executeGetPaymentsAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getPaymentsWithHttpInfo() throws ApiException { GetPaymentsParams params = new GetPaymentsParams(); return executeGetPaymentsAPICall(params); } **/ /** Legacy Query Params Requests **/ public PaymentListResponse getPayments(String cursor, List expand, List filter) throws ApiException { GetPaymentsParams params = new GetPaymentsParams(); params.cursor(cursor); params.expand(expand); params.filter(filter); return executeGetPaymentsAPICall(params).getData(); } /* * add header methods */ public PaymentListResponse getPayments(String cursor,List expand,List filter,Headers headers) throws ApiException { GetPaymentsParams params = new GetPaymentsParams() .cursor(cursor) .expand(expand) .filter(filter) .headers(headers); return executeGetPaymentsAPICall(params).getData(); } /** * List payments * Returns a dictionary with a data property that contains an array of payments, starting after the cursor, if used. Each entry in the array is a separate payment object. If no more payments are available, the resulting array will be empty. This request should never return an error. * @param params GetPaymentsParams * @return PaymentListResponse * @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public PaymentListResponse list(GetPaymentsParams params) throws ApiException { return executeGetPaymentsAPICall(params).getData(); } public ApiResponse listWithHttpInfo(GetPaymentsParams params) throws ApiException { return executeGetPaymentsAPICall(params); } ApiResponse executeGetPaymentsAPICall(GetPaymentsParams params) throws ApiException { return getPaymentsWithHttpInfo(params.cursor, params.expand, params.filter, params.sort, params.pageSize, params.fields, params.paymentFields, params.accountFields, params.paymentMethodFields, params.paymentAppliedToFields, params.paymentAppliedToItemsFields, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call unapplyPaymentCall(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = paymentApplyUnapplyRequest; // create path and map variables String localVarPath = "/payments/{payment_id}/unapply" .replace("{" + "payment_id" + "}", localVarApiClient.escapeString(paymentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (fields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields)); } if (paymentFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment.fields[]", paymentFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (paymentMethodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_method.fields[]", paymentMethodFields)); } if (paymentAppliedToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to.fields[]", paymentAppliedToFields)); } if (paymentAppliedToItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to_items.fields[]", paymentAppliedToItemsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call unapplyPaymentValidateBeforeCall(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'paymentId' is set if (paymentId == null) { throw new ApiException("Missing the required parameter 'paymentId' when calling unapplyPayment(Async)"); } // verify the required parameter 'paymentApplyUnapplyRequest' is set if (paymentApplyUnapplyRequest == null) { throw new ApiException("Missing the required parameter 'paymentApplyUnapplyRequest' when calling unapplyPayment(Async)"); } return unapplyPaymentCall(paymentId, paymentApplyUnapplyRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse unapplyPaymentWithHttpInfo(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = unapplyPaymentValidateBeforeCall(paymentId, paymentApplyUnapplyRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call unapplyPaymentAsync(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = unapplyPaymentValidateBeforeCall(paymentId, paymentApplyUnapplyRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class UnapplyPaymentParams { private final String paymentId; private final PaymentApplyUnapplyRequest paymentApplyUnapplyRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List paymentFields; private List accountFields; private List paymentMethodFields; private List paymentAppliedToFields; private List paymentAppliedToItemsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public UnapplyPaymentParams(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest) { this.paymentId = paymentId; this.paymentApplyUnapplyRequest = paymentApplyUnapplyRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return UnapplyPaymentParams */ public UnapplyPaymentParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) { this.getByIdQueryParams = getByIdQueryParams; if (expand != null) { this.expand = getByIdQueryParams.getExpand(); } if (filter != null) { this.filter = getByIdQueryParams.getFilter(); } if (pageSize != null) { this.pageSize = getByIdQueryParams.getPageSize(); } return this; } /** * Set headers * @param headers Headers * @return UnapplyPaymentParams */ public UnapplyPaymentParams headers(Headers headers) { this.headers = headers; if (headers.getZuoraTrackId() != null) { this.zuoraTrackId = headers.getZuoraTrackId(); } if (headers.getAsync() != null) { this.async = headers.getAsync(); } if (headers.getZuoraCacheEnabled() != null) { this.zuoraCacheEnabled = headers.getZuoraCacheEnabled(); } if (headers.getZuoraEntityIds() != null) { this.zuoraEntityIds = headers.getZuoraEntityIds(); } if (headers.getIdempotencyKey() != null) { this.idempotencyKey = headers.getIdempotencyKey(); } if (headers.getAcceptEncoding() != null) { this.acceptEncoding = headers.getAcceptEncoding(); } if (headers.getContentEncoding() != null) { this.contentEncoding = headers.getContentEncoding(); } if (headers.getZuoraOrgIds() != null) { this.zuoraOrgIds = headers.getZuoraOrgIds(); } return this; } /** * Set fields * @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return UnapplyPaymentParams */ public UnapplyPaymentParams fields(List fields) { this.fields = fields; return this; } /** * Set paymentFields * @param paymentFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return UnapplyPaymentParams */ public UnapplyPaymentParams paymentFields(List paymentFields) { this.paymentFields = paymentFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return UnapplyPaymentParams */ public UnapplyPaymentParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set paymentMethodFields * @param paymentMethodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return UnapplyPaymentParams */ public UnapplyPaymentParams paymentMethodFields(List paymentMethodFields) { this.paymentMethodFields = paymentMethodFields; return this; } /** * Set paymentAppliedToFields * @param paymentAppliedToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `amount`, `billing_document_id`, `billing_document_type`, `id`, `state` </details> (optional) * @return UnapplyPaymentParams */ public UnapplyPaymentParams paymentAppliedToFields(List paymentAppliedToFields) { this.paymentAppliedToFields = paymentAppliedToFields; return this; } /** * Set paymentAppliedToItemsFields * @param paymentAppliedToItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `id`, `amount`, `billing_document_item_id` </details> (optional) * @return UnapplyPaymentParams */ public UnapplyPaymentParams paymentAppliedToItemsFields(List paymentAppliedToItemsFields) { this.paymentAppliedToItemsFields = paymentAppliedToItemsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return UnapplyPaymentParams */ public UnapplyPaymentParams expand(List expand) { this.expand = expand; return this; } /** * Set filter * @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional) * @return UnapplyPaymentParams */ public UnapplyPaymentParams filter(List filter) { this.filter = filter; return this; } /** * Set pageSize * @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional) * @return UnapplyPaymentParams */ public UnapplyPaymentParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Unapply a payment * Unapplies an applied payment. * @param paymentId Identifier for the payment, either `payment_number` or `payment_id` (required) * @param paymentApplyUnapplyRequest (required) * @return Payment * @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public UnapplyPaymentParams unapplyPaymentParams(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest) { return new UnapplyPaymentParams(paymentId, paymentApplyUnapplyRequest); } public Payment unapplyPayment(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest) throws ApiException { UnapplyPaymentParams params = new UnapplyPaymentParams(paymentId, paymentApplyUnapplyRequest); return executeUnapplyPaymentAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse unapplyPaymentWithHttpInfo(String paymentId, PaymentApplyUnapplyRequest paymentApplyUnapplyRequest) throws ApiException { UnapplyPaymentParams params = new UnapplyPaymentParams(paymentId, paymentApplyUnapplyRequest); return executeUnapplyPaymentAPICall(params); } **/ /** Legacy Query Params Requests **/ public Payment unapplyPayment( String paymentId , PaymentApplyUnapplyRequest paymentApplyUnapplyRequest , List expand) throws ApiException { UnapplyPaymentParams params = new UnapplyPaymentParams(paymentId, paymentApplyUnapplyRequest); params.expand(expand); return executeUnapplyPaymentAPICall(params).getData(); } /* * add header methods */ public Payment unapplyPayment(String paymentId , PaymentApplyUnapplyRequest paymentApplyUnapplyRequest ,List expand,Headers headers) throws ApiException { UnapplyPaymentParams params = new UnapplyPaymentParams(paymentId, paymentApplyUnapplyRequest) .expand(expand) .headers(headers); return executeUnapplyPaymentAPICall(params).getData(); } /** * Unapply a payment * Unapplies an applied payment. * @param params UnapplyPaymentParams * @return Payment * @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public Payment unapply(UnapplyPaymentParams params) throws ApiException { return executeUnapplyPaymentAPICall(params).getData(); } public ApiResponse unapplyWithHttpInfo(UnapplyPaymentParams params) throws ApiException { return executeUnapplyPaymentAPICall(params); } ApiResponse executeUnapplyPaymentAPICall(UnapplyPaymentParams params) throws ApiException { return unapplyPaymentWithHttpInfo(params.paymentId, params.paymentApplyUnapplyRequest, params.fields, params.paymentFields, params.accountFields, params.paymentMethodFields, params.paymentAppliedToFields, params.paymentAppliedToItemsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call updatePaymentCall(String paymentId, PaymentPatchRequest paymentPatchRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = paymentPatchRequest; // create path and map variables String localVarPath = "/payments/{payment_id}" .replace("{" + "payment_id" + "}", localVarApiClient.escapeString(paymentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (fields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields)); } if (paymentFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment.fields[]", paymentFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (paymentMethodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_method.fields[]", paymentMethodFields)); } if (paymentAppliedToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to.fields[]", paymentAppliedToFields)); } if (paymentAppliedToItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_applied_to_items.fields[]", paymentAppliedToItemsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updatePaymentValidateBeforeCall(String paymentId, PaymentPatchRequest paymentPatchRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'paymentId' is set if (paymentId == null) { throw new ApiException("Missing the required parameter 'paymentId' when calling updatePayment(Async)"); } // verify the required parameter 'paymentPatchRequest' is set if (paymentPatchRequest == null) { throw new ApiException("Missing the required parameter 'paymentPatchRequest' when calling updatePayment(Async)"); } return updatePaymentCall(paymentId, paymentPatchRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse updatePaymentWithHttpInfo(String paymentId, PaymentPatchRequest paymentPatchRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = updatePaymentValidateBeforeCall(paymentId, paymentPatchRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call updatePaymentAsync(String paymentId, PaymentPatchRequest paymentPatchRequest, List fields, List paymentFields, List accountFields, List paymentMethodFields, List paymentAppliedToFields, List paymentAppliedToItemsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updatePaymentValidateBeforeCall(paymentId, paymentPatchRequest, fields, paymentFields, accountFields, paymentMethodFields, paymentAppliedToFields, paymentAppliedToItemsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class UpdatePaymentParams { private final String paymentId; private final PaymentPatchRequest paymentPatchRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List paymentFields; private List accountFields; private List paymentMethodFields; private List paymentAppliedToFields; private List paymentAppliedToItemsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public UpdatePaymentParams(String paymentId, PaymentPatchRequest paymentPatchRequest) { this.paymentId = paymentId; this.paymentPatchRequest = paymentPatchRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return UpdatePaymentParams */ public UpdatePaymentParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) { this.getByIdQueryParams = getByIdQueryParams; if (expand != null) { this.expand = getByIdQueryParams.getExpand(); } if (filter != null) { this.filter = getByIdQueryParams.getFilter(); } if (pageSize != null) { this.pageSize = getByIdQueryParams.getPageSize(); } return this; } /** * Set headers * @param headers Headers * @return UpdatePaymentParams */ public UpdatePaymentParams headers(Headers headers) { this.headers = headers; if (headers.getZuoraTrackId() != null) { this.zuoraTrackId = headers.getZuoraTrackId(); } if (headers.getAsync() != null) { this.async = headers.getAsync(); } if (headers.getZuoraCacheEnabled() != null) { this.zuoraCacheEnabled = headers.getZuoraCacheEnabled(); } if (headers.getZuoraEntityIds() != null) { this.zuoraEntityIds = headers.getZuoraEntityIds(); } if (headers.getIdempotencyKey() != null) { this.idempotencyKey = headers.getIdempotencyKey(); } if (headers.getAcceptEncoding() != null) { this.acceptEncoding = headers.getAcceptEncoding(); } if (headers.getContentEncoding() != null) { this.contentEncoding = headers.getContentEncoding(); } if (headers.getZuoraOrgIds() != null) { this.zuoraOrgIds = headers.getZuoraOrgIds(); } return this; } /** * Set fields * @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return UpdatePaymentParams */ public UpdatePaymentParams fields(List fields) { this.fields = fields; return this; } /** * Set paymentFields * @param paymentFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional) * @return UpdatePaymentParams */ public UpdatePaymentParams paymentFields(List paymentFields) { this.paymentFields = paymentFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return UpdatePaymentParams */ public UpdatePaymentParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set paymentMethodFields * @param paymentMethodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional) * @return UpdatePaymentParams */ public UpdatePaymentParams paymentMethodFields(List paymentMethodFields) { this.paymentMethodFields = paymentMethodFields; return this; } /** * Set paymentAppliedToFields * @param paymentAppliedToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `amount`, `billing_document_id`, `billing_document_type`, `id`, `state` </details> (optional) * @return UpdatePaymentParams */ public UpdatePaymentParams paymentAppliedToFields(List paymentAppliedToFields) { this.paymentAppliedToFields = paymentAppliedToFields; return this; } /** * Set paymentAppliedToItemsFields * @param paymentAppliedToItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `id`, `amount`, `billing_document_item_id` </details> (optional) * @return UpdatePaymentParams */ public UpdatePaymentParams paymentAppliedToItemsFields(List paymentAppliedToItemsFields) { this.paymentAppliedToItemsFields = paymentAppliedToItemsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return UpdatePaymentParams */ public UpdatePaymentParams expand(List expand) { this.expand = expand; return this; } /** * Set filter * @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional) * @return UpdatePaymentParams */ public UpdatePaymentParams filter(List filter) { this.filter = filter; return this; } /** * Set pageSize * @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional) * @return UpdatePaymentParams */ public UpdatePaymentParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Update a payment * Updates the specified payment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @param paymentId Identifier for the payment, either `payment_number` or `payment_id` (required) * @param paymentPatchRequest (required) * @return Payment * @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public UpdatePaymentParams updatePaymentParams(String paymentId, PaymentPatchRequest paymentPatchRequest) { return new UpdatePaymentParams(paymentId, paymentPatchRequest); } public Payment updatePayment(String paymentId, PaymentPatchRequest paymentPatchRequest) throws ApiException { UpdatePaymentParams params = new UpdatePaymentParams(paymentId, paymentPatchRequest); return executeUpdatePaymentAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse updatePaymentWithHttpInfo(String paymentId, PaymentPatchRequest paymentPatchRequest) throws ApiException { UpdatePaymentParams params = new UpdatePaymentParams(paymentId, paymentPatchRequest); return executeUpdatePaymentAPICall(params); } **/ /** Legacy Query Params Requests **/ public Payment updatePayment( String paymentId , PaymentPatchRequest paymentPatchRequest , List expand) throws ApiException { UpdatePaymentParams params = new UpdatePaymentParams(paymentId, paymentPatchRequest); params.expand(expand); return executeUpdatePaymentAPICall(params).getData(); } /* * add header methods */ public Payment updatePayment(String paymentId , PaymentPatchRequest paymentPatchRequest ,List expand,Headers headers) throws ApiException { UpdatePaymentParams params = new UpdatePaymentParams(paymentId, paymentPatchRequest) .expand(expand) .headers(headers); return executeUpdatePaymentAPICall(params).getData(); } /** * Update a payment * Updates the specified payment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @param params UpdatePaymentParams * @return Payment * @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public Payment update(UpdatePaymentParams params) throws ApiException { return executeUpdatePaymentAPICall(params).getData(); } public ApiResponse updateWithHttpInfo(UpdatePaymentParams params) throws ApiException { return executeUpdatePaymentAPICall(params); } ApiResponse executeUpdatePaymentAPICall(UpdatePaymentParams params) throws ApiException { return updatePaymentWithHttpInfo(params.paymentId, params.paymentPatchRequest, params.fields, params.paymentFields, params.accountFields, params.paymentMethodFields, params.paymentAppliedToFields, params.paymentAppliedToItemsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy