code
stringlengths 1
5.19M
| package
stringlengths 1
81
| path
stringlengths 9
304
| filename
stringlengths 4
145
|
---|---|---|---|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class GETInvoiceFilesResponse(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'invoice_files': 'list[InvoiceFile]',
'next_page': 'str',
'success': 'bool'
}
attribute_map = {
'invoice_files': 'invoiceFiles',
'next_page': 'nextPage',
'success': 'success'
}
def __init__(self, invoice_files=None, next_page=None, success=None, _configuration=None): # noqa: E501
"""GETInvoiceFilesResponse - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._invoice_files = None
self._next_page = None
self._success = None
self.discriminator = None
if invoice_files is not None:
self.invoice_files = invoice_files
if next_page is not None:
self.next_page = next_page
if success is not None:
self.success = success
@property
def invoice_files(self):
"""Gets the invoice_files of this GETInvoiceFilesResponse. # noqa: E501
Container for invoice PDF files. # noqa: E501
:return: The invoice_files of this GETInvoiceFilesResponse. # noqa: E501
:rtype: list[InvoiceFile]
"""
return self._invoice_files
@invoice_files.setter
def invoice_files(self, invoice_files):
"""Sets the invoice_files of this GETInvoiceFilesResponse.
Container for invoice PDF files. # noqa: E501
:param invoice_files: The invoice_files of this GETInvoiceFilesResponse. # noqa: E501
:type: list[InvoiceFile]
"""
self._invoice_files = invoice_files
@property
def next_page(self):
"""Gets the next_page of this GETInvoiceFilesResponse. # noqa: E501
URL to retrieve the next page of the response if it exists; otherwise absent. # noqa: E501
:return: The next_page of this GETInvoiceFilesResponse. # noqa: E501
:rtype: str
"""
return self._next_page
@next_page.setter
def next_page(self, next_page):
"""Sets the next_page of this GETInvoiceFilesResponse.
URL to retrieve the next page of the response if it exists; otherwise absent. # noqa: E501
:param next_page: The next_page of this GETInvoiceFilesResponse. # noqa: E501
:type: str
"""
self._next_page = next_page
@property
def success(self):
"""Gets the success of this GETInvoiceFilesResponse. # noqa: E501
Returns `true` if the request was processed successfully. # noqa: E501
:return: The success of this GETInvoiceFilesResponse. # noqa: E501
:rtype: bool
"""
return self._success
@success.setter
def success(self, success):
"""Sets the success of this GETInvoiceFilesResponse.
Returns `true` if the request was processed successfully. # noqa: E501
:param success: The success of this GETInvoiceFilesResponse. # noqa: E501
:type: bool
"""
self._success = success
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(GETInvoiceFilesResponse, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, GETInvoiceFilesResponse):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, GETInvoiceFilesResponse):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/get_invoice_files_response.py
|
get_invoice_files_response.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class UnapplyCreditMemoType(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'debit_memos': 'list[CreditMemoUnapplyDebitMemoRequestType]',
'effective_date': 'date',
'invoices': 'list[CreditMemoUnapplyInvoiceRequestType]'
}
attribute_map = {
'debit_memos': 'debitMemos',
'effective_date': 'effectiveDate',
'invoices': 'invoices'
}
def __init__(self, debit_memos=None, effective_date=None, invoices=None, _configuration=None): # noqa: E501
"""UnapplyCreditMemoType - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._debit_memos = None
self._effective_date = None
self._invoices = None
self.discriminator = None
if debit_memos is not None:
self.debit_memos = debit_memos
if effective_date is not None:
self.effective_date = effective_date
if invoices is not None:
self.invoices = invoices
@property
def debit_memos(self):
"""Gets the debit_memos of this UnapplyCreditMemoType. # noqa: E501
Container for debit memos that the credit memo is unapplied from. The maximum number of debit memos is 1,000. # noqa: E501
:return: The debit_memos of this UnapplyCreditMemoType. # noqa: E501
:rtype: list[CreditMemoUnapplyDebitMemoRequestType]
"""
return self._debit_memos
@debit_memos.setter
def debit_memos(self, debit_memos):
"""Sets the debit_memos of this UnapplyCreditMemoType.
Container for debit memos that the credit memo is unapplied from. The maximum number of debit memos is 1,000. # noqa: E501
:param debit_memos: The debit_memos of this UnapplyCreditMemoType. # noqa: E501
:type: list[CreditMemoUnapplyDebitMemoRequestType]
"""
self._debit_memos = debit_memos
@property
def effective_date(self):
"""Gets the effective_date of this UnapplyCreditMemoType. # noqa: E501
The date when the credit memo is unapplied. # noqa: E501
:return: The effective_date of this UnapplyCreditMemoType. # noqa: E501
:rtype: date
"""
return self._effective_date
@effective_date.setter
def effective_date(self, effective_date):
"""Sets the effective_date of this UnapplyCreditMemoType.
The date when the credit memo is unapplied. # noqa: E501
:param effective_date: The effective_date of this UnapplyCreditMemoType. # noqa: E501
:type: date
"""
self._effective_date = effective_date
@property
def invoices(self):
"""Gets the invoices of this UnapplyCreditMemoType. # noqa: E501
Container for invoices that the credit memo is unapplied from. The maximum number of invoices is 1,000. # noqa: E501
:return: The invoices of this UnapplyCreditMemoType. # noqa: E501
:rtype: list[CreditMemoUnapplyInvoiceRequestType]
"""
return self._invoices
@invoices.setter
def invoices(self, invoices):
"""Sets the invoices of this UnapplyCreditMemoType.
Container for invoices that the credit memo is unapplied from. The maximum number of invoices is 1,000. # noqa: E501
:param invoices: The invoices of this UnapplyCreditMemoType. # noqa: E501
:type: list[CreditMemoUnapplyInvoiceRequestType]
"""
self._invoices = invoices
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(UnapplyCreditMemoType, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, UnapplyCreditMemoType):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, UnapplyCreditMemoType):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/unapply_credit_memo_type.py
|
unapply_credit_memo_type.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class POSTCreatePaymentSessionRequest(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'account_id': 'str',
'amount': 'float',
'auth_amount': 'float',
'currency': 'str',
'payment_gateway': 'str',
'process_payment': 'bool'
}
attribute_map = {
'account_id': 'accountId',
'amount': 'amount',
'auth_amount': 'authAmount',
'currency': 'currency',
'payment_gateway': 'paymentGateway',
'process_payment': 'processPayment'
}
def __init__(self, account_id=None, amount=None, auth_amount=None, currency=None, payment_gateway=None, process_payment=None, _configuration=None): # noqa: E501
"""POSTCreatePaymentSessionRequest - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._account_id = None
self._amount = None
self._auth_amount = None
self._currency = None
self._payment_gateway = None
self._process_payment = None
self.discriminator = None
self.account_id = account_id
if amount is not None:
self.amount = amount
if auth_amount is not None:
self.auth_amount = auth_amount
self.currency = currency
self.payment_gateway = payment_gateway
self.process_payment = process_payment
@property
def account_id(self):
"""Gets the account_id of this POSTCreatePaymentSessionRequest. # noqa: E501
The ID of the customer account in Zuora that is associated with this payment method. # noqa: E501
:return: The account_id of this POSTCreatePaymentSessionRequest. # noqa: E501
:rtype: str
"""
return self._account_id
@account_id.setter
def account_id(self, account_id):
"""Sets the account_id of this POSTCreatePaymentSessionRequest.
The ID of the customer account in Zuora that is associated with this payment method. # noqa: E501
:param account_id: The account_id of this POSTCreatePaymentSessionRequest. # noqa: E501
:type: str
"""
if self._configuration.client_side_validation and account_id is None:
raise ValueError("Invalid value for `account_id`, must not be `None`") # noqa: E501
self._account_id = account_id
@property
def amount(self):
"""Gets the amount of this POSTCreatePaymentSessionRequest. # noqa: E501
The amount of the payment. This field is required if `processPayment` is `true`. # noqa: E501
:return: The amount of this POSTCreatePaymentSessionRequest. # noqa: E501
:rtype: float
"""
return self._amount
@amount.setter
def amount(self, amount):
"""Sets the amount of this POSTCreatePaymentSessionRequest.
The amount of the payment. This field is required if `processPayment` is `true`. # noqa: E501
:param amount: The amount of this POSTCreatePaymentSessionRequest. # noqa: E501
:type: float
"""
self._amount = amount
@property
def auth_amount(self):
"""Gets the auth_amount of this POSTCreatePaymentSessionRequest. # noqa: E501
The authorization amount for the payment method. Specify a value greater than 0. This field is required if `processPayment` is false. # noqa: E501
:return: The auth_amount of this POSTCreatePaymentSessionRequest. # noqa: E501
:rtype: float
"""
return self._auth_amount
@auth_amount.setter
def auth_amount(self, auth_amount):
"""Sets the auth_amount of this POSTCreatePaymentSessionRequest.
The authorization amount for the payment method. Specify a value greater than 0. This field is required if `processPayment` is false. # noqa: E501
:param auth_amount: The auth_amount of this POSTCreatePaymentSessionRequest. # noqa: E501
:type: float
"""
self._auth_amount = auth_amount
@property
def currency(self):
"""Gets the currency of this POSTCreatePaymentSessionRequest. # noqa: E501
The currency of the payment in the format of the three-character ISO currency code. # noqa: E501
:return: The currency of this POSTCreatePaymentSessionRequest. # noqa: E501
:rtype: str
"""
return self._currency
@currency.setter
def currency(self, currency):
"""Sets the currency of this POSTCreatePaymentSessionRequest.
The currency of the payment in the format of the three-character ISO currency code. # noqa: E501
:param currency: The currency of this POSTCreatePaymentSessionRequest. # noqa: E501
:type: str
"""
if self._configuration.client_side_validation and currency is None:
raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501
self._currency = currency
@property
def payment_gateway(self):
"""Gets the payment_gateway of this POSTCreatePaymentSessionRequest. # noqa: E501
The ID of the payment gateway instance configured in Zuora that will process the payment, such as `e884322ab8c711edab030242ac120004`. # noqa: E501
:return: The payment_gateway of this POSTCreatePaymentSessionRequest. # noqa: E501
:rtype: str
"""
return self._payment_gateway
@payment_gateway.setter
def payment_gateway(self, payment_gateway):
"""Sets the payment_gateway of this POSTCreatePaymentSessionRequest.
The ID of the payment gateway instance configured in Zuora that will process the payment, such as `e884322ab8c711edab030242ac120004`. # noqa: E501
:param payment_gateway: The payment_gateway of this POSTCreatePaymentSessionRequest. # noqa: E501
:type: str
"""
if self._configuration.client_side_validation and payment_gateway is None:
raise ValueError("Invalid value for `payment_gateway`, must not be `None`") # noqa: E501
self._payment_gateway = payment_gateway
@property
def process_payment(self):
"""Gets the process_payment of this POSTCreatePaymentSessionRequest. # noqa: E501
Indicate whether a payment should be processed after creating the payment method. If this field is set to `true`, you must specify the `amount` field. If this field is set to `false`, you must specify the `authAmount` field. The payment method will be verified through the payment gateway instance specified in the `paymentGateway` field. # noqa: E501
:return: The process_payment of this POSTCreatePaymentSessionRequest. # noqa: E501
:rtype: bool
"""
return self._process_payment
@process_payment.setter
def process_payment(self, process_payment):
"""Sets the process_payment of this POSTCreatePaymentSessionRequest.
Indicate whether a payment should be processed after creating the payment method. If this field is set to `true`, you must specify the `amount` field. If this field is set to `false`, you must specify the `authAmount` field. The payment method will be verified through the payment gateway instance specified in the `paymentGateway` field. # noqa: E501
:param process_payment: The process_payment of this POSTCreatePaymentSessionRequest. # noqa: E501
:type: bool
"""
if self._configuration.client_side_validation and process_payment is None:
raise ValueError("Invalid value for `process_payment`, must not be `None`") # noqa: E501
self._process_payment = process_payment
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(POSTCreatePaymentSessionRequest, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, POSTCreatePaymentSessionRequest):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, POSTCreatePaymentSessionRequest):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/post_create_payment_session_request.py
|
post_create_payment_session_request.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class POSTEmailBillingDocfromBillRunType(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'resend': 'bool'
}
attribute_map = {
'resend': 'resend'
}
def __init__(self, resend=False, _configuration=None): # noqa: E501
"""POSTEmailBillingDocfromBillRunType - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._resend = None
self.discriminator = None
if resend is not None:
self.resend = resend
@property
def resend(self):
"""Gets the resend of this POSTEmailBillingDocfromBillRunType. # noqa: E501
Whether to send out emails for all the billing documents that are associated with the bill run. If the value is `false`, emails are sent out only for the billing documents that never have emails sent out. # noqa: E501
:return: The resend of this POSTEmailBillingDocfromBillRunType. # noqa: E501
:rtype: bool
"""
return self._resend
@resend.setter
def resend(self, resend):
"""Sets the resend of this POSTEmailBillingDocfromBillRunType.
Whether to send out emails for all the billing documents that are associated with the bill run. If the value is `false`, emails are sent out only for the billing documents that never have emails sent out. # noqa: E501
:param resend: The resend of this POSTEmailBillingDocfromBillRunType. # noqa: E501
:type: bool
"""
self._resend = resend
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(POSTEmailBillingDocfromBillRunType, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, POSTEmailBillingDocfromBillRunType):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, POSTEmailBillingDocfromBillRunType):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/post_email_billing_docfrom_bill_run_type.py
|
post_email_billing_docfrom_bill_run_type.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class ProxyGetPaymentMethodTransactionLog(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'gateway': 'str',
'gateway_reason_code': 'str',
'gateway_reason_code_description': 'str',
'gateway_transaction_type': 'str',
'id': 'str',
'payment_method_id': 'str',
'payment_method_type': 'str',
'request_string': 'str',
'response_string': 'str',
'transaction_date': 'datetime',
'transaction_id': 'str'
}
attribute_map = {
'gateway': 'Gateway',
'gateway_reason_code': 'GatewayReasonCode',
'gateway_reason_code_description': 'GatewayReasonCodeDescription',
'gateway_transaction_type': 'GatewayTransactionType',
'id': 'Id',
'payment_method_id': 'PaymentMethodId',
'payment_method_type': 'PaymentMethodType',
'request_string': 'RequestString',
'response_string': 'ResponseString',
'transaction_date': 'TransactionDate',
'transaction_id': 'TransactionId'
}
def __init__(self, gateway=None, gateway_reason_code=None, gateway_reason_code_description=None, gateway_transaction_type=None, id=None, payment_method_id=None, payment_method_type=None, request_string=None, response_string=None, transaction_date=None, transaction_id=None, _configuration=None): # noqa: E501
"""ProxyGetPaymentMethodTransactionLog - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._gateway = None
self._gateway_reason_code = None
self._gateway_reason_code_description = None
self._gateway_transaction_type = None
self._id = None
self._payment_method_id = None
self._payment_method_type = None
self._request_string = None
self._response_string = None
self._transaction_date = None
self._transaction_id = None
self.discriminator = None
if gateway is not None:
self.gateway = gateway
if gateway_reason_code is not None:
self.gateway_reason_code = gateway_reason_code
if gateway_reason_code_description is not None:
self.gateway_reason_code_description = gateway_reason_code_description
if gateway_transaction_type is not None:
self.gateway_transaction_type = gateway_transaction_type
if id is not None:
self.id = id
if payment_method_id is not None:
self.payment_method_id = payment_method_id
if payment_method_type is not None:
self.payment_method_type = payment_method_type
if request_string is not None:
self.request_string = request_string
if response_string is not None:
self.response_string = response_string
if transaction_date is not None:
self.transaction_date = transaction_date
if transaction_id is not None:
self.transaction_id = transaction_id
@property
def gateway(self):
"""Gets the gateway of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
# noqa: E501
:return: The gateway of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: str
"""
return self._gateway
@gateway.setter
def gateway(self, gateway):
"""Sets the gateway of this ProxyGetPaymentMethodTransactionLog.
# noqa: E501
:param gateway: The gateway of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: str
"""
self._gateway = gateway
@property
def gateway_reason_code(self):
"""Gets the gateway_reason_code of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
# noqa: E501
:return: The gateway_reason_code of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: str
"""
return self._gateway_reason_code
@gateway_reason_code.setter
def gateway_reason_code(self, gateway_reason_code):
"""Sets the gateway_reason_code of this ProxyGetPaymentMethodTransactionLog.
# noqa: E501
:param gateway_reason_code: The gateway_reason_code of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: str
"""
self._gateway_reason_code = gateway_reason_code
@property
def gateway_reason_code_description(self):
"""Gets the gateway_reason_code_description of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
# noqa: E501
:return: The gateway_reason_code_description of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: str
"""
return self._gateway_reason_code_description
@gateway_reason_code_description.setter
def gateway_reason_code_description(self, gateway_reason_code_description):
"""Sets the gateway_reason_code_description of this ProxyGetPaymentMethodTransactionLog.
# noqa: E501
:param gateway_reason_code_description: The gateway_reason_code_description of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: str
"""
self._gateway_reason_code_description = gateway_reason_code_description
@property
def gateway_transaction_type(self):
"""Gets the gateway_transaction_type of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
# noqa: E501
:return: The gateway_transaction_type of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: str
"""
return self._gateway_transaction_type
@gateway_transaction_type.setter
def gateway_transaction_type(self, gateway_transaction_type):
"""Sets the gateway_transaction_type of this ProxyGetPaymentMethodTransactionLog.
# noqa: E501
:param gateway_transaction_type: The gateway_transaction_type of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: str
"""
self._gateway_transaction_type = gateway_transaction_type
@property
def id(self):
"""Gets the id of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
Object identifier. # noqa: E501
:return: The id of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this ProxyGetPaymentMethodTransactionLog.
Object identifier. # noqa: E501
:param id: The id of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: str
"""
self._id = id
@property
def payment_method_id(self):
"""Gets the payment_method_id of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
# noqa: E501
:return: The payment_method_id of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: str
"""
return self._payment_method_id
@payment_method_id.setter
def payment_method_id(self, payment_method_id):
"""Sets the payment_method_id of this ProxyGetPaymentMethodTransactionLog.
# noqa: E501
:param payment_method_id: The payment_method_id of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: str
"""
self._payment_method_id = payment_method_id
@property
def payment_method_type(self):
"""Gets the payment_method_type of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
# noqa: E501
:return: The payment_method_type of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: str
"""
return self._payment_method_type
@payment_method_type.setter
def payment_method_type(self, payment_method_type):
"""Sets the payment_method_type of this ProxyGetPaymentMethodTransactionLog.
# noqa: E501
:param payment_method_type: The payment_method_type of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: str
"""
self._payment_method_type = payment_method_type
@property
def request_string(self):
"""Gets the request_string of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
# noqa: E501
:return: The request_string of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: str
"""
return self._request_string
@request_string.setter
def request_string(self, request_string):
"""Sets the request_string of this ProxyGetPaymentMethodTransactionLog.
# noqa: E501
:param request_string: The request_string of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: str
"""
self._request_string = request_string
@property
def response_string(self):
"""Gets the response_string of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
# noqa: E501
:return: The response_string of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: str
"""
return self._response_string
@response_string.setter
def response_string(self, response_string):
"""Sets the response_string of this ProxyGetPaymentMethodTransactionLog.
# noqa: E501
:param response_string: The response_string of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: str
"""
self._response_string = response_string
@property
def transaction_date(self):
"""Gets the transaction_date of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
# noqa: E501
:return: The transaction_date of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: datetime
"""
return self._transaction_date
@transaction_date.setter
def transaction_date(self, transaction_date):
"""Sets the transaction_date of this ProxyGetPaymentMethodTransactionLog.
# noqa: E501
:param transaction_date: The transaction_date of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: datetime
"""
self._transaction_date = transaction_date
@property
def transaction_id(self):
"""Gets the transaction_id of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
# noqa: E501
:return: The transaction_id of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:rtype: str
"""
return self._transaction_id
@transaction_id.setter
def transaction_id(self, transaction_id):
"""Sets the transaction_id of this ProxyGetPaymentMethodTransactionLog.
# noqa: E501
:param transaction_id: The transaction_id of this ProxyGetPaymentMethodTransactionLog. # noqa: E501
:type: str
"""
self._transaction_id = transaction_id
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(ProxyGetPaymentMethodTransactionLog, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ProxyGetPaymentMethodTransactionLog):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, ProxyGetPaymentMethodTransactionLog):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/proxy_get_payment_method_transaction_log.py
|
proxy_get_payment_method_transaction_log.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class SettingValueRequest(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'body': 'BodyInSettingValueRequest',
'children': 'list[ChildrenSettingValueRequest]',
'id': 'str',
'method': 'str',
'url': 'str'
}
attribute_map = {
'body': 'body',
'children': 'children',
'id': 'id',
'method': 'method',
'url': 'url'
}
def __init__(self, body=None, children=None, id=None, method=None, url=None, _configuration=None): # noqa: E501
"""SettingValueRequest - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._body = None
self._children = None
self._id = None
self._method = None
self._url = None
self.discriminator = None
if body is not None:
self.body = body
if children is not None:
self.children = children
if id is not None:
self.id = id
if method is not None:
self.method = method
if url is not None:
self.url = url
@property
def body(self):
"""Gets the body of this SettingValueRequest. # noqa: E501
:return: The body of this SettingValueRequest. # noqa: E501
:rtype: BodyInSettingValueRequest
"""
return self._body
@body.setter
def body(self, body):
"""Sets the body of this SettingValueRequest.
:param body: The body of this SettingValueRequest. # noqa: E501
:type: BodyInSettingValueRequest
"""
self._body = body
@property
def children(self):
"""Gets the children of this SettingValueRequest. # noqa: E501
An array of requests that can only be executed after its parent request has been executed successfully. # noqa: E501
:return: The children of this SettingValueRequest. # noqa: E501
:rtype: list[ChildrenSettingValueRequest]
"""
return self._children
@children.setter
def children(self, children):
"""Sets the children of this SettingValueRequest.
An array of requests that can only be executed after its parent request has been executed successfully. # noqa: E501
:param children: The children of this SettingValueRequest. # noqa: E501
:type: list[ChildrenSettingValueRequest]
"""
self._children = children
@property
def id(self):
"""Gets the id of this SettingValueRequest. # noqa: E501
The id of the request. You can set it to any string. It must be unique within the whole batch. # noqa: E501
:return: The id of this SettingValueRequest. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this SettingValueRequest.
The id of the request. You can set it to any string. It must be unique within the whole batch. # noqa: E501
:param id: The id of this SettingValueRequest. # noqa: E501
:type: str
"""
self._id = id
@property
def method(self):
"""Gets the method of this SettingValueRequest. # noqa: E501
One of the HTTP methods supported by the setting endpoint, for example, GET,PUT,POST or DELETE. # noqa: E501
:return: The method of this SettingValueRequest. # noqa: E501
:rtype: str
"""
return self._method
@method.setter
def method(self, method):
"""Sets the method of this SettingValueRequest.
One of the HTTP methods supported by the setting endpoint, for example, GET,PUT,POST or DELETE. # noqa: E501
:param method: The method of this SettingValueRequest. # noqa: E501
:type: str
"""
allowed_values = ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "TRACE"] # noqa: E501
if (self._configuration.client_side_validation and
method not in allowed_values):
raise ValueError(
"Invalid value for `method` ({0}), must be one of {1}" # noqa: E501
.format(method, allowed_values)
)
self._method = method
@property
def url(self):
"""Gets the url of this SettingValueRequest. # noqa: E501
The relative URL of the setting. It is the same as in the `pathPattern` field in the response body of [Listing all Settings](https://www.zuora.com/developer/api-references/api/operation/GET_ListAllSettings). For example, `/billing-rules`. # noqa: E501
:return: The url of this SettingValueRequest. # noqa: E501
:rtype: str
"""
return self._url
@url.setter
def url(self, url):
"""Sets the url of this SettingValueRequest.
The relative URL of the setting. It is the same as in the `pathPattern` field in the response body of [Listing all Settings](https://www.zuora.com/developer/api-references/api/operation/GET_ListAllSettings). For example, `/billing-rules`. # noqa: E501
:param url: The url of this SettingValueRequest. # noqa: E501
:type: str
"""
self._url = url
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(SettingValueRequest, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, SettingValueRequest):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, SettingValueRequest):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/setting_value_request.py
|
setting_value_request.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class GETSequenceSetsResponse(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'sequence_sets': 'list[GETSequenceSetResponse]',
'success': 'bool'
}
attribute_map = {
'sequence_sets': 'sequenceSets',
'success': 'success'
}
def __init__(self, sequence_sets=None, success=None, _configuration=None): # noqa: E501
"""GETSequenceSetsResponse - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._sequence_sets = None
self._success = None
self.discriminator = None
if sequence_sets is not None:
self.sequence_sets = sequence_sets
if success is not None:
self.success = success
@property
def sequence_sets(self):
"""Gets the sequence_sets of this GETSequenceSetsResponse. # noqa: E501
Array of sequence sets configured for billing documents, payments, and refunds. # noqa: E501
:return: The sequence_sets of this GETSequenceSetsResponse. # noqa: E501
:rtype: list[GETSequenceSetResponse]
"""
return self._sequence_sets
@sequence_sets.setter
def sequence_sets(self, sequence_sets):
"""Sets the sequence_sets of this GETSequenceSetsResponse.
Array of sequence sets configured for billing documents, payments, and refunds. # noqa: E501
:param sequence_sets: The sequence_sets of this GETSequenceSetsResponse. # noqa: E501
:type: list[GETSequenceSetResponse]
"""
self._sequence_sets = sequence_sets
@property
def success(self):
"""Gets the success of this GETSequenceSetsResponse. # noqa: E501
Indicates whether the call succeeded. # noqa: E501
:return: The success of this GETSequenceSetsResponse. # noqa: E501
:rtype: bool
"""
return self._success
@success.setter
def success(self, success):
"""Sets the success of this GETSequenceSetsResponse.
Indicates whether the call succeeded. # noqa: E501
:param success: The success of this GETSequenceSetsResponse. # noqa: E501
:type: bool
"""
self._success = success
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(GETSequenceSetsResponse, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, GETSequenceSetsResponse):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, GETSequenceSetsResponse):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/get_sequence_sets_response.py
|
get_sequence_sets_response.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class GETAccountingCodeItemType(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
}
attribute_map = {
}
def __init__(self, _configuration=None): # noqa: E501
"""GETAccountingCodeItemType - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self.discriminator = None
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(GETAccountingCodeItemType, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, GETAccountingCodeItemType):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, GETAccountingCodeItemType):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/get_accounting_code_item_type.py
|
get_accounting_code_item_type.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class GETCreditMemoItemPartType(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'amount': 'float',
'created_by_id': 'str',
'created_date': 'datetime',
'credit_memo_item_id': 'str',
'credit_tax_item_id': 'str',
'debit_memo_item_id': 'str',
'id': 'str',
'invoice_item_id': 'str',
'success': 'bool',
'tax_item_id': 'str',
'updated_by_id': 'str',
'updated_date': 'datetime'
}
attribute_map = {
'amount': 'amount',
'created_by_id': 'createdById',
'created_date': 'createdDate',
'credit_memo_item_id': 'creditMemoItemId',
'credit_tax_item_id': 'creditTaxItemId',
'debit_memo_item_id': 'debitMemoItemId',
'id': 'id',
'invoice_item_id': 'invoiceItemId',
'success': 'success',
'tax_item_id': 'taxItemId',
'updated_by_id': 'updatedById',
'updated_date': 'updatedDate'
}
def __init__(self, amount=None, created_by_id=None, created_date=None, credit_memo_item_id=None, credit_tax_item_id=None, debit_memo_item_id=None, id=None, invoice_item_id=None, success=None, tax_item_id=None, updated_by_id=None, updated_date=None, _configuration=None): # noqa: E501
"""GETCreditMemoItemPartType - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._amount = None
self._created_by_id = None
self._created_date = None
self._credit_memo_item_id = None
self._credit_tax_item_id = None
self._debit_memo_item_id = None
self._id = None
self._invoice_item_id = None
self._success = None
self._tax_item_id = None
self._updated_by_id = None
self._updated_date = None
self.discriminator = None
if amount is not None:
self.amount = amount
if created_by_id is not None:
self.created_by_id = created_by_id
if created_date is not None:
self.created_date = created_date
if credit_memo_item_id is not None:
self.credit_memo_item_id = credit_memo_item_id
if credit_tax_item_id is not None:
self.credit_tax_item_id = credit_tax_item_id
if debit_memo_item_id is not None:
self.debit_memo_item_id = debit_memo_item_id
if id is not None:
self.id = id
if invoice_item_id is not None:
self.invoice_item_id = invoice_item_id
if success is not None:
self.success = success
if tax_item_id is not None:
self.tax_item_id = tax_item_id
if updated_by_id is not None:
self.updated_by_id = updated_by_id
if updated_date is not None:
self.updated_date = updated_date
@property
def amount(self):
"""Gets the amount of this GETCreditMemoItemPartType. # noqa: E501
The amount of the credit memo part item. # noqa: E501
:return: The amount of this GETCreditMemoItemPartType. # noqa: E501
:rtype: float
"""
return self._amount
@amount.setter
def amount(self, amount):
"""Sets the amount of this GETCreditMemoItemPartType.
The amount of the credit memo part item. # noqa: E501
:param amount: The amount of this GETCreditMemoItemPartType. # noqa: E501
:type: float
"""
self._amount = amount
@property
def created_by_id(self):
"""Gets the created_by_id of this GETCreditMemoItemPartType. # noqa: E501
The ID of the Zuora user who created the credit memo part item. # noqa: E501
:return: The created_by_id of this GETCreditMemoItemPartType. # noqa: E501
:rtype: str
"""
return self._created_by_id
@created_by_id.setter
def created_by_id(self, created_by_id):
"""Sets the created_by_id of this GETCreditMemoItemPartType.
The ID of the Zuora user who created the credit memo part item. # noqa: E501
:param created_by_id: The created_by_id of this GETCreditMemoItemPartType. # noqa: E501
:type: str
"""
self._created_by_id = created_by_id
@property
def created_date(self):
"""Gets the created_date of this GETCreditMemoItemPartType. # noqa: E501
The date and time when the credit memo part item was created, in `yyyy-mm-dd hh:mm:ss` format. For example, 2017-03-01 15:31:10. # noqa: E501
:return: The created_date of this GETCreditMemoItemPartType. # noqa: E501
:rtype: datetime
"""
return self._created_date
@created_date.setter
def created_date(self, created_date):
"""Sets the created_date of this GETCreditMemoItemPartType.
The date and time when the credit memo part item was created, in `yyyy-mm-dd hh:mm:ss` format. For example, 2017-03-01 15:31:10. # noqa: E501
:param created_date: The created_date of this GETCreditMemoItemPartType. # noqa: E501
:type: datetime
"""
self._created_date = created_date
@property
def credit_memo_item_id(self):
"""Gets the credit_memo_item_id of this GETCreditMemoItemPartType. # noqa: E501
The ID of the credit memo item associated with the credit memo part item. # noqa: E501
:return: The credit_memo_item_id of this GETCreditMemoItemPartType. # noqa: E501
:rtype: str
"""
return self._credit_memo_item_id
@credit_memo_item_id.setter
def credit_memo_item_id(self, credit_memo_item_id):
"""Sets the credit_memo_item_id of this GETCreditMemoItemPartType.
The ID of the credit memo item associated with the credit memo part item. # noqa: E501
:param credit_memo_item_id: The credit_memo_item_id of this GETCreditMemoItemPartType. # noqa: E501
:type: str
"""
self._credit_memo_item_id = credit_memo_item_id
@property
def credit_tax_item_id(self):
"""Gets the credit_tax_item_id of this GETCreditMemoItemPartType. # noqa: E501
The ID of the credit memo taxation item. # noqa: E501
:return: The credit_tax_item_id of this GETCreditMemoItemPartType. # noqa: E501
:rtype: str
"""
return self._credit_tax_item_id
@credit_tax_item_id.setter
def credit_tax_item_id(self, credit_tax_item_id):
"""Sets the credit_tax_item_id of this GETCreditMemoItemPartType.
The ID of the credit memo taxation item. # noqa: E501
:param credit_tax_item_id: The credit_tax_item_id of this GETCreditMemoItemPartType. # noqa: E501
:type: str
"""
self._credit_tax_item_id = credit_tax_item_id
@property
def debit_memo_item_id(self):
"""Gets the debit_memo_item_id of this GETCreditMemoItemPartType. # noqa: E501
The ID of the debit memo item associated with the credit memo part item. # noqa: E501
:return: The debit_memo_item_id of this GETCreditMemoItemPartType. # noqa: E501
:rtype: str
"""
return self._debit_memo_item_id
@debit_memo_item_id.setter
def debit_memo_item_id(self, debit_memo_item_id):
"""Sets the debit_memo_item_id of this GETCreditMemoItemPartType.
The ID of the debit memo item associated with the credit memo part item. # noqa: E501
:param debit_memo_item_id: The debit_memo_item_id of this GETCreditMemoItemPartType. # noqa: E501
:type: str
"""
self._debit_memo_item_id = debit_memo_item_id
@property
def id(self):
"""Gets the id of this GETCreditMemoItemPartType. # noqa: E501
The ID of the credit memo part item. # noqa: E501
:return: The id of this GETCreditMemoItemPartType. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this GETCreditMemoItemPartType.
The ID of the credit memo part item. # noqa: E501
:param id: The id of this GETCreditMemoItemPartType. # noqa: E501
:type: str
"""
self._id = id
@property
def invoice_item_id(self):
"""Gets the invoice_item_id of this GETCreditMemoItemPartType. # noqa: E501
The ID of the invoice item associated with the credit memo part item. # noqa: E501
:return: The invoice_item_id of this GETCreditMemoItemPartType. # noqa: E501
:rtype: str
"""
return self._invoice_item_id
@invoice_item_id.setter
def invoice_item_id(self, invoice_item_id):
"""Sets the invoice_item_id of this GETCreditMemoItemPartType.
The ID of the invoice item associated with the credit memo part item. # noqa: E501
:param invoice_item_id: The invoice_item_id of this GETCreditMemoItemPartType. # noqa: E501
:type: str
"""
self._invoice_item_id = invoice_item_id
@property
def success(self):
"""Gets the success of this GETCreditMemoItemPartType. # noqa: E501
Returns `true` if the request was processed successfully. # noqa: E501
:return: The success of this GETCreditMemoItemPartType. # noqa: E501
:rtype: bool
"""
return self._success
@success.setter
def success(self, success):
"""Sets the success of this GETCreditMemoItemPartType.
Returns `true` if the request was processed successfully. # noqa: E501
:param success: The success of this GETCreditMemoItemPartType. # noqa: E501
:type: bool
"""
self._success = success
@property
def tax_item_id(self):
"""Gets the tax_item_id of this GETCreditMemoItemPartType. # noqa: E501
The ID of the invoice or debit memo taxation item associated with the credit memo taxation item. # noqa: E501
:return: The tax_item_id of this GETCreditMemoItemPartType. # noqa: E501
:rtype: str
"""
return self._tax_item_id
@tax_item_id.setter
def tax_item_id(self, tax_item_id):
"""Sets the tax_item_id of this GETCreditMemoItemPartType.
The ID of the invoice or debit memo taxation item associated with the credit memo taxation item. # noqa: E501
:param tax_item_id: The tax_item_id of this GETCreditMemoItemPartType. # noqa: E501
:type: str
"""
self._tax_item_id = tax_item_id
@property
def updated_by_id(self):
"""Gets the updated_by_id of this GETCreditMemoItemPartType. # noqa: E501
The ID of the Zuora user who last updated the credit memo part item. # noqa: E501
:return: The updated_by_id of this GETCreditMemoItemPartType. # noqa: E501
:rtype: str
"""
return self._updated_by_id
@updated_by_id.setter
def updated_by_id(self, updated_by_id):
"""Sets the updated_by_id of this GETCreditMemoItemPartType.
The ID of the Zuora user who last updated the credit memo part item. # noqa: E501
:param updated_by_id: The updated_by_id of this GETCreditMemoItemPartType. # noqa: E501
:type: str
"""
self._updated_by_id = updated_by_id
@property
def updated_date(self):
"""Gets the updated_date of this GETCreditMemoItemPartType. # noqa: E501
The date and time when the credit memo part item was last updated, in `yyyy-mm-dd hh:mm:ss` format. For example, 2017-03-02 15:36:10. # noqa: E501
:return: The updated_date of this GETCreditMemoItemPartType. # noqa: E501
:rtype: datetime
"""
return self._updated_date
@updated_date.setter
def updated_date(self, updated_date):
"""Sets the updated_date of this GETCreditMemoItemPartType.
The date and time when the credit memo part item was last updated, in `yyyy-mm-dd hh:mm:ss` format. For example, 2017-03-02 15:36:10. # noqa: E501
:param updated_date: The updated_date of this GETCreditMemoItemPartType. # noqa: E501
:type: datetime
"""
self._updated_date = updated_date
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(GETCreditMemoItemPartType, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, GETCreditMemoItemPartType):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, GETCreditMemoItemPartType):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/get_credit_memo_item_part_type.py
|
get_credit_memo_item_part_type.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class InvoiceItemObjectNSFields(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'integration_id__ns': 'str',
'integration_status__ns': 'str',
'sync_date__ns': 'str'
}
attribute_map = {
'integration_id__ns': 'IntegrationId__NS',
'integration_status__ns': 'IntegrationStatus__NS',
'sync_date__ns': 'SyncDate__NS'
}
def __init__(self, integration_id__ns=None, integration_status__ns=None, sync_date__ns=None, _configuration=None): # noqa: E501
"""InvoiceItemObjectNSFields - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._integration_id__ns = None
self._integration_status__ns = None
self._sync_date__ns = None
self.discriminator = None
if integration_id__ns is not None:
self.integration_id__ns = integration_id__ns
if integration_status__ns is not None:
self.integration_status__ns = integration_status__ns
if sync_date__ns is not None:
self.sync_date__ns = sync_date__ns
@property
def integration_id__ns(self):
"""Gets the integration_id__ns of this InvoiceItemObjectNSFields. # noqa: E501
ID of the corresponding object in NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265). # noqa: E501
:return: The integration_id__ns of this InvoiceItemObjectNSFields. # noqa: E501
:rtype: str
"""
return self._integration_id__ns
@integration_id__ns.setter
def integration_id__ns(self, integration_id__ns):
"""Sets the integration_id__ns of this InvoiceItemObjectNSFields.
ID of the corresponding object in NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265). # noqa: E501
:param integration_id__ns: The integration_id__ns of this InvoiceItemObjectNSFields. # noqa: E501
:type: str
"""
if (self._configuration.client_side_validation and
integration_id__ns is not None and len(integration_id__ns) > 255):
raise ValueError("Invalid value for `integration_id__ns`, length must be less than or equal to `255`") # noqa: E501
self._integration_id__ns = integration_id__ns
@property
def integration_status__ns(self):
"""Gets the integration_status__ns of this InvoiceItemObjectNSFields. # noqa: E501
Status of the invoice item's synchronization with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265). # noqa: E501
:return: The integration_status__ns of this InvoiceItemObjectNSFields. # noqa: E501
:rtype: str
"""
return self._integration_status__ns
@integration_status__ns.setter
def integration_status__ns(self, integration_status__ns):
"""Sets the integration_status__ns of this InvoiceItemObjectNSFields.
Status of the invoice item's synchronization with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265). # noqa: E501
:param integration_status__ns: The integration_status__ns of this InvoiceItemObjectNSFields. # noqa: E501
:type: str
"""
if (self._configuration.client_side_validation and
integration_status__ns is not None and len(integration_status__ns) > 255):
raise ValueError("Invalid value for `integration_status__ns`, length must be less than or equal to `255`") # noqa: E501
self._integration_status__ns = integration_status__ns
@property
def sync_date__ns(self):
"""Gets the sync_date__ns of this InvoiceItemObjectNSFields. # noqa: E501
Date when the invoice item was synchronized with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265). # noqa: E501
:return: The sync_date__ns of this InvoiceItemObjectNSFields. # noqa: E501
:rtype: str
"""
return self._sync_date__ns
@sync_date__ns.setter
def sync_date__ns(self, sync_date__ns):
"""Sets the sync_date__ns of this InvoiceItemObjectNSFields.
Date when the invoice item was synchronized with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265). # noqa: E501
:param sync_date__ns: The sync_date__ns of this InvoiceItemObjectNSFields. # noqa: E501
:type: str
"""
if (self._configuration.client_side_validation and
sync_date__ns is not None and len(sync_date__ns) > 255):
raise ValueError("Invalid value for `sync_date__ns`, length must be less than or equal to `255`") # noqa: E501
self._sync_date__ns = sync_date__ns
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(InvoiceItemObjectNSFields, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, InvoiceItemObjectNSFields):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, InvoiceItemObjectNSFields):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/invoice_item_object_ns_fields.py
|
invoice_item_object_ns_fields.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class POSTSubscriptionPreviewResponseTypeChargeMetrics(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'dmrr': 'str',
'dtcv': 'str',
'mrr': 'str',
'number': 'str',
'origin_rate_plan_id': 'str',
'original_id': 'str',
'product_rate_plan_charge_id': 'str',
'product_rate_plan_id': 'str',
'tcv': 'str'
}
attribute_map = {
'dmrr': 'dmrr',
'dtcv': 'dtcv',
'mrr': 'mrr',
'number': 'number',
'origin_rate_plan_id': 'originRatePlanId',
'original_id': 'originalId',
'product_rate_plan_charge_id': 'productRatePlanChargeId',
'product_rate_plan_id': 'productRatePlanId',
'tcv': 'tcv'
}
def __init__(self, dmrr=None, dtcv=None, mrr=None, number=None, origin_rate_plan_id=None, original_id=None, product_rate_plan_charge_id=None, product_rate_plan_id=None, tcv=None, _configuration=None): # noqa: E501
"""POSTSubscriptionPreviewResponseTypeChargeMetrics - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._dmrr = None
self._dtcv = None
self._mrr = None
self._number = None
self._origin_rate_plan_id = None
self._original_id = None
self._product_rate_plan_charge_id = None
self._product_rate_plan_id = None
self._tcv = None
self.discriminator = None
if dmrr is not None:
self.dmrr = dmrr
if dtcv is not None:
self.dtcv = dtcv
if mrr is not None:
self.mrr = mrr
if number is not None:
self.number = number
if origin_rate_plan_id is not None:
self.origin_rate_plan_id = origin_rate_plan_id
if original_id is not None:
self.original_id = original_id
if product_rate_plan_charge_id is not None:
self.product_rate_plan_charge_id = product_rate_plan_charge_id
if product_rate_plan_id is not None:
self.product_rate_plan_id = product_rate_plan_id
if tcv is not None:
self.tcv = tcv
@property
def dmrr(self):
"""Gets the dmrr of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
Change in monthly recurring revenue. # noqa: E501
:return: The dmrr of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:rtype: str
"""
return self._dmrr
@dmrr.setter
def dmrr(self, dmrr):
"""Sets the dmrr of this POSTSubscriptionPreviewResponseTypeChargeMetrics.
Change in monthly recurring revenue. # noqa: E501
:param dmrr: The dmrr of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:type: str
"""
self._dmrr = dmrr
@property
def dtcv(self):
"""Gets the dtcv of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
Change in total contract value. # noqa: E501
:return: The dtcv of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:rtype: str
"""
return self._dtcv
@dtcv.setter
def dtcv(self, dtcv):
"""Sets the dtcv of this POSTSubscriptionPreviewResponseTypeChargeMetrics.
Change in total contract value. # noqa: E501
:param dtcv: The dtcv of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:type: str
"""
self._dtcv = dtcv
@property
def mrr(self):
"""Gets the mrr of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
Monthly recurring revenue. # noqa: E501
:return: The mrr of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:rtype: str
"""
return self._mrr
@mrr.setter
def mrr(self, mrr):
"""Sets the mrr of this POSTSubscriptionPreviewResponseTypeChargeMetrics.
Monthly recurring revenue. # noqa: E501
:param mrr: The mrr of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:type: str
"""
self._mrr = mrr
@property
def number(self):
"""Gets the number of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
The charge number of the subscription. Only available for update subscription. # noqa: E501
:return: The number of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:rtype: str
"""
return self._number
@number.setter
def number(self, number):
"""Sets the number of this POSTSubscriptionPreviewResponseTypeChargeMetrics.
The charge number of the subscription. Only available for update subscription. # noqa: E501
:param number: The number of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:type: str
"""
self._number = number
@property
def origin_rate_plan_id(self):
"""Gets the origin_rate_plan_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
The origin rate plan ID. Only available for update subscription. # noqa: E501
:return: The origin_rate_plan_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:rtype: str
"""
return self._origin_rate_plan_id
@origin_rate_plan_id.setter
def origin_rate_plan_id(self, origin_rate_plan_id):
"""Sets the origin_rate_plan_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics.
The origin rate plan ID. Only available for update subscription. # noqa: E501
:param origin_rate_plan_id: The origin_rate_plan_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:type: str
"""
self._origin_rate_plan_id = origin_rate_plan_id
@property
def original_id(self):
"""Gets the original_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
The original rate plan charge ID. Only available for update subscription. # noqa: E501
:return: The original_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:rtype: str
"""
return self._original_id
@original_id.setter
def original_id(self, original_id):
"""Sets the original_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics.
The original rate plan charge ID. Only available for update subscription. # noqa: E501
:param original_id: The original_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:type: str
"""
self._original_id = original_id
@property
def product_rate_plan_charge_id(self):
"""Gets the product_rate_plan_charge_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
The product rate plan charge ID. # noqa: E501
:return: The product_rate_plan_charge_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:rtype: str
"""
return self._product_rate_plan_charge_id
@product_rate_plan_charge_id.setter
def product_rate_plan_charge_id(self, product_rate_plan_charge_id):
"""Sets the product_rate_plan_charge_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics.
The product rate plan charge ID. # noqa: E501
:param product_rate_plan_charge_id: The product_rate_plan_charge_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:type: str
"""
self._product_rate_plan_charge_id = product_rate_plan_charge_id
@property
def product_rate_plan_id(self):
"""Gets the product_rate_plan_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
The product rate plan ID. # noqa: E501
:return: The product_rate_plan_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:rtype: str
"""
return self._product_rate_plan_id
@product_rate_plan_id.setter
def product_rate_plan_id(self, product_rate_plan_id):
"""Sets the product_rate_plan_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics.
The product rate plan ID. # noqa: E501
:param product_rate_plan_id: The product_rate_plan_id of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:type: str
"""
self._product_rate_plan_id = product_rate_plan_id
@property
def tcv(self):
"""Gets the tcv of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
Total contract value. # noqa: E501
:return: The tcv of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:rtype: str
"""
return self._tcv
@tcv.setter
def tcv(self, tcv):
"""Sets the tcv of this POSTSubscriptionPreviewResponseTypeChargeMetrics.
Total contract value. # noqa: E501
:param tcv: The tcv of this POSTSubscriptionPreviewResponseTypeChargeMetrics. # noqa: E501
:type: str
"""
self._tcv = tcv
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(POSTSubscriptionPreviewResponseTypeChargeMetrics, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, POSTSubscriptionPreviewResponseTypeChargeMetrics):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, POSTSubscriptionPreviewResponseTypeChargeMetrics):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/post_subscription_preview_response_type_charge_metrics.py
|
post_subscription_preview_response_type_charge_metrics.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class ProxyCreateOrModifyResponse(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'id': 'str',
'success': 'bool'
}
attribute_map = {
'id': 'Id',
'success': 'Success'
}
def __init__(self, id=None, success=None, _configuration=None): # noqa: E501
"""ProxyCreateOrModifyResponse - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._id = None
self._success = None
self.discriminator = None
if id is not None:
self.id = id
if success is not None:
self.success = success
@property
def id(self):
"""Gets the id of this ProxyCreateOrModifyResponse. # noqa: E501
# noqa: E501
:return: The id of this ProxyCreateOrModifyResponse. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this ProxyCreateOrModifyResponse.
# noqa: E501
:param id: The id of this ProxyCreateOrModifyResponse. # noqa: E501
:type: str
"""
self._id = id
@property
def success(self):
"""Gets the success of this ProxyCreateOrModifyResponse. # noqa: E501
# noqa: E501
:return: The success of this ProxyCreateOrModifyResponse. # noqa: E501
:rtype: bool
"""
return self._success
@success.setter
def success(self, success):
"""Sets the success of this ProxyCreateOrModifyResponse.
# noqa: E501
:param success: The success of this ProxyCreateOrModifyResponse. # noqa: E501
:type: bool
"""
self._success = success
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(ProxyCreateOrModifyResponse, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ProxyCreateOrModifyResponse):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, ProxyCreateOrModifyResponse):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/proxy_create_or_modify_response.py
|
proxy_create_or_modify_response.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class CreateOrderOrderAction(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'add_product': 'CreateOrderOrderActionAddProduct',
'cancel_subscription': 'CancelSubscription',
'change_plan': 'CreateChangePlan',
'change_reason': 'str',
'create_subscription': 'CreateOrderCreateSubscription',
'custom_fields': 'OrderActionObjectCustomFields',
'owner_transfer': 'OwnerTransfer',
'remove_product': 'RemoveProduct',
'renew_subscription': 'RenewSubscription',
'resume': 'CreateOrderResume',
'suspend': 'CreateOrderSuspend',
'terms_and_conditions': 'CreateOrderTermsAndConditions',
'trigger_dates': 'list[TriggerDate]',
'type': 'str',
'update_product': 'CreateOrderOrderActionUpdateProduct'
}
attribute_map = {
'add_product': 'addProduct',
'cancel_subscription': 'cancelSubscription',
'change_plan': 'changePlan',
'change_reason': 'changeReason',
'create_subscription': 'createSubscription',
'custom_fields': 'customFields',
'owner_transfer': 'ownerTransfer',
'remove_product': 'removeProduct',
'renew_subscription': 'renewSubscription',
'resume': 'resume',
'suspend': 'suspend',
'terms_and_conditions': 'termsAndConditions',
'trigger_dates': 'triggerDates',
'type': 'type',
'update_product': 'updateProduct'
}
def __init__(self, add_product=None, cancel_subscription=None, change_plan=None, change_reason=None, create_subscription=None, custom_fields=None, owner_transfer=None, remove_product=None, renew_subscription=None, resume=None, suspend=None, terms_and_conditions=None, trigger_dates=None, type=None, update_product=None, _configuration=None): # noqa: E501
"""CreateOrderOrderAction - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._add_product = None
self._cancel_subscription = None
self._change_plan = None
self._change_reason = None
self._create_subscription = None
self._custom_fields = None
self._owner_transfer = None
self._remove_product = None
self._renew_subscription = None
self._resume = None
self._suspend = None
self._terms_and_conditions = None
self._trigger_dates = None
self._type = None
self._update_product = None
self.discriminator = None
if add_product is not None:
self.add_product = add_product
if cancel_subscription is not None:
self.cancel_subscription = cancel_subscription
if change_plan is not None:
self.change_plan = change_plan
if change_reason is not None:
self.change_reason = change_reason
if create_subscription is not None:
self.create_subscription = create_subscription
if custom_fields is not None:
self.custom_fields = custom_fields
if owner_transfer is not None:
self.owner_transfer = owner_transfer
if remove_product is not None:
self.remove_product = remove_product
if renew_subscription is not None:
self.renew_subscription = renew_subscription
if resume is not None:
self.resume = resume
if suspend is not None:
self.suspend = suspend
if terms_and_conditions is not None:
self.terms_and_conditions = terms_and_conditions
if trigger_dates is not None:
self.trigger_dates = trigger_dates
self.type = type
if update_product is not None:
self.update_product = update_product
@property
def add_product(self):
"""Gets the add_product of this CreateOrderOrderAction. # noqa: E501
:return: The add_product of this CreateOrderOrderAction. # noqa: E501
:rtype: CreateOrderOrderActionAddProduct
"""
return self._add_product
@add_product.setter
def add_product(self, add_product):
"""Sets the add_product of this CreateOrderOrderAction.
:param add_product: The add_product of this CreateOrderOrderAction. # noqa: E501
:type: CreateOrderOrderActionAddProduct
"""
self._add_product = add_product
@property
def cancel_subscription(self):
"""Gets the cancel_subscription of this CreateOrderOrderAction. # noqa: E501
:return: The cancel_subscription of this CreateOrderOrderAction. # noqa: E501
:rtype: CancelSubscription
"""
return self._cancel_subscription
@cancel_subscription.setter
def cancel_subscription(self, cancel_subscription):
"""Sets the cancel_subscription of this CreateOrderOrderAction.
:param cancel_subscription: The cancel_subscription of this CreateOrderOrderAction. # noqa: E501
:type: CancelSubscription
"""
self._cancel_subscription = cancel_subscription
@property
def change_plan(self):
"""Gets the change_plan of this CreateOrderOrderAction. # noqa: E501
:return: The change_plan of this CreateOrderOrderAction. # noqa: E501
:rtype: CreateChangePlan
"""
return self._change_plan
@change_plan.setter
def change_plan(self, change_plan):
"""Sets the change_plan of this CreateOrderOrderAction.
:param change_plan: The change_plan of this CreateOrderOrderAction. # noqa: E501
:type: CreateChangePlan
"""
self._change_plan = change_plan
@property
def change_reason(self):
"""Gets the change_reason of this CreateOrderOrderAction. # noqa: E501
The change reason set for an order action when an order is created. # noqa: E501
:return: The change_reason of this CreateOrderOrderAction. # noqa: E501
:rtype: str
"""
return self._change_reason
@change_reason.setter
def change_reason(self, change_reason):
"""Sets the change_reason of this CreateOrderOrderAction.
The change reason set for an order action when an order is created. # noqa: E501
:param change_reason: The change_reason of this CreateOrderOrderAction. # noqa: E501
:type: str
"""
self._change_reason = change_reason
@property
def create_subscription(self):
"""Gets the create_subscription of this CreateOrderOrderAction. # noqa: E501
:return: The create_subscription of this CreateOrderOrderAction. # noqa: E501
:rtype: CreateOrderCreateSubscription
"""
return self._create_subscription
@create_subscription.setter
def create_subscription(self, create_subscription):
"""Sets the create_subscription of this CreateOrderOrderAction.
:param create_subscription: The create_subscription of this CreateOrderOrderAction. # noqa: E501
:type: CreateOrderCreateSubscription
"""
self._create_subscription = create_subscription
@property
def custom_fields(self):
"""Gets the custom_fields of this CreateOrderOrderAction. # noqa: E501
:return: The custom_fields of this CreateOrderOrderAction. # noqa: E501
:rtype: OrderActionObjectCustomFields
"""
return self._custom_fields
@custom_fields.setter
def custom_fields(self, custom_fields):
"""Sets the custom_fields of this CreateOrderOrderAction.
:param custom_fields: The custom_fields of this CreateOrderOrderAction. # noqa: E501
:type: OrderActionObjectCustomFields
"""
self._custom_fields = custom_fields
@property
def owner_transfer(self):
"""Gets the owner_transfer of this CreateOrderOrderAction. # noqa: E501
:return: The owner_transfer of this CreateOrderOrderAction. # noqa: E501
:rtype: OwnerTransfer
"""
return self._owner_transfer
@owner_transfer.setter
def owner_transfer(self, owner_transfer):
"""Sets the owner_transfer of this CreateOrderOrderAction.
:param owner_transfer: The owner_transfer of this CreateOrderOrderAction. # noqa: E501
:type: OwnerTransfer
"""
self._owner_transfer = owner_transfer
@property
def remove_product(self):
"""Gets the remove_product of this CreateOrderOrderAction. # noqa: E501
:return: The remove_product of this CreateOrderOrderAction. # noqa: E501
:rtype: RemoveProduct
"""
return self._remove_product
@remove_product.setter
def remove_product(self, remove_product):
"""Sets the remove_product of this CreateOrderOrderAction.
:param remove_product: The remove_product of this CreateOrderOrderAction. # noqa: E501
:type: RemoveProduct
"""
self._remove_product = remove_product
@property
def renew_subscription(self):
"""Gets the renew_subscription of this CreateOrderOrderAction. # noqa: E501
:return: The renew_subscription of this CreateOrderOrderAction. # noqa: E501
:rtype: RenewSubscription
"""
return self._renew_subscription
@renew_subscription.setter
def renew_subscription(self, renew_subscription):
"""Sets the renew_subscription of this CreateOrderOrderAction.
:param renew_subscription: The renew_subscription of this CreateOrderOrderAction. # noqa: E501
:type: RenewSubscription
"""
self._renew_subscription = renew_subscription
@property
def resume(self):
"""Gets the resume of this CreateOrderOrderAction. # noqa: E501
:return: The resume of this CreateOrderOrderAction. # noqa: E501
:rtype: CreateOrderResume
"""
return self._resume
@resume.setter
def resume(self, resume):
"""Sets the resume of this CreateOrderOrderAction.
:param resume: The resume of this CreateOrderOrderAction. # noqa: E501
:type: CreateOrderResume
"""
self._resume = resume
@property
def suspend(self):
"""Gets the suspend of this CreateOrderOrderAction. # noqa: E501
:return: The suspend of this CreateOrderOrderAction. # noqa: E501
:rtype: CreateOrderSuspend
"""
return self._suspend
@suspend.setter
def suspend(self, suspend):
"""Sets the suspend of this CreateOrderOrderAction.
:param suspend: The suspend of this CreateOrderOrderAction. # noqa: E501
:type: CreateOrderSuspend
"""
self._suspend = suspend
@property
def terms_and_conditions(self):
"""Gets the terms_and_conditions of this CreateOrderOrderAction. # noqa: E501
:return: The terms_and_conditions of this CreateOrderOrderAction. # noqa: E501
:rtype: CreateOrderTermsAndConditions
"""
return self._terms_and_conditions
@terms_and_conditions.setter
def terms_and_conditions(self, terms_and_conditions):
"""Sets the terms_and_conditions of this CreateOrderOrderAction.
:param terms_and_conditions: The terms_and_conditions of this CreateOrderOrderAction. # noqa: E501
:type: CreateOrderTermsAndConditions
"""
self._terms_and_conditions = terms_and_conditions
@property
def trigger_dates(self):
"""Gets the trigger_dates of this CreateOrderOrderAction. # noqa: E501
Container for the contract effective, service activation, and customer acceptance dates of the order action. If [Zuora is configured to require service activation](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Service_Activation_of_Orders.3F) and the `ServiceActivation` field is not set for a `CreateSubscription` order action, a `Pending` order and a `Pending Activation` subscription are created. If [Zuora is configured to require customer acceptance](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Customer_Acceptance_of_Orders.3F) and the `CustomerAcceptance` field is not set for a `CreateSubscription` order action, a `Pending` order and a `Pending Acceptance` subscription are created. At the same time, if the service activation date field is also required and not set, a `Pending` order and a `Pending Activation` subscription are created instead. If [Zuora is configured to require service activation](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Service_Activation_of_Orders.3F) and the `ServiceActivation` field is not set for either of the following order actions, a `Pending` order is created. The subscription status is not impacted. **Note:** This feature is in **Limited Availability**. If you want to have access to the feature, submit a request at [Zuora Global Support](http://support.zuora.com/). * AddProduct * UpdateProduct * RemoveProduct * RenewSubscription * TermsAndConditions If [Zuora is configured to require customer acceptance](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Customer_Acceptance_of_Orders.3F) and the `CustomerAcceptance` field is not set for either of the following order actions, a `Pending` order is created. The subscription status is not impacted. **Note:** This feature is in **Limited Availability**. If you want to have access to the feature, submit a request at [Zuora Global Support](http://support.zuora.com/). * AddProduct * UpdateProduct * RemoveProduct * RenewSubscription * TermsAndConditions # noqa: E501
:return: The trigger_dates of this CreateOrderOrderAction. # noqa: E501
:rtype: list[TriggerDate]
"""
return self._trigger_dates
@trigger_dates.setter
def trigger_dates(self, trigger_dates):
"""Sets the trigger_dates of this CreateOrderOrderAction.
Container for the contract effective, service activation, and customer acceptance dates of the order action. If [Zuora is configured to require service activation](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Service_Activation_of_Orders.3F) and the `ServiceActivation` field is not set for a `CreateSubscription` order action, a `Pending` order and a `Pending Activation` subscription are created. If [Zuora is configured to require customer acceptance](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Customer_Acceptance_of_Orders.3F) and the `CustomerAcceptance` field is not set for a `CreateSubscription` order action, a `Pending` order and a `Pending Acceptance` subscription are created. At the same time, if the service activation date field is also required and not set, a `Pending` order and a `Pending Activation` subscription are created instead. If [Zuora is configured to require service activation](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Service_Activation_of_Orders.3F) and the `ServiceActivation` field is not set for either of the following order actions, a `Pending` order is created. The subscription status is not impacted. **Note:** This feature is in **Limited Availability**. If you want to have access to the feature, submit a request at [Zuora Global Support](http://support.zuora.com/). * AddProduct * UpdateProduct * RemoveProduct * RenewSubscription * TermsAndConditions If [Zuora is configured to require customer acceptance](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Customer_Acceptance_of_Orders.3F) and the `CustomerAcceptance` field is not set for either of the following order actions, a `Pending` order is created. The subscription status is not impacted. **Note:** This feature is in **Limited Availability**. If you want to have access to the feature, submit a request at [Zuora Global Support](http://support.zuora.com/). * AddProduct * UpdateProduct * RemoveProduct * RenewSubscription * TermsAndConditions # noqa: E501
:param trigger_dates: The trigger_dates of this CreateOrderOrderAction. # noqa: E501
:type: list[TriggerDate]
"""
self._trigger_dates = trigger_dates
@property
def type(self):
"""Gets the type of this CreateOrderOrderAction. # noqa: E501
Type of order action. Unless the type of order action is `RenewSubscription`, you must use the corresponding field to provide information about the order action. For example, if the type of order action is `AddProduct`, you must set the `addProduct` field. Zuora returns an error if you set a field that corresponds to a different type of order action. For example, if the type of order action is `AddProduct`, Zuora returns an error if you set the `updateProduct` field. A [pending order](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/Pending_Order_and_Subscription) supports the following order actions: * CreateSubscription * AddProduct * UpdateProduct * RemoveProduct * RenewSubscription * TermsAndConditions * ChangePlan However, pending orders created through all order actions except for \"Create new subscription\": * Do not impact the subscription status. * Are in **Limited Availability**. If you want to have access to the feature, submit a request at [Zuora Global Support](https://support.zuora.com). A pending order is created in either of the following conditions: * [Zuora is configured to require service activation](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Service_Activation_of_Orders.3F) and the service activation date is not set in your \"Create an order\" call. * [Zuora is configured to require customer acceptance](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Customer_Acceptance_of_Orders.3F) and the customer acceptance date is not set in your \"Create an order\" call. * When a charge in the subscription has its `triggerEvent` field set as `SpecificDate` and the `specificTriggerDate` field is not set in your \"Create an order\" API call. **Note**: The change plan type of order action is currently not supported for Billing - Revenue Integration. When Billing - Revenue Integration is enabled, the change plan type of order action will no longer be applicable in Zuora Billing. # noqa: E501
:return: The type of this CreateOrderOrderAction. # noqa: E501
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""Sets the type of this CreateOrderOrderAction.
Type of order action. Unless the type of order action is `RenewSubscription`, you must use the corresponding field to provide information about the order action. For example, if the type of order action is `AddProduct`, you must set the `addProduct` field. Zuora returns an error if you set a field that corresponds to a different type of order action. For example, if the type of order action is `AddProduct`, Zuora returns an error if you set the `updateProduct` field. A [pending order](https://knowledgecenter.zuora.com/BC_Subscription_Management/Orders/Pending_Order_and_Subscription) supports the following order actions: * CreateSubscription * AddProduct * UpdateProduct * RemoveProduct * RenewSubscription * TermsAndConditions * ChangePlan However, pending orders created through all order actions except for \"Create new subscription\": * Do not impact the subscription status. * Are in **Limited Availability**. If you want to have access to the feature, submit a request at [Zuora Global Support](https://support.zuora.com). A pending order is created in either of the following conditions: * [Zuora is configured to require service activation](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Service_Activation_of_Orders.3F) and the service activation date is not set in your \"Create an order\" call. * [Zuora is configured to require customer acceptance](https://knowledgecenter.zuora.com/CB_Billing/Billing_Settings/Define_Default_Subscription_Settings#Require_Customer_Acceptance_of_Orders.3F) and the customer acceptance date is not set in your \"Create an order\" call. * When a charge in the subscription has its `triggerEvent` field set as `SpecificDate` and the `specificTriggerDate` field is not set in your \"Create an order\" API call. **Note**: The change plan type of order action is currently not supported for Billing - Revenue Integration. When Billing - Revenue Integration is enabled, the change plan type of order action will no longer be applicable in Zuora Billing. # noqa: E501
:param type: The type of this CreateOrderOrderAction. # noqa: E501
:type: str
"""
if self._configuration.client_side_validation and type is None:
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
allowed_values = ["CreateSubscription", "TermsAndConditions", "AddProduct", "UpdateProduct", "RemoveProduct", "RenewSubscription", "CancelSubscription", "OwnerTransfer", "Suspend", "Resume", "ChangePlan"] # noqa: E501
if (self._configuration.client_side_validation and
type not in allowed_values):
raise ValueError(
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
.format(type, allowed_values)
)
self._type = type
@property
def update_product(self):
"""Gets the update_product of this CreateOrderOrderAction. # noqa: E501
:return: The update_product of this CreateOrderOrderAction. # noqa: E501
:rtype: CreateOrderOrderActionUpdateProduct
"""
return self._update_product
@update_product.setter
def update_product(self, update_product):
"""Sets the update_product of this CreateOrderOrderAction.
:param update_product: The update_product of this CreateOrderOrderAction. # noqa: E501
:type: CreateOrderOrderActionUpdateProduct
"""
self._update_product = update_product
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(CreateOrderOrderAction, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, CreateOrderOrderAction):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, CreateOrderOrderAction):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/create_order_order_action.py
|
create_order_order_action.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class GetFulfillmentResponseType(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'fulfillment': 'FulfillmentGet'
}
attribute_map = {
'fulfillment': 'fulfillment'
}
def __init__(self, fulfillment=None, _configuration=None): # noqa: E501
"""GetFulfillmentResponseType - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._fulfillment = None
self.discriminator = None
if fulfillment is not None:
self.fulfillment = fulfillment
@property
def fulfillment(self):
"""Gets the fulfillment of this GetFulfillmentResponseType. # noqa: E501
:return: The fulfillment of this GetFulfillmentResponseType. # noqa: E501
:rtype: FulfillmentGet
"""
return self._fulfillment
@fulfillment.setter
def fulfillment(self, fulfillment):
"""Sets the fulfillment of this GetFulfillmentResponseType.
:param fulfillment: The fulfillment of this GetFulfillmentResponseType. # noqa: E501
:type: FulfillmentGet
"""
self._fulfillment = fulfillment
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(GetFulfillmentResponseType, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, GetFulfillmentResponseType):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, GetFulfillmentResponseType):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/get_fulfillment_response_type.py
|
get_fulfillment_response_type.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class GETOfferTier(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'ending_unit': 'float',
'price': 'float',
'price_format': 'str',
'starting_unit': 'float',
'tier': 'float'
}
attribute_map = {
'ending_unit': 'endingUnit',
'price': 'price',
'price_format': 'priceFormat',
'starting_unit': 'startingUnit',
'tier': 'tier'
}
def __init__(self, ending_unit=None, price=None, price_format=None, starting_unit=None, tier=None, _configuration=None): # noqa: E501
"""GETOfferTier - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._ending_unit = None
self._price = None
self._price_format = None
self._starting_unit = None
self._tier = None
self.discriminator = None
if ending_unit is not None:
self.ending_unit = ending_unit
if price is not None:
self.price = price
if price_format is not None:
self.price_format = price_format
if starting_unit is not None:
self.starting_unit = starting_unit
if tier is not None:
self.tier = tier
@property
def ending_unit(self):
"""Gets the ending_unit of this GETOfferTier. # noqa: E501
The ending unit of the tier. # noqa: E501
:return: The ending_unit of this GETOfferTier. # noqa: E501
:rtype: float
"""
return self._ending_unit
@ending_unit.setter
def ending_unit(self, ending_unit):
"""Sets the ending_unit of this GETOfferTier.
The ending unit of the tier. # noqa: E501
:param ending_unit: The ending_unit of this GETOfferTier. # noqa: E501
:type: float
"""
self._ending_unit = ending_unit
@property
def price(self):
"""Gets the price of this GETOfferTier. # noqa: E501
The price of the tier. # noqa: E501
:return: The price of this GETOfferTier. # noqa: E501
:rtype: float
"""
return self._price
@price.setter
def price(self, price):
"""Sets the price of this GETOfferTier.
The price of the tier. # noqa: E501
:param price: The price of this GETOfferTier. # noqa: E501
:type: float
"""
self._price = price
@property
def price_format(self):
"""Gets the price_format of this GETOfferTier. # noqa: E501
The price format of the tier. # noqa: E501
:return: The price_format of this GETOfferTier. # noqa: E501
:rtype: str
"""
return self._price_format
@price_format.setter
def price_format(self, price_format):
"""Sets the price_format of this GETOfferTier.
The price format of the tier. # noqa: E501
:param price_format: The price_format of this GETOfferTier. # noqa: E501
:type: str
"""
allowed_values = ["FlatFee", "PerUnit"] # noqa: E501
if (self._configuration.client_side_validation and
price_format not in allowed_values):
raise ValueError(
"Invalid value for `price_format` ({0}), must be one of {1}" # noqa: E501
.format(price_format, allowed_values)
)
self._price_format = price_format
@property
def starting_unit(self):
"""Gets the starting_unit of this GETOfferTier. # noqa: E501
The starting unit of the tier. # noqa: E501
:return: The starting_unit of this GETOfferTier. # noqa: E501
:rtype: float
"""
return self._starting_unit
@starting_unit.setter
def starting_unit(self, starting_unit):
"""Sets the starting_unit of this GETOfferTier.
The starting unit of the tier. # noqa: E501
:param starting_unit: The starting_unit of this GETOfferTier. # noqa: E501
:type: float
"""
self._starting_unit = starting_unit
@property
def tier(self):
"""Gets the tier of this GETOfferTier. # noqa: E501
The number of the tier. # noqa: E501
:return: The tier of this GETOfferTier. # noqa: E501
:rtype: float
"""
return self._tier
@tier.setter
def tier(self, tier):
"""Sets the tier of this GETOfferTier.
The number of the tier. # noqa: E501
:param tier: The tier of this GETOfferTier. # noqa: E501
:type: float
"""
self._tier = tier
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(GETOfferTier, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, GETOfferTier):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, GETOfferTier):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/get_offer_tier.py
|
get_offer_tier.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class Request1(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'workflow': 'DetailedWorkflow',
'tasks': 'list[Task]',
'linkages': 'list[Linkage]'
}
attribute_map = {
'workflow': 'workflow',
'tasks': 'tasks',
'linkages': 'linkages'
}
def __init__(self, workflow=None, tasks=None, linkages=None, _configuration=None): # noqa: E501
"""Request1 - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._workflow = None
self._tasks = None
self._linkages = None
self.discriminator = None
if workflow is not None:
self.workflow = workflow
if tasks is not None:
self.tasks = tasks
if linkages is not None:
self.linkages = linkages
@property
def workflow(self):
"""Gets the workflow of this Request1. # noqa: E501
:return: The workflow of this Request1. # noqa: E501
:rtype: DetailedWorkflow
"""
return self._workflow
@workflow.setter
def workflow(self, workflow):
"""Sets the workflow of this Request1.
:param workflow: The workflow of this Request1. # noqa: E501
:type: DetailedWorkflow
"""
self._workflow = workflow
@property
def tasks(self):
"""Gets the tasks of this Request1. # noqa: E501
:return: The tasks of this Request1. # noqa: E501
:rtype: list[Task]
"""
return self._tasks
@tasks.setter
def tasks(self, tasks):
"""Sets the tasks of this Request1.
:param tasks: The tasks of this Request1. # noqa: E501
:type: list[Task]
"""
self._tasks = tasks
@property
def linkages(self):
"""Gets the linkages of this Request1. # noqa: E501
:return: The linkages of this Request1. # noqa: E501
:rtype: list[Linkage]
"""
return self._linkages
@linkages.setter
def linkages(self, linkages):
"""Sets the linkages of this Request1.
:param linkages: The linkages of this Request1. # noqa: E501
:type: list[Linkage]
"""
self._linkages = linkages
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(Request1, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, Request1):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, Request1):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/request1.py
|
request1.py
|
# coding: utf-8
"""
API Reference
# Introduction Welcome to the REST API reference for the Zuora Billing, Payments, and Central Platform! To learn about the common use cases of Zuora REST APIs, check out the [REST API Tutorials](https://www.zuora.com/developer/rest-api/api-guides/overview/). In addition to Zuora API Reference, we also provide API references for other Zuora products: * [Revenue API Reference](https://www.zuora.com/developer/api-references/revenue/overview/) * [Collections API Reference](https://www.zuora.com/developer/api-references/collections/overview/) The Zuora REST API provides a broad set of operations and resources that: * Enable Web Storefront integration from your website. * Support self-service subscriber sign-ups and account management. * Process revenue schedules through custom revenue rule models. * Enable manipulation of most objects in the Zuora Billing Object Model. Want to share your opinion on how our API works for you? <a href=\"https://community.zuora.com/t5/Developers/API-Feedback-Form/gpm-p/21399\" target=\"_blank\">Tell us how you feel </a>about using our API and what we can do to make it better. Some of our older APIs are no longer recommended but still available, not affecting any existing integration. To find related API documentation, see [Older API Reference](https://www.zuora.com/developer/api-references/older-api/overview/). ## Access to the API If you have a Zuora tenant, you can access the Zuora REST API via one of the following endpoints: | Tenant | Base URL for REST Endpoints | |-------------------------|-------------------------| |US Cloud 1 Production | https://rest.na.zuora.com | |US Cloud 1 API Sandbox | https://rest.sandbox.na.zuora.com | |US Cloud 2 Production | https://rest.zuora.com | |US Cloud 2 API Sandbox | https://rest.apisandbox.zuora.com| |US Central Sandbox | https://rest.test.zuora.com | |US Performance Test | https://rest.pt1.zuora.com | |US Production Copy | Submit a request at <a href=\"http://support.zuora.com/\" target=\"_blank\">Zuora Global Support</a> to enable the Zuora REST API in your tenant and obtain the base URL for REST endpoints. See [REST endpoint base URL of Production Copy (Service) Environment for existing and new customers](https://community.zuora.com/t5/API/REST-endpoint-base-URL-of-Production-Copy-Service-Environment/td-p/29611) for more information. | |EU Production | https://rest.eu.zuora.com | |EU API Sandbox | https://rest.sandbox.eu.zuora.com | |EU Central Sandbox | https://rest.test.eu.zuora.com | The Production endpoint provides access to your live user data. Sandbox tenants are a good place to test code without affecting real-world data. If you would like Zuora to provision a Sandbox tenant for you, contact your Zuora representative for assistance. If you do not have a Zuora tenant, go to <a href=\"https://www.zuora.com/resource/zuora-test-drive\" target=\"_blank\">https://www.zuora.com/resource/zuora-test-drive</a> and sign up for a Production Test Drive tenant. The tenant comes with seed data, including a sample product catalog. # Error Handling If a request to Zuora Billing REST API with an endpoint starting with `/v1` (except [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions) and CRUD operations) fails, the response will contain an eight-digit error code with a corresponding error message to indicate the details of the error. The following code snippet is a sample error response that contains an error code and message pair: ``` { \"success\": false, \"processId\": \"CBCFED6580B4E076\", \"reasons\": [ { \"code\": 53100320, \"message\": \"'termType' value should be one of: TERMED, EVERGREEN\" } ] } ``` The `success` field indicates whether the API request has succeeded. The `processId` field is a Zuora internal ID that you can provide to Zuora Global Support for troubleshooting purposes. The `reasons` field contains the actual error code and message pair. The error code begins with `5` or `6` means that you encountered a certain issue that is specific to a REST API resource in Zuora Billing, Payments, and Central Platform. For example, `53100320` indicates that an invalid value is specified for the `termType` field of the `subscription` object. The error code beginning with `9` usually indicates that an authentication-related issue occurred, and it can also indicate other unexpected errors depending on different cases. For example, `90000011` indicates that an invalid credential is provided in the request header. When troubleshooting the error, you can divide the error code into two components: REST API resource code and error category code. See the following Zuora error code sample: <a href=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" target=\"_blank\"><img src=\"https://www.zuora.com/developer/images/ZuoraErrorCode.jpeg\" alt=\"Zuora Error Code Sample\"></a> **Note:** Zuora determines resource codes based on the request payload. Therefore, if GET and DELETE requests that do not contain payloads fail, you will get `500000` as the resource code, which indicates an unknown object and an unknown field. The error category code of these requests is valid and follows the rules described in the [Error Category Codes](https://www.zuora.com/developer/api-references/api/overview/#section/Error-Handling/Error-Category-Codes) section. In such case, you can refer to the returned error message to troubleshoot. ## REST API Resource Codes The 6-digit resource code indicates the REST API resource, typically a field of a Zuora object, on which the issue occurs. In the preceding example, `531003` refers to the `termType` field of the `subscription` object. The value range for all REST API resource codes is from `500000` to `679999`. See <a href=\"https://knowledgecenter.zuora.com/Central_Platform/API/AA_REST_API/Resource_Codes\" target=\"_blank\">Resource Codes</a> in the Knowledge Center for a full list of resource codes. ## Error Category Codes The 2-digit error category code identifies the type of error, for example, resource not found or missing required field. The following table describes all error categories and the corresponding resolution: | Code | Error category | Description | Resolution | |:--------|:--------|:--------|:--------| | 10 | Permission or access denied | The request cannot be processed because a certain tenant or user permission is missing. | Check the missing tenant or user permission in the response message and contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> for enablement. | | 11 | Authentication failed | Authentication fails due to invalid API authentication credentials. | Ensure that a valid API credential is specified. | | 20 | Invalid format or value | The request cannot be processed due to an invalid field format or value. | Check the invalid field in the error message, and ensure that the format and value of all fields you passed in are valid. | | 21 | Unknown field in request | The request cannot be processed because an unknown field exists in the request body. | Check the unknown field name in the response message, and ensure that you do not include any unknown field in the request body. | | 22 | Missing required field | The request cannot be processed because a required field in the request body is missing. | Check the missing field name in the response message, and ensure that you include all required fields in the request body. | | 23 | Missing required parameter | The request cannot be processed because a required query parameter is missing. | Check the missing parameter name in the response message, and ensure that you include the parameter in the query. | | 30 | Rule restriction | The request cannot be processed due to the violation of a Zuora business rule. | Check the response message and ensure that the API request meets the specified business rules. | | 40 | Not found | The specified resource cannot be found. | Check the response message and ensure that the specified resource exists in your Zuora tenant. | | 45 | Unsupported request | The requested endpoint does not support the specified HTTP method. | Check your request and ensure that the endpoint and method matches. | | 50 | Locking contention | This request cannot be processed because the objects this request is trying to modify are being modified by another API request, UI operation, or batch job process. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance.</p> | | 60 | Internal error | The server encounters an internal error. | Contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. | | 61 | Temporary error | A temporary error occurs during request processing, for example, a database communication error. | <p>Resubmit the request first to have another try.</p> <p>If this error still occurs, contact <a href=\"https://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> with the returned `Zuora-Request-Id` value in the response header for assistance. </p>| | 70 | Request exceeded limit | The total number of concurrent requests exceeds the limit allowed by the system. | <p>Resubmit the request after the number of seconds specified by the `Retry-After` value in the response header.</p> <p>Check [Concurrent request limits](https://www.zuora.com/developer/rest-api/general-concepts/rate-concurrency-limits/) for details about Zuoraโs concurrent request limit policy.</p> | | 90 | Malformed request | The request cannot be processed due to JSON syntax errors. | Check the syntax error in the JSON request body and ensure that the request is in the correct JSON format. | | 99 | Integration error | The server encounters an error when communicating with an external system, for example, payment gateway, tax engine provider. | Check the response message and take action accordingly. | # API Versions The Zuora REST API are version controlled. Versioning ensures that Zuora REST API changes are backward compatible. Zuora uses a major and minor version nomenclature to manage changes. By specifying a version in a REST request, you can get expected responses regardless of future changes to the API. ## Major Version The major version number of the REST API appears in the REST URL. In this API reference, only the **v1** major version is available. For example, `POST https://rest.zuora.com/v1/subscriptions`. ## Minor Version Zuora uses minor versions for the REST API to control small changes. For example, a field in a REST method is deprecated and a new field is used to replace it. Some fields in the REST methods are supported as of minor versions. If a field is not noted with a minor version, this field is available for all minor versions. If a field is noted with a minor version, this field is in version control. You must specify the supported minor version in the request header to process without an error. If a field is in version control, it is either with a minimum minor version or a maximum minor version, or both of them. You can only use this field with the minor version between the minimum and the maximum minor versions. For example, the `invoiceCollect` field in the POST Subscription method is in version control and its maximum minor version is 189.0. You can only use this field with the minor version 189.0 or earlier. If you specify a version number in the request header that is not supported, Zuora will use the minimum minor version of the REST API. In our REST API documentation, if a field or feature requires a minor version number, we note that in the field description. You only need to specify the version number when you use the fields require a minor version. To specify the minor version, set the `zuora-version` parameter to the minor version number in the request header for the request call. For example, the `collect` field is in 196.0 minor version. If you want to use this field for the POST Subscription method, set the `zuora-version` parameter to `196.0` in the request header. The `zuora-version` parameter is case sensitive. For all the REST API fields, by default, if the minor version is not specified in the request header, Zuora will use the minimum minor version of the REST API to avoid breaking your integration. ### Minor Version History The supported minor versions are not serial. This section documents the changes made to each Zuora REST API minor version. The following table lists the supported versions and the fields that have a Zuora REST API minor version. | Fields | Minor Version | REST Methods | Description | |:--------|:--------|:--------|:--------| | invoiceCollect | 189.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice and collects a payment for a subscription. | | collect | 196.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Collects an automatic payment for a subscription. | | invoice | 196.0 and 207.0| [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice for a subscription. | | invoiceTargetDate | 206.0 and earlier | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | invoiceTargetDate | 207.0 and earlier | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\") |Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | targetDate | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Date through which charges are calculated on the invoice, as `yyyy-mm-dd`. | | includeExisting DraftInvoiceItems | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | includeExisting DraftDocItems | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | Specifies whether to include draft invoice items in subscription previews. Specify it to be `true` (default) to include draft invoice items in the preview result. Specify it to be `false` to excludes draft invoice items in the preview result. | | previewType | 206.0 and earlier| [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `InvoiceItem`(default), `ChargeMetrics`, and `InvoiceItemChargeMetrics`. | | previewType | 207.0 and later | [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") | The type of preview you will receive. The possible values are `LegalDoc`(default), `ChargeMetrics`, and `LegalDocChargeMetrics`. | | runBilling | 211.0 and later | [Create Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_Subscription \"Create Subscription\"); [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\"); [Renew Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_RenewSubscription \"Renew Subscription\"); [Cancel Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelSubscription \"Cancel Subscription\"); [Suspend Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_SuspendSubscription \"Suspend Subscription\"); [Resume Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_ResumeSubscription \"Resume Subscription\"); [Create Account](https://www.zuora.com/developer/api-references/api/operation/POST_Account \"Create Account\")|Generates an invoice or credit memo for a subscription. **Note:** Credit memos are only available if you have the Invoice Settlement feature enabled. | | invoiceDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice being generated, as `yyyy-mm-dd`. | | invoiceTargetDate | 214.0 and earlier | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice is generated, as `yyyy-mm-dd`. | | documentDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date that should appear on the invoice and credit memo being generated, as `yyyy-mm-dd`. | | targetDate | 215.0 and later | [Invoice and Collect](https://www.zuora.com/developer/api-references/api/operation/POST_TransactionInvoicePayment \"Invoice and Collect\") |Date through which to calculate charges on this account if an invoice or a credit memo is generated, as `yyyy-mm-dd`. | | memoItemAmount | 223.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | amount | 224.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | Amount of the memo item. | | subscriptionNumbers | 222.4 and earlier | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers of the subscriptions in an order. | | subscriptions | 223.0 and later | [Create order](https://www.zuora.com/developer/api-references/api/operation/POST_Order \"Create order\") | Container for the subscription numbers and statuses in an order. | | creditTaxItems | 238.0 and earlier | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\") | Container for the taxation items of the credit memo item. | | taxItems | 238.0 and earlier | [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the debit memo item. | | taxationItems | 239.0 and later | [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Container for the taxation items of the memo item. | | chargeId | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | productRatePlanChargeId | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\") | ID of the product rate plan charge that the memo is created from. | | comment | 256.0 and earlier | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Comments about the product rate plan charge, invoice item, or memo item. | | description | 257.0 and later | [Create credit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromPrpc \"Create credit memo from charge\"); [Create debit memo from charge](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromPrpc \"Create debit memo from charge\"); [Create credit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_CreditMemoFromInvoice \"Create credit memo from invoice\"); [Create debit memo from invoice](https://www.zuora.com/developer/api-references/api/operation/POST_DebitMemoFromInvoice \"Create debit memo from invoice\"); [Get credit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItems \"Get credit memo items\"); [Get credit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_CreditMemoItem \"Get credit memo item\"); [Get debit memo items](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItems \"Get debit memo items\"); [Get debit memo item](https://www.zuora.com/developer/api-references/api/operation/GET_DebitMemoItem \"Get debit memo item\") | Description of the the product rate plan charge, invoice item, or memo item. | | taxationItems | 309.0 and later | [Preview an order](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewOrder \"Preview an order\") | List of taxation items for an invoice item or a credit memo item. | | batch | 309.0 and earlier | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | batches | 314.0 and later | [Create a billing preview run](https://www.zuora.com/developer/api-references/api/operation/POST_BillingPreviewRun \"Create a billing preview run\") | The customer batches to include in the billing preview run. | | taxationItems | 315.0 and later | [Preview a subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription \"Preview a subscription\"); [Update a subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update a subscription\")| List of taxation items for an invoice item or a credit memo item. | | billingDocument | 330.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules \"Create multiple payment schedules at once\")| The billing document with which the payment schedule item is associated. | | paymentId | 336.0 and earlier | [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\");[Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\");[Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\") | ID of the payment to be linked to the payment schedule item. | | paymentOption | 337.0 and later | [Create a payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedule/ \"Create a payment schedule\"); [Create multiple payment schedules at once](https://www.zuora.com/developer/api-references/api/operation/POST_PaymentSchedules/ \"Create multiple payment schedules at once\"); [Create a payment](https://www.zuora.com/developer/api-references/api/operation/POST_CreatePayment/ \"Create a payment\"); [Add payment schedule items to a custom payment schedule](https://www.zuora.com/developer/api-references/api/operation/POST_AddItemsToCustomPaymentSchedule/ \"Add payment schedule items to a custom payment schedule\"); [Update a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentSchedule/ \"Update a payment schedule\"); [Update a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleItem/ \"Update a payment schedule item\"); [Preview the result of payment schedule update](https://www.zuora.com/developer/api-references/api/operation/PUT_PaymentScheduleUpdatePreview/ \"Preview the result of payment schedule update\"); [Retrieve a payment schedule](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedule/ \"Retrieve a payment schedule\"); [Retrieve a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentScheduleItem/ \"Retrieve a payment schedule item\"); [List payment schedules by customer account](https://www.zuora.com/developer/api-references/api/operation/GET_PaymentSchedules/ \"List payment schedules by customer account\"); [Cancel a payment schedule](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentSchedule/ \"Cancel a payment schedule\"); [Cancel a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_CancelPaymentScheduleItem/ \"Cancel a payment schedule item\"); [Skip a payment schedule item](https://www.zuora.com/developer/api-references/api/operation/PUT_SkipPaymentScheduleItem/ \"Skip a payment schedule item\"); [Retry failed payment schedule items](https://www.zuora.com/developer/api-references/api/operation/POST_RetryPaymentScheduleItem/ \"Retry failed payment schedule items\"); [List payments](https://www.zuora.com/developer/api-references/api/operation/GET_RetrieveAllPayments/ \"List payments\") | Array of transactional level rules for processing payments. | #### Version 207.0 and Later The response structure of the [Preview Subscription](https://www.zuora.com/developer/api-references/api/operation/POST_PreviewSubscription) and [Update Subscription](https://www.zuora.com/developer/api-references/api/operation/PUT_Subscription \"Update Subscription\") methods are changed. The following invoice related response fields are moved to the invoice container: * amount * amountWithoutTax * taxAmount * invoiceItems * targetDate * chargeMetrics # API Names for Zuora Objects For information about the Zuora business object model, see [Zuora Business Object Model](https://www.zuora.com/developer/rest-api/general-concepts/object-model/). You can use the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation to list the fields of each Zuora object that is available in your tenant. When you call the operation, you must specify the API name of the Zuora object. The following table provides the API name of each Zuora object: | Object | API Name | |-----------------------------------------------|--------------------------------------------| | Account | `Account` | | Accounting Code | `AccountingCode` | | Accounting Period | `AccountingPeriod` | | Amendment | `Amendment` | | Application Group | `ApplicationGroup` | | Billing Run | <p>`BillingRun` - API name used in the [Describe](https://www.zuora.com/developer/api-references/api/operation/GET_Describe) operation, Export ZOQL queries, and Data Query.</p> <p>`BillRun` - API name used in the [Actions](https://www.zuora.com/developer/api-references/api/tag/Actions). See the CRUD oprations of [Bill Run](https://www.zuora.com/developer/api-references/api/tag/Bill-Run) for more information about the `BillRun` object. `BillingRun` and `BillRun` have different fields. | | Configuration Templates | `ConfigurationTemplates` | | Contact | `Contact` | | Contact Snapshot | `ContactSnapshot` | | Credit Balance Adjustment | `CreditBalanceAdjustment` | | Credit Memo | `CreditMemo` | | Credit Memo Application | `CreditMemoApplication` | | Credit Memo Application Item | `CreditMemoApplicationItem` | | Credit Memo Item | `CreditMemoItem` | | Credit Memo Part | `CreditMemoPart` | | Credit Memo Part Item | `CreditMemoPartItem` | | Credit Taxation Item | `CreditTaxationItem` | | Custom Exchange Rate | `FXCustomRate` | | Debit Memo | `DebitMemo` | | Debit Memo Item | `DebitMemoItem` | | Debit Taxation Item | `DebitTaxationItem` | | Discount Applied Metrics | `DiscountAppliedMetrics` | | Entity | `Tenant` | | Fulfillment | `Fulfillment` | | Feature | `Feature` | | Gateway Reconciliation Event | `PaymentGatewayReconciliationEventLog` | | Gateway Reconciliation Job | `PaymentReconciliationJob` | | Gateway Reconciliation Log | `PaymentReconciliationLog` | | Invoice | `Invoice` | | Invoice Adjustment | `InvoiceAdjustment` | | Invoice Item | `InvoiceItem` | | Invoice Item Adjustment | `InvoiceItemAdjustment` | | Invoice Payment | `InvoicePayment` | | Invoice Schedule | `InvoiceSchedule` | | Journal Entry | `JournalEntry` | | Journal Entry Item | `JournalEntryItem` | | Journal Run | `JournalRun` | | Notification History - Callout | `CalloutHistory` | | Notification History - Email | `EmailHistory` | | Offer | `Offer` | | Order | `Order` | | Order Action | `OrderAction` | | Order ELP | `OrderElp` | | Order Line Items | `OrderLineItems` | | Order Item | `OrderItem` | | Order MRR | `OrderMrr` | | Order Quantity | `OrderQuantity` | | Order TCB | `OrderTcb` | | Order TCV | `OrderTcv` | | Payment | `Payment` | | Payment Application | `PaymentApplication` | | Payment Application Item | `PaymentApplicationItem` | | Payment Method | `PaymentMethod` | | Payment Method Snapshot | `PaymentMethodSnapshot` | | Payment Method Transaction Log | `PaymentMethodTransactionLog` | | Payment Method Update | `UpdaterDetail` | | Payment Part | `PaymentPart` | | Payment Part Item | `PaymentPartItem` | | Payment Run | `PaymentRun` | | Payment Transaction Log | `PaymentTransactionLog` | | Price Book Item | `PriceBookItem` | | Processed Usage | `ProcessedUsage` | | Product | `Product` | | Product Feature | `ProductFeature` | | Product Rate Plan | `ProductRatePlan` | | Product Rate Plan Charge | `ProductRatePlanCharge` | | Product Rate Plan Charge Tier | `ProductRatePlanChargeTier` | | Rate Plan | `RatePlan` | | Rate Plan Charge | `RatePlanCharge` | | Rate Plan Charge Tier | `RatePlanChargeTier` | | Refund | `Refund` | | Refund Application | `RefundApplication` | | Refund Application Item | `RefundApplicationItem` | | Refund Invoice Payment | `RefundInvoicePayment` | | Refund Part | `RefundPart` | | Refund Part Item | `RefundPartItem` | | Refund Transaction Log | `RefundTransactionLog` | | Revenue Charge Summary | `RevenueChargeSummary` | | Revenue Charge Summary Item | `RevenueChargeSummaryItem` | | Revenue Event | `RevenueEvent` | | Revenue Event Credit Memo Item | `RevenueEventCreditMemoItem` | | Revenue Event Debit Memo Item | `RevenueEventDebitMemoItem` | | Revenue Event Invoice Item | `RevenueEventInvoiceItem` | | Revenue Event Invoice Item Adjustment | `RevenueEventInvoiceItemAdjustment` | | Revenue Event Item | `RevenueEventItem` | | Revenue Event Item Credit Memo Item | `RevenueEventItemCreditMemoItem` | | Revenue Event Item Debit Memo Item | `RevenueEventItemDebitMemoItem` | | Revenue Event Item Invoice Item | `RevenueEventItemInvoiceItem` | | Revenue Event Item Invoice Item Adjustment | `RevenueEventItemInvoiceItemAdjustment` | | Revenue Event Type | `RevenueEventType` | | Revenue Schedule | `RevenueSchedule` | | Revenue Schedule Credit Memo Item | `RevenueScheduleCreditMemoItem` | | Revenue Schedule Debit Memo Item | `RevenueScheduleDebitMemoItem` | | Revenue Schedule Invoice Item | `RevenueScheduleInvoiceItem` | | Revenue Schedule Invoice Item Adjustment | `RevenueScheduleInvoiceItemAdjustment` | | Revenue Schedule Item | `RevenueScheduleItem` | | Revenue Schedule Item Credit Memo Item | `RevenueScheduleItemCreditMemoItem` | | Revenue Schedule Item Debit Memo Item | `RevenueScheduleItemDebitMemoItem` | | Revenue Schedule Item Invoice Item | `RevenueScheduleItemInvoiceItem` | | Revenue Schedule Item Invoice Item Adjustment | `RevenueScheduleItemInvoiceItemAdjustment` | | Subscription | `Subscription` | | Subscription Product Feature | `SubscriptionProductFeature` | | Taxable Item Snapshot | `TaxableItemSnapshot` | | Taxation Item | `TaxationItem` | | Updater Batch | `UpdaterBatch` | | Usage | `Usage` | # noqa: E501
OpenAPI spec version: 2023-07-24
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class ProxyGetPaymentMethodSnapshot(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'account_id': 'str',
'ach_aba_code': 'str',
'ach_account_name': 'str',
'ach_account_number_mask': 'str',
'ach_account_type': 'str',
'ach_bank_name': 'str',
'bank_branch_code': 'str',
'bank_check_digit': 'str',
'bank_city': 'str',
'bank_code': 'str',
'bank_identification_number': 'str',
'bank_name': 'str',
'bank_postal_code': 'str',
'bank_street_name': 'str',
'bank_street_number': 'str',
'bank_transfer_account_name': 'str',
'bank_transfer_account_number_mask': 'str',
'bank_transfer_account_type': 'str',
'bank_transfer_type': 'str',
'business_identification_code': 'str',
'city': 'str',
'company_name': 'str',
'country': 'str',
'credit_card_address1': 'str',
'credit_card_address2': 'str',
'credit_card_city': 'str',
'credit_card_country': 'str',
'credit_card_expiration_month': 'int',
'credit_card_expiration_year': 'int',
'credit_card_holder_name': 'str',
'credit_card_mask_number': 'str',
'credit_card_postal_code': 'str',
'credit_card_state': 'str',
'credit_card_type': 'str',
'device_session_id': 'str',
'email': 'str',
'existing_mandate': 'str',
'first_name': 'str',
'iban': 'str',
'ip_address': 'str',
'id': 'str',
'identity_number': 'str',
'is_company': 'bool',
'last_failed_sale_transaction_date': 'datetime',
'last_name': 'str',
'last_transaction_date_time': 'datetime',
'last_transaction_status': 'str',
'mandate_creation_date': 'date',
'mandate_id': 'str',
'mandate_received': 'str',
'mandate_update_date': 'date',
'max_consecutive_payment_failures': 'int',
'name': 'str',
'num_consecutive_failures': 'int',
'payment_method_id': 'str',
'payment_method_status': 'str',
'payment_retry_window': 'int',
'paypal_baid': 'str',
'paypal_email': 'str',
'paypal_preapproval_key': 'str',
'paypal_type': 'str',
'phone': 'str',
'postal_code': 'str',
'second_token_id': 'str',
'state': 'str',
'street_name': 'str',
'street_number': 'str',
'token_id': 'str',
'total_number_of_error_payments': 'int',
'total_number_of_processed_payments': 'int',
'type': 'str',
'use_default_retry_rule': 'bool'
}
attribute_map = {
'account_id': 'AccountId',
'ach_aba_code': 'AchAbaCode',
'ach_account_name': 'AchAccountName',
'ach_account_number_mask': 'AchAccountNumberMask',
'ach_account_type': 'AchAccountType',
'ach_bank_name': 'AchBankName',
'bank_branch_code': 'BankBranchCode',
'bank_check_digit': 'BankCheckDigit',
'bank_city': 'BankCity',
'bank_code': 'BankCode',
'bank_identification_number': 'BankIdentificationNumber',
'bank_name': 'BankName',
'bank_postal_code': 'BankPostalCode',
'bank_street_name': 'BankStreetName',
'bank_street_number': 'BankStreetNumber',
'bank_transfer_account_name': 'BankTransferAccountName',
'bank_transfer_account_number_mask': 'BankTransferAccountNumberMask',
'bank_transfer_account_type': 'BankTransferAccountType',
'bank_transfer_type': 'BankTransferType',
'business_identification_code': 'BusinessIdentificationCode',
'city': 'City',
'company_name': 'CompanyName',
'country': 'Country',
'credit_card_address1': 'CreditCardAddress1',
'credit_card_address2': 'CreditCardAddress2',
'credit_card_city': 'CreditCardCity',
'credit_card_country': 'CreditCardCountry',
'credit_card_expiration_month': 'CreditCardExpirationMonth',
'credit_card_expiration_year': 'CreditCardExpirationYear',
'credit_card_holder_name': 'CreditCardHolderName',
'credit_card_mask_number': 'CreditCardMaskNumber',
'credit_card_postal_code': 'CreditCardPostalCode',
'credit_card_state': 'CreditCardState',
'credit_card_type': 'CreditCardType',
'device_session_id': 'DeviceSessionId',
'email': 'Email',
'existing_mandate': 'ExistingMandate',
'first_name': 'FirstName',
'iban': 'IBAN',
'ip_address': 'IPAddress',
'id': 'Id',
'identity_number': 'IdentityNumber',
'is_company': 'IsCompany',
'last_failed_sale_transaction_date': 'LastFailedSaleTransactionDate',
'last_name': 'LastName',
'last_transaction_date_time': 'LastTransactionDateTime',
'last_transaction_status': 'LastTransactionStatus',
'mandate_creation_date': 'MandateCreationDate',
'mandate_id': 'MandateID',
'mandate_received': 'MandateReceived',
'mandate_update_date': 'MandateUpdateDate',
'max_consecutive_payment_failures': 'MaxConsecutivePaymentFailures',
'name': 'Name',
'num_consecutive_failures': 'NumConsecutiveFailures',
'payment_method_id': 'PaymentMethodId',
'payment_method_status': 'PaymentMethodStatus',
'payment_retry_window': 'PaymentRetryWindow',
'paypal_baid': 'PaypalBaid',
'paypal_email': 'PaypalEmail',
'paypal_preapproval_key': 'PaypalPreapprovalKey',
'paypal_type': 'PaypalType',
'phone': 'Phone',
'postal_code': 'PostalCode',
'second_token_id': 'SecondTokenId',
'state': 'State',
'street_name': 'StreetName',
'street_number': 'StreetNumber',
'token_id': 'TokenId',
'total_number_of_error_payments': 'TotalNumberOfErrorPayments',
'total_number_of_processed_payments': 'TotalNumberOfProcessedPayments',
'type': 'Type',
'use_default_retry_rule': 'UseDefaultRetryRule'
}
def __init__(self, account_id=None, ach_aba_code=None, ach_account_name=None, ach_account_number_mask=None, ach_account_type=None, ach_bank_name=None, bank_branch_code=None, bank_check_digit=None, bank_city=None, bank_code=None, bank_identification_number=None, bank_name=None, bank_postal_code=None, bank_street_name=None, bank_street_number=None, bank_transfer_account_name=None, bank_transfer_account_number_mask=None, bank_transfer_account_type=None, bank_transfer_type=None, business_identification_code=None, city=None, company_name=None, country=None, credit_card_address1=None, credit_card_address2=None, credit_card_city=None, credit_card_country=None, credit_card_expiration_month=None, credit_card_expiration_year=None, credit_card_holder_name=None, credit_card_mask_number=None, credit_card_postal_code=None, credit_card_state=None, credit_card_type=None, device_session_id=None, email=None, existing_mandate=None, first_name=None, iban=None, ip_address=None, id=None, identity_number=None, is_company=None, last_failed_sale_transaction_date=None, last_name=None, last_transaction_date_time=None, last_transaction_status=None, mandate_creation_date=None, mandate_id=None, mandate_received=None, mandate_update_date=None, max_consecutive_payment_failures=None, name=None, num_consecutive_failures=None, payment_method_id=None, payment_method_status=None, payment_retry_window=None, paypal_baid=None, paypal_email=None, paypal_preapproval_key=None, paypal_type=None, phone=None, postal_code=None, second_token_id=None, state=None, street_name=None, street_number=None, token_id=None, total_number_of_error_payments=None, total_number_of_processed_payments=None, type=None, use_default_retry_rule=None, _configuration=None): # noqa: E501
"""ProxyGetPaymentMethodSnapshot - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._account_id = None
self._ach_aba_code = None
self._ach_account_name = None
self._ach_account_number_mask = None
self._ach_account_type = None
self._ach_bank_name = None
self._bank_branch_code = None
self._bank_check_digit = None
self._bank_city = None
self._bank_code = None
self._bank_identification_number = None
self._bank_name = None
self._bank_postal_code = None
self._bank_street_name = None
self._bank_street_number = None
self._bank_transfer_account_name = None
self._bank_transfer_account_number_mask = None
self._bank_transfer_account_type = None
self._bank_transfer_type = None
self._business_identification_code = None
self._city = None
self._company_name = None
self._country = None
self._credit_card_address1 = None
self._credit_card_address2 = None
self._credit_card_city = None
self._credit_card_country = None
self._credit_card_expiration_month = None
self._credit_card_expiration_year = None
self._credit_card_holder_name = None
self._credit_card_mask_number = None
self._credit_card_postal_code = None
self._credit_card_state = None
self._credit_card_type = None
self._device_session_id = None
self._email = None
self._existing_mandate = None
self._first_name = None
self._iban = None
self._ip_address = None
self._id = None
self._identity_number = None
self._is_company = None
self._last_failed_sale_transaction_date = None
self._last_name = None
self._last_transaction_date_time = None
self._last_transaction_status = None
self._mandate_creation_date = None
self._mandate_id = None
self._mandate_received = None
self._mandate_update_date = None
self._max_consecutive_payment_failures = None
self._name = None
self._num_consecutive_failures = None
self._payment_method_id = None
self._payment_method_status = None
self._payment_retry_window = None
self._paypal_baid = None
self._paypal_email = None
self._paypal_preapproval_key = None
self._paypal_type = None
self._phone = None
self._postal_code = None
self._second_token_id = None
self._state = None
self._street_name = None
self._street_number = None
self._token_id = None
self._total_number_of_error_payments = None
self._total_number_of_processed_payments = None
self._type = None
self._use_default_retry_rule = None
self.discriminator = None
if account_id is not None:
self.account_id = account_id
if ach_aba_code is not None:
self.ach_aba_code = ach_aba_code
if ach_account_name is not None:
self.ach_account_name = ach_account_name
if ach_account_number_mask is not None:
self.ach_account_number_mask = ach_account_number_mask
if ach_account_type is not None:
self.ach_account_type = ach_account_type
if ach_bank_name is not None:
self.ach_bank_name = ach_bank_name
if bank_branch_code is not None:
self.bank_branch_code = bank_branch_code
if bank_check_digit is not None:
self.bank_check_digit = bank_check_digit
if bank_city is not None:
self.bank_city = bank_city
if bank_code is not None:
self.bank_code = bank_code
if bank_identification_number is not None:
self.bank_identification_number = bank_identification_number
if bank_name is not None:
self.bank_name = bank_name
if bank_postal_code is not None:
self.bank_postal_code = bank_postal_code
if bank_street_name is not None:
self.bank_street_name = bank_street_name
if bank_street_number is not None:
self.bank_street_number = bank_street_number
if bank_transfer_account_name is not None:
self.bank_transfer_account_name = bank_transfer_account_name
if bank_transfer_account_number_mask is not None:
self.bank_transfer_account_number_mask = bank_transfer_account_number_mask
if bank_transfer_account_type is not None:
self.bank_transfer_account_type = bank_transfer_account_type
if bank_transfer_type is not None:
self.bank_transfer_type = bank_transfer_type
if business_identification_code is not None:
self.business_identification_code = business_identification_code
if city is not None:
self.city = city
if company_name is not None:
self.company_name = company_name
if country is not None:
self.country = country
if credit_card_address1 is not None:
self.credit_card_address1 = credit_card_address1
if credit_card_address2 is not None:
self.credit_card_address2 = credit_card_address2
if credit_card_city is not None:
self.credit_card_city = credit_card_city
if credit_card_country is not None:
self.credit_card_country = credit_card_country
if credit_card_expiration_month is not None:
self.credit_card_expiration_month = credit_card_expiration_month
if credit_card_expiration_year is not None:
self.credit_card_expiration_year = credit_card_expiration_year
if credit_card_holder_name is not None:
self.credit_card_holder_name = credit_card_holder_name
if credit_card_mask_number is not None:
self.credit_card_mask_number = credit_card_mask_number
if credit_card_postal_code is not None:
self.credit_card_postal_code = credit_card_postal_code
if credit_card_state is not None:
self.credit_card_state = credit_card_state
if credit_card_type is not None:
self.credit_card_type = credit_card_type
if device_session_id is not None:
self.device_session_id = device_session_id
if email is not None:
self.email = email
if existing_mandate is not None:
self.existing_mandate = existing_mandate
if first_name is not None:
self.first_name = first_name
if iban is not None:
self.iban = iban
if ip_address is not None:
self.ip_address = ip_address
if id is not None:
self.id = id
if identity_number is not None:
self.identity_number = identity_number
if is_company is not None:
self.is_company = is_company
if last_failed_sale_transaction_date is not None:
self.last_failed_sale_transaction_date = last_failed_sale_transaction_date
if last_name is not None:
self.last_name = last_name
if last_transaction_date_time is not None:
self.last_transaction_date_time = last_transaction_date_time
if last_transaction_status is not None:
self.last_transaction_status = last_transaction_status
if mandate_creation_date is not None:
self.mandate_creation_date = mandate_creation_date
if mandate_id is not None:
self.mandate_id = mandate_id
if mandate_received is not None:
self.mandate_received = mandate_received
if mandate_update_date is not None:
self.mandate_update_date = mandate_update_date
if max_consecutive_payment_failures is not None:
self.max_consecutive_payment_failures = max_consecutive_payment_failures
if name is not None:
self.name = name
if num_consecutive_failures is not None:
self.num_consecutive_failures = num_consecutive_failures
if payment_method_id is not None:
self.payment_method_id = payment_method_id
if payment_method_status is not None:
self.payment_method_status = payment_method_status
if payment_retry_window is not None:
self.payment_retry_window = payment_retry_window
if paypal_baid is not None:
self.paypal_baid = paypal_baid
if paypal_email is not None:
self.paypal_email = paypal_email
if paypal_preapproval_key is not None:
self.paypal_preapproval_key = paypal_preapproval_key
if paypal_type is not None:
self.paypal_type = paypal_type
if phone is not None:
self.phone = phone
if postal_code is not None:
self.postal_code = postal_code
if second_token_id is not None:
self.second_token_id = second_token_id
if state is not None:
self.state = state
if street_name is not None:
self.street_name = street_name
if street_number is not None:
self.street_number = street_number
if token_id is not None:
self.token_id = token_id
if total_number_of_error_payments is not None:
self.total_number_of_error_payments = total_number_of_error_payments
if total_number_of_processed_payments is not None:
self.total_number_of_processed_payments = total_number_of_processed_payments
if type is not None:
self.type = type
if use_default_retry_rule is not None:
self.use_default_retry_rule = use_default_retry_rule
@property
def account_id(self):
"""Gets the account_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The ID of the customer account associated with this payment method. # noqa: E501
:return: The account_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._account_id
@account_id.setter
def account_id(self, account_id):
"""Sets the account_id of this ProxyGetPaymentMethodSnapshot.
The ID of the customer account associated with this payment method. # noqa: E501
:param account_id: The account_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._account_id = account_id
@property
def ach_aba_code(self):
"""Gets the ach_aba_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The nine-digit routing number or ABA number used by banks. Applicable to ACH payment methods. # noqa: E501
:return: The ach_aba_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._ach_aba_code
@ach_aba_code.setter
def ach_aba_code(self, ach_aba_code):
"""Sets the ach_aba_code of this ProxyGetPaymentMethodSnapshot.
The nine-digit routing number or ABA number used by banks. Applicable to ACH payment methods. # noqa: E501
:param ach_aba_code: The ach_aba_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._ach_aba_code = ach_aba_code
@property
def ach_account_name(self):
"""Gets the ach_account_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The name of the account holder, which can be either a person or a company. Applicable to ACH payment methods. # noqa: E501
:return: The ach_account_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._ach_account_name
@ach_account_name.setter
def ach_account_name(self, ach_account_name):
"""Sets the ach_account_name of this ProxyGetPaymentMethodSnapshot.
The name of the account holder, which can be either a person or a company. Applicable to ACH payment methods. # noqa: E501
:param ach_account_name: The ach_account_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._ach_account_name = ach_account_name
@property
def ach_account_number_mask(self):
"""Gets the ach_account_number_mask of this ProxyGetPaymentMethodSnapshot. # noqa: E501
This is a masked displayable version of the ACH account number, used for security purposes. For example: `XXXXXXXXX54321`. # noqa: E501
:return: The ach_account_number_mask of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._ach_account_number_mask
@ach_account_number_mask.setter
def ach_account_number_mask(self, ach_account_number_mask):
"""Sets the ach_account_number_mask of this ProxyGetPaymentMethodSnapshot.
This is a masked displayable version of the ACH account number, used for security purposes. For example: `XXXXXXXXX54321`. # noqa: E501
:param ach_account_number_mask: The ach_account_number_mask of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._ach_account_number_mask = ach_account_number_mask
@property
def ach_account_type(self):
"""Gets the ach_account_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The type of bank account associated with the ACH payment. # noqa: E501
:return: The ach_account_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._ach_account_type
@ach_account_type.setter
def ach_account_type(self, ach_account_type):
"""Sets the ach_account_type of this ProxyGetPaymentMethodSnapshot.
The type of bank account associated with the ACH payment. # noqa: E501
:param ach_account_type: The ach_account_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
allowed_values = ["BusinessChecking", "Checking", "Saving"] # noqa: E501
if (self._configuration.client_side_validation and
ach_account_type not in allowed_values):
raise ValueError(
"Invalid value for `ach_account_type` ({0}), must be one of {1}" # noqa: E501
.format(ach_account_type, allowed_values)
)
self._ach_account_type = ach_account_type
@property
def ach_bank_name(self):
"""Gets the ach_bank_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The name of the bank where the ACH payment account is held. # noqa: E501
:return: The ach_bank_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._ach_bank_name
@ach_bank_name.setter
def ach_bank_name(self, ach_bank_name):
"""Sets the ach_bank_name of this ProxyGetPaymentMethodSnapshot.
The name of the bank where the ACH payment account is held. # noqa: E501
:param ach_bank_name: The ach_bank_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._ach_bank_name = ach_bank_name
@property
def bank_branch_code(self):
"""Gets the bank_branch_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The branch code of the bank used for direct debit. # noqa: E501
:return: The bank_branch_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_branch_code
@bank_branch_code.setter
def bank_branch_code(self, bank_branch_code):
"""Sets the bank_branch_code of this ProxyGetPaymentMethodSnapshot.
The branch code of the bank used for direct debit. # noqa: E501
:param bank_branch_code: The bank_branch_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_branch_code = bank_branch_code
@property
def bank_check_digit(self):
"""Gets the bank_check_digit of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The check digit in the international bank account number, which confirms the validity of the account. Applicable to direct debit payment methods. # noqa: E501
:return: The bank_check_digit of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_check_digit
@bank_check_digit.setter
def bank_check_digit(self, bank_check_digit):
"""Sets the bank_check_digit of this ProxyGetPaymentMethodSnapshot.
The check digit in the international bank account number, which confirms the validity of the account. Applicable to direct debit payment methods. # noqa: E501
:param bank_check_digit: The bank_check_digit of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_check_digit = bank_check_digit
@property
def bank_city(self):
"""Gets the bank_city of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The city of the direct debit bank. # noqa: E501
:return: The bank_city of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_city
@bank_city.setter
def bank_city(self, bank_city):
"""Sets the bank_city of this ProxyGetPaymentMethodSnapshot.
The city of the direct debit bank. # noqa: E501
:param bank_city: The bank_city of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_city = bank_city
@property
def bank_code(self):
"""Gets the bank_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The sort code or number that identifies the bank. This is also known as the sort code. # noqa: E501
:return: The bank_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_code
@bank_code.setter
def bank_code(self, bank_code):
"""Sets the bank_code of this ProxyGetPaymentMethodSnapshot.
The sort code or number that identifies the bank. This is also known as the sort code. # noqa: E501
:param bank_code: The bank_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_code = bank_code
@property
def bank_identification_number(self):
"""Gets the bank_identification_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The first six or eight digits of the payment method's number, such as the credit card number or account number. Banks use this number to identify a payment method. # noqa: E501
:return: The bank_identification_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_identification_number
@bank_identification_number.setter
def bank_identification_number(self, bank_identification_number):
"""Sets the bank_identification_number of this ProxyGetPaymentMethodSnapshot.
The first six or eight digits of the payment method's number, such as the credit card number or account number. Banks use this number to identify a payment method. # noqa: E501
:param bank_identification_number: The bank_identification_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_identification_number = bank_identification_number
@property
def bank_name(self):
"""Gets the bank_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The name of the direct debit bank. # noqa: E501
:return: The bank_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_name
@bank_name.setter
def bank_name(self, bank_name):
"""Sets the bank_name of this ProxyGetPaymentMethodSnapshot.
The name of the direct debit bank. # noqa: E501
:param bank_name: The bank_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_name = bank_name
@property
def bank_postal_code(self):
"""Gets the bank_postal_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The zip code or postal code of the direct debit bank. # noqa: E501
:return: The bank_postal_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_postal_code
@bank_postal_code.setter
def bank_postal_code(self, bank_postal_code):
"""Sets the bank_postal_code of this ProxyGetPaymentMethodSnapshot.
The zip code or postal code of the direct debit bank. # noqa: E501
:param bank_postal_code: The bank_postal_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_postal_code = bank_postal_code
@property
def bank_street_name(self):
"""Gets the bank_street_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The name of the street of the direct debit bank. # noqa: E501
:return: The bank_street_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_street_name
@bank_street_name.setter
def bank_street_name(self, bank_street_name):
"""Sets the bank_street_name of this ProxyGetPaymentMethodSnapshot.
The name of the street of the direct debit bank. # noqa: E501
:param bank_street_name: The bank_street_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_street_name = bank_street_name
@property
def bank_street_number(self):
"""Gets the bank_street_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The number of the direct debit bank. # noqa: E501
:return: The bank_street_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_street_number
@bank_street_number.setter
def bank_street_number(self, bank_street_number):
"""Sets the bank_street_number of this ProxyGetPaymentMethodSnapshot.
The number of the direct debit bank. # noqa: E501
:param bank_street_number: The bank_street_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_street_number = bank_street_number
@property
def bank_transfer_account_name(self):
"""Gets the bank_transfer_account_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The name on the direct debit bank account. # noqa: E501
:return: The bank_transfer_account_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_transfer_account_name
@bank_transfer_account_name.setter
def bank_transfer_account_name(self, bank_transfer_account_name):
"""Sets the bank_transfer_account_name of this ProxyGetPaymentMethodSnapshot.
The name on the direct debit bank account. # noqa: E501
:param bank_transfer_account_name: The bank_transfer_account_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_transfer_account_name = bank_transfer_account_name
@property
def bank_transfer_account_number_mask(self):
"""Gets the bank_transfer_account_number_mask of this ProxyGetPaymentMethodSnapshot. # noqa: E501
This is a masked displayable version of the bank account number, used for security purposes. For example: `XXXXXXXXX54321`. # noqa: E501
:return: The bank_transfer_account_number_mask of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_transfer_account_number_mask
@bank_transfer_account_number_mask.setter
def bank_transfer_account_number_mask(self, bank_transfer_account_number_mask):
"""Sets the bank_transfer_account_number_mask of this ProxyGetPaymentMethodSnapshot.
This is a masked displayable version of the bank account number, used for security purposes. For example: `XXXXXXXXX54321`. # noqa: E501
:param bank_transfer_account_number_mask: The bank_transfer_account_number_mask of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_transfer_account_number_mask = bank_transfer_account_number_mask
@property
def bank_transfer_account_type(self):
"""Gets the bank_transfer_account_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The type of the customer's bank account. Applicable to direct debit payment methods. # noqa: E501
:return: The bank_transfer_account_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_transfer_account_type
@bank_transfer_account_type.setter
def bank_transfer_account_type(self, bank_transfer_account_type):
"""Sets the bank_transfer_account_type of this ProxyGetPaymentMethodSnapshot.
The type of the customer's bank account. Applicable to direct debit payment methods. # noqa: E501
:param bank_transfer_account_type: The bank_transfer_account_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._bank_transfer_account_type = bank_transfer_account_type
@property
def bank_transfer_type(self):
"""Gets the bank_transfer_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
Specifies the type of direct debit transfer. The value of this field is dependent on the country of the user. Possible Values: * `AutomatischIncasso` (NL) * `LastschriftDE` (Germany) * `LastschriftAT` (Austria) * `DemandeDePrelevement` (FR) * `DirectDebitUK` (UK) * `Domicil` (Belgium) * `LastschriftCH` (CH) * `RID` (Italy) * `OrdenDeDomiciliacion` (Spain) * `Autogiro` (Sweden) * `Betalingsservice` (Denmark) # noqa: E501
:return: The bank_transfer_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._bank_transfer_type
@bank_transfer_type.setter
def bank_transfer_type(self, bank_transfer_type):
"""Sets the bank_transfer_type of this ProxyGetPaymentMethodSnapshot.
Specifies the type of direct debit transfer. The value of this field is dependent on the country of the user. Possible Values: * `AutomatischIncasso` (NL) * `LastschriftDE` (Germany) * `LastschriftAT` (Austria) * `DemandeDePrelevement` (FR) * `DirectDebitUK` (UK) * `Domicil` (Belgium) * `LastschriftCH` (CH) * `RID` (Italy) * `OrdenDeDomiciliacion` (Spain) * `Autogiro` (Sweden) * `Betalingsservice` (Denmark) # noqa: E501
:param bank_transfer_type: The bank_transfer_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
allowed_values = ["AutomatischIncasso", "LastschriftDE", "LastschriftAT", "DemandeDePrelevement", "DirectDebitUK", "Domicil", "LastschriftCH", "RID", "OrdenDeDomiciliacion", "Autogiro", "Betalingsservice"] # noqa: E501
if (self._configuration.client_side_validation and
bank_transfer_type not in allowed_values):
raise ValueError(
"Invalid value for `bank_transfer_type` ({0}), must be one of {1}" # noqa: E501
.format(bank_transfer_type, allowed_values)
)
self._bank_transfer_type = bank_transfer_type
@property
def business_identification_code(self):
"""Gets the business_identification_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The business identification code for Swiss direct payment methods that use the Global Collect payment gateway. Only applicable to direct debit payments in Switzerland with Global Collect. # noqa: E501
:return: The business_identification_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._business_identification_code
@business_identification_code.setter
def business_identification_code(self, business_identification_code):
"""Sets the business_identification_code of this ProxyGetPaymentMethodSnapshot.
The business identification code for Swiss direct payment methods that use the Global Collect payment gateway. Only applicable to direct debit payments in Switzerland with Global Collect. # noqa: E501
:param business_identification_code: The business_identification_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._business_identification_code = business_identification_code
@property
def city(self):
"""Gets the city of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The city of the customer's address. Applicable to debit payment methods. # noqa: E501
:return: The city of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._city
@city.setter
def city(self, city):
"""Sets the city of this ProxyGetPaymentMethodSnapshot.
The city of the customer's address. Applicable to debit payment methods. # noqa: E501
:param city: The city of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._city = city
@property
def company_name(self):
"""Gets the company_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The name of the company. # noqa: E501
:return: The company_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._company_name
@company_name.setter
def company_name(self, company_name):
"""Sets the company_name of this ProxyGetPaymentMethodSnapshot.
The name of the company. # noqa: E501
:param company_name: The company_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._company_name = company_name
@property
def country(self):
"""Gets the country of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The two-letter country code of the customer's address. Applicable to direct debit payment methods. # noqa: E501
:return: The country of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._country
@country.setter
def country(self, country):
"""Sets the country of this ProxyGetPaymentMethodSnapshot.
The two-letter country code of the customer's address. Applicable to direct debit payment methods. # noqa: E501
:param country: The country of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._country = country
@property
def credit_card_address1(self):
"""Gets the credit_card_address1 of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The first line of the card holder's address, which is often a street address or business name. Applicable to credit card and direct debit payment methods. # noqa: E501
:return: The credit_card_address1 of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._credit_card_address1
@credit_card_address1.setter
def credit_card_address1(self, credit_card_address1):
"""Sets the credit_card_address1 of this ProxyGetPaymentMethodSnapshot.
The first line of the card holder's address, which is often a street address or business name. Applicable to credit card and direct debit payment methods. # noqa: E501
:param credit_card_address1: The credit_card_address1 of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._credit_card_address1 = credit_card_address1
@property
def credit_card_address2(self):
"""Gets the credit_card_address2 of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The second line of the card holder's address. Applicable to credit card and direct debit payment methods. # noqa: E501
:return: The credit_card_address2 of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._credit_card_address2
@credit_card_address2.setter
def credit_card_address2(self, credit_card_address2):
"""Sets the credit_card_address2 of this ProxyGetPaymentMethodSnapshot.
The second line of the card holder's address. Applicable to credit card and direct debit payment methods. # noqa: E501
:param credit_card_address2: The credit_card_address2 of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._credit_card_address2 = credit_card_address2
@property
def credit_card_city(self):
"""Gets the credit_card_city of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The city of the card holder's address. Applicable to credit card and direct debit payment methods. # noqa: E501
:return: The credit_card_city of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._credit_card_city
@credit_card_city.setter
def credit_card_city(self, credit_card_city):
"""Sets the credit_card_city of this ProxyGetPaymentMethodSnapshot.
The city of the card holder's address. Applicable to credit card and direct debit payment methods. # noqa: E501
:param credit_card_city: The credit_card_city of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._credit_card_city = credit_card_city
@property
def credit_card_country(self):
"""Gets the credit_card_country of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The country of the card holder's address. # noqa: E501
:return: The credit_card_country of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._credit_card_country
@credit_card_country.setter
def credit_card_country(self, credit_card_country):
"""Sets the credit_card_country of this ProxyGetPaymentMethodSnapshot.
The country of the card holder's address. # noqa: E501
:param credit_card_country: The credit_card_country of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._credit_card_country = credit_card_country
@property
def credit_card_expiration_month(self):
"""Gets the credit_card_expiration_month of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The expiration month of the credit card or debit card. Applicable to credit card and direct debit payment methods. # noqa: E501
:return: The credit_card_expiration_month of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: int
"""
return self._credit_card_expiration_month
@credit_card_expiration_month.setter
def credit_card_expiration_month(self, credit_card_expiration_month):
"""Sets the credit_card_expiration_month of this ProxyGetPaymentMethodSnapshot.
The expiration month of the credit card or debit card. Applicable to credit card and direct debit payment methods. # noqa: E501
:param credit_card_expiration_month: The credit_card_expiration_month of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: int
"""
self._credit_card_expiration_month = credit_card_expiration_month
@property
def credit_card_expiration_year(self):
"""Gets the credit_card_expiration_year of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The expiration month of the credit card or debit card. Applicable to credit card and direct debit payment methods. # noqa: E501
:return: The credit_card_expiration_year of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: int
"""
return self._credit_card_expiration_year
@credit_card_expiration_year.setter
def credit_card_expiration_year(self, credit_card_expiration_year):
"""Sets the credit_card_expiration_year of this ProxyGetPaymentMethodSnapshot.
The expiration month of the credit card or debit card. Applicable to credit card and direct debit payment methods. # noqa: E501
:param credit_card_expiration_year: The credit_card_expiration_year of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: int
"""
self._credit_card_expiration_year = credit_card_expiration_year
@property
def credit_card_holder_name(self):
"""Gets the credit_card_holder_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The full name of the card holder. Applicable to credit card and direct debit payment methods. # noqa: E501
:return: The credit_card_holder_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._credit_card_holder_name
@credit_card_holder_name.setter
def credit_card_holder_name(self, credit_card_holder_name):
"""Sets the credit_card_holder_name of this ProxyGetPaymentMethodSnapshot.
The full name of the card holder. Applicable to credit card and direct debit payment methods. # noqa: E501
:param credit_card_holder_name: The credit_card_holder_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._credit_card_holder_name = credit_card_holder_name
@property
def credit_card_mask_number(self):
"""Gets the credit_card_mask_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
A masked version of the credit or debit card number. # noqa: E501
:return: The credit_card_mask_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._credit_card_mask_number
@credit_card_mask_number.setter
def credit_card_mask_number(self, credit_card_mask_number):
"""Sets the credit_card_mask_number of this ProxyGetPaymentMethodSnapshot.
A masked version of the credit or debit card number. # noqa: E501
:param credit_card_mask_number: The credit_card_mask_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._credit_card_mask_number = credit_card_mask_number
@property
def credit_card_postal_code(self):
"""Gets the credit_card_postal_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The billing address's zip code. # noqa: E501
:return: The credit_card_postal_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._credit_card_postal_code
@credit_card_postal_code.setter
def credit_card_postal_code(self, credit_card_postal_code):
"""Sets the credit_card_postal_code of this ProxyGetPaymentMethodSnapshot.
The billing address's zip code. # noqa: E501
:param credit_card_postal_code: The credit_card_postal_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._credit_card_postal_code = credit_card_postal_code
@property
def credit_card_state(self):
"""Gets the credit_card_state of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The billing address's state. Applicable if `CreditCardCountry` is either Canada or the US. # noqa: E501
:return: The credit_card_state of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._credit_card_state
@credit_card_state.setter
def credit_card_state(self, credit_card_state):
"""Sets the credit_card_state of this ProxyGetPaymentMethodSnapshot.
The billing address's state. Applicable if `CreditCardCountry` is either Canada or the US. # noqa: E501
:param credit_card_state: The credit_card_state of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._credit_card_state = credit_card_state
@property
def credit_card_type(self):
"""Gets the credit_card_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The type of credit card or debit card. # noqa: E501
:return: The credit_card_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._credit_card_type
@credit_card_type.setter
def credit_card_type(self, credit_card_type):
"""Sets the credit_card_type of this ProxyGetPaymentMethodSnapshot.
The type of credit card or debit card. # noqa: E501
:param credit_card_type: The credit_card_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
allowed_values = ["AmericanExpress", "Discover", "MasterCard", "Visa"] # noqa: E501
if (self._configuration.client_side_validation and
credit_card_type not in allowed_values):
raise ValueError(
"Invalid value for `credit_card_type` ({0}), must be one of {1}" # noqa: E501
.format(credit_card_type, allowed_values)
)
self._credit_card_type = credit_card_type
@property
def device_session_id(self):
"""Gets the device_session_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The session ID of the user when the `PaymentMethod` was created or updated. # noqa: E501
:return: The device_session_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._device_session_id
@device_session_id.setter
def device_session_id(self, device_session_id):
"""Sets the device_session_id of this ProxyGetPaymentMethodSnapshot.
The session ID of the user when the `PaymentMethod` was created or updated. # noqa: E501
:param device_session_id: The device_session_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._device_session_id = device_session_id
@property
def email(self):
"""Gets the email of this ProxyGetPaymentMethodSnapshot. # noqa: E501
An email address for the payment method in addition to the bill to contact email address. # noqa: E501
:return: The email of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""Sets the email of this ProxyGetPaymentMethodSnapshot.
An email address for the payment method in addition to the bill to contact email address. # noqa: E501
:param email: The email of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._email = email
@property
def existing_mandate(self):
"""Gets the existing_mandate of this ProxyGetPaymentMethodSnapshot. # noqa: E501
Indicates if the customer has an existing mandate or a new mandate. Only applicable to direct debit payment methods. # noqa: E501
:return: The existing_mandate of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._existing_mandate
@existing_mandate.setter
def existing_mandate(self, existing_mandate):
"""Sets the existing_mandate of this ProxyGetPaymentMethodSnapshot.
Indicates if the customer has an existing mandate or a new mandate. Only applicable to direct debit payment methods. # noqa: E501
:param existing_mandate: The existing_mandate of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
allowed_values = ["Yes", "No"] # noqa: E501
if (self._configuration.client_side_validation and
existing_mandate not in allowed_values):
raise ValueError(
"Invalid value for `existing_mandate` ({0}), must be one of {1}" # noqa: E501
.format(existing_mandate, allowed_values)
)
self._existing_mandate = existing_mandate
@property
def first_name(self):
"""Gets the first_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The customer's first name. Only applicable to direct debit payment methods. # noqa: E501
:return: The first_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._first_name
@first_name.setter
def first_name(self, first_name):
"""Sets the first_name of this ProxyGetPaymentMethodSnapshot.
The customer's first name. Only applicable to direct debit payment methods. # noqa: E501
:param first_name: The first_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._first_name = first_name
@property
def iban(self):
"""Gets the iban of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The International Bank Account Number. Only applicable to direct debit payment methods. # noqa: E501
:return: The iban of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._iban
@iban.setter
def iban(self, iban):
"""Sets the iban of this ProxyGetPaymentMethodSnapshot.
The International Bank Account Number. Only applicable to direct debit payment methods. # noqa: E501
:param iban: The iban of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._iban = iban
@property
def ip_address(self):
"""Gets the ip_address of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The IP address of the user when the payment method was created or updated. # noqa: E501
:return: The ip_address of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._ip_address
@ip_address.setter
def ip_address(self, ip_address):
"""Sets the ip_address of this ProxyGetPaymentMethodSnapshot.
The IP address of the user when the payment method was created or updated. # noqa: E501
:param ip_address: The ip_address of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._ip_address = ip_address
@property
def id(self):
"""Gets the id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
Object identifier. # noqa: E501
:return: The id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this ProxyGetPaymentMethodSnapshot.
Object identifier. # noqa: E501
:param id: The id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._id = id
@property
def identity_number(self):
"""Gets the identity_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The unique identity number of the customer account. # noqa: E501
:return: The identity_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._identity_number
@identity_number.setter
def identity_number(self, identity_number):
"""Sets the identity_number of this ProxyGetPaymentMethodSnapshot.
The unique identity number of the customer account. # noqa: E501
:param identity_number: The identity_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._identity_number = identity_number
@property
def is_company(self):
"""Gets the is_company of this ProxyGetPaymentMethodSnapshot. # noqa: E501
Whether the customer account is a company. # noqa: E501
:return: The is_company of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: bool
"""
return self._is_company
@is_company.setter
def is_company(self, is_company):
"""Sets the is_company of this ProxyGetPaymentMethodSnapshot.
Whether the customer account is a company. # noqa: E501
:param is_company: The is_company of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: bool
"""
self._is_company = is_company
@property
def last_failed_sale_transaction_date(self):
"""Gets the last_failed_sale_transaction_date of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The date of the last failed attempt to collect payment with this payment method. # noqa: E501
:return: The last_failed_sale_transaction_date of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: datetime
"""
return self._last_failed_sale_transaction_date
@last_failed_sale_transaction_date.setter
def last_failed_sale_transaction_date(self, last_failed_sale_transaction_date):
"""Sets the last_failed_sale_transaction_date of this ProxyGetPaymentMethodSnapshot.
The date of the last failed attempt to collect payment with this payment method. # noqa: E501
:param last_failed_sale_transaction_date: The last_failed_sale_transaction_date of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: datetime
"""
self._last_failed_sale_transaction_date = last_failed_sale_transaction_date
@property
def last_name(self):
"""Gets the last_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The customer's last name. Only applicable to direct debit payment methods. # noqa: E501
:return: The last_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._last_name
@last_name.setter
def last_name(self, last_name):
"""Sets the last_name of this ProxyGetPaymentMethodSnapshot.
The customer's last name. Only applicable to direct debit payment methods. # noqa: E501
:param last_name: The last_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._last_name = last_name
@property
def last_transaction_date_time(self):
"""Gets the last_transaction_date_time of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The date of the most recent transaction. # noqa: E501
:return: The last_transaction_date_time of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: datetime
"""
return self._last_transaction_date_time
@last_transaction_date_time.setter
def last_transaction_date_time(self, last_transaction_date_time):
"""Sets the last_transaction_date_time of this ProxyGetPaymentMethodSnapshot.
The date of the most recent transaction. # noqa: E501
:param last_transaction_date_time: The last_transaction_date_time of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: datetime
"""
self._last_transaction_date_time = last_transaction_date_time
@property
def last_transaction_status(self):
"""Gets the last_transaction_status of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The status of the most recent transaction. # noqa: E501
:return: The last_transaction_status of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._last_transaction_status
@last_transaction_status.setter
def last_transaction_status(self, last_transaction_status):
"""Sets the last_transaction_status of this ProxyGetPaymentMethodSnapshot.
The status of the most recent transaction. # noqa: E501
:param last_transaction_status: The last_transaction_status of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._last_transaction_status = last_transaction_status
@property
def mandate_creation_date(self):
"""Gets the mandate_creation_date of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The date when the mandate was created, in `yyyy-mm-dd` format. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods. # noqa: E501
:return: The mandate_creation_date of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: date
"""
return self._mandate_creation_date
@mandate_creation_date.setter
def mandate_creation_date(self, mandate_creation_date):
"""Sets the mandate_creation_date of this ProxyGetPaymentMethodSnapshot.
The date when the mandate was created, in `yyyy-mm-dd` format. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods. # noqa: E501
:param mandate_creation_date: The mandate_creation_date of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: date
"""
self._mandate_creation_date = mandate_creation_date
@property
def mandate_id(self):
"""Gets the mandate_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The ID of the mandate. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods. # noqa: E501
:return: The mandate_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._mandate_id
@mandate_id.setter
def mandate_id(self, mandate_id):
"""Sets the mandate_id of this ProxyGetPaymentMethodSnapshot.
The ID of the mandate. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods. # noqa: E501
:param mandate_id: The mandate_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._mandate_id = mandate_id
@property
def mandate_received(self):
"""Gets the mandate_received of this ProxyGetPaymentMethodSnapshot. # noqa: E501
Indicates if the mandate was received. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods. # noqa: E501
:return: The mandate_received of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._mandate_received
@mandate_received.setter
def mandate_received(self, mandate_received):
"""Sets the mandate_received of this ProxyGetPaymentMethodSnapshot.
Indicates if the mandate was received. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods. # noqa: E501
:param mandate_received: The mandate_received of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._mandate_received = mandate_received
@property
def mandate_update_date(self):
"""Gets the mandate_update_date of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The date when the mandate was last updated, in `yyyy-mm-dd` format. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods. # noqa: E501
:return: The mandate_update_date of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: date
"""
return self._mandate_update_date
@mandate_update_date.setter
def mandate_update_date(self, mandate_update_date):
"""Sets the mandate_update_date of this ProxyGetPaymentMethodSnapshot.
The date when the mandate was last updated, in `yyyy-mm-dd` format. A mandate is a signed authorization for UK and NL customers. Only applicable to direct debit payment methods. # noqa: E501
:param mandate_update_date: The mandate_update_date of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: date
"""
self._mandate_update_date = mandate_update_date
@property
def max_consecutive_payment_failures(self):
"""Gets the max_consecutive_payment_failures of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The number of allowable consecutive failures Zuora attempts with the payment method before stopping. # noqa: E501
:return: The max_consecutive_payment_failures of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: int
"""
return self._max_consecutive_payment_failures
@max_consecutive_payment_failures.setter
def max_consecutive_payment_failures(self, max_consecutive_payment_failures):
"""Sets the max_consecutive_payment_failures of this ProxyGetPaymentMethodSnapshot.
The number of allowable consecutive failures Zuora attempts with the payment method before stopping. # noqa: E501
:param max_consecutive_payment_failures: The max_consecutive_payment_failures of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: int
"""
self._max_consecutive_payment_failures = max_consecutive_payment_failures
@property
def name(self):
"""Gets the name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The name of the payment method. # noqa: E501
:return: The name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this ProxyGetPaymentMethodSnapshot.
The name of the payment method. # noqa: E501
:param name: The name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._name = name
@property
def num_consecutive_failures(self):
"""Gets the num_consecutive_failures of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The number of consecutive failed payment for the payment method. # noqa: E501
:return: The num_consecutive_failures of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: int
"""
return self._num_consecutive_failures
@num_consecutive_failures.setter
def num_consecutive_failures(self, num_consecutive_failures):
"""Sets the num_consecutive_failures of this ProxyGetPaymentMethodSnapshot.
The number of consecutive failed payment for the payment method. # noqa: E501
:param num_consecutive_failures: The num_consecutive_failures of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: int
"""
self._num_consecutive_failures = num_consecutive_failures
@property
def payment_method_id(self):
"""Gets the payment_method_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
Object identifier of the payment method. # noqa: E501
:return: The payment_method_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._payment_method_id
@payment_method_id.setter
def payment_method_id(self, payment_method_id):
"""Sets the payment_method_id of this ProxyGetPaymentMethodSnapshot.
Object identifier of the payment method. # noqa: E501
:param payment_method_id: The payment_method_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._payment_method_id = payment_method_id
@property
def payment_method_status(self):
"""Gets the payment_method_status of this ProxyGetPaymentMethodSnapshot. # noqa: E501
Specifies the status of the payment method. # noqa: E501
:return: The payment_method_status of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._payment_method_status
@payment_method_status.setter
def payment_method_status(self, payment_method_status):
"""Sets the payment_method_status of this ProxyGetPaymentMethodSnapshot.
Specifies the status of the payment method. # noqa: E501
:param payment_method_status: The payment_method_status of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
allowed_values = ["Active", "Closed"] # noqa: E501
if (self._configuration.client_side_validation and
payment_method_status not in allowed_values):
raise ValueError(
"Invalid value for `payment_method_status` ({0}), must be one of {1}" # noqa: E501
.format(payment_method_status, allowed_values)
)
self._payment_method_status = payment_method_status
@property
def payment_retry_window(self):
"""Gets the payment_retry_window of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The retry interval setting, which prevents making a payment attempt if the last failed attempt was within the last specified number of hours. # noqa: E501
:return: The payment_retry_window of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: int
"""
return self._payment_retry_window
@payment_retry_window.setter
def payment_retry_window(self, payment_retry_window):
"""Sets the payment_retry_window of this ProxyGetPaymentMethodSnapshot.
The retry interval setting, which prevents making a payment attempt if the last failed attempt was within the last specified number of hours. # noqa: E501
:param payment_retry_window: The payment_retry_window of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: int
"""
self._payment_retry_window = payment_retry_window
@property
def paypal_baid(self):
"""Gets the paypal_baid of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The PayPal billing agreement ID, which is a contract between two PayPal accounts. # noqa: E501
:return: The paypal_baid of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._paypal_baid
@paypal_baid.setter
def paypal_baid(self, paypal_baid):
"""Sets the paypal_baid of this ProxyGetPaymentMethodSnapshot.
The PayPal billing agreement ID, which is a contract between two PayPal accounts. # noqa: E501
:param paypal_baid: The paypal_baid of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._paypal_baid = paypal_baid
@property
def paypal_email(self):
"""Gets the paypal_email of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The email address associated with the account holder's PayPal account or of the PayPal account of the person paying for the service. # noqa: E501
:return: The paypal_email of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._paypal_email
@paypal_email.setter
def paypal_email(self, paypal_email):
"""Sets the paypal_email of this ProxyGetPaymentMethodSnapshot.
The email address associated with the account holder's PayPal account or of the PayPal account of the person paying for the service. # noqa: E501
:param paypal_email: The paypal_email of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._paypal_email = paypal_email
@property
def paypal_preapproval_key(self):
"""Gets the paypal_preapproval_key of this ProxyGetPaymentMethodSnapshot. # noqa: E501
PayPal's Adaptive Payments API key. # noqa: E501
:return: The paypal_preapproval_key of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._paypal_preapproval_key
@paypal_preapproval_key.setter
def paypal_preapproval_key(self, paypal_preapproval_key):
"""Sets the paypal_preapproval_key of this ProxyGetPaymentMethodSnapshot.
PayPal's Adaptive Payments API key. # noqa: E501
:param paypal_preapproval_key: The paypal_preapproval_key of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._paypal_preapproval_key = paypal_preapproval_key
@property
def paypal_type(self):
"""Gets the paypal_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
Specifies the PayPal gateway: PayFlow Pro (Express Checkout) or Adaptive Payments. # noqa: E501
:return: The paypal_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._paypal_type
@paypal_type.setter
def paypal_type(self, paypal_type):
"""Sets the paypal_type of this ProxyGetPaymentMethodSnapshot.
Specifies the PayPal gateway: PayFlow Pro (Express Checkout) or Adaptive Payments. # noqa: E501
:param paypal_type: The paypal_type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
allowed_values = ["ExpressCheckout", "AdaptivePayments"] # noqa: E501
if (self._configuration.client_side_validation and
paypal_type not in allowed_values):
raise ValueError(
"Invalid value for `paypal_type` ({0}), must be one of {1}" # noqa: E501
.format(paypal_type, allowed_values)
)
self._paypal_type = paypal_type
@property
def phone(self):
"""Gets the phone of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The phone number that the account holder registered with the bank. This field is used for credit card validation when passing to a gateway. # noqa: E501
:return: The phone of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._phone
@phone.setter
def phone(self, phone):
"""Sets the phone of this ProxyGetPaymentMethodSnapshot.
The phone number that the account holder registered with the bank. This field is used for credit card validation when passing to a gateway. # noqa: E501
:param phone: The phone of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._phone = phone
@property
def postal_code(self):
"""Gets the postal_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The zip code of the customer's address. Only applicable to direct debit payment methods. # noqa: E501
:return: The postal_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._postal_code
@postal_code.setter
def postal_code(self, postal_code):
"""Sets the postal_code of this ProxyGetPaymentMethodSnapshot.
The zip code of the customer's address. Only applicable to direct debit payment methods. # noqa: E501
:param postal_code: The postal_code of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._postal_code = postal_code
@property
def second_token_id(self):
"""Gets the second_token_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
A gateway unique identifier that replaces sensitive payment method data. Applicable to CC Reference Transaction payment methods. # noqa: E501
:return: The second_token_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._second_token_id
@second_token_id.setter
def second_token_id(self, second_token_id):
"""Sets the second_token_id of this ProxyGetPaymentMethodSnapshot.
A gateway unique identifier that replaces sensitive payment method data. Applicable to CC Reference Transaction payment methods. # noqa: E501
:param second_token_id: The second_token_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._second_token_id = second_token_id
@property
def state(self):
"""Gets the state of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The state of the customer's address. Only applicable to direct debit payment methods. # noqa: E501
:return: The state of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._state
@state.setter
def state(self, state):
"""Sets the state of this ProxyGetPaymentMethodSnapshot.
The state of the customer's address. Only applicable to direct debit payment methods. # noqa: E501
:param state: The state of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._state = state
@property
def street_name(self):
"""Gets the street_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The street name of the customer's address. Only applicable to direct debit payment methods. # noqa: E501
:return: The street_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._street_name
@street_name.setter
def street_name(self, street_name):
"""Sets the street_name of this ProxyGetPaymentMethodSnapshot.
The street name of the customer's address. Only applicable to direct debit payment methods. # noqa: E501
:param street_name: The street_name of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._street_name = street_name
@property
def street_number(self):
"""Gets the street_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The street number of the customer's address. Only applicable to direct debit payment methods. # noqa: E501
:return: The street_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._street_number
@street_number.setter
def street_number(self, street_number):
"""Sets the street_number of this ProxyGetPaymentMethodSnapshot.
The street number of the customer's address. Only applicable to direct debit payment methods. # noqa: E501
:param street_number: The street_number of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._street_number = street_number
@property
def token_id(self):
"""Gets the token_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
A gateway unique identifier that replaces sensitive payment method data or represents a gateway's unique customer profile. Applicable to CC Reference Transaction payment methods. # noqa: E501
:return: The token_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._token_id
@token_id.setter
def token_id(self, token_id):
"""Sets the token_id of this ProxyGetPaymentMethodSnapshot.
A gateway unique identifier that replaces sensitive payment method data or represents a gateway's unique customer profile. Applicable to CC Reference Transaction payment methods. # noqa: E501
:param token_id: The token_id of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
self._token_id = token_id
@property
def total_number_of_error_payments(self):
"""Gets the total_number_of_error_payments of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The number of error payments that used this payment method. # noqa: E501
:return: The total_number_of_error_payments of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: int
"""
return self._total_number_of_error_payments
@total_number_of_error_payments.setter
def total_number_of_error_payments(self, total_number_of_error_payments):
"""Sets the total_number_of_error_payments of this ProxyGetPaymentMethodSnapshot.
The number of error payments that used this payment method. # noqa: E501
:param total_number_of_error_payments: The total_number_of_error_payments of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: int
"""
self._total_number_of_error_payments = total_number_of_error_payments
@property
def total_number_of_processed_payments(self):
"""Gets the total_number_of_processed_payments of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The number of successful payments that used this payment method. # noqa: E501
:return: The total_number_of_processed_payments of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: int
"""
return self._total_number_of_processed_payments
@total_number_of_processed_payments.setter
def total_number_of_processed_payments(self, total_number_of_processed_payments):
"""Sets the total_number_of_processed_payments of this ProxyGetPaymentMethodSnapshot.
The number of successful payments that used this payment method. # noqa: E501
:param total_number_of_processed_payments: The total_number_of_processed_payments of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: int
"""
self._total_number_of_processed_payments = total_number_of_processed_payments
@property
def type(self):
"""Gets the type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
The type of payment method. # noqa: E501
:return: The type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""Sets the type of this ProxyGetPaymentMethodSnapshot.
The type of payment method. # noqa: E501
:param type: The type of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: str
"""
allowed_values = ["ACH", "ApplePay", "BankTransfer", "Cash", "Check", "CreditCard", "CreditCardReferenceTransaction", "DebitCard", "Other", "PayPal", "WireTransfer"] # noqa: E501
if (self._configuration.client_side_validation and
type not in allowed_values):
raise ValueError(
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
.format(type, allowed_values)
)
self._type = type
@property
def use_default_retry_rule(self):
"""Gets the use_default_retry_rule of this ProxyGetPaymentMethodSnapshot. # noqa: E501
Determines whether to use the default retry rules configured in the Zuora Payments settings. # noqa: E501
:return: The use_default_retry_rule of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:rtype: bool
"""
return self._use_default_retry_rule
@use_default_retry_rule.setter
def use_default_retry_rule(self, use_default_retry_rule):
"""Sets the use_default_retry_rule of this ProxyGetPaymentMethodSnapshot.
Determines whether to use the default retry rules configured in the Zuora Payments settings. # noqa: E501
:param use_default_retry_rule: The use_default_retry_rule of this ProxyGetPaymentMethodSnapshot. # noqa: E501
:type: bool
"""
self._use_default_retry_rule = use_default_retry_rule
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(ProxyGetPaymentMethodSnapshot, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ProxyGetPaymentMethodSnapshot):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, ProxyGetPaymentMethodSnapshot):
return True
return self.to_dict() != other.to_dict()
|
zuora-swagger-client
|
/zuora-swagger-client-1.2.0.tar.gz/zuora-swagger-client-1.2.0/swagger_client/models/proxy_get_payment_method_snapshot.py
|
proxy_get_payment_method_snapshot.py
|
#!/usr/bin/python -tt
setupArgs = {
'name': 'zuora',
'version': '1.0.17',
'author': 'MapMyFitness',
'author_email': '[email protected]',
'url': 'http://github.com/mapmyfitness/python-zuora',
'description': 'Zuora client library.',
'packages': [
'zuora',
'zuora.rest_wrapper',
],
'package_data': {'zuora': ['./*.wsdl']},
}
try:
from setuptools import setup, Command
except ImportError:
from distutils.core import setup
else:
import sys
import subprocess
class TestRunner(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
errno = subprocess.call(['py.test'])
sys.exit(errno)
setupArgs.update({
'tests_require': ['pytest'],
'cmdclass': {'test': TestRunner},
'install_requires': ['suds >= 0.4', 'requests', 'httplib2'],
'zip_safe': False,
})
setup(**setupArgs)
|
zuora
|
/zuora-1.0.17.tar.gz/zuora-1.0.17/setup.py
|
setup.py
|
import setuptools
setuptools.setup(
name="zuorapy",
version="0.0.4",
author="ihong5",
author_email="[email protected]",
description="Zuora Rest Client for Python",
long_description_content_type="text/markdown",
url="https://bitbucket.org/ihong5/zuorapy",
packages=setuptools.find_packages(),
classifiers=(
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
),
)
|
zuorapy
|
/zuorapy-0.0.4.tar.gz/zuorapy-0.0.4/setup.py
|
setup.py
|
US_PROD="https://rest.zuora.com"
US_SANDBOX="https://rest.apisandbox.zuora.com"
US_PT="https://rest.pt1.zuora.com"
EU_PROD="https://rest.eu.zuora.com"
EU_SANDBOX="https://rest.sandbox.eu.zuora.com"
|
zuorapy
|
/zuorapy-0.0.4.tar.gz/zuorapy-0.0.4/consts/host.py
|
host.py
|
ACTION = "/v1/action"
ACCOUNTING_CODE = "/v1/accounting-codes"
ACCOUNTING_PERIOD = "/v1/accounting-periods"
ACCOUNT_CRUD = "/v1/object/account"
ACCOUNT_SERVICE = "/v1/accounts"
AMENDMENT_CRUD = "/v1/object/amendment"
AMENDMENT_SERVICE = "/v1/amendments"
ATTACHMENT = "/v1/attachments"
BILL_RUN_CRUD = "/v1/object/bill-run"
BILL_RUN_SERVICE = "/v1/bill-runs"
BILLING_DOCUMENT = "/v1/billing-documents"
BILLING_PREVIEW_RUN = "/v1/billing-preview-runs"
CATALOG = "/v1/catalog/products"
CHARGE_REVENUE_SUMMARY = "/v1/charge-revenue-summaries"
COMMUNICATION_PROFILE = "/v1/object/communication-profile"
CONNECTIONS = "/v1/connections"
CONTACT = "/v1/object/contact"
CREDIT_BALANCE_ADJUSTMENT = "/v1/object/credit-balance-adjustment"
CREDIT_MEMO = "/v1/creditmemos"
CUSTOM_EXCHANGE_RATE = "/v1/custom-exchange-rates"
DEBIT_MEMO = "/v1/debitmemos"
DESCRIBE = "/v1/describe"
ENTITY = "/v1/entities"
ENTITY_CONNECTION = "/v1/entity-connections"
EVENT_TRIGGER = "/events/event-triggers"
EXPORT = "/v1/object/export"
FEATURE = "/v1/object/feature"
FILE = "/v1/files"
HMAC_SIGNATURE = "/v1/hmac-signatures"
HOSTED_PAGE = "/v1/hostedpages"
IMPORT = "/v1/object/import"
INVOICE_ADJUSTMENT = "/v1/object/invoice-adjustment"
INVOICE_ITEM_ADJUSTMENT = "/v1/object/invoice-item-adjustment"
INVOICE_ITEM = "/v1/object/invoice-item"
INVOICE_PAYMENT = "/v1/object/invoice-payment"
INVOICE_SPLIT_ITEM = "/v1/object/invoice-split-item"
INVOICE_SPLIT = "/v1/object/invoice-split"
INVOICE_CRUD = "/v1/object/invoice"
INVOICE_SERVICE = "/v1/invoices"
JOURNAL_RUN = "/v1/journal-runs"
MASS_UPDATER = "/v1/bulk"
NOTIFICATION = "/notifications"
NOTIFICATION_HISTORY = "/v1/notification-history"
OAUTH = "/oauth/token"
OPERATION = "/v1/operations"
ORDER = "/v1/orders"
PAYMENT_GATEWAY = "/v1/paymentgateways"
PAYMENT_METHOD_SNAPSHOT = "/v1/object/payment-method-snapshot"
PAYMENT_METHOD_TRANSACTION_LOG = "/v1/object/payment-method-transaction-log"
PAYMENT_METHOD_CRUD = "/v1/object/payment-method"
PAYMENT_METHOD_SERVICE = "/v1/payment-methods"
PAYMENT_RUN = "/v1/payment-runs"
PAYMENT_TRANSACTION_LOG = "/v1/object/payment-transaction-log"
PAYMENT_CRUD = "/v1/object/payment"
PAYMENT_SERVICE = "/v1/payments"
PRODUCT_FEATURE = "/v1/object/product-feature"
PRODUCT_RATE_PLAN_CHARGE_TIER = "/v1/object/product-rate-plan-charge-tier"
PRODUCT_RATE_PLAN_CHARGE = "/v1/object/product-rate-plan-charge"
PRODUCT_RATE_PLAN = "/v1/object/product-rate-plan"
PRODUCT = "/v1/object/product"
QUOTE_DOCUMENT = "/v1/quotes/document"
RATE_PLAN_CHARGE_TIER = "/v1/object/rate-plan-charge-tier"
RATE_PLAN_CHARGE = "/v1/object/rate-plan-charge"
RATE_PLAN = "/v1/object/rate-plan"
REFUND_INVOICE_PAYMENT = "/v1/object/refund-invoice-payment"
REFUND_TRANSACTION_LOG = "/v1/object/refund-transaction-log"
REFUND_CRUD = "/v1/object/refund"
REFUND_SERVICE = "/v1/refunds"
REVENUE_EVENT = "/v1/revenue-events"
REVENUE_ITEM = "/v1/revenue-items"
REVENUE_RULE = "/v1/revenue-recognition-rules"
REVENUE_SCHEDULE = "/v1/revenue-schedules"
RSA_SIGNATURE = "/v1/rsa-signatures"
SETTING = "/v1/settings"
SUBSCRIPTION_PRODUCT_FEATURE = "/v1/object/subscription-product-feature"
SUBSCRIPTION_CRUD = "/v1/object/subscription"
SUBSCRIPTION_SERVICE = "/v1/subscriptions"
SUMMARY_JOURNAL_ENTRY = "/v1/journal-entries"
TAXATION_ITEM_CRUD = "/v1/object/taxation-item"
TAXATION_ITEM_SERVICE = "/v1/taxationitems"
TRANSACTION = "/v1/transactions"
UNIT_OF_MEASURE = "/v1/object/unit-of-measure"
USAGE_CRUD = "/v1/usage"
USAGE_SERVICE = "/v1/object/usage"
USER = "/v1/users"
|
zuorapy
|
/zuorapy-0.0.4.tar.gz/zuorapy-0.0.4/consts/endpoint.py
|
endpoint.py
|
import unittest
import os
from zuorapy.client import Client
from consts import endpoint as ep, host as h
class ClientTest(unittest.TestCase):
host = h.US_SANDBOX
username = os.environ['USERNAME']
password = os.environ['PASSWORD']
client_id = os.environ['CLIENT_ID']
client_secret = os.environ['CLIENT_SECRET']
def test_check_and_refresh_bearer_token(self):
c = Client(host=self.host, client_id=self.client_id, client_secret=self.client_secret)
self.assertIsNotNone(c.bearer_token, "Failed to retrieve bearer token!")
def test_basic_get_200(self):
endpoint = ep.CATALOG
c = Client(host=self.host, username=self.username, password=self.password)
res = c.get(endpoint=endpoint)
self.assertEqual(res.status_code, 200, "GET request failure!")
def test_basic_post_200(self):
endpoint = ep.ACCOUNT_CRUD
c = Client(host=self.host, username=self.username, password=self.password)
payload = { "BillCycleDay": 1, "Currency": "USD", "Name": "Inki test account create from zuorapy", "Status": "Draft" }
res = c.post(endpoint=endpoint, payload=payload)
self.assertEqual(res.status_code, 200, "POST request failure!")
def test_basic_put_200(self):
test_acct_id = "2c92c0f964cff4f30164d3a831060c29"
endpoint = "%s/%s" % (ep.ACCOUNT_CRUD, test_acct_id)
c = Client(host=self.host, username=self.username, password=self.password)
payload = { "Currency": "USD" }
res = c.put(endpoint=endpoint, payload=payload)
self.assertEqual(res.status_code, 200, "PUT request failure!")
def test_basic_delete_200(self):
test_acct_id = "2c92c0f9638c546c01638dc92fac138e"
endpoint = "%s/%s" % (ep.ACCOUNT_CRUD, test_acct_id)
c = Client(host=self.host, username=self.username, password=self.password)
res = c.delete(endpoint=endpoint)
self.assertEqual(res.status_code, 200, "DELETE request failure!")
if __name__ == '__main__':
unittest.main()
|
zuorapy
|
/zuorapy-0.0.4.tar.gz/zuorapy-0.0.4/test/client_test.py
|
client_test.py
|
from setuptools import setup
setup(name='zuoraquery',
version='0.1',
description='Query Zuora SOAP API using Zuora Object Query Language (ZOQL)',
url='https://github.com/michaelperalta/zuoraquery',
author='Mike Peralta',
author_email='[email protected]',
license='MIT',
packages=['zuoraquery'],
install_requires=[
'suds',
],
zip_safe=False)
|
zuoraquery
|
/zuoraquery-0.1.zip/zuoraquery-0.1/setup.py
|
setup.py
|
from setuptools import setup
setup(
name='zuoyeji',
version='0.0.0',
description='homework machine',
url='https://github.com/zhihuijin/zuoyeji',
packages=['zuoyeji'],
)
|
zuoyeji
|
/zuoyeji-0.0.0.tar.gz/zuoyeji-0.0.0/setup.py
|
setup.py
|
# zup
### dependencies
* Python 3.8
### Installation
```bash
$ pip install zup
```
### Installing Zig
This will install latest master Zig release and set it as default `zig` command in your system.
Note that zup never modifies your system configuration and you must add the symlink directory that zup manages to your `%PATH%` on Windows or `$PATH` on other platforms.
```bash
zup install master -d
```
### Configuration
Config file is a python script that gets executed before any command is ran.
It can be opened with `zup config`. This uses your default program for a filetype; on windows the default is `python.exe`, please set it to a proper text editor or it won't open. Zup does not check or configure any system variables and can't know what the config will be opened with and it is your job as the owner of your system to configure it properly.
```python
# config.py
# windows: Path(os.getenv('APPDATA')) / 'zup/config.py'
# macos: Path.home() / 'Library/Preferences/zup/config.py'
# other: Path.home() / '.config/zup/config.py'
# url where index will be fetched from
# default: 'https://ziglang.org/download/index.json'
index_url = zup.config.default_index_url()
# directory where zig compilers are installed
# windows: Path(os.getenv('LOCALAPPDATA')) / 'zup'
# macos: Path.home() / 'Library/Application Support/zup'
# other: Path.home() / '.local/share/zup'
install_dir = zup.config.default_install_dir()
# directory where symlinks to compilers are created
# windows: install_dir
# macos: install_dir
# other: Path.home() / '.local/bin'
symlink_dir = zup.config.default_symlink_dir()
```
|
zup
|
/zup-0.1.6.tar.gz/zup-0.1.6/README.md
|
README.md
|
from setuptools import setup
setup(name='zup',
version='0.1.6',
description='Zig compiler multiplexer',
classifiers = [
'Programming Language :: Python :: 3.8',
'License :: OSI Approved :: zlib/libpng License',
'Operating System :: OS Independent',
'Topic :: System :: Installation/Setup',
'Development Status :: 4 - Beta'
],
keywords='zig',
url='https://github.com/yamirui/zup',
author='yamirui',
author_email='[email protected]',
license='zlib',
packages=['zup'],
entry_points = {
'console_scripts': ['zup=zup.main:main'],
},
include_package_data=True,
zip_safe=True,
python_requires='>=3.8')
|
zup
|
/zup-0.1.6.tar.gz/zup-0.1.6/setup.py
|
setup.py
|
=======
History
=======
0.0.2 (2023-07-16)
------------------
* Fix release script by renaming README.
* Release on PyPi.
0.0.1 (2023-07-16)
------------------
* Create release scripts.
0.0.0 (yyyy-mm-dd)
------------------
* No history yet.
|
zupa
|
/zupa-0.0.2.tar.gz/zupa-0.0.2/HISTORY.rst
|
HISTORY.rst
|
####
Zupa
####
Playground for server management.
..
.. code-block:: python
pass
Installation
------------
.. code-block:: shell
pip install zupa
|
zupa
|
/zupa-0.0.2.tar.gz/zupa-0.0.2/README.rst
|
README.rst
|
import sys
from pathlib import Path
from invoke import task
from jinja2 import Template
system = "zupa" # Directory name of the project
@task
def lint(c):
""""""
c.run(f"python3 -m black {system}")
c.run(f"python3 -m pylint {system}")
@task(name="docs", aliases=("html", "documentation"))
def docs_html(c, output_directory="build/html"):
"""Build the documentation in HTML form."""
c.run(f"python3 -m sphinx docs {output_directory}")
@task(name="preview", aliases=("rst",))
def preview(c):
"""Show a preview of the README file."""
rst_view = c.run(f"restview --listen=8888 --browser --pypi-strict README.rst", asynchronous=True, out_stream=sys.stdout)
print("Listening on http://localhost:8888/")
rst_view.join()
@task
def clean(c):
"""Remove all artefacts."""
patterns = ["build", "docs/build"]
for pattern in patterns:
c.run(f"rm -rf {pattern}")
@task
def test(c):
"""Run all tests under the 'tests' directory."""
c.run("python3 -m unittest discover tests 'test_*' -v")
@task
def coverage(c):
"""Run coverage from the 'tests' directory."""
c.run("coverage run --source . -m unittest discover tests 'test_*' -v")
c.run("coverage html")
@task
def minimum(c):
"""Check the minimum required python version for the project."""
c.run("vermin --no-parse-comments .")
@task(name="migrate")
def migrate_requirements(c):
"""Copy requirements from the requirements.txt file to pyproject.toml."""
lines = Path("requirements.txt").read_text().split("\n")
current = system.lower().replace("-", "_")
requirements = {current: [], "test": [], "doc": [], "graphical": [], "dev": []}
for line in lines:
if line.startswith("#"):
candidate = line[1:].lower().strip().replace(" ", "_").replace("-", "_")
if candidate in requirements.keys():
current = candidate
continue
if line.strip() == "" or ("=" in line and "#" in line):
continue
requirements[current].append("".join(line.split()))
template = Template(Path("docs/templates/pyproject.toml").read_text())
Path("pyproject.toml").write_text(template.render(requirements=requirements))
@task
def release(c, version):
""""""
if version not in ["minor", "major", "patch"]:
print("Version can be either major, minor or patch.")
return
import importlib
current_module = importlib.import_module(system)
__version_info__ = current_module.__version_info__
__version__ = current_module.__version__
_major, _minor, _patch = __version_info__
if version == "patch":
_patch = _patch + 1
elif version == "minor":
_minor = _minor + 1
_patch = 0
elif version == "major":
_major = _major + 1
_minor = 0
_patch = 0
c.run(f"git checkout -b release-{_major}.{_minor}.{_patch} dev")
c.run(f"sed -i 's/{__version__}/{_major}.{_minor}.{_patch}/g' {system}/__init__.py")
print(f"Update the readme for version {_major}.{_minor}.{_patch}.")
input("Press enter when ready.")
c.run(f"git add -u")
c.run(f'git commit -m "Update changelog version {_major}.{_minor}.{_patch}"')
c.run(f"git push --set-upstream origin release-{_major}.{_minor}.{_patch}")
c.run(f"git checkout main")
c.run(f"git merge --no-ff release-{_major}.{_minor}.{_patch}")
c.run(f'git tag -a {_major}.{_minor}.{_patch} -m "Release {_major}.{_minor}.{_patch}"')
c.run(f"git push")
c.run(f"git checkout dev")
c.run(f"git merge --no-ff release-{_major}.{_minor}.{_patch}")
c.run(f"git push")
c.run(f"git branch -d release-{_major}.{_minor}.{_patch}")
c.run(f"git push origin --tags")
|
zupa
|
/zupa-0.0.2.tar.gz/zupa-0.0.2/tasks.py
|
tasks.py
|
.. include:: ../README.md
Index
-----
.. toctree::
:maxdepth: 1
:caption: Installation:
:name: sec-files
installation
|
zupa
|
/zupa-0.0.2.tar.gz/zupa-0.0.2/docs/index.rst
|
index.rst
|
import os
import sys
import sphinx_godot_theme as sgt
from zupa import __version__
sys.path.insert(0, os.path.abspath(".."))
html_favicon = "static/images/docs_logo.svg"
supported_languages = {
"en": "Zupa (%s)",
}
extensions = [
# "notfound.extension",
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx_rtd_theme",
"sphinx_search.extension",
"sphinx_tabs.tabs",
"sphinxext.opengraph",
"sphinxcontrib.drawio",
"myst_parser",
"sphinx_xournal",
]
# autosectionlabel_prefix_document = True
sphinx_tabs_nowarn = True
templates_path = sgt.templates_path
source_suffix = {
".rst": "restructuredtext",
".txt": "markdown",
".md": "markdown",
}
source_encoding = sgt.source_encoding
master_doc = "index"
# https://pypi.org/project/sphinxcontrib-drawio/
drawio_binary_path = "/usr/bin/drawio"
drawio_headless = True
drawio_no_sandbox = True
author = "Arkadiusz Michaล Ryล"
project = "Zupa"
copyright = f"2022, {author}"
version = __version__
release = version
ogp_site_name = project
env_tags = os.getenv("SPHINX_TAGS")
if env_tags is not None:
for tag in env_tags.split(","):
print("Adding Sphinx tag: %s" % tag.strip())
tags.add(tag.strip()) # noqa: F821
language = os.getenv("READTHEDOCS_LANGUAGE", "en")
if language not in supported_languages.keys():
print("Unknown language: " + language)
print("Supported languages: " + ", ".join(supported_languages.keys()))
print("The configured language is wrong. Falling back to 'en'.")
language = "en"
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
pygments_style = "sphinx"
todo_include_todos = False
html_theme = "sphinx_rtd_theme"
html_theme_options = {
"logo_only": True,
"collapse_navigation": False,
}
html_logo = "static/images/docs_logo.svg"
html_static_path = ["static"] + sgt.html_static_path
htmlhelp_basename = project
html_extra_path = sgt.html_extra_path
html_css_files = ["css/custom.css"]
html_js_files = ["js/custom.js"]
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
html_title = supported_languages[language] % version
html_context = {"conf_py_path": "/"}
latex_engine = "pdflatex"
latex_elements = {
"papersize": "letterpaper",
"pointsize": "10pt",
"figure_align": "htbp",
"preamble": r"""
\DeclareUnicodeCharacter{2610}{[ ]}
\DeclareUnicodeCharacter{2611}{[X]}
\DeclareUnicodeCharacter{251C}{|}
\DeclareUnicodeCharacter{2500}{-}
\DeclareUnicodeCharacter{2514}{|}
""",
}
latex_documents = [(master_doc, f"{project.lower().replace(' ', '_')}.tex", project, author, "manual"),]
man_pages = [(master_doc, project, project, [author], 1)]
texinfo_documents = [(master_doc, project, project, author, project, project, "Miscellaneous")]
notfound_context = sgt.notfound_context
|
zupa
|
/zupa-0.0.2.tar.gz/zupa-0.0.2/docs/conf.py
|
conf.py
|
from setuptools import setup, find_packages
def get_version(filename):
import ast
version = None
with open(filename) as f:
for line in f:
if line.startswith('__version__'):
version = ast.parse(line).body[0].value.s
break
else:
raise ValueError('No version found in %r.' % filename)
if version is None:
raise ValueError(filename)
return version
line = 'z5'
version = get_version('src/zuper_auth/__init__.py')
import os
description = """"""
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name=f'zuper-auth-{line}',
version=version,
package_dir={'': 'src'},
packages=find_packages('src'),
zip_safe=True,
entry_points={
'console_scripts': [
]
},
install_requires=[
'zuper-typing-z5',
'zuper-commons-z5',
],
)
|
zuper-auth-z5
|
/zuper-auth-z5-5.0.3.tar.gz/zuper-auth-z5-5.0.3/setup.py
|
setup.py
|
from collections import defaultdict
from dataclasses import dataclass, field
from typing import *
from zuper_commons.text.zc_wildcards import wildcard_to_regexp
from zuper_typing import debug_print
from .parsing import (AbilityMatch, AbilityMatchByPattern, Allow, Always, AndMatch, AttributeMatch, ByPattern, Comment,
ConditionMatch, HasAttributes, NewAbility, NewObject, NewOType, NewParentRelation, NewProperty,
parse_string, QueryGetProperties, QueryHAS, QueryIS, ResourceMatch, SetChildParentRelation,
SetProperty, ShowState, SingleResourceMatch, Statement)
@dataclass
class Object:
main_name: str
others: List[str]
type_name: str
parents: Dict[str, 'Object'] = field(default_factory=dict)
children: Dict[str, 'Object'] = field(default_factory=dict)
properties: Dict[str, List[ResourceMatch]] = field(default_factory=lambda: defaultdict(list))
@dataclass
class OType:
t_parents: Dict[str, bool] = field(default_factory=dict)
t_abilities: Dict[str, str] = field(default_factory=dict)
t_objects: Dict[str, Object] = field(default_factory=dict)
t_aliases: Dict[str, Object] = field(default_factory=dict)
t_properties: Dict[str, str] = field(default_factory=dict)
class AuthException(Exception):
pass
class Invalid(AuthException):
pass
class CouldNotFindResource(AuthException):
pass
@dataclass
class QResult:
ok: bool
line: str
query_result: Any
msg: Optional[str]
@dataclass
class Interpreter:
types: Dict[str, OType] = field(default_factory=dict)
allows: List[Allow] = field(default_factory=list)
statements_history: List[Statement] = field(default_factory=list)
results: List[QResult] = field(default_factory=list)
results_history: List[QResult] = field(default_factory=list)
last_line: str = None
functions: Dict[str, Callable] = field(default_factory=dict)
child_parent_relations: List[SetChildParentRelation] = field(default_factory=list)
# def __post_init__(self):
# # self.types = {}
# # self.allows = []
# # self.statements_history = []
# # self.results = []
# # self.results_history = []
# self.last_line = None
#
# self.functions = {}
def info(self) -> str:
s = []
for k, v in self.types.items():
s.append(k)
s.append(debug_print(v.t_objects))
return "\n".join(s)
def knows(self, type_name: str, object_identifier: str):
t = self._get_type(type_name)
return object_identifier in t.t_objects
def interpret(self, line: str, statement: Statement) -> QResult:
self.last_line = line
self.statements_history.append(statement)
t = type(statement).__name__
if t in self.functions:
ff = self.functions[t]
else:
f = f'interpret_{t}'
if not hasattr(self, f):
msg = f'Cannot find {f}'
raise NotImplementedError(msg)
ff = getattr(self, f)
self.functions[t] = ff
try:
r = ff(statement)
assert isinstance(r, QResult), statement
return r
except AuthException as e:
return self._mark_failure(str(e))
except (SystemExit, KeyboardInterrupt):
raise
except BaseException as e:
msg = f'Cannot intepret statement {statement}'
raise ValueError(msg) from e
def _mark_ok(self, msg=None) -> QResult:
qr = QResult(ok=True, msg=msg, line=self.last_line, query_result=None)
self.results.append(qr)
self.results_history.append(qr)
return qr
def _mark_failure(self, msg) -> QResult:
qr = QResult(ok=False, msg=msg, line=self.last_line, query_result=None)
self.results.append(qr)
self.results_history.append(qr)
return qr
def _mark_query_result(self, res, msg=None) -> QResult:
qr = QResult(ok=True, msg=msg, line=self.last_line, query_result=res)
self.results.append(qr)
self.results_history.append(qr)
return qr
# def get_results(self) -> List[QResult]:
# """ Returns the last results and drops them. """
# r = self.results
# self.results = []
# return r
# def get_results_log_errors(self):
# for r in self.get_results():
# if not r.ok:
# logger.error(r)
def _get_type(self, type_name):
if type_name not in self.types:
msg = f'Could not find type {type_name!r}'
raise Invalid(msg)
return self.types[type_name]
def interpret_NewOType(self, s: NewOType) -> QResult:
if s.type_name in self.types:
msg = f'Already know find type {s.type_name!r}'
raise Invalid(msg)
self.types[s.type_name] = OType()
return self._mark_ok()
def interpret_NewParentRelation(self, s: NewParentRelation) -> QResult:
t = self._get_type(s.type_name)
if s.parent_name in t.t_parents:
msg = f'Already set relationship.'
raise Invalid(msg)
t.t_parents[s.parent_name] = s.compulsory
return self._mark_ok()
def interpret_Comment(self, s: Comment) -> QResult:
return self._mark_ok(s.line)
def interpret_ShowState(self, s: ShowState) -> QResult:
m = self.info()
return self._mark_ok(m)
def interpret_NewAbility(self, s: NewAbility) -> QResult:
t = self._get_type(s.type_name)
if s.ability_name in t.t_abilities:
msg = f'Already set ability {s.ability_name!r}.'
raise Invalid(msg)
t.t_abilities[s.ability_name] = s.title
return self._mark_ok()
def interpret_NewObject(self, s: NewObject) -> QResult:
t = self._get_type(s.type_name)
main_name = s.identifiers[0]
others = s.identifiers[1:]
if main_name in t.t_objects:
msg = f'Already know object {main_name!r}.'
raise Invalid(msg)
t.t_objects[main_name] = ob = Object(main_name=main_name, others=others, type_name=s.type_name)
for alias in others:
if alias in t.t_aliases:
msg = f'Already know alias {alias!r}.'
raise Invalid(msg)
t.t_aliases[alias] = ob
for scp in self.child_parent_relations:
if self.object_matches(ob, scp.child_match):
for parent in self.get_resources(scp.parent_match):
self.set_relationship(ob, parent)
if self.object_matches(ob, scp.parent_match):
for child in self.get_resources(scp.child_match):
self.set_relationship(child, ob)
return self._mark_ok()
def set_relationship(self, child: Object, parent: Object):
p = list(get_parents_and_self(parent))
if child in p:
msg = f'Cannot set parent-relation because child is a parent of parent.' \
f'\nParent: {parent}' \
f'\nChild: {child}'
raise Invalid(msg)
child.parents[parent.main_name] = parent
parent.children[child.main_name] = child
def interpret_SetChildParentRelation(self, s: SetChildParentRelation) -> QResult:
for parent in self.get_resources(s.parent_match):
for child in self.get_resources(s.child_match):
self.set_relationship(child, parent)
# make sure no recursion
# p = list(get_parents_and_self(parent))
# if child in p:
# msg = f'Cannot set parent-relation because child is a parent of parent.' \
# f'\nParent: {parent}' \
# f'\nChild: {child}' \
# f'\ns: {s}'
# raise Invalid(msg)
#
# child.parents[parent.main_name] = parent
# parent.children[child.main_name] = child
self.child_parent_relations.append(s)
return self._mark_ok()
def interpret_NewProperty(self, s: NewProperty) -> QResult:
t = self._get_type(s.type_name)
if s.property_name in t.t_properties:
msg = f'Already set property {s.property_name!r}.'
raise Invalid(msg)
t.t_properties[s.property_name] = s.title
return self._mark_ok()
def interpret_SetProperty(self, s: SetProperty) -> QResult:
for r in self.get_resources(s.resource_match):
t = self.types[r.type_name]
if s.property_name not in t.t_properties:
msg = f'Cannot set property {s.property_name!r} for object {r.main_name!r} of type {r.type_name!r}.'
raise Invalid(msg)
r.properties[s.property_name].append(s.context)
return self._mark_ok()
def interpret_Allow(self, s: Allow) -> QResult:
self.allows.append(s)
return self._mark_ok()
def object_matches(self, ob: Object, rm: ResourceMatch):
if isinstance(rm, ByPattern):
if (ob.type_name != rm.type_name):
return False
for identifier in [ob.main_name] + ob.others:
if pattern_matches(rm.pattern, identifier):
return True
return False
elif isinstance(rm, SingleResourceMatch):
if (ob.type_name != rm.type_name):
return False
return rm.identifier in [ob.main_name] + ob.others
else:
raise NotImplementedError(rm)
def get_resources(self, rm: ResourceMatch) -> Iterator[Object]:
if isinstance(rm, ByPattern):
t = self._get_type(rm.type_name)
for obname, ob in list(t.t_objects.items()):
for identifier in [ob.main_name] + ob.others:
if pattern_matches(rm.pattern, identifier):
yield ob
elif isinstance(rm, SingleResourceMatch):
t = self._get_type(rm.type_name)
if rm.identifier in t.t_objects:
yield t.t_objects[rm.identifier]
elif rm.identifier in t.t_aliases:
yield t.t_aliases[rm.identifier]
else:
raise NotImplementedError(rm)
def get_resource(self, rm: SingleResourceMatch) -> Object:
t = self.types[rm.type_name]
for obname, ob in list(t.t_objects.items()):
for identifier in [ob.main_name] + ob.others:
if rm.identifier == identifier:
return ob
msg = f'Could not find resource corresponding to {rm}'
raise CouldNotFindResource(msg)
def interpret_QueryIS(self, query: QueryIS) -> QResult:
# logger.debug(f'query {query}')
user = self.get_resource(query.user)
context = self.get_resource(query.context)
t = self._get_type(context.type_name)
ability = query.ability
if not ability in t.t_abilities:
msg = f'Unknown ability {ability!r} for object of type {context.type_name!r}.'
msg += f'\nKnown: {",".join(t.t_abilities)}.'
raise Invalid(msg)
properties = get_active_properties(user, context)
# logger.info('properties: %s' % properties)
context_parents = list(get_parents_and_self(context))
user_parents = list(get_parents_and_self(user))
msg = 'Active properties: %s' % properties
msg += f'\nuser hierarchy:'
for p in user_parents:
msg += f'\n - {p.type_name} : {p.main_name}'
msg += f'\nresource hierarchy: '
for p in context_parents:
msg += f'\n - {p.type_name} : {p.main_name}'
for allow in self.allows:
c1 = any(rmatch(allow.user_match, _) for _ in user_parents)
c2 = amatch(allow.ability_match, ability)
c3 = any(rmatch(allow.context_match, _) for _ in context_parents)
c4 = cmatch(allow.condition, properties)
ok = c1 and c2 and c3 and c4
if ok:
return self._mark_query_result(True)
else:
pass
msg += f'\nfalse (user match {c1}, amatch {c2}, context match {c3}, condition match{c4})\n for {allow}'
return self._mark_query_result(False, msg)
def interpret_QueryHAS(self, query: QueryHAS) -> QResult:
# logger.debug(f'query {query}')
user = self.get_resource(query.user)
context = self.get_resource(query.context)
properties = get_active_properties(user, context)
# logger.debug('properties: %s' % properties)
res = query.property in properties
return self._mark_query_result(res)
def interpret_QueryGetProperties(self, query: QueryGetProperties) -> QResult:
user = self.get_resource(query.user)
context = self.get_resource(query.context)
properties = get_active_properties(user, context)
return self._mark_query_result(properties)
def parse_and_interpret(self, src: str) -> List[QResult]:
res = []
for line, statement in parse_string(src):
r = self.interpret(line, statement)
assert isinstance(r, QResult), line
res.append(r)
return res
def get_history(self) -> str:
res = []
for s in reversed(self.results_history):
res.append(str(s))
return "\n".join(res)
def amatch(am: AbilityMatch, ability):
if isinstance(am, AbilityMatchByPattern):
if pattern_matches(am.pattern, ability):
return True
return False
else:
raise NotImplementedError(am)
def cmatch(cm: ConditionMatch, properties: Dict[str, bool]):
if isinstance(cm, Always):
return True
if isinstance(cm, AttributeMatch):
for p, v in properties.items():
if v and pattern_matches(cm.pattern, p):
return True
return False
raise NotImplementedError(cm)
def get_active_properties(user: Object, context: Object):
user_parents = list(get_parents_and_self(user))
context_parents = list(get_parents_and_self(context))
properties = {}
# Now set the properties
for cp in context_parents:
for up in user_parents:
for pname, matches in up.properties.items():
for match in matches:
if rmatch(match, cp):
properties[pname] = True
return properties
def get_parents_and_self(ob: Object) -> Iterator[Object]:
for parent in ob.parents.values():
yield from get_parents_and_self(parent)
yield ob
def rmatch(rm: ResourceMatch, ob: Object):
if isinstance(rm, ByPattern):
if rm.type_name != ob.type_name:
return False
for identifier in [ob.main_name] + ob.others:
if pattern_matches(rm.pattern, identifier):
return True
return False
if isinstance(rm, SingleResourceMatch):
if rm.type_name != ob.type_name:
return False
if rm.identifier == ob.main_name:
return True
if rm.identifier in ob.others:
return True
return False
elif isinstance(rm, AndMatch):
matches = (rmatch(_, ob) for _ in rm.ops)
return all(matches)
elif isinstance(rm, HasAttributes):
# XXX
matches = (_ in ob.properties for _ in rm.attributes)
return all(matches)
else:
raise NotImplementedError(rm)
def pattern_matches(pattern, identifier):
regexp = wildcard_to_regexp(pattern)
return regexp.match(identifier)
|
zuper-auth-z5
|
/zuper-auth-z5-5.0.3.tar.gz/zuper-auth-z5-5.0.3/src/zuper_auth/interpret.py
|
interpret.py
|
from dataclasses import dataclass
from typing import Callable, Iterator, List, Optional, Tuple
class Statement:
def to_line(self) -> str:
''' Returns the line that can be parsed to this statement. '''
return str(self)
class Storage:
parsing_functions = {}
def parse_function(f: Callable) -> Callable:
_, token = f.__name__.split('_', maxsplit=1)
Storage.parsing_functions[token] = f
return f
@dataclass
class NewOType(Statement):
type_name: str
title: Optional[str] = None
@dataclass
class Comment(Statement):
line: str
@parse_function
def parse_REM(rest: str) -> Tuple[Statement, str]:
return Comment(rest), ''
@dataclass
class ShowState(Statement):
pass
@parse_function
def parse_SHOW_STATE(rest: str) -> Tuple[Statement, str]:
return ShowState(), ''
@parse_function
def parse_TYPE(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
return NewOType(type_name=type_name), rest
@dataclass
class NewAbility(Statement):
'ABILITY domain domain-create-organization '
type_name: str
ability_name: str
title: Optional[str] = None
@parse_function
def parse_ABILITY(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
ability_name, rest = get_one_token(rest)
return NewAbility(type_name=type_name, ability_name=ability_name), rest
@dataclass
class NewParentRelation(Statement):
"PARENT type_name parent_name"
type_name: str
parent_name: str
compulsory: bool
@parse_function
def parse_PARENT(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
parent_name, rest = get_one_token(rest)
return NewParentRelation(type_name=type_name, parent_name=parent_name, compulsory=False), rest
@dataclass
class NewProperty(Statement):
''' PROPERTY type_name name title '''
type_name: str
property_name: str
title: Optional[str] = None
@parse_function
def parse_PROPERTY(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
property_name, rest = get_one_token(rest)
return NewProperty(type_name=type_name, property_name=property_name), rest
@dataclass
class SetProperty(Statement):
''' FOR <> SET property_name IN <> '''
resource_match: 'ResourceMatch'
property_name: str
context: 'ResourceMatch'
@parse_function
def parse_FOR(rest0: str) -> Tuple[Statement, str]:
resource_match, rest = parse_resource_match(rest0)
rest = skip_one_token('SET', rest)
property_name, rest = get_one_token(rest)
if rest:
rest = skip_one_token('IN', rest)
context, rest = parse_resource_match(rest)
else:
context = ByPattern('*', '*')
return SetProperty(resource_match, property_name, context), rest
@dataclass
class NewRelation(Statement):
relation_name: str
types: List[str]
@dataclass
class NewObject(Statement):
''' NEW challenge 12 aido-admin aido-admin '''
type_name: str
identifiers: List[str]
@parse_function
def parse_NEW(rest0: str) -> Tuple[NewObject, str]:
type_name, rest = parse_until(' ', rest0)
identifiers = rest.split(' ')
return NewObject(type_name, identifiers), ''
class ResourceMatch:
pass
@dataclass
class SingleResourceMatch(ResourceMatch):
type_name: str
identifier: str
def __post_init__(self):
if '*' in self.identifier:
msg = 'Expected a single resource, not a pattern here.'
raise ValueError(msg)
# class ByIdentifier(ResourceMatch):
# ''' challenge:12 '''
# type_name: str
# identifier: str
#
@dataclass
class ByPattern(ResourceMatch):
''' challenge:aido* '''
type_name: str
pattern: str
def __post_init__(self):
if not self.type_name or not self.pattern:
raise ValueError(self)
@dataclass
class HasAttributes(ResourceMatch):
attributes: List[str]
@dataclass
class AndMatch(ResourceMatch):
ops: List[ResourceMatch]
def parse_single_resource_match(rest0) -> Tuple[SingleResourceMatch, str]:
type_name, rest = parse_until(':', rest0, required=True)
identifier, rest = parse_until(' ', rest)
return SingleResourceMatch(type_name=type_name, identifier=identifier), rest
def parse_resource_match(rest0: str) -> Tuple[ResourceMatch, str]:
if not rest0:
raise ValueError(rest0)
type_name, rest = parse_until(':', rest0, required=True)
pattern, rest = parse_until(' ', rest)
if '*' in type_name or '*' in pattern:
bp = ByPattern(type_name, pattern)
else:
bp = SingleResourceMatch(type_name, pattern)
if rest.startswith('['):
n = rest.index(']')
interesting = rest[1:n]
attributes = interesting.strip().split()
rest = rest[n + 1:]
bp = AndMatch([HasAttributes(attributes), bp])
try:
return bp, rest
except ValueError as e:
msg = f'Cannot parse resource match {rest0!r}'
raise ValueError(msg) from e
@dataclass
class SetChildParentRelation(Statement):
''' SUB group:one organization:aido '''
child_match: ResourceMatch
parent_match: ResourceMatch
@parse_function
def parse_SUB(rest0) -> Tuple[Statement, str]:
child_match, rest = parse_resource_match(rest0)
parent_match, rest = parse_resource_match(rest)
return SetChildParentRelation(child_match, parent_match), rest
"""
SUB challenge:* domain:1
ALLOW <name> TO <Ability> IN <context> IF challenge-owner
"""
class Query0(Statement):
pass
@dataclass
class QueryIS(Query0):
''' IS <res> ALLOWED ability IN <context> '''
user: 'SingleResourceMatch'
ability: str
context: 'SingleResourceMatch'
@parse_function
def parse_IS(rest0) -> Tuple[QueryIS, str]:
user, rest = parse_single_resource_match(rest0)
rest = skip_one_token('ALLOWED', rest)
ability, rest = get_one_token(rest)
rest = skip_one_token('IN', rest)
context, rest = parse_single_resource_match(rest)
return QueryIS(user, ability, context), rest
@dataclass
class QueryHAS(Query0):
''' HAS <res> PROPERTY ability IN <context> '''
user: 'SingleResourceMatch'
property: str
context: 'SingleResourceMatch'
@parse_function
def parse_HAS(rest0) -> Tuple[QueryHAS, str]:
user, rest = parse_single_resource_match(rest0)
rest = skip_one_token('PROPERTY', rest)
property, rest = get_one_token(rest)
rest = skip_one_token('IN', rest)
context, rest = parse_single_resource_match(rest)
return QueryHAS(user, property, context), rest
@dataclass
class QueryGetProperties(Query0):
''' PROPERTIES <r> IN <context> '''
user: 'SingleResourceMatch'
context: 'SingleResourceMatch'
@parse_function
def parse_PROPERTIES(rest0) -> Tuple[QueryGetProperties, str]:
user, rest = parse_single_resource_match(rest0)
rest = skip_one_token('IN', rest)
context, rest = parse_single_resource_match(rest)
return QueryGetProperties(user, context), rest
class AbilityMatch:
pass
@dataclass
class AbilityMatchByPattern(AbilityMatch):
pattern: str
def __post_init__(self):
if ':' in self.pattern:
raise ValueError(self)
def parse_ability_match(rest) -> Tuple[AbilityMatch, str]:
pattern, rest = get_one_token(rest)
return AbilityMatchByPattern(pattern), rest
class ConditionMatch:
pass
@dataclass
class AttributeMatch(ConditionMatch):
pattern: str
def __post_init__(self):
if ':' in self.pattern:
raise ValueError(self)
def parse_condition_match(rest) -> Tuple[ConditionMatch, str]:
pattern, rest = get_one_token(rest)
return AttributeMatch(pattern), rest
class Always(ConditionMatch):
pass
@dataclass
class Allow(Statement):
''' ALLOW <user match> TO <ability match> IN <resource match> [IF <condition match>] '''
user_match: ResourceMatch
ability_match: AbilityMatch
context_match: ResourceMatch
condition: ConditionMatch
@parse_function
def parse_ALLOW(rest0) -> Tuple[Allow, str]:
user_match, rest = parse_resource_match(rest0)
rest = skip_one_token('TO', rest)
ability_match, rest = parse_ability_match(rest)
rest = skip_one_token('IN', rest)
context_match, rest = parse_resource_match(rest)
if rest:
rest = skip_one_token('IF', rest)
condition_match, rest = parse_condition_match(rest)
else:
condition_match = Always()
return Allow(user_match, ability_match, context_match, condition_match), rest
def remove_comment(line: str) -> str:
try:
i = line.index('#')
except:
return line
else:
return line[:i]
def parse_string(s) -> Iterator[Tuple[str, Statement]]:
s = s.strip()
lines = s.split('\n')
lines = [remove_comment(_) for _ in lines]
lines = [_.strip() for _ in lines]
lines = [_ for _ in lines if _]
for line in lines:
token, rest = get_one_token(line)
functions = Storage.parsing_functions
if token not in functions:
raise NotImplementedError((token, line))
f = functions[token]
try:
statement, rest = f(rest)
except ValueError as e:
msg = f'Cannot parse line {line!r}.'
raise ValueError(msg) from e
yield line, statement
def get_one_token(line: str):
line = line.lstrip()
return parse_until(' ', line)
def skip_one_token(expect: str, line: str):
token, rest = get_one_token(line)
if expect != token:
msg = f'Expected {expect!r} at the beginning of {line!r}.'
raise ValueError(msg)
return rest
def parse_until(sep: str, rest: str, required=False) -> Tuple[str, str]:
rest = rest.lstrip()
if not sep in rest:
if required:
msg = f'Could not find separator {sep!r} in {rest!r}.'
raise ValueError(msg)
return rest, ''
# msg = f'Cannot find separator {sep!r} in {rest!r}.'
# raise ValueError(msg)
tokens = rest.split(sep, maxsplit=1)
return tokens[0], tokens[1]
|
zuper-auth-z5
|
/zuper-auth-z5-5.0.3.tar.gz/zuper-auth-z5-5.0.3/src/zuper_auth/parsing.py
|
parsing.py
|
__version__ = '5.0.3'
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.info(f'zuper-auth {__version__}')
|
zuper-auth-z5
|
/zuper-auth-z5-5.0.3.tar.gz/zuper-auth-z5-5.0.3/src/zuper_auth/__init__.py
|
__init__.py
|
from zuper_auth.interpret import Interpreter
from zuper_auth_tests.test_parsing1 import assert_true, assert_false
def test_user_after():
src = """
TYPE user
TYPE server
ABILITY server admin
NEW server local
NEW user alice
TYPE group
PARENT user group
NEW group admins
ALLOW group:admins TO admin IN server:local
SUB user:* group:admins
NEW user bob
SHOW_STATE
"""
i = Interpreter()
i.parse_and_interpret(src)
print(i.info())
assert_true(i, 'IS user:alice ALLOWED admin IN server:local')
assert_true(i, 'IS user:bob ALLOWED admin IN server:local')
|
zuper-auth-z5
|
/zuper-auth-z5-5.0.3.tar.gz/zuper-auth-z5-5.0.3/src/zuper_auth_tests/test_user.py
|
test_user.py
|
from zuper_auth.interpret import Interpreter
from zuper_auth_tests.test_parsing1 import assert_eq
def test1():
src = """
TYPE domain
TYPE organization
TYPE user
PROPERTY user domain-owner
PARENT organization domain
NEW domain global
NEW organization aido
SUB organization:aido domain:global
NEW user tizio
FOR user:tizio SET domain-owner IN domain:global
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_eq(i, {'domain-owner': True}, 'PROPERTIES user:tizio IN domain:global')
assert_eq(i, {'domain-owner': True}, 'PROPERTIES user:tizio IN organization:aido')
def test2():
src = """
TYPE user
TYPE user-group
PARENT user user-group
TYPE resource
ABILITY resource read
NEW user tizio
NEW user-group G
SUB user:tizio user-group:G
NEW resource r1
ALLOW user-group:G TO * IN resource:r1
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_eq(i, True, 'IS user:tizio ALLOWED read IN resource:r1')
if __name__ == '__main__':
test1()
|
zuper-auth-z5
|
/zuper-auth-z5-5.0.3.tar.gz/zuper-auth-z5-5.0.3/src/zuper_auth_tests/test_aido.py
|
test_aido.py
|
from nose.tools import assert_equal
from zuper_auth.interpret import Interpreter
def test1():
src = """
TYPE domain
TYPE organization
TYPE user
PROPERTY user organization-owner
PARENT organization domain
ABILITY organization create-repos
NEW domain global
NEW organization aido
SUB organization:aido domain:global
NEW user yes-because-owner-aido
NEW user yes-because-owner-global
NEW user yes-because-direct
NEW user no
FOR user:yes-because-owner-aido SET organization-owner IN organization:aido
FOR user:yes-because-owner-global SET organization-owner IN domain:global
ALLOW user:* TO create-repos IN organization:* IF organization-owner
ALLOW user:yes-because-direct TO create-repos IN organization:aido
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_true(i, 'HAS user:yes-because-owner-aido PROPERTY organization-owner IN organization:aido')
assert_true(i, 'IS user:yes-because-owner-aido ALLOWED create-repos IN organization:aido')
assert_true(i, 'HAS user:yes-because-owner-global PROPERTY organization-owner IN domain:global')
assert_true(i, 'HAS user:yes-because-owner-global PROPERTY organization-owner IN organization:aido')
assert_true(i, 'IS user:yes-because-owner-global ALLOWED create-repos IN organization:aido')
assert_false(i, 'HAS user:yes-because-direct PROPERTY organization-owner IN organization:aido')
assert_true(i, 'IS user:yes-because-direct ALLOWED create-repos IN organization:aido')
assert_false(i, 'IS user:no ALLOWED create-repos IN organization:aido')
def test2_attrs():
src = """
TYPE challenge
PROPERTY challenge private
PROPERTY challenge public
TYPE user
ABILITY challenge read
NEW challenge pri1
FOR challenge:pri1 SET private
NEW challenge pub1
FOR challenge:pub1 SET public
NEW user john
ALLOW user:* TO read IN challenge:* [ public ]
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_true(i, 'IS user:john ALLOWED read IN challenge:pub1')
assert_false(i, 'IS user:john ALLOWED read IN challenge:pri1')
def test_rem():
src = """
REM comment
REM comment two
"""
i = Interpreter()
i.parse_and_interpret(src)
def assert_eq(i: Interpreter, val, s):
ress = i.parse_and_interpret(s)
res = ress[0]
print(res.msg)
if not res.ok:
raise Exception(res)
assert_equal(res.query_result, val, s)
def assert_true(i, s):
assert_eq(i, True, s)
def assert_false(i, s):
assert_eq(i, False, s)
if __name__ == '__main__':
test1()
|
zuper-auth-z5
|
/zuper-auth-z5-5.0.3.tar.gz/zuper-auth-z5-5.0.3/src/zuper_auth_tests/test_parsing1.py
|
test_parsing1.py
|
from setuptools import setup, find_packages
def get_version(filename):
import ast
version = None
with open(filename) as f:
for line in f:
if line.startswith('__version__'):
version = ast.parse(line).body[0].value.s
break
else:
raise ValueError('No version found in %r.' % filename)
if version is None:
raise ValueError(filename)
return version
version = get_version('src/zuper_auth/__init__.py')
import os
description = """"""
install_requires=[
'zuper-typing-z6',
'zuper-commons-z6',
]
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
line = 'z6'
setup(name=f'zuper-auth-{line}',
version=version,
package_dir={'': 'src'},
packages=find_packages('src'),
zip_safe=True,
entry_points={
'console_scripts': [
]
},
install_requires=install_requires
)
|
zuper-auth-z6
|
/zuper-auth-z6-6.0.1.tar.gz/zuper-auth-z6-6.0.1/setup.py
|
setup.py
|
from collections import defaultdict
from dataclasses import dataclass, field
from typing import Any, Callable, Dict, Iterator, List, Optional
from zuper_commons.text.zc_wildcards import wildcard_to_regexp
from zuper_typing import debug_print
from .parsing import (AbilityMatch, AbilityMatchByPattern, Allow, Always, AndMatch, AttributeMatch, ByPattern, Comment,
ConditionMatch, HasAttributes, NewAbility, NewObject, NewOType, NewParentRelation, NewProperty,
parse_string, QueryGetProperties, QueryHAS, QueryIS, ResourceMatch, SetChildParentRelation,
SetProperty, ShowState, SingleResourceMatch, Statement)
@dataclass
class Object:
main_name: str
others: List[str]
type_name: str
parents: Dict[str, 'Object'] = field(default_factory=dict)
children: Dict[str, 'Object'] = field(default_factory=dict)
properties: Dict[str, List[ResourceMatch]] = field(default_factory=lambda: defaultdict(list))
@dataclass
class OType:
t_parents: Dict[str, bool] = field(default_factory=dict)
t_abilities: Dict[str, str] = field(default_factory=dict)
t_objects: Dict[str, Object] = field(default_factory=dict)
t_aliases: Dict[str, Object] = field(default_factory=dict)
t_properties: Dict[str, str] = field(default_factory=dict)
class AuthException(Exception):
pass
class Invalid(AuthException):
pass
class CouldNotFindResource(AuthException):
pass
@dataclass
class QResult:
ok: bool
line: str
query_result: Any
msg: Optional[str]
@dataclass
class Interpreter:
types: Dict[str, OType] = field(default_factory=dict)
allows: List[Allow] = field(default_factory=list)
statements_history: List[Statement] = field(default_factory=list)
results: List[QResult] = field(default_factory=list)
results_history: List[QResult] = field(default_factory=list)
last_line: str = None
functions: Dict[str, Callable] = field(default_factory=dict)
child_parent_relations: List[SetChildParentRelation] = field(default_factory=list)
# def __post_init__(self):
# # self.types = {}
# # self.allows = []
# # self.statements_history = []
# # self.results = []
# # self.results_history = []
# self.last_line = None
#
# self.functions = {}
def info(self) -> str:
s = []
for k, v in self.types.items():
s.append(k)
s.append(debug_print(v.t_objects))
return "\n".join(s)
def knows(self, type_name: str, object_identifier: str):
t = self._get_type(type_name)
return object_identifier in t.t_objects
def interpret(self, line: str, statement: Statement) -> QResult:
self.last_line = line
self.statements_history.append(statement)
t = type(statement).__name__
if t in self.functions:
ff = self.functions[t]
else:
f = f'interpret_{t}'
if not hasattr(self, f):
msg = f'Cannot find {f}'
raise NotImplementedError(msg)
ff = getattr(self, f)
self.functions[t] = ff
try:
r = ff(statement)
assert isinstance(r, QResult), statement
return r
except AuthException as e:
return self._mark_failure(str(e))
except (SystemExit, KeyboardInterrupt):
raise
except BaseException as e:
msg = f'Cannot intepret statement {statement}'
raise ValueError(msg) from e
def _mark_ok(self, msg=None) -> QResult:
qr = QResult(ok=True, msg=msg, line=self.last_line, query_result=None)
self.results.append(qr)
self.results_history.append(qr)
return qr
def _mark_failure(self, msg) -> QResult:
qr = QResult(ok=False, msg=msg, line=self.last_line, query_result=None)
self.results.append(qr)
self.results_history.append(qr)
return qr
def _mark_query_result(self, res, msg=None) -> QResult:
qr = QResult(ok=True, msg=msg, line=self.last_line, query_result=res)
self.results.append(qr)
self.results_history.append(qr)
return qr
# def get_results(self) -> List[QResult]:
# """ Returns the last results and drops them. """
# r = self.results
# self.results = []
# return r
# def get_results_log_errors(self):
# for r in self.get_results():
# if not r.ok:
# logger.error(r)
def _get_type(self, type_name):
if type_name not in self.types:
msg = f'Could not find type {type_name!r}'
raise Invalid(msg)
return self.types[type_name]
def interpret_NewOType(self, s: NewOType) -> QResult:
if s.type_name in self.types:
msg = f'Already know find type {s.type_name!r}'
raise Invalid(msg)
self.types[s.type_name] = OType()
return self._mark_ok()
def interpret_NewParentRelation(self, s: NewParentRelation) -> QResult:
t = self._get_type(s.type_name)
if s.parent_name in t.t_parents:
msg = f'Already set relationship.'
raise Invalid(msg)
t.t_parents[s.parent_name] = s.compulsory
return self._mark_ok()
def interpret_Comment(self, s: Comment) -> QResult:
return self._mark_ok(s.line)
def interpret_ShowState(self, s: ShowState) -> QResult:
m = self.info()
return self._mark_ok(m)
def interpret_NewAbility(self, s: NewAbility) -> QResult:
t = self._get_type(s.type_name)
if s.ability_name in t.t_abilities:
msg = f'Already set ability {s.ability_name!r}.'
raise Invalid(msg)
t.t_abilities[s.ability_name] = s.title
return self._mark_ok()
def interpret_NewObject(self, s: NewObject) -> QResult:
t = self._get_type(s.type_name)
main_name = s.identifiers[0]
others = s.identifiers[1:]
if main_name in t.t_objects:
msg = f'Already know object {main_name!r}.'
raise Invalid(msg)
t.t_objects[main_name] = ob = Object(main_name=main_name, others=others, type_name=s.type_name)
for alias in others:
if alias in t.t_aliases:
msg = f'Already know alias {alias!r}.'
raise Invalid(msg)
t.t_aliases[alias] = ob
for scp in self.child_parent_relations:
if self.object_matches(ob, scp.child_match):
for parent in self.get_resources(scp.parent_match):
self.set_relationship(ob, parent)
if self.object_matches(ob, scp.parent_match):
for child in self.get_resources(scp.child_match):
self.set_relationship(child, ob)
return self._mark_ok()
def set_relationship(self, child: Object, parent: Object):
p = list(get_parents_and_self(parent))
if child in p:
msg = f'Cannot set parent-relation because child is a parent of parent.' \
f'\nParent: {parent}' \
f'\nChild: {child}'
raise Invalid(msg)
child.parents[parent.main_name] = parent
parent.children[child.main_name] = child
def interpret_SetChildParentRelation(self, s: SetChildParentRelation) -> QResult:
for parent in self.get_resources(s.parent_match):
for child in self.get_resources(s.child_match):
self.set_relationship(child, parent)
# make sure no recursion
# p = list(get_parents_and_self(parent))
# if child in p:
# msg = f'Cannot set parent-relation because child is a parent of parent.' \
# f'\nParent: {parent}' \
# f'\nChild: {child}' \
# f'\ns: {s}'
# raise Invalid(msg)
#
# child.parents[parent.main_name] = parent
# parent.children[child.main_name] = child
self.child_parent_relations.append(s)
return self._mark_ok()
def interpret_NewProperty(self, s: NewProperty) -> QResult:
t = self._get_type(s.type_name)
if s.property_name in t.t_properties:
msg = f'Already set property {s.property_name!r}.'
raise Invalid(msg)
t.t_properties[s.property_name] = s.title
return self._mark_ok()
def interpret_SetProperty(self, s: SetProperty) -> QResult:
for r in self.get_resources(s.resource_match):
t = self.types[r.type_name]
if s.property_name not in t.t_properties:
msg = f'Cannot set property {s.property_name!r} for object {r.main_name!r} of type {r.type_name!r}.'
raise Invalid(msg)
r.properties[s.property_name].append(s.context)
return self._mark_ok()
def interpret_Allow(self, s: Allow) -> QResult:
self.allows.append(s)
return self._mark_ok()
def object_matches(self, ob: Object, rm: ResourceMatch):
if isinstance(rm, ByPattern):
if (ob.type_name != rm.type_name):
return False
for identifier in [ob.main_name] + ob.others:
if pattern_matches(rm.pattern, identifier):
return True
return False
elif isinstance(rm, SingleResourceMatch):
if (ob.type_name != rm.type_name):
return False
return rm.identifier in [ob.main_name] + ob.others
else:
raise NotImplementedError(rm)
def get_resources(self, rm: ResourceMatch) -> Iterator[Object]:
if isinstance(rm, ByPattern):
t = self._get_type(rm.type_name)
for obname, ob in list(t.t_objects.items()):
for identifier in [ob.main_name] + ob.others:
if pattern_matches(rm.pattern, identifier):
yield ob
elif isinstance(rm, SingleResourceMatch):
t = self._get_type(rm.type_name)
if rm.identifier in t.t_objects:
yield t.t_objects[rm.identifier]
elif rm.identifier in t.t_aliases:
yield t.t_aliases[rm.identifier]
else:
raise NotImplementedError(rm)
def get_resource(self, rm: SingleResourceMatch) -> Object:
t = self.types[rm.type_name]
for obname, ob in list(t.t_objects.items()):
for identifier in [ob.main_name] + ob.others:
if rm.identifier == identifier:
return ob
msg = f'Could not find resource corresponding to {rm}'
raise CouldNotFindResource(msg)
def interpret_QueryIS(self, query: QueryIS) -> QResult:
# logger.debug(f'query {query}')
user = self.get_resource(query.user)
context = self.get_resource(query.context)
t = self._get_type(context.type_name)
ability = query.ability
if not ability in t.t_abilities:
msg = f'Unknown ability {ability!r} for object of type {context.type_name!r}.'
msg += f'\nKnown: {",".join(t.t_abilities)}.'
raise Invalid(msg)
properties = get_active_properties(user, context)
# logger.info('properties: %s' % properties)
context_parents = list(get_parents_and_self(context))
user_parents = list(get_parents_and_self(user))
msg = 'Active properties: %s' % properties
msg += f'\nuser hierarchy:'
for p in user_parents:
msg += f'\n - {p.type_name} : {p.main_name}'
msg += f'\nresource hierarchy: '
for p in context_parents:
msg += f'\n - {p.type_name} : {p.main_name}'
for allow in self.allows:
c1 = any(rmatch(allow.user_match, _) for _ in user_parents)
c2 = amatch(allow.ability_match, ability)
c3 = any(rmatch(allow.context_match, _) for _ in context_parents)
c4 = cmatch(allow.condition, properties)
ok = c1 and c2 and c3 and c4
if ok:
return self._mark_query_result(True)
else:
pass
msg += f'\nfalse (user match {c1}, amatch {c2}, context match {c3}, condition match{c4})\n for {allow}'
return self._mark_query_result(False, msg)
def interpret_QueryHAS(self, query: QueryHAS) -> QResult:
# logger.debug(f'query {query}')
user = self.get_resource(query.user)
context = self.get_resource(query.context)
properties = get_active_properties(user, context)
# logger.debug('properties: %s' % properties)
res = query.property in properties
return self._mark_query_result(res)
def interpret_QueryGetProperties(self, query: QueryGetProperties) -> QResult:
user = self.get_resource(query.user)
context = self.get_resource(query.context)
properties = get_active_properties(user, context)
return self._mark_query_result(properties)
def parse_and_interpret(self, src: str) -> List[QResult]:
res = []
for line, statement in parse_string(src):
r = self.interpret(line, statement)
assert isinstance(r, QResult), line
res.append(r)
return res
def get_history(self) -> str:
res = []
for s in reversed(self.results_history):
res.append(str(s))
return "\n".join(res)
def amatch(am: AbilityMatch, ability):
if isinstance(am, AbilityMatchByPattern):
if pattern_matches(am.pattern, ability):
return True
return False
else:
raise NotImplementedError(am)
def cmatch(cm: ConditionMatch, properties: Dict[str, bool]):
if isinstance(cm, Always):
return True
if isinstance(cm, AttributeMatch):
for p, v in properties.items():
if v and pattern_matches(cm.pattern, p):
return True
return False
raise NotImplementedError(cm)
def get_active_properties(user: Object, context: Object):
user_parents = list(get_parents_and_self(user))
context_parents = list(get_parents_and_self(context))
properties = {}
# Now set the properties
for cp in context_parents:
for up in user_parents:
for pname, matches in up.properties.items():
for match in matches:
if rmatch(match, cp):
properties[pname] = True
return properties
def get_parents_and_self(ob: Object) -> Iterator[Object]:
for parent in ob.parents.values():
yield from get_parents_and_self(parent)
yield ob
def rmatch(rm: ResourceMatch, ob: Object):
if isinstance(rm, ByPattern):
if rm.type_name != ob.type_name:
return False
for identifier in [ob.main_name] + ob.others:
if pattern_matches(rm.pattern, identifier):
return True
return False
if isinstance(rm, SingleResourceMatch):
if rm.type_name != ob.type_name:
return False
if rm.identifier == ob.main_name:
return True
if rm.identifier in ob.others:
return True
return False
elif isinstance(rm, AndMatch):
matches = (rmatch(_, ob) for _ in rm.ops)
return all(matches)
elif isinstance(rm, HasAttributes):
# XXX
matches = (_ in ob.properties for _ in rm.attributes)
return all(matches)
else:
raise NotImplementedError(rm)
def pattern_matches(pattern, identifier):
regexp = wildcard_to_regexp(pattern)
return regexp.match(identifier)
|
zuper-auth-z6
|
/zuper-auth-z6-6.0.1.tar.gz/zuper-auth-z6-6.0.1/src/zuper_auth/interpret.py
|
interpret.py
|
from dataclasses import dataclass
from typing import Callable, Iterator, List, Optional, Tuple
class Statement:
def to_line(self) -> str:
''' Returns the line that can be parsed to this statement. '''
return str(self)
class Storage:
parsing_functions = {}
def parse_function(f: Callable) -> Callable:
_, token = f.__name__.split('_', maxsplit=1)
Storage.parsing_functions[token] = f
return f
@dataclass
class NewOType(Statement):
type_name: str
title: Optional[str] = None
@dataclass
class Comment(Statement):
line: str
@parse_function
def parse_REM(rest: str) -> Tuple[Statement, str]:
return Comment(rest), ''
@dataclass
class ShowState(Statement):
pass
@parse_function
def parse_SHOW_STATE(rest: str) -> Tuple[Statement, str]:
return ShowState(), ''
@parse_function
def parse_TYPE(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
return NewOType(type_name=type_name), rest
@dataclass
class NewAbility(Statement):
'ABILITY domain domain-create-organization '
type_name: str
ability_name: str
title: Optional[str] = None
@parse_function
def parse_ABILITY(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
ability_name, rest = get_one_token(rest)
return NewAbility(type_name=type_name, ability_name=ability_name), rest
@dataclass
class NewParentRelation(Statement):
"PARENT type_name parent_name"
type_name: str
parent_name: str
compulsory: bool
@parse_function
def parse_PARENT(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
parent_name, rest = get_one_token(rest)
return NewParentRelation(type_name=type_name, parent_name=parent_name, compulsory=False), rest
@dataclass
class NewProperty(Statement):
''' PROPERTY type_name name title '''
type_name: str
property_name: str
title: Optional[str] = None
@parse_function
def parse_PROPERTY(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
property_name, rest = get_one_token(rest)
return NewProperty(type_name=type_name, property_name=property_name), rest
@dataclass
class SetProperty(Statement):
''' FOR <> SET property_name IN <> '''
resource_match: 'ResourceMatch'
property_name: str
context: 'ResourceMatch'
@parse_function
def parse_FOR(rest0: str) -> Tuple[Statement, str]:
resource_match, rest = parse_resource_match(rest0)
rest = skip_one_token('SET', rest)
property_name, rest = get_one_token(rest)
if rest:
rest = skip_one_token('IN', rest)
context, rest = parse_resource_match(rest)
else:
context = ByPattern('*', '*')
return SetProperty(resource_match, property_name, context), rest
@dataclass
class NewRelation(Statement):
relation_name: str
types: List[str]
@dataclass
class NewObject(Statement):
''' NEW challenge 12 aido-admin aido-admin '''
type_name: str
identifiers: List[str]
@parse_function
def parse_NEW(rest0: str) -> Tuple[NewObject, str]:
type_name, rest = parse_until(' ', rest0)
identifiers = rest.split(' ')
return NewObject(type_name, identifiers), ''
class ResourceMatch:
pass
@dataclass
class SingleResourceMatch(ResourceMatch):
type_name: str
identifier: str
def __post_init__(self):
if '*' in self.identifier:
msg = 'Expected a single resource, not a pattern here.'
raise ValueError(msg)
# class ByIdentifier(ResourceMatch):
# ''' challenge:12 '''
# type_name: str
# identifier: str
#
@dataclass
class ByPattern(ResourceMatch):
''' challenge:aido* '''
type_name: str
pattern: str
def __post_init__(self):
if not self.type_name or not self.pattern:
raise ValueError(self)
@dataclass
class HasAttributes(ResourceMatch):
attributes: List[str]
@dataclass
class AndMatch(ResourceMatch):
ops: List[ResourceMatch]
def parse_single_resource_match(rest0) -> Tuple[SingleResourceMatch, str]:
type_name, rest = parse_until(':', rest0, required=True)
identifier, rest = parse_until(' ', rest)
return SingleResourceMatch(type_name=type_name, identifier=identifier), rest
def parse_resource_match(rest0: str) -> Tuple[ResourceMatch, str]:
if not rest0:
raise ValueError(rest0)
type_name, rest = parse_until(':', rest0, required=True)
pattern, rest = parse_until(' ', rest)
if '*' in type_name or '*' in pattern:
bp = ByPattern(type_name, pattern)
else:
bp = SingleResourceMatch(type_name, pattern)
if rest.startswith('['):
n = rest.index(']')
interesting = rest[1:n]
attributes = interesting.strip().split()
rest = rest[n + 1:]
bp = AndMatch([HasAttributes(attributes), bp])
try:
return bp, rest
except ValueError as e:
msg = f'Cannot parse resource match {rest0!r}'
raise ValueError(msg) from e
@dataclass
class SetChildParentRelation(Statement):
''' SUB group:one organization:aido '''
child_match: ResourceMatch
parent_match: ResourceMatch
@parse_function
def parse_SUB(rest0) -> Tuple[Statement, str]:
child_match, rest = parse_resource_match(rest0)
parent_match, rest = parse_resource_match(rest)
return SetChildParentRelation(child_match, parent_match), rest
"""
SUB challenge:* domain:1
ALLOW <name> TO <Ability> IN <context> IF challenge-owner
"""
class Query0(Statement):
pass
@dataclass
class QueryIS(Query0):
''' IS <res> ALLOWED ability IN <context> '''
user: 'SingleResourceMatch'
ability: str
context: 'SingleResourceMatch'
@parse_function
def parse_IS(rest0) -> Tuple[QueryIS, str]:
user, rest = parse_single_resource_match(rest0)
rest = skip_one_token('ALLOWED', rest)
ability, rest = get_one_token(rest)
rest = skip_one_token('IN', rest)
context, rest = parse_single_resource_match(rest)
return QueryIS(user, ability, context), rest
@dataclass
class QueryHAS(Query0):
''' HAS <res> PROPERTY ability IN <context> '''
user: 'SingleResourceMatch'
property: str
context: 'SingleResourceMatch'
@parse_function
def parse_HAS(rest0) -> Tuple[QueryHAS, str]:
user, rest = parse_single_resource_match(rest0)
rest = skip_one_token('PROPERTY', rest)
property, rest = get_one_token(rest)
rest = skip_one_token('IN', rest)
context, rest = parse_single_resource_match(rest)
return QueryHAS(user, property, context), rest
@dataclass
class QueryGetProperties(Query0):
''' PROPERTIES <r> IN <context> '''
user: 'SingleResourceMatch'
context: 'SingleResourceMatch'
@parse_function
def parse_PROPERTIES(rest0) -> Tuple[QueryGetProperties, str]:
user, rest = parse_single_resource_match(rest0)
rest = skip_one_token('IN', rest)
context, rest = parse_single_resource_match(rest)
return QueryGetProperties(user, context), rest
class AbilityMatch:
pass
@dataclass
class AbilityMatchByPattern(AbilityMatch):
pattern: str
def __post_init__(self):
if ':' in self.pattern:
raise ValueError(self)
def parse_ability_match(rest) -> Tuple[AbilityMatch, str]:
pattern, rest = get_one_token(rest)
return AbilityMatchByPattern(pattern), rest
class ConditionMatch:
pass
@dataclass
class AttributeMatch(ConditionMatch):
pattern: str
def __post_init__(self):
if ':' in self.pattern:
raise ValueError(self)
def parse_condition_match(rest) -> Tuple[ConditionMatch, str]:
pattern, rest = get_one_token(rest)
return AttributeMatch(pattern), rest
class Always(ConditionMatch):
pass
@dataclass
class Allow(Statement):
''' ALLOW <user match> TO <ability match> IN <resource match> [IF <condition match>] '''
user_match: ResourceMatch
ability_match: AbilityMatch
context_match: ResourceMatch
condition: ConditionMatch
@parse_function
def parse_ALLOW(rest0) -> Tuple[Allow, str]:
user_match, rest = parse_resource_match(rest0)
rest = skip_one_token('TO', rest)
ability_match, rest = parse_ability_match(rest)
rest = skip_one_token('IN', rest)
context_match, rest = parse_resource_match(rest)
if rest:
rest = skip_one_token('IF', rest)
condition_match, rest = parse_condition_match(rest)
else:
condition_match = Always()
return Allow(user_match, ability_match, context_match, condition_match), rest
def remove_comment(line: str) -> str:
try:
i = line.index('#')
except:
return line
else:
return line[:i]
def parse_string(s) -> Iterator[Tuple[str, Statement]]:
s = s.strip()
lines = s.split('\n')
lines = [remove_comment(_) for _ in lines]
lines = [_.strip() for _ in lines]
lines = [_ for _ in lines if _]
for line in lines:
token, rest = get_one_token(line)
functions = Storage.parsing_functions
if token not in functions:
raise NotImplementedError((token, line))
f = functions[token]
try:
statement, rest = f(rest)
except ValueError as e:
msg = f'Cannot parse line {line!r}.'
raise ValueError(msg) from e
yield line, statement
def get_one_token(line: str):
line = line.lstrip()
return parse_until(' ', line)
def skip_one_token(expect: str, line: str):
token, rest = get_one_token(line)
if expect != token:
msg = f'Expected {expect!r} at the beginning of {line!r}.'
raise ValueError(msg)
return rest
def parse_until(sep: str, rest: str, required=False) -> Tuple[str, str]:
rest = rest.lstrip()
if not sep in rest:
if required:
msg = f'Could not find separator {sep!r} in {rest!r}.'
raise ValueError(msg)
return rest, ''
# msg = f'Cannot find separator {sep!r} in {rest!r}.'
# raise ValueError(msg)
tokens = rest.split(sep, maxsplit=1)
return tokens[0], tokens[1]
|
zuper-auth-z6
|
/zuper-auth-z6-6.0.1.tar.gz/zuper-auth-z6-6.0.1/src/zuper_auth/parsing.py
|
parsing.py
|
__version__ = '6.0.1'
from zuper_commons.logs import ZLogger
logger = ZLogger(__name__)
logger.info(f'version: {__version__}')
|
zuper-auth-z6
|
/zuper-auth-z6-6.0.1.tar.gz/zuper-auth-z6-6.0.1/src/zuper_auth/__init__.py
|
__init__.py
|
from zuper_auth.interpret import Interpreter
from .test_parsing1 import assert_true
def test_user_after():
src = """
TYPE user
TYPE server
ABILITY server admin
NEW server local
NEW user alice
TYPE group
PARENT user group
NEW group admins
ALLOW group:admins TO admin IN server:local
SUB user:* group:admins
NEW user bob
SHOW_STATE
"""
i = Interpreter()
i.parse_and_interpret(src)
print(i.info())
assert_true(i, 'IS user:alice ALLOWED admin IN server:local')
assert_true(i, 'IS user:bob ALLOWED admin IN server:local')
|
zuper-auth-z6
|
/zuper-auth-z6-6.0.1.tar.gz/zuper-auth-z6-6.0.1/src/zuper_auth_tests/test_user.py
|
test_user.py
|
from zuper_auth.interpret import Interpreter
from .test_parsing1 import assert_eq
def test1():
src = """
TYPE domain
TYPE organization
TYPE user
PROPERTY user domain-owner
PARENT organization domain
NEW domain global
NEW organization aido
SUB organization:aido domain:global
NEW user tizio
FOR user:tizio SET domain-owner IN domain:global
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_eq(i, {'domain-owner': True}, 'PROPERTIES user:tizio IN domain:global')
assert_eq(i, {'domain-owner': True}, 'PROPERTIES user:tizio IN organization:aido')
def test2():
src = """
TYPE user
TYPE user-group
PARENT user user-group
TYPE resource
ABILITY resource read
NEW user tizio
NEW user-group G
SUB user:tizio user-group:G
NEW resource r1
ALLOW user-group:G TO * IN resource:r1
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_eq(i, True, 'IS user:tizio ALLOWED read IN resource:r1')
if __name__ == '__main__':
test1()
|
zuper-auth-z6
|
/zuper-auth-z6-6.0.1.tar.gz/zuper-auth-z6-6.0.1/src/zuper_auth_tests/test_aido.py
|
test_aido.py
|
from nose.tools import assert_equal
from zuper_auth.interpret import Interpreter
def test1():
src = """
TYPE domain
TYPE organization
TYPE user
PROPERTY user organization-owner
PARENT organization domain
ABILITY organization create-repos
NEW domain global
NEW organization aido
SUB organization:aido domain:global
NEW user yes-because-owner-aido
NEW user yes-because-owner-global
NEW user yes-because-direct
NEW user no
FOR user:yes-because-owner-aido SET organization-owner IN organization:aido
FOR user:yes-because-owner-global SET organization-owner IN domain:global
ALLOW user:* TO create-repos IN organization:* IF organization-owner
ALLOW user:yes-because-direct TO create-repos IN organization:aido
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_true(i, 'HAS user:yes-because-owner-aido PROPERTY organization-owner IN organization:aido')
assert_true(i, 'IS user:yes-because-owner-aido ALLOWED create-repos IN organization:aido')
assert_true(i, 'HAS user:yes-because-owner-global PROPERTY organization-owner IN domain:global')
assert_true(i, 'HAS user:yes-because-owner-global PROPERTY organization-owner IN organization:aido')
assert_true(i, 'IS user:yes-because-owner-global ALLOWED create-repos IN organization:aido')
assert_false(i, 'HAS user:yes-because-direct PROPERTY organization-owner IN organization:aido')
assert_true(i, 'IS user:yes-because-direct ALLOWED create-repos IN organization:aido')
assert_false(i, 'IS user:no ALLOWED create-repos IN organization:aido')
def test2_attrs():
src = """
TYPE challenge
PROPERTY challenge private
PROPERTY challenge public
TYPE user
ABILITY challenge read
NEW challenge pri1
FOR challenge:pri1 SET private
NEW challenge pub1
FOR challenge:pub1 SET public
NEW user john
ALLOW user:* TO read IN challenge:* [ public ]
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_true(i, 'IS user:john ALLOWED read IN challenge:pub1')
assert_false(i, 'IS user:john ALLOWED read IN challenge:pri1')
def test_rem():
src = """
REM comment
REM comment two
"""
i = Interpreter()
i.parse_and_interpret(src)
def assert_eq(i: Interpreter, val, s):
ress = i.parse_and_interpret(s)
res = ress[0]
print(res.msg)
if not res.ok:
raise Exception(res)
assert_equal(res.query_result, val, s)
def assert_true(i, s):
assert_eq(i, True, s)
def assert_false(i, s):
assert_eq(i, False, s)
if __name__ == '__main__':
test1()
|
zuper-auth-z6
|
/zuper-auth-z6-6.0.1.tar.gz/zuper-auth-z6-6.0.1/src/zuper_auth_tests/test_parsing1.py
|
test_parsing1.py
|
from setuptools import setup, find_packages
def get_version(filename):
import ast
version = None
with open(filename) as f:
for line in f:
if line.startswith('__version__'):
version = ast.parse(line).body[0].value.s
break
else:
raise ValueError('No version found in %r.' % filename)
if version is None:
raise ValueError(filename)
return version
version = get_version('src/zuper_auth/__init__.py')
import os
description = """"""
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='zuper-auth',
version=version,
package_dir={'': 'src'},
packages=find_packages('src'),
zip_safe=True,
entry_points={
'console_scripts': [
]
},
install_requires=[
],
)
|
zuper-auth
|
/zuper-auth-2.0.1.tar.gz/zuper-auth-2.0.1/setup.py
|
setup.py
|
from collections import defaultdict
from dataclasses import dataclass, field
from typing import *
from zuper_commons.text.zc_wildcards import wildcard_to_regexp
from zuper_typing import debug_print
from .parsing import (AbilityMatch, AbilityMatchByPattern, Allow, Always, AndMatch, AttributeMatch, ByPattern, Comment,
ConditionMatch, HasAttributes, NewAbility, NewObject, NewOType, NewParentRelation, NewProperty,
parse_string, QueryGetProperties, QueryHAS, QueryIS, ResourceMatch, SetChildParentRelation,
SetProperty, ShowState, SingleResourceMatch, Statement)
@dataclass
class Object:
main_name: str
others: List[str]
type_name: str
parents: Dict[str, 'Object'] = field(default_factory=dict)
children: Dict[str, 'Object'] = field(default_factory=dict)
properties: Dict[str, List[ResourceMatch]] = field(default_factory=lambda: defaultdict(list))
@dataclass
class OType:
t_parents: Dict[str, bool] = field(default_factory=dict)
t_abilities: Dict[str, str] = field(default_factory=dict)
t_objects: Dict[str, Object] = field(default_factory=dict)
t_aliases: Dict[str, Object] = field(default_factory=dict)
t_properties: Dict[str, str] = field(default_factory=dict)
class AuthException(Exception):
pass
class Invalid(AuthException):
pass
class CouldNotFindResource(AuthException):
pass
@dataclass
class QResult:
ok: bool
line: str
query_result: Any
msg: Optional[str]
@dataclass
class Interpreter:
types: Dict[str, OType] = field(default_factory=dict)
allows: List[Allow] = field(default_factory=list)
statements_history: List[Statement] = field(default_factory=list)
results: List[QResult] = field(default_factory=list)
results_history: List[QResult] = field(default_factory=list)
last_line: str = None
functions: Dict[str, Callable] = field(default_factory=dict)
child_parent_relations: List[SetChildParentRelation] = field(default_factory=list)
# def __post_init__(self):
# # self.types = {}
# # self.allows = []
# # self.statements_history = []
# # self.results = []
# # self.results_history = []
# self.last_line = None
#
# self.functions = {}
def info(self) -> str:
s = []
for k, v in self.types.items():
s.append(k)
s.append(debug_print(v.t_objects))
return "\n".join(s)
def knows(self, type_name: str, object_identifier: str):
t = self._get_type(type_name)
return object_identifier in t.t_objects
def interpret(self, line: str, statement: Statement) -> QResult:
self.last_line = line
self.statements_history.append(statement)
t = type(statement).__name__
if t in self.functions:
ff = self.functions[t]
else:
f = f'interpret_{t}'
if not hasattr(self, f):
msg = f'Cannot find {f}'
raise NotImplementedError(msg)
ff = getattr(self, f)
self.functions[t] = ff
try:
r = ff(statement)
assert isinstance(r, QResult), statement
return r
except AuthException as e:
return self._mark_failure(str(e))
except (SystemExit, KeyboardInterrupt):
raise
except BaseException as e:
msg = f'Cannot intepret statement {statement}'
raise ValueError(msg) from e
def _mark_ok(self, msg=None) -> QResult:
qr = QResult(ok=True, msg=msg, line=self.last_line, query_result=None)
self.results.append(qr)
self.results_history.append(qr)
return qr
def _mark_failure(self, msg) -> QResult:
qr = QResult(ok=False, msg=msg, line=self.last_line, query_result=None)
self.results.append(qr)
self.results_history.append(qr)
return qr
def _mark_query_result(self, res, msg=None) -> QResult:
qr = QResult(ok=True, msg=msg, line=self.last_line, query_result=res)
self.results.append(qr)
self.results_history.append(qr)
return qr
# def get_results(self) -> List[QResult]:
# """ Returns the last results and drops them. """
# r = self.results
# self.results = []
# return r
# def get_results_log_errors(self):
# for r in self.get_results():
# if not r.ok:
# logger.error(r)
def _get_type(self, type_name):
if type_name not in self.types:
msg = f'Could not find type {type_name!r}'
raise Invalid(msg)
return self.types[type_name]
def interpret_NewOType(self, s: NewOType) -> QResult:
if s.type_name in self.types:
msg = f'Already know find type {s.type_name!r}'
raise Invalid(msg)
self.types[s.type_name] = OType()
return self._mark_ok()
def interpret_NewParentRelation(self, s: NewParentRelation) -> QResult:
t = self._get_type(s.type_name)
if s.parent_name in t.t_parents:
msg = f'Already set relationship.'
raise Invalid(msg)
t.t_parents[s.parent_name] = s.compulsory
return self._mark_ok()
def interpret_Comment(self, s: Comment) -> QResult:
return self._mark_ok(s.line)
def interpret_ShowState(self, s: ShowState) -> QResult:
m = self.info()
return self._mark_ok(m)
def interpret_NewAbility(self, s: NewAbility) -> QResult:
t = self._get_type(s.type_name)
if s.ability_name in t.t_abilities:
msg = f'Already set ability {s.ability_name!r}.'
raise Invalid(msg)
t.t_abilities[s.ability_name] = s.title
return self._mark_ok()
def interpret_NewObject(self, s: NewObject) -> QResult:
t = self._get_type(s.type_name)
main_name = s.identifiers[0]
others = s.identifiers[1:]
if main_name in t.t_objects:
msg = f'Already know object {main_name!r}.'
raise Invalid(msg)
t.t_objects[main_name] = ob = Object(main_name=main_name, others=others, type_name=s.type_name)
for alias in others:
if alias in t.t_aliases:
msg = f'Already know alias {alias!r}.'
raise Invalid(msg)
t.t_aliases[alias] = ob
for scp in self.child_parent_relations:
if self.object_matches(ob, scp.child_match):
for parent in self.get_resources(scp.parent_match):
self.set_relationship(ob, parent)
if self.object_matches(ob, scp.parent_match):
for child in self.get_resources(scp.child_match):
self.set_relationship(child, ob)
return self._mark_ok()
def set_relationship(self, child: Object, parent: Object):
p = list(get_parents_and_self(parent))
if child in p:
msg = f'Cannot set parent-relation because child is a parent of parent.' \
f'\nParent: {parent}' \
f'\nChild: {child}'
raise Invalid(msg)
child.parents[parent.main_name] = parent
parent.children[child.main_name] = child
def interpret_SetChildParentRelation(self, s: SetChildParentRelation) -> QResult:
for parent in self.get_resources(s.parent_match):
for child in self.get_resources(s.child_match):
self.set_relationship(child, parent)
# make sure no recursion
# p = list(get_parents_and_self(parent))
# if child in p:
# msg = f'Cannot set parent-relation because child is a parent of parent.' \
# f'\nParent: {parent}' \
# f'\nChild: {child}' \
# f'\ns: {s}'
# raise Invalid(msg)
#
# child.parents[parent.main_name] = parent
# parent.children[child.main_name] = child
self.child_parent_relations.append(s)
return self._mark_ok()
def interpret_NewProperty(self, s: NewProperty) -> QResult:
t = self._get_type(s.type_name)
if s.property_name in t.t_properties:
msg = f'Already set property {s.property_name!r}.'
raise Invalid(msg)
t.t_properties[s.property_name] = s.title
return self._mark_ok()
def interpret_SetProperty(self, s: SetProperty) -> QResult:
for r in self.get_resources(s.resource_match):
t = self.types[r.type_name]
if s.property_name not in t.t_properties:
msg = f'Cannot set property {s.property_name!r} for object {r.main_name!r} of type {r.type_name!r}.'
raise Invalid(msg)
r.properties[s.property_name].append(s.context)
return self._mark_ok()
def interpret_Allow(self, s: Allow) -> QResult:
self.allows.append(s)
return self._mark_ok()
def object_matches(self, ob: Object, rm: ResourceMatch):
if isinstance(rm, ByPattern):
if (ob.type_name != rm.type_name):
return False
for identifier in [ob.main_name] + ob.others:
if pattern_matches(rm.pattern, identifier):
return True
return False
elif isinstance(rm, SingleResourceMatch):
if (ob.type_name != rm.type_name):
return False
return rm.identifier in [ob.main_name] + ob.others
else:
raise NotImplementedError(rm)
def get_resources(self, rm: ResourceMatch) -> Iterator[Object]:
if isinstance(rm, ByPattern):
t = self._get_type(rm.type_name)
for obname, ob in list(t.t_objects.items()):
for identifier in [ob.main_name] + ob.others:
if pattern_matches(rm.pattern, identifier):
yield ob
elif isinstance(rm, SingleResourceMatch):
t = self._get_type(rm.type_name)
if rm.identifier in t.t_objects:
yield t.t_objects[rm.identifier]
elif rm.identifier in t.t_aliases:
yield t.t_aliases[rm.identifier]
else:
raise NotImplementedError(rm)
def get_resource(self, rm: SingleResourceMatch) -> Object:
t = self.types[rm.type_name]
for obname, ob in list(t.t_objects.items()):
for identifier in [ob.main_name] + ob.others:
if rm.identifier == identifier:
return ob
msg = f'Could not find resource corresponding to {rm}'
raise CouldNotFindResource(msg)
def interpret_QueryIS(self, query: QueryIS) -> QResult:
# logger.debug(f'query {query}')
user = self.get_resource(query.user)
context = self.get_resource(query.context)
t = self._get_type(context.type_name)
ability = query.ability
if not ability in t.t_abilities:
msg = f'Unknown ability {ability!r} for object of type {context.type_name!r}.'
msg += f'\nKnown: {",".join(t.t_abilities)}.'
raise Invalid(msg)
properties = get_active_properties(user, context)
# logger.info('properties: %s' % properties)
context_parents = list(get_parents_and_self(context))
user_parents = list(get_parents_and_self(user))
msg = 'Active properties: %s' % properties
msg += f'\nuser hierarchy:'
for p in user_parents:
msg += f'\n - {p.type_name} : {p.main_name}'
msg += f'\nresource hierarchy: '
for p in context_parents:
msg += f'\n - {p.type_name} : {p.main_name}'
for allow in self.allows:
c1 = any(rmatch(allow.user_match, _) for _ in user_parents)
c2 = amatch(allow.ability_match, ability)
c3 = any(rmatch(allow.context_match, _) for _ in context_parents)
c4 = cmatch(allow.condition, properties)
ok = c1 and c2 and c3 and c4
if ok:
return self._mark_query_result(True)
else:
pass
msg += f'\nfalse (user match {c1}, amatch {c2}, context match {c3}, condition match{c4})\n for {allow}'
return self._mark_query_result(False, msg)
def interpret_QueryHAS(self, query: QueryHAS) -> QResult:
# logger.debug(f'query {query}')
user = self.get_resource(query.user)
context = self.get_resource(query.context)
properties = get_active_properties(user, context)
# logger.debug('properties: %s' % properties)
res = query.property in properties
return self._mark_query_result(res)
def interpret_QueryGetProperties(self, query: QueryGetProperties) -> QResult:
user = self.get_resource(query.user)
context = self.get_resource(query.context)
properties = get_active_properties(user, context)
return self._mark_query_result(properties)
def parse_and_interpret(self, src: str) -> List[QResult]:
res = []
for line, statement in parse_string(src):
r = self.interpret(line, statement)
assert isinstance(r, QResult), line
res.append(r)
return res
def get_history(self) -> str:
res = []
for s in reversed(self.results_history):
res.append(str(s))
return "\n".join(res)
def amatch(am: AbilityMatch, ability):
if isinstance(am, AbilityMatchByPattern):
if pattern_matches(am.pattern, ability):
return True
return False
else:
raise NotImplementedError(am)
def cmatch(cm: ConditionMatch, properties: Dict[str, bool]):
if isinstance(cm, Always):
return True
if isinstance(cm, AttributeMatch):
for p, v in properties.items():
if v and pattern_matches(cm.pattern, p):
return True
return False
raise NotImplementedError(cm)
def get_active_properties(user: Object, context: Object):
user_parents = list(get_parents_and_self(user))
context_parents = list(get_parents_and_self(context))
properties = {}
# Now set the properties
for cp in context_parents:
for up in user_parents:
for pname, matches in up.properties.items():
for match in matches:
if rmatch(match, cp):
properties[pname] = True
return properties
def get_parents_and_self(ob: Object) -> Iterator[Object]:
for parent in ob.parents.values():
yield from get_parents_and_self(parent)
yield ob
def rmatch(rm: ResourceMatch, ob: Object):
if isinstance(rm, ByPattern):
if rm.type_name != ob.type_name:
return False
for identifier in [ob.main_name] + ob.others:
if pattern_matches(rm.pattern, identifier):
return True
return False
if isinstance(rm, SingleResourceMatch):
if rm.type_name != ob.type_name:
return False
if rm.identifier == ob.main_name:
return True
if rm.identifier in ob.others:
return True
return False
elif isinstance(rm, AndMatch):
matches = (rmatch(_, ob) for _ in rm.ops)
return all(matches)
elif isinstance(rm, HasAttributes):
# XXX
matches = (_ in ob.properties for _ in rm.attributes)
return all(matches)
else:
raise NotImplementedError(rm)
def pattern_matches(pattern, identifier):
regexp = wildcard_to_regexp(pattern)
return regexp.match(identifier)
|
zuper-auth
|
/zuper-auth-2.0.1.tar.gz/zuper-auth-2.0.1/src/zuper_auth/interpret.py
|
interpret.py
|
from dataclasses import dataclass
from typing import Callable, Iterator, List, Optional, Tuple
class Statement:
def to_line(self) -> str:
''' Returns the line that can be parsed to this statement. '''
return str(self)
class Storage:
parsing_functions = {}
def parse_function(f: Callable) -> Callable:
_, token = f.__name__.split('_', maxsplit=1)
Storage.parsing_functions[token] = f
return f
@dataclass
class NewOType(Statement):
type_name: str
title: Optional[str] = None
@dataclass
class Comment(Statement):
line: str
@parse_function
def parse_REM(rest: str) -> Tuple[Statement, str]:
return Comment(rest), ''
@dataclass
class ShowState(Statement):
pass
@parse_function
def parse_SHOW_STATE(rest: str) -> Tuple[Statement, str]:
return ShowState(), ''
@parse_function
def parse_TYPE(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
return NewOType(type_name=type_name), rest
@dataclass
class NewAbility(Statement):
'ABILITY domain domain-create-organization '
type_name: str
ability_name: str
title: Optional[str] = None
@parse_function
def parse_ABILITY(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
ability_name, rest = get_one_token(rest)
return NewAbility(type_name=type_name, ability_name=ability_name), rest
@dataclass
class NewParentRelation(Statement):
"PARENT type_name parent_name"
type_name: str
parent_name: str
compulsory: bool
@parse_function
def parse_PARENT(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
parent_name, rest = get_one_token(rest)
return NewParentRelation(type_name=type_name, parent_name=parent_name, compulsory=False), rest
@dataclass
class NewProperty(Statement):
''' PROPERTY type_name name title '''
type_name: str
property_name: str
title: Optional[str] = None
@parse_function
def parse_PROPERTY(rest: str) -> Tuple[Statement, str]:
type_name, rest = get_one_token(rest)
property_name, rest = get_one_token(rest)
return NewProperty(type_name=type_name, property_name=property_name), rest
@dataclass
class SetProperty(Statement):
''' FOR <> SET property_name IN <> '''
resource_match: 'ResourceMatch'
property_name: str
context: 'ResourceMatch'
@parse_function
def parse_FOR(rest0: str) -> Tuple[Statement, str]:
resource_match, rest = parse_resource_match(rest0)
rest = skip_one_token('SET', rest)
property_name, rest = get_one_token(rest)
if rest:
rest = skip_one_token('IN', rest)
context, rest = parse_resource_match(rest)
else:
context = ByPattern('*', '*')
return SetProperty(resource_match, property_name, context), rest
@dataclass
class NewRelation(Statement):
relation_name: str
types: List[str]
@dataclass
class NewObject(Statement):
''' NEW challenge 12 aido-admin aido-admin '''
type_name: str
identifiers: List[str]
@parse_function
def parse_NEW(rest0: str) -> Tuple[NewObject, str]:
type_name, rest = parse_until(' ', rest0)
identifiers = rest.split(' ')
return NewObject(type_name, identifiers), ''
class ResourceMatch:
pass
@dataclass
class SingleResourceMatch(ResourceMatch):
type_name: str
identifier: str
def __post_init__(self):
if '*' in self.identifier:
msg = 'Expected a single resource, not a pattern here.'
raise ValueError(msg)
# class ByIdentifier(ResourceMatch):
# ''' challenge:12 '''
# type_name: str
# identifier: str
#
@dataclass
class ByPattern(ResourceMatch):
''' challenge:aido* '''
type_name: str
pattern: str
def __post_init__(self):
if not self.type_name or not self.pattern:
raise ValueError(self)
@dataclass
class HasAttributes(ResourceMatch):
attributes: List[str]
@dataclass
class AndMatch(ResourceMatch):
ops: List[ResourceMatch]
def parse_single_resource_match(rest0) -> Tuple[SingleResourceMatch, str]:
type_name, rest = parse_until(':', rest0, required=True)
identifier, rest = parse_until(' ', rest)
return SingleResourceMatch(type_name=type_name, identifier=identifier), rest
def parse_resource_match(rest0: str) -> Tuple[ResourceMatch, str]:
if not rest0:
raise ValueError(rest0)
type_name, rest = parse_until(':', rest0, required=True)
pattern, rest = parse_until(' ', rest)
if '*' in type_name or '*' in pattern:
bp = ByPattern(type_name, pattern)
else:
bp = SingleResourceMatch(type_name, pattern)
if rest.startswith('['):
n = rest.index(']')
interesting = rest[1:n]
attributes = interesting.strip().split()
rest = rest[n + 1:]
bp = AndMatch([HasAttributes(attributes), bp])
try:
return bp, rest
except ValueError as e:
msg = f'Cannot parse resource match {rest0!r}'
raise ValueError(msg) from e
@dataclass
class SetChildParentRelation(Statement):
''' SUB group:one organization:aido '''
child_match: ResourceMatch
parent_match: ResourceMatch
@parse_function
def parse_SUB(rest0) -> Tuple[Statement, str]:
child_match, rest = parse_resource_match(rest0)
parent_match, rest = parse_resource_match(rest)
return SetChildParentRelation(child_match, parent_match), rest
"""
SUB challenge:* domain:1
ALLOW <name> TO <Ability> IN <context> IF challenge-owner
"""
class Query0(Statement):
pass
@dataclass
class QueryIS(Query0):
''' IS <res> ALLOWED ability IN <context> '''
user: 'SingleResourceMatch'
ability: str
context: 'SingleResourceMatch'
@parse_function
def parse_IS(rest0) -> Tuple[QueryIS, str]:
user, rest = parse_single_resource_match(rest0)
rest = skip_one_token('ALLOWED', rest)
ability, rest = get_one_token(rest)
rest = skip_one_token('IN', rest)
context, rest = parse_single_resource_match(rest)
return QueryIS(user, ability, context), rest
@dataclass
class QueryHAS(Query0):
''' HAS <res> PROPERTY ability IN <context> '''
user: 'SingleResourceMatch'
property: str
context: 'SingleResourceMatch'
@parse_function
def parse_HAS(rest0) -> Tuple[QueryHAS, str]:
user, rest = parse_single_resource_match(rest0)
rest = skip_one_token('PROPERTY', rest)
property, rest = get_one_token(rest)
rest = skip_one_token('IN', rest)
context, rest = parse_single_resource_match(rest)
return QueryHAS(user, property, context), rest
@dataclass
class QueryGetProperties(Query0):
''' PROPERTIES <r> IN <context> '''
user: 'SingleResourceMatch'
context: 'SingleResourceMatch'
@parse_function
def parse_PROPERTIES(rest0) -> Tuple[QueryGetProperties, str]:
user, rest = parse_single_resource_match(rest0)
rest = skip_one_token('IN', rest)
context, rest = parse_single_resource_match(rest)
return QueryGetProperties(user, context), rest
class AbilityMatch:
pass
@dataclass
class AbilityMatchByPattern(AbilityMatch):
pattern: str
def __post_init__(self):
if ':' in self.pattern:
raise ValueError(self)
def parse_ability_match(rest) -> Tuple[AbilityMatch, str]:
pattern, rest = get_one_token(rest)
return AbilityMatchByPattern(pattern), rest
class ConditionMatch:
pass
@dataclass
class AttributeMatch(ConditionMatch):
pattern: str
def __post_init__(self):
if ':' in self.pattern:
raise ValueError(self)
def parse_condition_match(rest) -> Tuple[ConditionMatch, str]:
pattern, rest = get_one_token(rest)
return AttributeMatch(pattern), rest
class Always(ConditionMatch):
pass
@dataclass
class Allow(Statement):
''' ALLOW <user match> TO <ability match> IN <resource match> [IF <condition match>] '''
user_match: ResourceMatch
ability_match: AbilityMatch
context_match: ResourceMatch
condition: ConditionMatch
@parse_function
def parse_ALLOW(rest0) -> Tuple[Allow, str]:
user_match, rest = parse_resource_match(rest0)
rest = skip_one_token('TO', rest)
ability_match, rest = parse_ability_match(rest)
rest = skip_one_token('IN', rest)
context_match, rest = parse_resource_match(rest)
if rest:
rest = skip_one_token('IF', rest)
condition_match, rest = parse_condition_match(rest)
else:
condition_match = Always()
return Allow(user_match, ability_match, context_match, condition_match), rest
def remove_comment(line: str) -> str:
try:
i = line.index('#')
except:
return line
else:
return line[:i]
def parse_string(s) -> Iterator[Tuple[str, Statement]]:
s = s.strip()
lines = s.split('\n')
lines = [remove_comment(_) for _ in lines]
lines = [_.strip() for _ in lines]
lines = [_ for _ in lines if _]
for line in lines:
token, rest = get_one_token(line)
functions = Storage.parsing_functions
if token not in functions:
raise NotImplementedError((token, line))
f = functions[token]
try:
statement, rest = f(rest)
except ValueError as e:
msg = f'Cannot parse line {line!r}.'
raise ValueError(msg) from e
yield line, statement
def get_one_token(line: str):
line = line.lstrip()
return parse_until(' ', line)
def skip_one_token(expect: str, line: str):
token, rest = get_one_token(line)
if expect != token:
msg = f'Expected {expect!r} at the beginning of {line!r}.'
raise ValueError(msg)
return rest
def parse_until(sep: str, rest: str, required=False) -> Tuple[str, str]:
rest = rest.lstrip()
if not sep in rest:
if required:
msg = f'Could not find separator {sep!r} in {rest!r}.'
raise ValueError(msg)
return rest, ''
# msg = f'Cannot find separator {sep!r} in {rest!r}.'
# raise ValueError(msg)
tokens = rest.split(sep, maxsplit=1)
return tokens[0], tokens[1]
|
zuper-auth
|
/zuper-auth-2.0.1.tar.gz/zuper-auth-2.0.1/src/zuper_auth/parsing.py
|
parsing.py
|
__version__ = '2.0.1'
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.info(f'zuper-auth {__version__}')
|
zuper-auth
|
/zuper-auth-2.0.1.tar.gz/zuper-auth-2.0.1/src/zuper_auth/__init__.py
|
__init__.py
|
from zuper_auth.interpret import Interpreter
from zuper_auth_tests.test_parsing1 import assert_true, assert_false
def test_user_after():
src = """
TYPE user
TYPE server
ABILITY server admin
NEW server local
NEW user alice
TYPE group
PARENT user group
NEW group admins
ALLOW group:admins TO admin IN server:local
SUB user:* group:admins
NEW user bob
SHOW_STATE
"""
i = Interpreter()
i.parse_and_interpret(src)
print(i.info())
assert_true(i, 'IS user:alice ALLOWED admin IN server:local')
assert_true(i, 'IS user:bob ALLOWED admin IN server:local')
|
zuper-auth
|
/zuper-auth-2.0.1.tar.gz/zuper-auth-2.0.1/src/zuper_auth_tests/test_user.py
|
test_user.py
|
from zuper_auth.interpret import Interpreter
from zuper_auth_tests.test_parsing1 import assert_eq
def test1():
src = """
TYPE domain
TYPE organization
TYPE user
PROPERTY user domain-owner
PARENT organization domain
NEW domain global
NEW organization aido
SUB organization:aido domain:global
NEW user tizio
FOR user:tizio SET domain-owner IN domain:global
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_eq(i, {'domain-owner': True}, 'PROPERTIES user:tizio IN domain:global')
assert_eq(i, {'domain-owner': True}, 'PROPERTIES user:tizio IN organization:aido')
def test2():
src = """
TYPE user
TYPE user-group
PARENT user user-group
TYPE resource
ABILITY resource read
NEW user tizio
NEW user-group G
SUB user:tizio user-group:G
NEW resource r1
ALLOW user-group:G TO * IN resource:r1
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_eq(i, True, 'IS user:tizio ALLOWED read IN resource:r1')
if __name__ == '__main__':
test1()
|
zuper-auth
|
/zuper-auth-2.0.1.tar.gz/zuper-auth-2.0.1/src/zuper_auth_tests/test_aido.py
|
test_aido.py
|
from nose.tools import assert_equal
from zuper_auth.interpret import Interpreter
def test1():
src = """
TYPE domain
TYPE organization
TYPE user
PROPERTY user organization-owner
PARENT organization domain
ABILITY organization create-repos
NEW domain global
NEW organization aido
SUB organization:aido domain:global
NEW user yes-because-owner-aido
NEW user yes-because-owner-global
NEW user yes-because-direct
NEW user no
FOR user:yes-because-owner-aido SET organization-owner IN organization:aido
FOR user:yes-because-owner-global SET organization-owner IN domain:global
ALLOW user:* TO create-repos IN organization:* IF organization-owner
ALLOW user:yes-because-direct TO create-repos IN organization:aido
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_true(i, 'HAS user:yes-because-owner-aido PROPERTY organization-owner IN organization:aido')
assert_true(i, 'IS user:yes-because-owner-aido ALLOWED create-repos IN organization:aido')
assert_true(i, 'HAS user:yes-because-owner-global PROPERTY organization-owner IN domain:global')
assert_true(i, 'HAS user:yes-because-owner-global PROPERTY organization-owner IN organization:aido')
assert_true(i, 'IS user:yes-because-owner-global ALLOWED create-repos IN organization:aido')
assert_false(i, 'HAS user:yes-because-direct PROPERTY organization-owner IN organization:aido')
assert_true(i, 'IS user:yes-because-direct ALLOWED create-repos IN organization:aido')
assert_false(i, 'IS user:no ALLOWED create-repos IN organization:aido')
def test2_attrs():
src = """
TYPE challenge
PROPERTY challenge private
PROPERTY challenge public
TYPE user
ABILITY challenge read
NEW challenge pri1
FOR challenge:pri1 SET private
NEW challenge pub1
FOR challenge:pub1 SET public
NEW user john
ALLOW user:* TO read IN challenge:* [ public ]
"""
i = Interpreter()
i.parse_and_interpret(src)
assert_true(i, 'IS user:john ALLOWED read IN challenge:pub1')
assert_false(i, 'IS user:john ALLOWED read IN challenge:pri1')
def test_rem():
src = """
REM comment
REM comment two
"""
i = Interpreter()
i.parse_and_interpret(src)
def assert_eq(i: Interpreter, val, s):
ress = i.parse_and_interpret(s)
res = ress[0]
print(res.msg)
if not res.ok:
raise Exception(res)
assert_equal(res.query_result, val, s)
def assert_true(i, s):
assert_eq(i, True, s)
def assert_false(i, s):
assert_eq(i, False, s)
if __name__ == '__main__':
test1()
|
zuper-auth
|
/zuper-auth-2.0.1.tar.gz/zuper-auth-2.0.1/src/zuper_auth_tests/test_parsing1.py
|
test_parsing1.py
|
import sys
from setuptools import find_packages, setup
def get_version(filename: str) -> str:
import ast
version = None
with open(filename) as f:
for line in f:
if line.startswith('__version__'):
version = ast.parse(line).body[0].value.s
break
else:
raise ValueError('No version found in %r.' % filename)
if version is None:
raise ValueError(filename)
return version
version = get_version('src/zuper_commons/__init__.py')
import os
description = """"""
def read(fname: str) -> str:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
requirements = [
'xtermcolor',
'termcolor',
]
PYTHON_36 = sys.version_info[1] == 6
if PYTHON_36:
requirements.append('dataclasses')
line = 'z5'
setup(name=f'zuper-commons-{line}',
version=version,
package_dir={'': 'src'},
packages=find_packages('src'),
zip_safe=True,
entry_points={
'console_scripts': [],
},
install_requires=requirements
)
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/setup.py
|
setup.py
|
__version__ = "5.0.11"
import logging
logging.basicConfig()
logger = logging.getLogger("zuper-commons")
logger.setLevel(logging.DEBUG)
logger.info(f"zuper-commons {__version__}")
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/__init__.py
|
__init__.py
|
# __all__ = ['FileName', 'DirName', 'PathName']
#
# FileName = NewType('FileName', str)
# DirName = NewType('DirName', str)
# PathName = NewType('PathName', Union[FileName, DirName])
__all__ = ['Path']
# Path = NewType('Path', str)
Path = str
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/types.py
|
types.py
|
# -*- coding: utf-8 -*-
import os
__all__ = ["friendly_path"]
def friendly_path(path: str, use_environment: bool=True) -> str:
"""
Gets a friendly representation of the given path,
using relative paths or environment variables
(if use_environment = True).
"""
# TODO: send extra rules
# always prefer getcwd
cwd = os.getcwd()
if path.startswith(cwd+'/'):
return path.replace(cwd + '/', '')
options = []
options.append(os.path.relpath(path, os.getcwd()))
rules = []
rules.append(("~", os.path.expanduser("~")))
rules.append((".", os.getcwd()))
rules.append((".", os.path.realpath(os.getcwd())))
if use_environment:
envs = dict(os.environ)
# remove unwanted
for e in list(envs.keys()):
if "PWD" in e:
del envs[e]
for k, v in envs.items():
if v:
if v and v[-1] == "/":
v = v[:-1]
if v and v[0] == "/":
rules.append(("${%s}" % k, v))
# apply longest first
rules.sort(key=lambda x: (-len(x[1])))
path = replace_variables(path, rules)
options.append(path)
weight_doubledot = 5
def score(s):
# penalize '..' a lot
s = s.replace("..", "*" * weight_doubledot)
return len(s)
options.sort(key=score)
result = options[0]
# print('Converted %s => %s' % (original, result))
return result
def replace_variables(path, rules):
for k, v in rules:
if path.startswith(v):
# print(" applied %s => %s" % (v, k))
path = path.replace(v, k)
return path
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/zc_friendly_path.py
|
zc_friendly_path.py
|
# -*- coding: utf-8 -*-
import os
from .types import Path
__all__ = ['expand_all']
def expand_all(x0: Path) -> Path:
x = x0
x = os.path.expanduser(x)
x = os.path.expandvars(x)
if "$" in x:
msg = "Cannot resolve all environment variables in %r." % x0
raise ValueError(msg)
return Path(x)
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/zc_path_utils.py
|
zc_path_utils.py
|
import os
from .types import Path
__all__ = ["mkdirs_thread_safe", "make_sure_dir_exists"]
def mkdirs_thread_safe(dst: Path) -> None:
"""Make directories leading to 'dst' if they don't exist yet"""
if dst == "" or os.path.exists(dst):
return
head, _ = os.path.split(dst)
if os.sep == ":" and not ":" in head:
head = head + ":"
mkdirs_thread_safe(head)
try:
os.mkdir(dst, 0o777)
except OSError as err:
if err.errno != 17: # file exists
raise
def make_sure_dir_exists(filename: Path) -> None:
""" Makes sure that the path to file exists, but creating directories. """
dirname = os.path.dirname(filename)
# dir == '' for current dir
if dirname != "" and not os.path.exists(dirname):
mkdirs_thread_safe(dirname)
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/zc_mkdirs.py
|
zc_mkdirs.py
|
# -*- coding: utf-8 -*-
import os
from .types import Path
__all__ = ["dir_from_package_name"]
def dir_from_package_name(d: Path) -> Path:
from zuper_commons.text import format_error
""" This works for "package.sub" format. If it's only
package, we look for __init__.py"""
tokens = d.split(".")
if len(tokens) == 1:
package = d
sub = "__init__"
else:
package = ".".join(tokens[:-1])
sub = tokens[-1]
try:
from pkg_resources import resource_filename # @UnresolvedImport
res = resource_filename(package, sub + ".py")
if len(tokens) == 1:
res = os.path.dirname(res)
return res
except BaseException as e: # pragma: no cover
msg = format_error("Cannot resolve package name", d=d)
raise ValueError(msg) from e
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/zc_dir_from_package_nam.py
|
zc_dir_from_package_nam.py
|
# -*- coding: utf-8 -*-
import pickle
import traceback
from io import BytesIO
from pickle import (
Pickler,
SETITEM,
MARK,
SETITEMS,
EMPTY_TUPLE,
TUPLE,
POP,
_tuplesize2code,
POP_MARK,
)
from zuper_commons.types.zc_describe_type import describe_type
from . import logger
__all__ = ["find_pickling_error"]
def find_pickling_error(obj: object, protocol=pickle.HIGHEST_PROTOCOL):
sio = BytesIO()
try:
pickle.dumps(obj)
except BaseException:
se1 = traceback.format_exc()
pickler = MyPickler(sio, protocol)
try:
pickler.dump(obj)
except Exception:
se2 = traceback.format_exc()
msg = pickler.get_stack_description()
msg += "\n --- Current exception----\n%s" % se1
msg += "\n --- Old exception----\n%s" % se2
return msg
else:
msg = "I could not find the exact pickling error."
raise Exception(msg)
else:
msg = (
"Strange! I could not reproduce the pickling error "
"for the object of class %s" % describe_type(obj)
)
logger.info(msg)
class MyPickler(Pickler):
def __init__(self, *args, **kargs):
Pickler.__init__(self, *args, **kargs)
self.stack = []
def save(self, obj):
desc = "object of type %s" % (describe_type(obj))
# , describe_value(obj, 100))
# self.stack.append(describe_value(obj, 120))
self.stack.append(desc)
Pickler.save(self, obj)
self.stack.pop()
def get_stack_description(self):
s = "Pickling error occurred at:\n"
for i, context in enumerate(self.stack):
s += " " * i + "- %s\n" % context
return s
def save_pair(self, k, v):
self.stack.append("key %r = object of type %s" % (k, describe_type(v)))
self.save(k)
self.save(v)
self.stack.pop()
def _batch_setitems(self, items):
# Helper to batch up SETITEMS sequences; proto >= 1 only
# save = self.save
write = self.write
if not self.bin:
for k, v in items:
self.stack.append("entry %s" % str(k))
self.save_pair(k, v)
self.stack.pop()
write(SETITEM)
return
r = list(range(self._BATCHSIZE))
while items is not None:
tmp = []
for _ in r:
try:
tmp.append(items.next())
except StopIteration:
items = None
break
n = len(tmp)
if n > 1:
write(MARK)
for k, v in tmp:
self.stack.append("entry %s" % str(k))
self.save_pair(k, v)
self.stack.pop()
write(SETITEMS)
elif n:
k, v = tmp[0]
self.stack.append("entry %s" % str(k))
self.save_pair(k, v)
self.stack.pop()
write(SETITEM)
# else tmp is empty, and we're done
def save_tuple(self, obj):
write = self.write
proto = self.proto
n = len(obj)
if n == 0:
if proto:
write(EMPTY_TUPLE)
else:
write(MARK + TUPLE)
return
save = self.save
memo = self.memo
if n <= 3 and proto >= 2:
for i, element in enumerate(obj):
self.stack.append("tuple element %s" % i)
save(element)
self.stack.pop()
# Subtle. Same as in the big comment below.
if id(obj) in memo:
get = self.get(memo[id(obj)][0])
write(POP * n + get)
else:
write(_tuplesize2code[n])
self.memoize(obj)
return
# proto 0 or proto 1 and tuple isn't empty, or proto > 1 and tuple
# has more than 3 elements.
write(MARK)
for i, element in enumerate(obj):
self.stack.append("tuple element %s" % i)
save(element)
self.stack.pop()
if id(obj) in memo:
# Subtle. d was not in memo when we entered save_tuple(), so
# the process of saving the tuple's elements must have saved
# the tuple itself: the tuple is recursive. The proper action
# now is to throw away everything we put on the stack, and
# simply GET the tuple (it's already constructed). This check
# could have been done in the "for element" loop instead, but
# recursive tuples are a rare thing.
get = self.get(memo[id(obj)][0])
if proto:
write(POP_MARK + get)
else: # proto 0 -- POP_MARK not available
write(POP * (n + 1) + get)
return
# No recursion.
self.write(TUPLE)
self.memoize(obj)
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/zc_debug_pickler.py
|
zc_debug_pickler.py
|
# -*- coding: utf-8 -*-
import fnmatch
import os
import time
from collections import defaultdict
from typing import List, Optional, Sequence, Union
from zuper_commons.types import check_isinstance
from . import logger
__all__ = ["locate_files"]
# @contract(returns='list(str)', directory='str',
# pattern='str|seq(str)', followlinks='bool')
def locate_files(
directory: str,
pattern: Union[str, Sequence[str]],
followlinks: bool = True,
include_directories: bool = False,
include_files: bool = True,
normalize: bool = True,
ignore_patterns: Optional[Sequence[str]] = None,
):
"""
pattern is either a string or a sequence of strings
NOTE: if you do not pass ignore_patterns, it will use MCDPConstants.locate_files_ignore_patterns
ignore_patterns = ['*.bak']
normalize = uses realpath
"""
t0 = time.time()
if ignore_patterns is None:
ignore_patterns = []
if isinstance(pattern, str):
patterns = [pattern]
else:
patterns = list(pattern)
for p in patterns:
check_isinstance(p, str)
# directories visited
# visited = set()
# visited_basename = set()
# print('locate_files %r %r' % (directory, pattern))
filenames = []
def matches_pattern(x):
return any(fnmatch.fnmatch(x, _) or (x == _) for _ in patterns)
def should_ignore_resource(x):
return any(fnmatch.fnmatch(x, _) or (x == _) for _ in ignore_patterns)
def accept_dirname_to_go_inside(_root_, d_):
if should_ignore_resource(d_):
return False
# XXX
# dd = os.path.realpath(os.path.join(root_, d_))
# if dd in visited:
# return False
# visited.add(dd)
return True
def accept_dirname_as_match(_):
return (
include_directories and not should_ignore_resource(_) and matches_pattern(_)
)
def accept_filename_as_match(_):
return include_files and not should_ignore_resource(_) and matches_pattern(_)
ntraversed = 0
for root, dirnames, files in os.walk(directory, followlinks=followlinks):
ntraversed += 1
dirnames[:] = [_ for _ in dirnames if accept_dirname_to_go_inside(root, _)]
for f in files:
# logger.info('look ' + root + '/' + f)
if accept_filename_as_match(f):
filename = os.path.join(root, f)
filenames.append(filename)
for d in dirnames:
if accept_dirname_as_match(d):
filename = os.path.join(root, d)
filenames.append(filename)
if normalize:
real2norm = defaultdict(lambda: [])
for norm in filenames:
real = os.path.realpath(norm)
real2norm[real].append(norm)
# print('%s -> %s' % (real, norm))
for k, v in real2norm.items():
if len(v) > 1:
msg = "In directory:\n\t%s\n" % directory
msg += "I found %d paths that refer to the same file:\n" % len(v)
for n in v:
msg += "\t%s\n" % n
msg += "refer to the same file:\n\t%s\n" % k
msg += "I will silently eliminate redundancies."
# logger.warning(msg) # XXX
filenames = list(real2norm.keys())
seconds = time.time() - t0
if seconds > 5:
n = len(filenames)
nuniques = len(set(filenames))
logger.debug(
"%.4f s for locate_files(%s,%s): %d traversed, found %d filenames (%d uniques)"
% (seconds, directory, pattern, ntraversed, n, nuniques)
)
return filenames
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/zc_locate_files_imp.py
|
zc_locate_files_imp.py
|
# -*- coding: utf-8 -*-
import gzip
import os
import random
from contextlib import contextmanager
__all__ = ["safe_write", "safe_read"]
from .types import Path
def is_gzip_filename(filename: Path) -> bool:
return ".gz" in filename
@contextmanager
def safe_write(filename: Path, mode: str = "wb", compresslevel: int = 5):
"""
Makes atomic writes by writing to a temp filename.
Also if the filename ends in ".gz", writes to a compressed stream.
Yields a file descriptor.
It is thread safe because it renames the file.
If there is an error, the file will be removed if it exists.
"""
dirname = os.path.dirname(filename)
if dirname:
if not os.path.exists(dirname):
try:
os.makedirs(dirname)
except:
pass
# Dont do this!
# if os.path.exists(filename):
# os.unlink(filename)
# assert not os.path.exists(filename)
#
n = random.randint(0, 10000)
tmp_filename = "%s.tmp.%s.%s" % (filename, os.getpid(), n)
try:
if is_gzip_filename(filename):
fopen = lambda fname, fmode: gzip.open(
filename=fname, mode=fmode, compresslevel=compresslevel
)
else:
fopen = open
with fopen(tmp_filename, mode) as f:
yield f
f.close()
# if os.path.exists(filename):
# msg = 'Race condition for writing to %r.' % filename
# raise Exception(msg)
#
# On Unix, if dst exists and is a file, it will be replaced silently
# if the user has permission.
os.rename(tmp_filename, filename)
except:
if os.path.exists(tmp_filename):
os.unlink(tmp_filename)
if os.path.exists(filename):
os.unlink(filename)
raise
@contextmanager
def safe_read(filename: Path, mode="rb"):
"""
If the filename ends in ".gz", reads from a compressed stream.
Yields a file descriptor.
"""
try:
if is_gzip_filename(filename):
f = gzip.open(filename, mode)
try:
yield f
finally:
f.close()
else:
with open(filename, mode) as f:
yield f
except:
# TODO
raise
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/zc_safe_write.py
|
zc_safe_write.py
|
# -*- coding: utf-8 -*-
import pickle
import sys
from zuper_commons.fs.types import Path
from . import logger
from .zc_debug_pickler import find_pickling_error
from .zc_safe_write import safe_read, safe_write
__all__ = ["safe_pickle_dump", "safe_pickle_load"]
debug_pickling = False
def safe_pickle_dump(
value: object, filename: Path, protocol=pickle.HIGHEST_PROTOCOL, **safe_write_options
):
# sys.setrecursionlimit(15000)
with safe_write(filename, **safe_write_options) as f:
try:
pickle.dump(value, f, protocol)
except KeyboardInterrupt:
raise
except BaseException:
msg = f"Cannot pickle object of class {type(value)}."
logger.error(msg)
if debug_pickling:
msg = find_pickling_error(value, protocol)
logger.error(msg)
raise
def safe_pickle_load(filename):
# TODO: add debug check
with safe_read(filename) as f:
return pickle.load(f)
# TODO: add pickling debug
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/zc_safe_pickling.py
|
zc_safe_pickling.py
|
# -*- coding: utf-8 -*-
import codecs
import os
from zuper_commons.types import check_isinstance
from . import logger
from .zc_friendly_path import friendly_path
from .zc_mkdirs import make_sure_dir_exists
from .zc_path_utils import expand_all
__all__ = [
"read_bytes_from_file",
"write_bytes_to_file",
"read_ustring_from_utf8_file",
"read_ustring_from_utf8_file_lenient",
"write_ustring_to_utf8_file",
]
from .types import Path
def read_bytes_from_file(filename: Path) -> bytes:
""" Read binary data and returns bytes """
_check_exists(filename)
with open(filename, "rb") as f:
return f.read()
def read_ustring_from_utf8_file(filename: Path) -> str:
""" Returns a unicode/proper string """
_check_exists(filename)
with codecs.open(filename, encoding="utf-8") as f:
try:
return f.read()
except UnicodeDecodeError as e:
msg = "Could not successfully decode file %s" % filename
raise UnicodeError(msg) from e
def read_ustring_from_utf8_file_lenient(filename: Path) -> str:
""" Ignores decoding errors """
_check_exists(filename)
with codecs.open(filename, encoding="utf-8", errors="ignore") as f:
try:
return f.read()
except UnicodeDecodeError as e:
msg = "Could not successfully decode file %s" % filename
raise UnicodeError(msg) from e
def _check_exists(filename: Path) -> None:
if not os.path.exists(filename):
if os.path.lexists(filename):
msg = "The link %s does not exist." % filename
msg += " it links to %s" % os.readlink(filename)
raise ValueError(msg)
else:
msg = "Could not find file %r" % filename
msg += " from directory %s" % os.getcwd()
raise ValueError(msg)
def write_ustring_to_utf8_file(data: str, filename: Path, quiet: bool=False) -> None:
"""
It also creates the directory if it does not exist.
:param data:
:param filename:
:param quiet:
:return:
"""
check_isinstance(data, str)
b = data.encode("utf-8") # OK
return write_bytes_to_file(b, filename, quiet=quiet)
def write_bytes_to_file(data: bytes, filename: Path, quiet: bool = False) -> None:
"""
Writes the data to the given filename.
If the data did not change, the file is not touched.
"""
check_isinstance(data, bytes)
L = len(filename)
if L > 1024:
msg = f"Invalid argument filename: too long at {L}. Did you confuse it with data?\n{filename[:1024]}"
raise ValueError(msg)
filename = expand_all(filename)
make_sure_dir_exists(filename)
if os.path.exists(filename):
current = open(filename, "rb").read()
if current == data:
if not "assets" in filename:
if not quiet:
logger.debug("already up to date %s" % friendly_path(filename))
return
with open(filename, "wb") as f:
f.write(data)
if filename.startswith("/tmp"):
quiet = True
if not quiet:
size = "%.1fMB" % (len(data) / (1024 * 1024))
logger.debug("Written %s to: %s" % (size, friendly_path(filename)))
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/zc_fileutils.py
|
zc_fileutils.py
|
from .. import logger
logger = logger.getChild("fs")
from .zc_dir_from_package_nam import *
from .zc_fileutils import *
from .zc_locate_files_imp import *
from .zc_mkdirs import *
from .zc_safe_pickling import *
from .zc_path_utils import *
from .zc_safe_write import *
from .zc_friendly_path import *
from .zc_debug_pickler import *
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/fs/__init__.py
|
__init__.py
|
from typing import Callable
import termcolor
color_orange = "#ffb342"
color_orange_dark = "#cfa342"
color_blue = "#42a0ff"
color_blue_light = "#62c0ff"
color_green = "#42ffa0"
color_pink = "#FF69B4"
color_pink2 = "#FF1493"
color_brown = "#b08100"
from xtermcolor import colorize
def colorize_rgb(x: str, rgb):
assert rgb.startswith("#"), rgb
r = colorize(x, int(rgb[1:], 16))
if r is None:
raise NotImplementedError()
return r
def get_colorize_function(rgb: str) -> Callable[[str], str]:
T = "template"
Tc = colorize_rgb(T, rgb)
def f(s: str) -> str:
return Tc.replace(T, s)
return f
color_ops = get_colorize_function(color_blue)
color_synthetic_types = get_colorize_function(color_green)
color_int = get_colorize_function(color_pink)
color_float = get_colorize_function(color_pink2)
color_typename = get_colorize_function(color_orange)
color_typename2 = get_colorize_function(color_orange_dark)
color_constant = get_colorize_function(color_pink2)
#
# def color_ops(x):
# return colorize_rgb(x, color_blue)
#
#
# def color_synthetic_types(x):
# return colorize_rgb(x, color_green)
#
#
# def color_int(x):
# return colorize_rgb(x, color_pink)
#
#
# def color_float(x):
# return colorize_rgb(x, color_pink2)
#
#
# def color_typename(x):
# return colorize_rgb(x, color_orange)
def color_par(x):
return termcolor.colored(x, attrs=["dark"])
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/ui/colors.py
|
colors.py
|
from .. import logger
logger = logger.getChild("ui")
from .zc_duration_hum import *
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/ui/__init__.py
|
__init__.py
|
# -*- coding: utf-8 -*-
import math
__all__ = ["duration_compact"]
def duration_compact(seconds: float) -> str:
seconds = int(math.ceil(seconds))
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
days, hours = divmod(hours, 24)
years, days = divmod(days, 365)
minutes = int(minutes)
hours = int(hours)
days = int(days)
years = int(years)
duration = []
if years > 0:
duration.append("%dy" % years)
else:
if days > 0:
duration.append("%dd" % days)
if (days < 3) and (years == 0):
if hours > 0:
duration.append("%dh" % hours)
if (hours < 3) and (days == 0):
if minutes > 0:
duration.append("%dm" % minutes)
if (minutes < 3) and (hours == 0):
if seconds > 0:
duration.append("%ds" % seconds)
return " ".join(duration)
#
# def duration_human(seconds):
# ''' Code modified from
# http://darklaunch.com/2009/10/06
# /python-time-duration-human-friendly-timestamp
# '''
# seconds = int(math.ceil(seconds))
# minutes, seconds = divmod(seconds, 60)
# hours, minutes = divmod(minutes, 60)
# days, hours = divmod(hours, 24)
# years, days = divmod(days, 365.242199)
#
# minutes = int(minutes)
# hours = int(hours)
# days = int(days)
# years = int(years)
#
# duration = []
# if years > 0:
# duration.append('%d year' % years + 's' * (years != 1))
# else:
# if days > 0:
# duration.append('%d day' % days + 's' * (days != 1))
# if (days < 3) and (years == 0):
# if hours > 0:
# duration.append('%d hour' % hours + 's' * (hours != 1))
# if (hours < 3) and (days == 0):
# if minutes > 0:
# duration.append('%d min' % minutes +
# 's' * (minutes != 1))
# if (minutes < 3) and (hours == 0):
# if seconds > 0:
# duration.append('%d sec' % seconds +
# 's' * (seconds != 1))
#
# return ' '.join(duration)
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/ui/zc_duration_hum.py
|
zc_duration_hum.py
|
import time
from contextlib import contextmanager
from logging import Logger
from typing import Callable, Optional
__all__ = ["timeit_clock", "timeit_wall"]
class Stack(object):
stack = []
@contextmanager
def timeit_generic(desc: str, minimum: Optional[float], time_function: Callable[[], float], logger: Logger):
# logger.debug('timeit %s ...' % desc)
t0 = time_function()
try:
Stack.stack.append(desc)
yield
finally:
Stack.stack.pop()
t1 = time_function()
delta = t1 - t0
if minimum is not None:
if delta < minimum:
return
show_timeit_benchmarks = True
if show_timeit_benchmarks or (minimum is not None):
pre = " " * len(Stack.stack)
msg = "timeit_clock: %s %6.2f ms for %s" % (pre, delta * 1000, desc)
# t0 = time_function()
logger.info(msg)
# t1 = time_function()
# delta = t1 - t0
@contextmanager
def timeit_clock(desc: Optional[str], logger: Logger, minimum: Optional[float] = None):
with timeit_generic(
desc=desc, minimum=minimum, time_function=time.clock, logger=logger
):
yield
@contextmanager
def timeit_wall(desc: Optional[str], logger: Logger, minimum: Optional[float] = None):
with timeit_generic(
desc=desc, minimum=minimum, time_function=time.time, logger=logger
):
yield
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/timing/timeit_.py
|
timeit_.py
|
from .timeit_ import *
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/timing/__init__.py
|
__init__.py
|
__all__ = ["describe_type"]
def describe_type(x: object) -> str:
""" Returns a friendly description of the type of x. """
if hasattr(x, "__class__"):
c = x.__class__
if hasattr(x, "__name__"):
class_name = "%s" % c.__name__
else:
class_name = str(c)
else:
# for extension classes (spmatrix)
class_name = str(type(x))
return class_name
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/types/zc_describe_type.py
|
zc_describe_type.py
|
from typing import NoReturn, Tuple, Type, Union
from .exceptions import ZValueError
from zuper_commons.text import indent, pretty_msg
__all__ = ["check_isinstance", "raise_wrapped"]
def check_isinstance(ob: object,
expected: Union[type, Tuple[type, ...]],
**kwargs: object) -> None:
if not isinstance(ob, expected):
kwargs["object"] = ob
raise_type_mismatch(ob, expected, **kwargs)
def raise_type_mismatch(ob: object, expected: type, **kwargs: object) -> NoReturn:
""" Raises an exception concerning ob having the wrong type. """
msg = "Object not of expected type:"
# e += "\n expected: {}".format(expected)
# e += "\n obtained: {}".format(type(ob))
# try:
# msg = pretty_msg(e, **kwargs)
# except:
# msg = e + "(! cannot write message)"
raise ZValueError(msg, expected=expected, obtained=type(ob))
def raise_desc(etype: Type[BaseException], msg: str, args_first: bool = False, **kwargs: object) -> NoReturn:
"""
Example:
raise_desc(ValueError, "I don't know", a=a, b=b)
"""
assert isinstance(msg, str), type(msg)
s1 = msg
if kwargs:
s2 = pretty_msg('', **kwargs)
else:
s2 = ""
if args_first:
s = s2 + "\n" + s1
else:
s = s1 + "\n" + s2
raise etype(s)
def raise_wrapped(etype: Type[BaseException], e: BaseException, msg: str, compact: bool = False, **kwargs: object) -> \
NoReturn:
s = pretty_msg(msg, **kwargs)
if compact:
s += "\n" + indent(str(e), "| ")
raise etype(s) from e
# if not compact:
# raise etype(s) from e
# else:
# e2 = etype(s)
# raise e2 from e
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/types/zc_checks.py
|
zc_checks.py
|
from .. import logger
logger = logger.getChild("types")
from .zc_checks import *
from .zc_describe_type import *
from .zc_describe_values import *
from .exceptions import *
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/types/__init__.py
|
__init__.py
|
def describe_value(x: object, clip:int=80)->str:
""" Describes an object, for use in the error messages.
Short description, no multiline.
"""
if hasattr(x, "shape") and hasattr(x, "dtype"):
shape_desc = "x".join(str(i) for i in x.shape)
desc = "array[%r](%s) " % (shape_desc, x.dtype)
final = desc + clipped_repr(x, clip - len(desc))
return remove_newlines(final)
else:
from .zc_describe_type import describe_type
class_name = describe_type(x)
desc = "Instance of %s: " % class_name
final = desc + clipped_repr(x, clip - len(desc))
return remove_newlines(final)
def clipped_repr(x: object, clip: int) -> str:
s = "{0!r}".format(x)
if len(s) > clip:
clip_tag = "... [clip]"
cut = clip - len(clip_tag)
s = "%s%s" % (s[:cut], clip_tag)
return s
def remove_newlines(s: str) -> str:
return s.replace("\n", " ")
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/types/zc_describe_values.py
|
zc_describe_values.py
|
import os
from typing import Callable, ClassVar, Dict, Optional
__all__ = ["ZException", 'ZValueError', 'ZTypeError', 'ZAssertionError',
'ZNotImplementedError']
class ZException(Exception):
msg: Optional[str] = None
info: Optional[Dict[str, object]] = None
entries_formatter: ClassVar[Callable[[object], str]] = repr
def __init__(self, msg: Optional[str] = None, **info: object):
assert isinstance(msg, (str, type(None))), msg
self.msg = msg
self.info = info
def __str__(self) -> str:
from zuper_commons.text import pretty_dict
entries = {}
for k, v in self.info.items():
# noinspection PyCallByClass
entries[k] = ZException.entries_formatter(v)
if not self.msg:
self.msg = "\n"
if entries:
s = pretty_dict(self.msg, entries)
else:
s = self.msg
s = sanitize_circle_ci(s)
return s
def __repr__(self) -> str:
return self.__str__()
def disable_colored() -> bool:
circle_job = os.environ.get("CIRCLE_JOB", None)
return circle_job is not None
def sanitize_circle_ci(s: str) -> str:
if disable_colored():
from zuper_commons.text.coloring import remove_escapes
s = remove_escapes(s)
difficult = ["โ"]
for c in difficult:
s = s.replace(c, "")
return s
else:
return s
class ZTypeError(ZException, TypeError):
pass
class ZValueError(ZException, ValueError):
pass
class ZAssertionError(ZException, AssertionError):
pass
class ZNotImplementedError(ZException, NotImplementedError):
pass
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/types/exceptions.py
|
exceptions.py
|
# -*- coding: utf-8 -*-
import traceback
from zuper_commons.text import indent
__all__ = ["import_name"]
def import_name(name: str)->object:
"""
Loads the python object with the given name.
Note that "name" might be "module.module.name" as well.
"""
try:
return __import__(name, fromlist=["dummy"])
except ImportError:
# split in (module, name) if we can
if "." in name:
tokens = name.split(".")
field = tokens[-1]
module_name = ".".join(tokens[:-1])
if False: # previous method
pass
# try:
# module = __import__(module_name, fromlist=['dummy'])
# except ImportError as e:
# msg = ('Cannot load %r (tried also with %r):\n' %
# (name, module_name))
# msg += '\n' + indent(
# '%s\n%s' % (e, traceback.format_exc(e)), '> ')
# raise ValueError(msg)
#
# if not field in module.__dict__:
# msg = 'No field %r\n' % field
# msg += ' found in %r.' % module
# raise ValueError(msg)
#
# return module.__dict__[field]
else:
# other method, don't assume that in "M.x", "M" is a module.
# It could be a class as well, and "x" be a staticmethod.
try:
module = import_name(module_name)
except ImportError as e:
msg = "Cannot load %r (tried also with %r):\n" % (name, module_name)
msg += "\n" + indent("%s\n%s" % (e, traceback.format_exc()), "> ")
raise ValueError(msg)
if isinstance(module, type):
if hasattr(module, field):
return getattr(module, field)
else:
msg = f"No field {field!r}\n"
msg += f" found in type {module!r}."
raise KeyError(msg)
if not field in module.__dict__:
msg = f"No field {field!r}\n"
msg += f" found in module {module!r}."
raise KeyError(msg)
f = module.__dict__[field]
# "staticmethod" are not functions but descriptors, we need
# extra magic
if isinstance(f, staticmethod):
return f.__get__(module, None)
else:
return f
else:
msg = "Cannot import name %r." % name
msg += indent(traceback.format_exc(), "> ")
raise ValueError(msg)
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/types/zc_import.py
|
zc_import.py
|
import io
import logging
import traceback
from logging import currentframe
from os.path import normcase
def monkeypatch_findCaller():
if __file__.lower()[-4:] in [".pyc", ".pyo"]:
_wrapper_srcfile = __file__.lower()[:-4] + ".py"
else:
_wrapper_srcfile = __file__
_wrapper_srcfile = normcase(_wrapper_srcfile)
def findCaller(self, stack_info=False):
"""
Find the stack frame of the caller so that we can note the source
file name, line number and function name.
"""
f = currentframe()
# On some versions of IronPython, currentframe() returns None if
# IronPython isn't run with -X:Frames.
if f is not None:
f = f.f_back
rv = "(unknown file)", 0, "(unknown function)", None
while hasattr(f, "f_code"):
co = f.f_code
filename = normcase(co.co_filename)
if filename == _wrapper_srcfile or filename == logging._srcfile:
f = f.f_back
continue
sinfo = None
if stack_info:
sio = io.StringIO()
sio.write("Stack (most recent call last):\n")
traceback.print_stack(f, file=sio)
sinfo = sio.getvalue()
if sinfo[-1] == "\n":
sinfo = sinfo[:-1]
sio.close()
rv = (co.co_filename, f.f_lineno, co.co_name, sinfo)
break
return rv
logging.Logger.findCaller = findCaller
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/logs/hacks.py
|
hacks.py
|
# coding=utf-8
import logging
from typing import cast
import termcolor
__all__ = ["setup_logging_color", "setup_logging_format", "setup_logging"]
def get_FORMAT_datefmt():
pre = "%(asctime)s|%(name)s|%(filename)s:%(lineno)s|%(funcName)s(): "
pre = termcolor.colored(pre, attrs=["dark"])
FORMAT = pre + "%(message)s"
datefmt = "%H:%M:%S"
return FORMAT, datefmt
def setup_logging_format():
from logging import Logger, StreamHandler, Formatter
import logging
FORMAT, datefmt = get_FORMAT_datefmt()
logging.basicConfig(format=FORMAT, datefmt=datefmt)
# noinspection PyUnresolvedReferences
root = cast(Logger, Logger.root)
if root.handlers:
for handler in root.handlers:
if isinstance(handler, StreamHandler):
formatter = Formatter(FORMAT, datefmt=datefmt)
handler.setFormatter(formatter)
else:
logging.basicConfig(format=FORMAT, datefmt=datefmt)
def add_coloring_to_emit_ansi(fn):
# add methods we need to the class
def new(*args):
levelno = args[1].levelno
if levelno >= 50:
color = "\x1b[31m" # red
elif levelno >= 40:
color = "\x1b[31m" # red
elif levelno >= 30:
color = "\x1b[33m" # yellow
elif levelno >= 20:
color = "\x1b[32m" # green
elif levelno >= 10:
color = "\x1b[35m" # pink
else:
color = "\x1b[0m" # normal
msg = str(args[1].msg)
lines = msg.split("\n")
def color_line(l):
return "%s%s%s" % (color, l, "\x1b[0m") # normal
lines = list(map(color_line, lines))
args[1].msg = "\n".join(lines)
return fn(*args)
return new
def setup_logging_color()->None:
import platform
if platform.system() != "Windows":
emit2 = add_coloring_to_emit_ansi(logging.StreamHandler.emit)
logging.StreamHandler.emit = emit2
def setup_logging() -> None:
# logging.basicConfig()
setup_logging_color()
setup_logging_format()
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/logs/col_logging.py
|
col_logging.py
|
from .hacks import *
from .col_logging import *
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/logs/__init__.py
|
__init__.py
|
import re
# escape = re.compile('\x1b\[..?m')
escape = re.compile("\x1b\[[\d;]*?m")
def remove_escapes(s):
return escape.sub("", s)
def get_length_on_screen(s):
""" Returns the length of s without the escapes """
return len(remove_escapes(s))
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/coloring.py
|
coloring.py
|
from typing import Mapping, Optional as O, TypeVar
from zuper_commons.text.coloring import get_length_on_screen
from .zc_indenting import indent
__all__ = ["pretty_dict", "pretty_msg", "format_error"]
def pretty_msg(head: str, **kwargs: object) -> str:
return pretty_dict(head, kwargs)
format_error = pretty_msg
def pretty_dict(
head: O[str],
d: Mapping[str, object],
omit_falsy: bool = False,
sort_keys: bool = False,
leftmargin: str = "โ ", # | <-- note box-making
) -> str:
if not d:
return head + ": (empty dict)" if head else "(empty dict)"
s = []
n = max(get_length_on_screen(str(_)) for _ in d)
ordered = sorted(d) if sort_keys else list(d)
# ks = sorted(d)
for k in ordered:
v = d[k]
if k == "__builtins__":
v = "(hiding __builtins__)"
if (
not hasattr(v, "conclusive")
and (not isinstance(v, int))
and (not v)
and omit_falsy
):
continue
prefix = (str(k) + ":").rjust(n + 1) + " "
if isinstance(v, TypeVar):
# noinspection PyUnresolvedReferences
v = f"TypeVar({v.__name__}, bound={v.__bound__})"
if isinstance(v, dict):
v = pretty_dict("", v)
s.extend(indent(v, "", prefix).split("\n"))
# return (head + ':\n' if head else '') + indent("\n".join(s), '| ')
return (head + "\n" if head else "") + indent("\n".join(s), leftmargin)
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/zc_pretty_dicts.py
|
zc_pretty_dicts.py
|
from typing import Optional as O
from .coloring import get_length_on_screen
__all__ = ["indent"]
def indent(s: str, prefix: str, first: O[str] = None, last: O[str] = None) -> str:
if not isinstance(s, str):
s = u"{}".format(s)
assert isinstance(prefix, str), type(prefix)
try:
lines = s.split("\n")
except UnicodeDecodeError:
print(type(s)) # XXX
print(s) # XXX
lines = [s]
if not lines:
return ""
if first is None:
first = prefix
if last is None:
couples = [("โ", "โ"), ("โ", "H")]
for a, b in couples:
if a in prefix:
last = prefix.replace(a, b)
break
else:
last = prefix
# print(f'{prefix!r:10} -> {get_length_on_screen(prefix)}')
# print(f'{first!r:10} -> {get_length_on_screen(first)}')
m = max(get_length_on_screen(prefix), get_length_on_screen(first))
prefix = " " * (m - get_length_on_screen(prefix)) + prefix
first = " " * (m - get_length_on_screen(first)) + first
last = " " * (m - get_length_on_screen(last)) + last
# differnet first prefix
res = [u"%s%s" % (prefix, line.rstrip()) for line in lines]
res[0] = u"%s%s" % (first, lines[0].rstrip())
return "\n".join(res)
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/zc_indenting.py
|
zc_indenting.py
|
from typing import Union
__all__ = ["get_md5", "get_sha1"]
def get_md5(contents: Union[bytes, str]) -> str:
""" Returns an hexdigest (string).
If the contents is a string, then it is encoded as utf-8.
"""
if isinstance(contents, str):
contents = contents.encode("utf-8")
from zuper_commons.types import check_isinstance
check_isinstance(contents, bytes)
import hashlib
m = hashlib.md5()
m.update(contents)
s = m.hexdigest()
check_isinstance(s, str)
return s
def get_sha1(contents: bytes) -> str:
""" Returns an hexdigest (string) """
from zuper_commons.types import check_isinstance
import hashlib
check_isinstance(contents, bytes)
m = hashlib.sha1()
m.update(contents)
s = m.hexdigest()
check_isinstance(s, str)
return s
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/zc_quick_hash.py
|
zc_quick_hash.py
|
from dataclasses import dataclass
from typing import Optional, List, Tuple
import termcolor
from zuper_commons.text.coloring import get_length_on_screen
from zuper_commons.text.text_sidebyside import pad
@dataclass
class TextDimensions:
nlines: int
max_width: int
def text_dimensions(s: str):
lines = s.split("\n")
max_width = max(get_length_on_screen(_) for _ in lines)
return TextDimensions(nlines=len(lines), max_width=max_width)
#
# U+250x โ โ โ โ โ โ
โ โ โ โ โ โ โ โ โ โ
# U+251x โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
# U+252x โ โก โข โฃ โค โฅ โฆ โง โจ โฉ โช โซ โฌ โญ โฎ โฏ
# U+253x โฐ โฑ โฒ โณ โด โต โถ โท โธ โน โบ โป โผ โฝ โพ โฟ
# U+254x โ โ โ โ โ โ
โ โ โ โ โ โ โ โ โ โ
# U+255x โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
# U+256x โ โก โข โฃ โค โฅ โฆ โง โจ โฉ โช โซ โฌ โญ โฎ โฏ
# U+257x โฐ โฑ โฒ โณ โด โต โถ โท โธ โน โบ โป โผ โฝ โพ โฟ
boxes = {
"pipes": "โ โ โ โ โ โ โ โ โฌ โ โฃ โฆ โฉ โ โ โผ โ โข โค โง โ โ".split(),
"heavy": "โ โ โ โ โ โ โ โ โ โฃ โซ โณ โป โ โ โผ โ โจ โฏ โท โ โ".split(),
"light": "โ โ โ โ โ โ โ โ โผ โ โค โฌ โด โ โ โผ โ โค โฌ โด โ โ".split(),
"circo": "โญ โ โฎ โ โฏ โ โฐ โ โผ โ โค โฌ โด โ โ โผ โ โค โฌ โด โ โ".split(),
}
boxes["spaces"] = [" "] * len(boxes["pipes"])
CORNERS = ["corner"]
NEIGH = ((0, 0, 0), (0, None, 0), (0, 0, 0))
def box(
s: str,
style="pipes",
neighs=NEIGH,
draw_borders: Tuple[int, int, int, int] = (1, 1, 1, 1),
light_inside=True,
color: Optional[str] = None,
attrs: Optional[List[str]] = None,
) -> str:
dims = text_dimensions(s)
padded = pad(s, dims.nlines, dims.max_width)
(tl_n, tc_n, tr_n), (ml_n, _, mr_n), (bl_n, bc_n, br_n) = neighs
S = boxes[style]
assert len(S) == 22, len(S)
tl, tc, tr, mr, br, bc, bl, ml, Pc, Pr, Pl, Pd, Pu, H, V, Pc_light, Pr_light, Pl_light, Pd_light, Pu_light, H_light, V_light = (
S
)
if light_inside:
Pc = Pc_light
Pu = Pu_light
Pd = Pd_light
Pr = Pr_light
Pl = Pl_light
H = H_light
V = V_light
tl_use = {
(0, 0, 0): tl,
(0, 0, 1): Pd,
(0, 1, 0): Pr,
(0, 1, 1): Pc, # XXX
(1, 0, 0): Pc, # XXX
(1, 0, 1): Pc, # XXX
(1, 1, 0): Pc,
(1, 1, 1): Pc,
}[(tl_n, tc_n, ml_n)]
tr_use = {
(0, 0, 0): tr,
(0, 0, 1): Pd,
(0, 1, 0): Pc,
(0, 1, 1): Pc,
(1, 0, 0): Pl,
(1, 0, 1): Pc,
(1, 1, 0): Pc,
(1, 1, 1): Pc,
}[(tc_n, tr_n, mr_n)]
br_use = {
(0, 0, 0): br,
(0, 0, 1): Pc,
(0, 1, 0): Pl,
(0, 1, 1): Pc,
(1, 0, 0): Pu,
(1, 0, 1): Pc,
(1, 1, 0): Pc,
(1, 1, 1): Pc,
}[(mr_n, bc_n, br_n)]
bl_use = {
(0, 0, 0): bl,
(0, 0, 1): Pr,
(0, 1, 0): Pc,
(0, 1, 1): Pc,
(1, 0, 0): Pu,
(1, 0, 1): Pc,
(1, 1, 0): Pc,
(1, 1, 1): Pc,
}[(ml_n, bl_n, bc_n)]
mr_use = {0: mr, 1: V}[mr_n]
ml_use = {0: ml, 1: V}[ml_n]
tc_use = {0: tc, 1: H}[tc_n]
bc_use = {0: bc, 1: H}[bc_n]
draw_top, draw_right, draw_bottom, draw_left = draw_borders
if not draw_right:
tr_use = ""
mr_use = ""
br_use = ""
if not draw_left:
tl_use = ""
ml_use = ""
bl_use = ""
top = tl_use + tc_use * dims.max_width + tr_use
bot = bl_use + bc_use * dims.max_width + br_use
def f(_):
return termcolor.colored(_, color=color, attrs=attrs)
top_col = f(top)
bot_col = f(bot)
mr_use_col = f(mr_use)
ml_use_col = f(ml_use)
new_lines = []
if draw_top:
new_lines.append(top_col)
for l in padded:
new_lines.append(ml_use_col + l + mr_use_col)
if draw_bottom:
new_lines.append(bot_col)
return "\n".join(new_lines)
# begin = termcolor.colored('โ', 'yellow', attrs=['dark'])
# ending = termcolor.colored('โ', 'yellow', attrs=['dark']) # โตโ
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/boxing.py
|
boxing.py
|
from zuper_commons.text.text_sidebyside import side_by_side
def test1():
a = """
This is the first
one. With Three
lines.
""".strip()
b = """
This is the first
one. Now with
four
lines!
""".strip()
print(side_by_side([a, b]))
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/text_sidebyside_test.py
|
text_sidebyside_test.py
|
from typing import List, Sequence
from zuper_commons.text.coloring import get_length_on_screen
def pad(
text: str, nlines: int, linelength: int, halign: str = "left", valign: str = "top"
) -> List[str]:
lines: List[str] = text.split("\n")
if len(lines) < nlines:
extra = nlines - len(lines)
if valign == "top":
extra_top = 0
extra_bottom = extra
elif valign == "bottom":
extra_top = extra
extra_bottom = 0
elif valign == "middle":
extra_bottom = int(extra / 2)
extra_top = extra - extra_bottom
else:
raise ValueError(valign)
assert extra == extra_top + extra_bottom
lines_top = [""] * extra_top
lines_bottom = [""] * extra_bottom
lines = lines_top + lines + lines_bottom
res: List[str] = []
for l in lines:
extra = max(linelength - get_length_on_screen(l), 0)
if halign == "left":
extra_left = 0
extra_right = extra
elif halign == "right":
extra_left = extra
extra_right = 0
elif halign == "center":
extra_right = int(extra / 2)
extra_left = extra - extra_right
else:
raise ValueError(halign)
assert extra == extra_left + extra_right
l = " " * extra_left + l + " " * extra_right
res.append(l)
# return '\n'.join(res)
return res
def side_by_side(args: Sequence[str], sep=" ") -> str:
args = list(args)
lines: List[List[str]] = [_.split("\n") for _ in args]
nlines: int = max([len(_) for _ in lines])
linelengths: List[int] = [
max(get_length_on_screen(line) for line in _) for _ in lines
]
padded = [pad(_, nlines, linelength) for _, linelength in zip(args, linelengths)]
res = []
for i in range(nlines):
ls = [x[i] for x in padded]
l = sep.join(ls)
res.append(l)
return "\n".join(res)
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/text_sidebyside.py
|
text_sidebyside.py
|
# -*- coding: utf-8 -*-
import re
from typing import List, Union, Iterator, Sequence
__all__ = ["expand_string", "get_wildcard_matches", "wildcard_to_regexp"]
def flatten(seq: Iterator) -> List:
res = []
for l in seq:
res.extend(l)
return res
def expand_string(x: Union[str, Sequence[str]], options: Sequence[str]) -> List[str]:
if isinstance(x, list):
return flatten(expand_string(y, options) for y in x)
elif isinstance(x, str):
x = x.strip()
if "," in x:
splat = [_ for _ in x.split(",") if _] # remove empty
return flatten(expand_string(y, options) for y in splat)
elif "*" in x:
xx = expand_wildcard(x, options)
expanded = list(xx)
return expanded
else:
return [x]
else:
assert False
def wildcard_to_regexp(arg: str):
""" Returns a regular expression from a shell wildcard expression. """
return re.compile("\A" + arg.replace("*", ".*") + "\Z")
def has_wildcard(s: str) -> bool:
return s.find("*") > -1
def expand_wildcard(wildcard: str, universe: Sequence[str]) -> Sequence[str]:
"""
Expands a wildcard expression against the given list.
Raises ValueError if none found.
:param wildcard: string with '*'
:param universe: a list of strings
"""
if not has_wildcard(wildcard):
msg = "No wildcards in %r." % wildcard
raise ValueError(msg)
matches = list(get_wildcard_matches(wildcard, universe))
if not matches:
msg = "Could not find matches for pattern %r in %s." % (wildcard, universe)
raise ValueError(msg)
return matches
def get_wildcard_matches(wildcard: str, universe: Sequence[str]) -> Iterator[str]:
"""
Expands a wildcard expression against the given list.
Yields a sequence of strings.
:param wildcard: string with '*'
:param universe: a list of strings
"""
regexp = wildcard_to_regexp(wildcard)
for x in universe:
if regexp.match(x):
yield x
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/zc_wildcards.py
|
zc_wildcards.py
|
from nose.tools import assert_equal
from zuper_commons.text.coloring import get_length_on_screen, remove_escapes
def test_escape() -> None:
l = remove_escapes("\x1b[38;5;75m#0 \x1b[0m")
assert_equal(l, "#0 ")
def test_length() -> None:
l = get_length_on_screen("\x1b[38;5;75m#0 \x1b[0m")
assert_equal(l, 3)
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/test_indent.py
|
test_indent.py
|
from .. import logger
logger = logger.getChild("text")
from .zc_indenting import *
from .zc_pretty_dicts import *
from .zc_quick_hash import *
from .zc_wildcards import *
from .boxing import box
from .text_sidebyside import side_by_side
from .table import *
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/__init__.py
|
__init__.py
|
import itertools
from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple
from zuper_commons.text.boxing import box, text_dimensions
from zuper_commons.text.text_sidebyside import pad, side_by_side
try:
from typing import Literal
HAlign = Literal["left", "center", "right", "inherit"]
VAlign = Literal["top", "middle", "bottom", "inherit"]
except:
HAlign = VAlign = str
@dataclass
class Style:
halign: HAlign = "inherit"
valign: VAlign = "inherit"
def format_table(
cells: Dict[Tuple[int, int], str],
*,
draw_grid_v: bool = True,
draw_grid_h: bool = True,
style: str = "pipes",
light_inside: bool = True,
color: Optional[str] = None,
attrs: Optional[List[str]] = None,
col_style: Dict[int, Style] = None,
row_style: Dict[int, Style] = None,
cell_style: Dict[Tuple[int, int], Style] = None,
) -> str:
col_styles = col_style or {}
row_styles = row_style or {}
cell_styles = cell_style or {}
def get_row_style(row):
return row_styles.get(row, Style())
def get_col_style(col):
return col_styles.get(col, Style())
def get_cell_style(cell):
return cell_styles.get(cell, Style())
def resolve(a: List[str]) -> str:
cur = a[0]
for s in a:
if s == "inherit":
continue
else:
cur = s
return cur
def get_style(cell: Tuple[int, int]) -> Style:
row, col = cell
rows = get_row_style(row)
cols = get_col_style(col)
cels = get_cell_style(cell)
halign = resolve(["left", rows.halign, cols.halign, cels.halign])
valign = resolve(["top", rows.valign, cols.valign, cels.valign])
return Style(halign=halign, valign=valign)
cells = dict(cells)
# find all mentioned cells
mentioned_js = set()
mentioned_is = set()
for i, j in cells:
mentioned_is.add(i)
mentioned_js.add(j)
# add default = '' for missing cells
nrows = max(mentioned_is) + 1
ncols = max(mentioned_js) + 1
coords = list(itertools.product(range(nrows), range(ncols)))
for c in coords:
if c not in cells:
cells[c] = ""
# find max size for cells
row_heights = [0] * nrows
col_widths = [0] * ncols
for (i, j), s in list(cells.items()):
dims = text_dimensions(s)
col_widths[j] = max(col_widths[j], dims.max_width)
row_heights[i] = max(row_heights[i], dims.nlines)
# pad all cells
for (i, j), s in list(cells.items()):
linelength = col_widths[j]
nlines = row_heights[i]
cell_style = get_style((i, j))
padded = do_padding(
s,
linelength=linelength,
nlines=nlines,
halign=cell_style.halign,
valign=cell_style.valign,
)
ibef = int(i > 0)
iaft = int(i < nrows - 1)
jbef = int(j > 0)
jaft = int(j < ncols - 1)
neighs = (
(ibef * jbef, ibef, ibef * jaft),
(jbef, None, jaft),
(iaft * jbef, iaft, iaft * jaft),
)
draw_top = 1
draw_left = 1
draw_right = jaft == 0
draw_bottom = iaft == 0
if not draw_grid_v:
draw_bottom = draw_top = 0
if not draw_grid_h:
draw_left = draw_right = 0
d = draw_top, draw_right, draw_bottom, draw_left
s = box(
padded,
neighs=neighs,
style=style,
draw_borders=d,
light_inside=light_inside,
color=color,
attrs=attrs,
)
cells[(i, j)] = s
parts = []
for i in range(nrows):
ss = []
for j in range(ncols):
ss.append(cells[(i, j)])
s = side_by_side(ss, sep="")
parts.append(s)
whole = "\n".join(parts)
# res = box(whole, style=style)
return whole
def do_padding(
s: str, linelength: int, nlines: int, halign: HAlign, valign: VAlign
) -> str:
padded_lines = pad(
s, linelength=linelength, nlines=nlines, halign=halign, valign=valign
)
padded = "\n".join(padded_lines)
return padded
|
zuper-commons-z5
|
/zuper-commons-z5-5.0.11.tar.gz/zuper-commons-z5-5.0.11/src/zuper_commons/text/table.py
|
table.py
|
from setuptools import find_packages, setup
def get_version(filename: str) -> str:
import ast
version = None
with open(filename) as f:
for line in f:
if line.startswith('__version__'):
version = ast.parse(line).body[0].value.s
break
else:
raise ValueError('No version found in %r.' % filename)
if version is None:
raise ValueError(filename)
return version
version = get_version('src/zuper_commons/__init__.py')
import os
description = """"""
def read(fname: str) -> str:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
install_requires = [
'xtermcolor',
'termcolor',
'pytz',
'webcolors',
]
import sys
system_version = tuple(sys.version_info)[:3]
if system_version < (3, 7):
install_requires.append('dataclasses')
line = 'z6'
setup(name=f'zuper-commons-{line}',
version=version,
package_dir={'': 'src'},
packages=find_packages('src'),
zip_safe=True,
entry_points={
'console_scripts': [],
},
install_requires=install_requires,
)
|
zuper-commons-z6
|
/zuper-commons-z6-6.2.4.tar.gz/zuper-commons-z6-6.2.4/setup.py
|
setup.py
|
__version__ = "6.2.4"
import logging
logging.basicConfig()
logger = logging.getLogger("commons")
logger.setLevel(logging.DEBUG)
logger.debug(f"version: {__version__} *")
|
zuper-commons-z6
|
/zuper-commons-z6-6.2.4.tar.gz/zuper-commons-z6-6.2.4/src/zuper_commons/__init__.py
|
__init__.py
|
__all__ = [
"Path",
"AbsPath",
"RelPath",
"AbsDirPath",
"AbsFilePath",
"RelDirPath",
"RelFilePath",
"DirPath",
"FilePath",
]
if False:
from typing import NewType, Union
Path = NewType("Path", str)
AbsPath = NewType("AbsPath", Path)
RelPath = NewType("RelPath", Path)
AbsDirPath = NewType("AbsDirPath", AbsPath)
AbsFilePath = NewType("AbsFilePath", AbsPath)
RelDirPath = NewType("RelDirPath", RelPath)
RelFilePath = NewType("RelFilePath", RelPath)
DirPath = Union[AbsDirPath, RelDirPath]
FilePath = Union[AbsFilePath, RelFilePath]
# DirEntryName = NewType("DirEntryName", RelPath)
else:
AbsPath = AbsFilePath = AbsDirPath = str
Path = DirPath = FilePath = str
RelPath = RelDirPath = RelFilePath = str
pass
|
zuper-commons-z6
|
/zuper-commons-z6-6.2.4.tar.gz/zuper-commons-z6-6.2.4/src/zuper_commons/fs/types.py
|
types.py
|
# -*- coding: utf-8 -*-
import os
__all__ = ["friendly_path"]
def friendly_path(path: str, use_environment: bool = True) -> str:
"""
Gets a friendly representation of the given path,
using relative paths or environment variables
(if use_environment = True).
"""
# TODO: send extra rules
# always prefer getcwd
cwd = os.getcwd()
if path.startswith(cwd + "/"):
return path.replace(cwd + "/", "")
options = []
options.append(os.path.relpath(path, os.getcwd()))
rules = []
rules.append(("~", os.path.expanduser("~")))
rules.append((".", os.getcwd()))
rules.append((".", os.path.realpath(os.getcwd())))
if use_environment:
envs = dict(os.environ)
# remove unwanted
for e in list(envs.keys()):
if "PWD" in e:
del envs[e]
for k, v in envs.items():
if v:
if v and v[-1] == "/":
v = v[:-1]
if v and v[0] == "/":
rules.append(("${%s}" % k, v))
# apply longest first
rules.sort(key=lambda x: (-len(x[1])))
path = replace_variables(path, rules)
options.append(path)
weight_doubledot = 5
def score(s):
# penalize '..' a lot
s = s.replace("..", "*" * weight_doubledot)
return len(s)
options.sort(key=score)
result = options[0]
# print('Converted %s => %s' % (original, result))
return result
def replace_variables(path, rules):
for k, v in rules:
if path.startswith(v):
# print(" applied %s => %s" % (v, k))
path = path.replace(v, k)
return path
|
zuper-commons-z6
|
/zuper-commons-z6-6.2.4.tar.gz/zuper-commons-z6-6.2.4/src/zuper_commons/fs/zc_friendly_path.py
|
zc_friendly_path.py
|
# -*- coding: utf-8 -*-
import os
from .types import Path
__all__ = ["expand_all"]
def expand_all(x0: Path) -> Path:
x = x0
x = os.path.expanduser(x)
x = os.path.expandvars(x)
if "$" in x:
msg = "Cannot resolve all environment variables in %r." % x0
raise ValueError(msg)
return Path(x)
|
zuper-commons-z6
|
/zuper-commons-z6-6.2.4.tar.gz/zuper-commons-z6-6.2.4/src/zuper_commons/fs/zc_path_utils.py
|
zc_path_utils.py
|
import os
from typing import cast
from .types import DirPath, FilePath
__all__ = ["mkdirs_thread_safe", "make_sure_dir_exists"]
def mkdirs_thread_safe(dst: DirPath) -> None:
"""Make directories leading to 'dst' if they don't exist yet"""
if dst == "" or os.path.exists(dst):
return
head, _ = os.path.split(dst)
if os.sep == ":" and not ":" in head:
head += ":"
mkdirs_thread_safe(cast(DirPath, head))
try:
os.mkdir(dst, 0o777)
except OSError as err:
if err.errno != 17: # file exists
raise
def parent_dir(filename: FilePath) -> DirPath:
d = os.path.dirname(filename)
return cast(DirPath, d)
def make_sure_dir_exists(filename: FilePath) -> None:
""" Makes sure that the path to file exists, but creating directories. """
dirname = parent_dir(filename)
# dir == '' for current dir
if dirname != "" and not os.path.exists(dirname):
mkdirs_thread_safe(dirname)
|
zuper-commons-z6
|
/zuper-commons-z6-6.2.4.tar.gz/zuper-commons-z6-6.2.4/src/zuper_commons/fs/zc_mkdirs.py
|
zc_mkdirs.py
|
# -*- coding: utf-8 -*-
import os
from .types import Path
__all__ = ["dir_from_package_name"]
def dir_from_package_name(d: str) -> Path:
from zuper_commons.text import format_error
""" This works for "package.sub" format. If it's only
package, we look for __init__.py"""
tokens = d.split(".")
if len(tokens) == 1:
package = d
sub = "__init__"
else:
package = ".".join(tokens[:-1])
sub = tokens[-1]
try:
from pkg_resources import resource_filename # @UnresolvedImport
res = resource_filename(package, sub + ".py")
if len(tokens) == 1:
res = os.path.dirname(res)
return res
except BaseException as e: # pragma: no cover
msg = format_error("Cannot resolve package name", d=d)
raise ValueError(msg) from e
|
zuper-commons-z6
|
/zuper-commons-z6-6.2.4.tar.gz/zuper-commons-z6-6.2.4/src/zuper_commons/fs/zc_dir_from_package_nam.py
|
zc_dir_from_package_nam.py
|
# -*- coding: utf-8 -*-
import pickle
import traceback
from io import BytesIO
from pickle import (
Pickler,
SETITEM,
MARK,
SETITEMS,
EMPTY_TUPLE,
TUPLE,
POP,
_tuplesize2code,
POP_MARK,
)
from zuper_commons.types.zc_describe_type import describe_type
from . import logger
__all__ = ["find_pickling_error"]
def find_pickling_error(obj: object, protocol=pickle.HIGHEST_PROTOCOL):
sio = BytesIO()
try:
pickle.dumps(obj)
except BaseException:
se1 = traceback.format_exc()
pickler = MyPickler(sio, protocol)
try:
pickler.dump(obj)
except Exception:
se2 = traceback.format_exc()
msg = pickler.get_stack_description()
msg += "\n --- Current exception----\n%s" % se1
msg += "\n --- Old exception----\n%s" % se2
return msg
else:
msg = "I could not find the exact pickling error."
raise Exception(msg)
else:
msg = (
"Strange! I could not reproduce the pickling error "
"for the object of class %s" % describe_type(obj)
)
logger.info(msg)
class MyPickler(Pickler):
def __init__(self, *args, **kargs):
Pickler.__init__(self, *args, **kargs)
self.stack = []
def save(self, obj):
desc = "object of type %s" % (describe_type(obj))
# , describe_value(obj, 100))
# self.stack.append(describe_value(obj, 120))
self.stack.append(desc)
Pickler.save(self, obj)
self.stack.pop()
def get_stack_description(self):
s = "Pickling error occurred at:\n"
for i, context in enumerate(self.stack):
s += " " * i + "- %s\n" % context
return s
def save_pair(self, k, v):
self.stack.append("key %r = object of type %s" % (k, describe_type(v)))
self.save(k)
self.save(v)
self.stack.pop()
def _batch_setitems(self, items):
# Helper to batch up SETITEMS sequences; proto >= 1 only
# save = self.save
write = self.write
if not self.bin:
for k, v in items:
self.stack.append("entry %s" % str(k))
self.save_pair(k, v)
self.stack.pop()
write(SETITEM)
return
r = list(range(self._BATCHSIZE))
while items is not None:
tmp = []
for _ in r:
try:
tmp.append(items.next())
except StopIteration:
items = None
break
n = len(tmp)
if n > 1:
write(MARK)
for k, v in tmp:
self.stack.append("entry %s" % str(k))
self.save_pair(k, v)
self.stack.pop()
write(SETITEMS)
elif n:
k, v = tmp[0]
self.stack.append("entry %s" % str(k))
self.save_pair(k, v)
self.stack.pop()
write(SETITEM)
# else tmp is empty, and we're done
def save_tuple(self, obj):
write = self.write
proto = self.proto
n = len(obj)
if n == 0:
if proto:
write(EMPTY_TUPLE)
else:
write(MARK + TUPLE)
return
save = self.save
memo = self.memo
if n <= 3 and proto >= 2:
for i, element in enumerate(obj):
self.stack.append("tuple element %s" % i)
save(element)
self.stack.pop()
# Subtle. Same as in the big comment below.
if id(obj) in memo:
get = self.get(memo[id(obj)][0])
write(POP * n + get)
else:
write(_tuplesize2code[n])
self.memoize(obj)
return
# proto 0 or proto 1 and tuple isn't empty, or proto > 1 and tuple
# has more than 3 elements.
write(MARK)
for i, element in enumerate(obj):
self.stack.append("tuple element %s" % i)
save(element)
self.stack.pop()
if id(obj) in memo:
# Subtle. d was not in memo when we entered save_tuple(), so
# the process of saving the tuple's elements must have saved
# the tuple itself: the tuple is recursive. The proper action
# now is to throw away everything we put on the stack, and
# simply GET the tuple (it's already constructed). This check
# could have been done in the "for element" loop instead, but
# recursive tuples are a rare thing.
get = self.get(memo[id(obj)][0])
if proto:
write(POP_MARK + get)
else: # proto 0 -- POP_MARK not available
write(POP * (n + 1) + get)
return
# No recursion.
self.write(TUPLE)
self.memoize(obj)
|
zuper-commons-z6
|
/zuper-commons-z6-6.2.4.tar.gz/zuper-commons-z6-6.2.4/src/zuper_commons/fs/zc_debug_pickler.py
|
zc_debug_pickler.py
|
# -*- coding: utf-8 -*-
import fnmatch
import os
import time
from collections import defaultdict
from typing import List, Optional, Sequence, Union
from zuper_commons.types import check_isinstance
from . import logger
from .types import DirPath, FilePath
__all__ = ["locate_files"]
# @contract(returns='list(str)', directory='str',
# pattern='str|seq(str)', followlinks='bool')
def locate_files(
directory: DirPath,
pattern: Union[str, Sequence[str]],
followlinks: bool = True,
include_directories: bool = False,
include_files: bool = True,
normalize: bool = True,
ignore_patterns: Optional[Sequence[str]] = None,
) -> List[FilePath]:
if not os.path.exists(directory):
msg = f'Root directory does not exist: {directory}'
logger.warning(msg)
return []
# raise ValueError(msg)
"""
pattern is either a string or a sequence of strings
NOTE: if you do not pass ignore_patterns, it will use MCDPConstants.locate_files_ignore_patterns
ignore_patterns = ['*.bak']
normalize = uses realpath
"""
t0 = time.time()
if ignore_patterns is None:
ignore_patterns = []
if isinstance(pattern, str):
patterns = [pattern]
else:
patterns = list(pattern)
for p in patterns:
check_isinstance(p, str)
# directories visited
# visited = set()
# visited_basename = set()
# print('locate_files %r %r' % (directory, pattern))
filenames = []
def matches_pattern(x):
return any(fnmatch.fnmatch(x, _) or (x == _) for _ in patterns)
def should_ignore_resource(x):
return any(fnmatch.fnmatch(x, _) or (x == _) for _ in ignore_patterns)
def accept_dirname_to_go_inside(_root_, d_):
if should_ignore_resource(d_):
return False
# XXX
# dd = os.path.realpath(os.path.join(root_, d_))
# if dd in visited:
# return False
# visited.add(dd)
return True
def accept_dirname_as_match(_):
return include_directories and not should_ignore_resource(_) and matches_pattern(_)
def accept_filename_as_match(_):
return include_files and not should_ignore_resource(_) and matches_pattern(_)
ntraversed = 0
for root, dirnames, files in os.walk(directory, followlinks=followlinks):
ntraversed += 1
dirnames[:] = [_ for _ in dirnames if accept_dirname_to_go_inside(root, _)]
for f in files:
# logger.info('look ' + root + '/' + f)
if accept_filename_as_match(f):
filename = os.path.join(root, f)
filenames.append(filename)
for d in dirnames:
if accept_dirname_as_match(d):
filename = os.path.join(root, d)
filenames.append(filename)
if normalize:
real2norm = defaultdict(lambda: [])
for norm in filenames:
real = os.path.realpath(norm)
real2norm[real].append(norm)
# print('%s -> %s' % (real, norm))
for k, v in real2norm.items():
if len(v) > 1:
msg = f"In directory:\n\t{directory}\n"
msg += f"I found {len(v)} paths that refer to the same file:\n"
for n in v:
msg += f"\t{n}\n"
msg += f"refer to the same file:\n\t{k}\n"
msg += "I will silently eliminate redundancies."
# logger.warning(msg) # XXX
filenames = list(real2norm.keys())
seconds = time.time() - t0
if seconds > 5:
n = len(filenames)
nuniques = len(set(filenames))
msg = (
f"{seconds:.1f} s for locate_files({directory},{pattern}): {ntraversed} traversed, "
f"found {n} filenames ({nuniques} uniques)")
logger.debug(msg)
return filenames
|
zuper-commons-z6
|
/zuper-commons-z6-6.2.4.tar.gz/zuper-commons-z6-6.2.4/src/zuper_commons/fs/zc_locate_files_imp.py
|
zc_locate_files_imp.py
|
# -*- coding: utf-8 -*-
import gzip
import os
import random
from contextlib import contextmanager
from .types import Path
__all__ = ["safe_write", "safe_read"]
def is_gzip_filename(filename: Path) -> bool:
return ".gz" in filename
@contextmanager
def safe_write(filename: Path, mode: str = "wb", compresslevel: int = 5):
"""
Makes atomic writes by writing to a temp filename.
Also if the filename ends in ".gz", writes to a compressed stream.
Yields a file descriptor.
It is thread safe because it renames the file.
If there is an error, the file will be removed if it exists.
"""
dirname = os.path.dirname(filename)
if dirname:
if not os.path.exists(dirname):
try:
os.makedirs(dirname)
except:
pass
# Dont do this!
# if os.path.exists(filename):
# os.unlink(filename)
# assert not os.path.exists(filename)
#
n = random.randint(0, 10000)
tmp_filename = "%s.tmp.%s.%s" % (filename, os.getpid(), n)
try:
if is_gzip_filename(filename):
fopen = lambda fname, fmode: gzip.open(filename=fname, mode=fmode, compresslevel=compresslevel)
else:
fopen = open
with fopen(tmp_filename, mode) as f:
yield f
f.close()
# if os.path.exists(filename):
# msg = 'Race condition for writing to %r.' % filename
# raise Exception(msg)
#
# On Unix, if dst exists and is a file, it will be replaced silently
# if the user has permission.
os.rename(tmp_filename, filename)
except:
if os.path.exists(tmp_filename):
os.unlink(tmp_filename)
if os.path.exists(filename):
os.unlink(filename)
raise
@contextmanager
def safe_read(filename: Path, mode="rb"):
"""
If the filename ends in ".gz", reads from a compressed stream.
Yields a file descriptor.
"""
try:
if is_gzip_filename(filename):
f = gzip.open(filename, mode)
try:
yield f
finally:
f.close()
else:
with open(filename, mode) as f:
yield f
except:
# TODO
raise
|
zuper-commons-z6
|
/zuper-commons-z6-6.2.4.tar.gz/zuper-commons-z6-6.2.4/src/zuper_commons/fs/zc_safe_write.py
|
zc_safe_write.py
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.