docusign_esign.apis.billing_api

Docusign eSignature REST API

The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign. # noqa: E501

OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git

   1# coding: utf-8
   2
   3"""
   4    Docusign eSignature REST API
   5
   6    The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign.  # noqa: E501
   7
   8    OpenAPI spec version: v2.1
   9    Contact: devcenter@docusign.com
  10    Generated by: https://github.com/swagger-api/swagger-codegen.git
  11"""
  12
  13
  14from __future__ import absolute_import
  15
  16import sys
  17import os
  18import re
  19
  20# python 2 and python 3 compatibility library
  21from six import iteritems
  22
  23from ..client.configuration import Configuration
  24from ..client.api_client import ApiClient
  25
  26
  27class BillingApi(object):
  28    """
  29    NOTE: This class is auto generated by the swagger code generator program.
  30    Do not edit the class manually.
  31    Ref: https://github.com/swagger-api/swagger-codegen
  32    """
  33
  34    def __init__(self, api_client=None):
  35        config = Configuration()
  36        if api_client:
  37            self.api_client = api_client
  38        else:
  39            if not config.api_client:
  40                config.api_client = ApiClient()
  41            self.api_client = config.api_client
  42
  43    def get_billing_plan(self, billing_plan_id, **kwargs):
  44        """
  45        Get the billing plan details.
  46        Retrieves the billing plan details for the specified billing plan ID.
  47        This method makes a synchronous HTTP request by default. To make an
  48        asynchronous HTTP request, please define a `callback` function
  49        to be invoked when receiving the response.
  50        >>> def callback_function(response):
  51        >>>     pprint(response)
  52        >>>
  53        >>> thread = api.get_billing_plan(billing_plan_id, callback=callback_function)
  54
  55        :param callback function: The callback function
  56            for asynchronous request. (optional)
  57        :param str billing_plan_id: The ID of the billing plan being accessed. (required)
  58        :return: BillingPlanResponse
  59                 If the method is called asynchronously,
  60                 returns the request thread.
  61        """
  62        kwargs['_return_http_data_only'] = True
  63        if kwargs.get('callback'):
  64            return self.get_billing_plan_with_http_info(billing_plan_id, **kwargs)
  65        else:
  66            (data) = self.get_billing_plan_with_http_info(billing_plan_id, **kwargs)
  67            return data
  68
  69    def get_billing_plan_with_http_info(self, billing_plan_id, **kwargs):
  70        """
  71        Get the billing plan details.
  72        Retrieves the billing plan details for the specified billing plan ID.
  73        This method makes a synchronous HTTP request by default. To make an
  74        asynchronous HTTP request, please define a `callback` function
  75        to be invoked when receiving the response.
  76        >>> def callback_function(response):
  77        >>>     pprint(response)
  78        >>>
  79        >>> thread = api.get_billing_plan_with_http_info(billing_plan_id, callback=callback_function)
  80
  81        :param callback function: The callback function
  82            for asynchronous request. (optional)
  83        :param str billing_plan_id: The ID of the billing plan being accessed. (required)
  84        :return: BillingPlanResponse
  85                 If the method is called asynchronously,
  86                 returns the request thread.
  87        """
  88
  89        all_params = ['billing_plan_id']
  90        all_params.append('callback')
  91        all_params.append('_return_http_data_only')
  92        all_params.append('_preload_content')
  93        all_params.append('_request_timeout')
  94
  95        params = locals()
  96        for key, val in iteritems(params['kwargs']):
  97            if key not in all_params:
  98                raise TypeError(
  99                    "Got an unexpected keyword argument '%s'"
 100                    " to method get_billing_plan" % key
 101                )
 102            params[key] = val
 103        del params['kwargs']
 104        # verify the required parameter 'billing_plan_id' is set
 105        if ('billing_plan_id' not in params) or (params['billing_plan_id'] is None):
 106            raise ValueError("Missing the required parameter `billing_plan_id` when calling `get_billing_plan`")
 107
 108
 109        collection_formats = {}
 110
 111        resource_path = '/v2.1/billing_plans/{billingPlanId}'.replace('{format}', 'json')
 112        path_params = {}
 113        if 'billing_plan_id' in params:
 114            path_params['billingPlanId'] = params['billing_plan_id']
 115
 116        query_params = {}
 117
 118        header_params = {}
 119
 120        form_params = []
 121        local_var_files = {}
 122
 123        body_params = None
 124        # HTTP header `Accept`
 125        header_params['Accept'] = self.api_client.\
 126            select_header_accept(['application/json'])
 127
 128        # Authentication setting
 129        auth_settings = []
 130
 131        return self.api_client.call_api(resource_path, 'GET',
 132                                        path_params,
 133                                        query_params,
 134                                        header_params,
 135                                        body=body_params,
 136                                        post_params=form_params,
 137                                        files=local_var_files,
 138                                        response_type='BillingPlanResponse',
 139                                        auth_settings=auth_settings,
 140                                        callback=params.get('callback'),
 141                                        _return_http_data_only=params.get('_return_http_data_only'),
 142                                        _preload_content=params.get('_preload_content', True),
 143                                        _request_timeout=params.get('_request_timeout'),
 144                                        collection_formats=collection_formats)
 145
 146    def get_credit_card_info(self, account_id, **kwargs):
 147        """
 148        Get metadata for a given credit card.
 149        This method returns information about a credit card associated with an account.
 150        This method makes a synchronous HTTP request by default. To make an
 151        asynchronous HTTP request, please define a `callback` function
 152        to be invoked when receiving the response.
 153        >>> def callback_function(response):
 154        >>>     pprint(response)
 155        >>>
 156        >>> thread = api.get_credit_card_info(account_id, callback=callback_function)
 157
 158        :param callback function: The callback function
 159            for asynchronous request. (optional)
 160        :param str account_id: The external account number (int) or account ID Guid. (required)
 161        :return: CreditCardInformation
 162                 If the method is called asynchronously,
 163                 returns the request thread.
 164        """
 165        kwargs['_return_http_data_only'] = True
 166        if kwargs.get('callback'):
 167            return self.get_credit_card_info_with_http_info(account_id, **kwargs)
 168        else:
 169            (data) = self.get_credit_card_info_with_http_info(account_id, **kwargs)
 170            return data
 171
 172    def get_credit_card_info_with_http_info(self, account_id, **kwargs):
 173        """
 174        Get metadata for a given credit card.
 175        This method returns information about a credit card associated with an account.
 176        This method makes a synchronous HTTP request by default. To make an
 177        asynchronous HTTP request, please define a `callback` function
 178        to be invoked when receiving the response.
 179        >>> def callback_function(response):
 180        >>>     pprint(response)
 181        >>>
 182        >>> thread = api.get_credit_card_info_with_http_info(account_id, callback=callback_function)
 183
 184        :param callback function: The callback function
 185            for asynchronous request. (optional)
 186        :param str account_id: The external account number (int) or account ID Guid. (required)
 187        :return: CreditCardInformation
 188                 If the method is called asynchronously,
 189                 returns the request thread.
 190        """
 191
 192        all_params = ['account_id']
 193        all_params.append('callback')
 194        all_params.append('_return_http_data_only')
 195        all_params.append('_preload_content')
 196        all_params.append('_request_timeout')
 197
 198        params = locals()
 199        for key, val in iteritems(params['kwargs']):
 200            if key not in all_params:
 201                raise TypeError(
 202                    "Got an unexpected keyword argument '%s'"
 203                    " to method get_credit_card_info" % key
 204                )
 205            params[key] = val
 206        del params['kwargs']
 207        # verify the required parameter 'account_id' is set
 208        if ('account_id' not in params) or (params['account_id'] is None):
 209            raise ValueError("Missing the required parameter `account_id` when calling `get_credit_card_info`")
 210
 211
 212        collection_formats = {}
 213
 214        resource_path = '/v2.1/accounts/{accountId}/billing_plan/credit_card'.replace('{format}', 'json')
 215        path_params = {}
 216        if 'account_id' in params:
 217            path_params['accountId'] = params['account_id']
 218
 219        query_params = {}
 220
 221        header_params = {}
 222
 223        form_params = []
 224        local_var_files = {}
 225
 226        body_params = None
 227        # HTTP header `Accept`
 228        header_params['Accept'] = self.api_client.\
 229            select_header_accept(['application/json'])
 230
 231        # Authentication setting
 232        auth_settings = []
 233
 234        return self.api_client.call_api(resource_path, 'GET',
 235                                        path_params,
 236                                        query_params,
 237                                        header_params,
 238                                        body=body_params,
 239                                        post_params=form_params,
 240                                        files=local_var_files,
 241                                        response_type='CreditCardInformation',
 242                                        auth_settings=auth_settings,
 243                                        callback=params.get('callback'),
 244                                        _return_http_data_only=params.get('_return_http_data_only'),
 245                                        _preload_content=params.get('_preload_content', True),
 246                                        _request_timeout=params.get('_request_timeout'),
 247                                        collection_formats=collection_formats)
 248
 249    def get_downgrade_request_billing_info(self, account_id, **kwargs):
 250        """
 251        Returns downgrade plan information for the specified account.
 252        
 253        This method makes a synchronous HTTP request by default. To make an
 254        asynchronous HTTP request, please define a `callback` function
 255        to be invoked when receiving the response.
 256        >>> def callback_function(response):
 257        >>>     pprint(response)
 258        >>>
 259        >>> thread = api.get_downgrade_request_billing_info(account_id, callback=callback_function)
 260
 261        :param callback function: The callback function
 262            for asynchronous request. (optional)
 263        :param str account_id: The external account number (int) or account ID Guid. (required)
 264        :return: DowngradRequestBillingInfoResponse
 265                 If the method is called asynchronously,
 266                 returns the request thread.
 267        """
 268        kwargs['_return_http_data_only'] = True
 269        if kwargs.get('callback'):
 270            return self.get_downgrade_request_billing_info_with_http_info(account_id, **kwargs)
 271        else:
 272            (data) = self.get_downgrade_request_billing_info_with_http_info(account_id, **kwargs)
 273            return data
 274
 275    def get_downgrade_request_billing_info_with_http_info(self, account_id, **kwargs):
 276        """
 277        Returns downgrade plan information for the specified account.
 278        
 279        This method makes a synchronous HTTP request by default. To make an
 280        asynchronous HTTP request, please define a `callback` function
 281        to be invoked when receiving the response.
 282        >>> def callback_function(response):
 283        >>>     pprint(response)
 284        >>>
 285        >>> thread = api.get_downgrade_request_billing_info_with_http_info(account_id, callback=callback_function)
 286
 287        :param callback function: The callback function
 288            for asynchronous request. (optional)
 289        :param str account_id: The external account number (int) or account ID Guid. (required)
 290        :return: DowngradRequestBillingInfoResponse
 291                 If the method is called asynchronously,
 292                 returns the request thread.
 293        """
 294
 295        all_params = ['account_id']
 296        all_params.append('callback')
 297        all_params.append('_return_http_data_only')
 298        all_params.append('_preload_content')
 299        all_params.append('_request_timeout')
 300
 301        params = locals()
 302        for key, val in iteritems(params['kwargs']):
 303            if key not in all_params:
 304                raise TypeError(
 305                    "Got an unexpected keyword argument '%s'"
 306                    " to method get_downgrade_request_billing_info" % key
 307                )
 308            params[key] = val
 309        del params['kwargs']
 310        # verify the required parameter 'account_id' is set
 311        if ('account_id' not in params) or (params['account_id'] is None):
 312            raise ValueError("Missing the required parameter `account_id` when calling `get_downgrade_request_billing_info`")
 313
 314
 315        collection_formats = {}
 316
 317        resource_path = '/v2.1/accounts/{accountId}/billing_plan/downgrade'.replace('{format}', 'json')
 318        path_params = {}
 319        if 'account_id' in params:
 320            path_params['accountId'] = params['account_id']
 321
 322        query_params = {}
 323
 324        header_params = {}
 325
 326        form_params = []
 327        local_var_files = {}
 328
 329        body_params = None
 330        # HTTP header `Accept`
 331        header_params['Accept'] = self.api_client.\
 332            select_header_accept(['application/json'])
 333
 334        # Authentication setting
 335        auth_settings = []
 336
 337        return self.api_client.call_api(resource_path, 'GET',
 338                                        path_params,
 339                                        query_params,
 340                                        header_params,
 341                                        body=body_params,
 342                                        post_params=form_params,
 343                                        files=local_var_files,
 344                                        response_type='DowngradRequestBillingInfoResponse',
 345                                        auth_settings=auth_settings,
 346                                        callback=params.get('callback'),
 347                                        _return_http_data_only=params.get('_return_http_data_only'),
 348                                        _preload_content=params.get('_preload_content', True),
 349                                        _request_timeout=params.get('_request_timeout'),
 350                                        collection_formats=collection_formats)
 351
 352    def get_invoice(self, account_id, invoice_id, **kwargs):
 353        """
 354        Retrieves a billing invoice.
 355        Retrieves the specified invoice.   ###### Note: If the `pdfAvailable` property in the response is set to *true*, you can download a PDF version of the invoice. To download the PDF, make the call again and change the value of the `Accept` property in the header to `Accept: application/pdf`.  Privileges required: account administrator  The response returns a list of charges and information about the charges. Quantities are usually shown as 'unlimited' or an integer. Amounts are shown in the currency set for the account.  **Response** The following table provides a description of the different `chargeName` property values. The information will grow as more chargeable items are added to the system.  | chargeName | Description | | --- | --- | | id_check | ID Check Charge | | in_person_signing | In Person Signing charge | | envelopes Included | Sent Envelopes for the account | | age_verify | Age verification check | | ofac | OFAC Check | | id_confirm | ID confirmation check | | student_authentication | STAN PIN authentication check | | wet_sign_fax | Pages for returning signed documents by fax | | attachment_fax | Pages for returning attachments by fax | | phone_authentication | Phone authentication charge | | powerforms | PowerForm envelopes sent | | signer_payments | Payment processing charge | | outbound_fax | Send by fax charge | | bulk_recipient_envelopes | Bulk Recipient Envelopes sent | | sms_authentications | SMS authentication charge | | saml_authentications | SAML authentication charge | | express_signer_certificate | DocuSign Express Certificate charge | | personal_signer_certificate | Personal Signer Certificate charge | | safe_certificate | SAFE BioPharma Signer Certificate charge | | seats | Included active seats charge | | open_trust_certificate | OpenTrust Signer Certificate charge | 
 356        This method makes a synchronous HTTP request by default. To make an
 357        asynchronous HTTP request, please define a `callback` function
 358        to be invoked when receiving the response.
 359        >>> def callback_function(response):
 360        >>>     pprint(response)
 361        >>>
 362        >>> thread = api.get_invoice(account_id, invoice_id, callback=callback_function)
 363
 364        :param callback function: The callback function
 365            for asynchronous request. (optional)
 366        :param str account_id: The external account number (int) or account ID Guid. (required)
 367        :param str invoice_id: (required)
 368        :return: BillingInvoice
 369                 If the method is called asynchronously,
 370                 returns the request thread.
 371        """
 372        kwargs['_return_http_data_only'] = True
 373        if kwargs.get('callback'):
 374            return self.get_invoice_with_http_info(account_id, invoice_id, **kwargs)
 375        else:
 376            (data) = self.get_invoice_with_http_info(account_id, invoice_id, **kwargs)
 377            return data
 378
 379    def get_invoice_with_http_info(self, account_id, invoice_id, **kwargs):
 380        """
 381        Retrieves a billing invoice.
 382        Retrieves the specified invoice.   ###### Note: If the `pdfAvailable` property in the response is set to *true*, you can download a PDF version of the invoice. To download the PDF, make the call again and change the value of the `Accept` property in the header to `Accept: application/pdf`.  Privileges required: account administrator  The response returns a list of charges and information about the charges. Quantities are usually shown as 'unlimited' or an integer. Amounts are shown in the currency set for the account.  **Response** The following table provides a description of the different `chargeName` property values. The information will grow as more chargeable items are added to the system.  | chargeName | Description | | --- | --- | | id_check | ID Check Charge | | in_person_signing | In Person Signing charge | | envelopes Included | Sent Envelopes for the account | | age_verify | Age verification check | | ofac | OFAC Check | | id_confirm | ID confirmation check | | student_authentication | STAN PIN authentication check | | wet_sign_fax | Pages for returning signed documents by fax | | attachment_fax | Pages for returning attachments by fax | | phone_authentication | Phone authentication charge | | powerforms | PowerForm envelopes sent | | signer_payments | Payment processing charge | | outbound_fax | Send by fax charge | | bulk_recipient_envelopes | Bulk Recipient Envelopes sent | | sms_authentications | SMS authentication charge | | saml_authentications | SAML authentication charge | | express_signer_certificate | DocuSign Express Certificate charge | | personal_signer_certificate | Personal Signer Certificate charge | | safe_certificate | SAFE BioPharma Signer Certificate charge | | seats | Included active seats charge | | open_trust_certificate | OpenTrust Signer Certificate charge | 
 383        This method makes a synchronous HTTP request by default. To make an
 384        asynchronous HTTP request, please define a `callback` function
 385        to be invoked when receiving the response.
 386        >>> def callback_function(response):
 387        >>>     pprint(response)
 388        >>>
 389        >>> thread = api.get_invoice_with_http_info(account_id, invoice_id, callback=callback_function)
 390
 391        :param callback function: The callback function
 392            for asynchronous request. (optional)
 393        :param str account_id: The external account number (int) or account ID Guid. (required)
 394        :param str invoice_id: (required)
 395        :return: BillingInvoice
 396                 If the method is called asynchronously,
 397                 returns the request thread.
 398        """
 399
 400        all_params = ['account_id', 'invoice_id']
 401        all_params.append('callback')
 402        all_params.append('_return_http_data_only')
 403        all_params.append('_preload_content')
 404        all_params.append('_request_timeout')
 405
 406        params = locals()
 407        for key, val in iteritems(params['kwargs']):
 408            if key not in all_params:
 409                raise TypeError(
 410                    "Got an unexpected keyword argument '%s'"
 411                    " to method get_invoice" % key
 412                )
 413            params[key] = val
 414        del params['kwargs']
 415        # verify the required parameter 'account_id' is set
 416        if ('account_id' not in params) or (params['account_id'] is None):
 417            raise ValueError("Missing the required parameter `account_id` when calling `get_invoice`")
 418        # verify the required parameter 'invoice_id' is set
 419        if ('invoice_id' not in params) or (params['invoice_id'] is None):
 420            raise ValueError("Missing the required parameter `invoice_id` when calling `get_invoice`")
 421
 422
 423        collection_formats = {}
 424
 425        resource_path = '/v2.1/accounts/{accountId}/billing_invoices/{invoiceId}'.replace('{format}', 'json')
 426        path_params = {}
 427        if 'account_id' in params:
 428            path_params['accountId'] = params['account_id']
 429        if 'invoice_id' in params:
 430            path_params['invoiceId'] = params['invoice_id']
 431
 432        query_params = {}
 433
 434        header_params = {}
 435
 436        form_params = []
 437        local_var_files = {}
 438
 439        body_params = None
 440        # HTTP header `Accept`
 441        header_params['Accept'] = self.api_client.\
 442            select_header_accept(['application/json'])
 443
 444        # Authentication setting
 445        auth_settings = []
 446
 447        return self.api_client.call_api(resource_path, 'GET',
 448                                        path_params,
 449                                        query_params,
 450                                        header_params,
 451                                        body=body_params,
 452                                        post_params=form_params,
 453                                        files=local_var_files,
 454                                        response_type='BillingInvoice',
 455                                        auth_settings=auth_settings,
 456                                        callback=params.get('callback'),
 457                                        _return_http_data_only=params.get('_return_http_data_only'),
 458                                        _preload_content=params.get('_preload_content', True),
 459                                        _request_timeout=params.get('_request_timeout'),
 460                                        collection_formats=collection_formats)
 461
 462    def get_payment(self, account_id, payment_id, **kwargs):
 463        """
 464        Gets billing payment information for a specific payment.
 465        Retrieves the information for a specified payment.   Privileges required: account administrator 
 466        This method makes a synchronous HTTP request by default. To make an
 467        asynchronous HTTP request, please define a `callback` function
 468        to be invoked when receiving the response.
 469        >>> def callback_function(response):
 470        >>>     pprint(response)
 471        >>>
 472        >>> thread = api.get_payment(account_id, payment_id, callback=callback_function)
 473
 474        :param callback function: The callback function
 475            for asynchronous request. (optional)
 476        :param str account_id: The external account number (int) or account ID Guid. (required)
 477        :param str payment_id: (required)
 478        :return: BillingPaymentItem
 479                 If the method is called asynchronously,
 480                 returns the request thread.
 481        """
 482        kwargs['_return_http_data_only'] = True
 483        if kwargs.get('callback'):
 484            return self.get_payment_with_http_info(account_id, payment_id, **kwargs)
 485        else:
 486            (data) = self.get_payment_with_http_info(account_id, payment_id, **kwargs)
 487            return data
 488
 489    def get_payment_with_http_info(self, account_id, payment_id, **kwargs):
 490        """
 491        Gets billing payment information for a specific payment.
 492        Retrieves the information for a specified payment.   Privileges required: account administrator 
 493        This method makes a synchronous HTTP request by default. To make an
 494        asynchronous HTTP request, please define a `callback` function
 495        to be invoked when receiving the response.
 496        >>> def callback_function(response):
 497        >>>     pprint(response)
 498        >>>
 499        >>> thread = api.get_payment_with_http_info(account_id, payment_id, callback=callback_function)
 500
 501        :param callback function: The callback function
 502            for asynchronous request. (optional)
 503        :param str account_id: The external account number (int) or account ID Guid. (required)
 504        :param str payment_id: (required)
 505        :return: BillingPaymentItem
 506                 If the method is called asynchronously,
 507                 returns the request thread.
 508        """
 509
 510        all_params = ['account_id', 'payment_id']
 511        all_params.append('callback')
 512        all_params.append('_return_http_data_only')
 513        all_params.append('_preload_content')
 514        all_params.append('_request_timeout')
 515
 516        params = locals()
 517        for key, val in iteritems(params['kwargs']):
 518            if key not in all_params:
 519                raise TypeError(
 520                    "Got an unexpected keyword argument '%s'"
 521                    " to method get_payment" % key
 522                )
 523            params[key] = val
 524        del params['kwargs']
 525        # verify the required parameter 'account_id' is set
 526        if ('account_id' not in params) or (params['account_id'] is None):
 527            raise ValueError("Missing the required parameter `account_id` when calling `get_payment`")
 528        # verify the required parameter 'payment_id' is set
 529        if ('payment_id' not in params) or (params['payment_id'] is None):
 530            raise ValueError("Missing the required parameter `payment_id` when calling `get_payment`")
 531
 532
 533        collection_formats = {}
 534
 535        resource_path = '/v2.1/accounts/{accountId}/billing_payments/{paymentId}'.replace('{format}', 'json')
 536        path_params = {}
 537        if 'account_id' in params:
 538            path_params['accountId'] = params['account_id']
 539        if 'payment_id' in params:
 540            path_params['paymentId'] = params['payment_id']
 541
 542        query_params = {}
 543
 544        header_params = {}
 545
 546        form_params = []
 547        local_var_files = {}
 548
 549        body_params = None
 550        # HTTP header `Accept`
 551        header_params['Accept'] = self.api_client.\
 552            select_header_accept(['application/json'])
 553
 554        # Authentication setting
 555        auth_settings = []
 556
 557        return self.api_client.call_api(resource_path, 'GET',
 558                                        path_params,
 559                                        query_params,
 560                                        header_params,
 561                                        body=body_params,
 562                                        post_params=form_params,
 563                                        files=local_var_files,
 564                                        response_type='BillingPaymentItem',
 565                                        auth_settings=auth_settings,
 566                                        callback=params.get('callback'),
 567                                        _return_http_data_only=params.get('_return_http_data_only'),
 568                                        _preload_content=params.get('_preload_content', True),
 569                                        _request_timeout=params.get('_request_timeout'),
 570                                        collection_formats=collection_formats)
 571
 572    def get_plan(self, account_id, **kwargs):
 573        """
 574        Get Account Billing Plan
 575        Retrieves the billing plan information for the specified account, including the current billing plan, successor plans, billing address, and billing credit card.  By default the successor plan and credit card information is included in the response. This information can be excluded from the response by adding the appropriate optional query string with the `setting` set to **false**.   Response  The response returns the billing plan information, including the currency code, for the plan. The `billingPlan` and `succesorPlans` property values are the same as those shown in the [ML:Get Billing Plan Details] reference. the `billingAddress` and `creditCardInformation` property values are the same as those shown in the [ML:Update Billing Plan] reference.  ###### Note: When credit card number information is shown, a mask is applied to the response so that only the last 4 digits of the card number are visible. 
 576        This method makes a synchronous HTTP request by default. To make an
 577        asynchronous HTTP request, please define a `callback` function
 578        to be invoked when receiving the response.
 579        >>> def callback_function(response):
 580        >>>     pprint(response)
 581        >>>
 582        >>> thread = api.get_plan(account_id, callback=callback_function)
 583
 584        :param callback function: The callback function
 585            for asynchronous request. (optional)
 586        :param str account_id: The external account number (int) or account ID Guid. (required)
 587        :param str include_credit_card_information: When set to **true**, excludes credit card information from the response.
 588        :param str include_downgrade_information:
 589        :param str include_metadata: When set to **true**, the `canUpgrade` and `renewalStatus` properities are included the response and an array of `supportedCountries` property is added to the `billingAddress` information. 
 590        :param str include_successor_plans: When set to **true**, excludes successor information from the response.
 591        :param str include_tax_exempt_id:
 592        :return: AccountBillingPlanResponse
 593                 If the method is called asynchronously,
 594                 returns the request thread.
 595        """
 596        kwargs['_return_http_data_only'] = True
 597        if kwargs.get('callback'):
 598            return self.get_plan_with_http_info(account_id, **kwargs)
 599        else:
 600            (data) = self.get_plan_with_http_info(account_id, **kwargs)
 601            return data
 602
 603    def get_plan_with_http_info(self, account_id, **kwargs):
 604        """
 605        Get Account Billing Plan
 606        Retrieves the billing plan information for the specified account, including the current billing plan, successor plans, billing address, and billing credit card.  By default the successor plan and credit card information is included in the response. This information can be excluded from the response by adding the appropriate optional query string with the `setting` set to **false**.   Response  The response returns the billing plan information, including the currency code, for the plan. The `billingPlan` and `succesorPlans` property values are the same as those shown in the [ML:Get Billing Plan Details] reference. the `billingAddress` and `creditCardInformation` property values are the same as those shown in the [ML:Update Billing Plan] reference.  ###### Note: When credit card number information is shown, a mask is applied to the response so that only the last 4 digits of the card number are visible. 
 607        This method makes a synchronous HTTP request by default. To make an
 608        asynchronous HTTP request, please define a `callback` function
 609        to be invoked when receiving the response.
 610        >>> def callback_function(response):
 611        >>>     pprint(response)
 612        >>>
 613        >>> thread = api.get_plan_with_http_info(account_id, callback=callback_function)
 614
 615        :param callback function: The callback function
 616            for asynchronous request. (optional)
 617        :param str account_id: The external account number (int) or account ID Guid. (required)
 618        :param str include_credit_card_information: When set to **true**, excludes credit card information from the response.
 619        :param str include_downgrade_information:
 620        :param str include_metadata: When set to **true**, the `canUpgrade` and `renewalStatus` properities are included the response and an array of `supportedCountries` property is added to the `billingAddress` information. 
 621        :param str include_successor_plans: When set to **true**, excludes successor information from the response.
 622        :param str include_tax_exempt_id:
 623        :return: AccountBillingPlanResponse
 624                 If the method is called asynchronously,
 625                 returns the request thread.
 626        """
 627
 628        all_params = ['account_id', 'include_credit_card_information', 'include_downgrade_information', 'include_metadata', 'include_successor_plans', 'include_tax_exempt_id']
 629        all_params.append('callback')
 630        all_params.append('_return_http_data_only')
 631        all_params.append('_preload_content')
 632        all_params.append('_request_timeout')
 633
 634        params = locals()
 635        for key, val in iteritems(params['kwargs']):
 636            if key not in all_params:
 637                raise TypeError(
 638                    "Got an unexpected keyword argument '%s'"
 639                    " to method get_plan" % key
 640                )
 641            params[key] = val
 642        del params['kwargs']
 643        # verify the required parameter 'account_id' is set
 644        if ('account_id' not in params) or (params['account_id'] is None):
 645            raise ValueError("Missing the required parameter `account_id` when calling `get_plan`")
 646
 647
 648        collection_formats = {}
 649
 650        resource_path = '/v2.1/accounts/{accountId}/billing_plan'.replace('{format}', 'json')
 651        path_params = {}
 652        if 'account_id' in params:
 653            path_params['accountId'] = params['account_id']
 654
 655        query_params = {}
 656        if 'include_credit_card_information' in params:
 657            query_params['include_credit_card_information'] = params['include_credit_card_information']
 658        if 'include_downgrade_information' in params:
 659            query_params['include_downgrade_information'] = params['include_downgrade_information']
 660        if 'include_metadata' in params:
 661            query_params['include_metadata'] = params['include_metadata']
 662        if 'include_successor_plans' in params:
 663            query_params['include_successor_plans'] = params['include_successor_plans']
 664        if 'include_tax_exempt_id' in params:
 665            query_params['include_tax_exempt_id'] = params['include_tax_exempt_id']
 666
 667        header_params = {}
 668
 669        form_params = []
 670        local_var_files = {}
 671
 672        body_params = None
 673        # HTTP header `Accept`
 674        header_params['Accept'] = self.api_client.\
 675            select_header_accept(['application/json'])
 676
 677        # Authentication setting
 678        auth_settings = []
 679
 680        return self.api_client.call_api(resource_path, 'GET',
 681                                        path_params,
 682                                        query_params,
 683                                        header_params,
 684                                        body=body_params,
 685                                        post_params=form_params,
 686                                        files=local_var_files,
 687                                        response_type='AccountBillingPlanResponse',
 688                                        auth_settings=auth_settings,
 689                                        callback=params.get('callback'),
 690                                        _return_http_data_only=params.get('_return_http_data_only'),
 691                                        _preload_content=params.get('_preload_content', True),
 692                                        _request_timeout=params.get('_request_timeout'),
 693                                        collection_formats=collection_formats)
 694
 695    def list_billing_plans(self, **kwargs):
 696        """
 697        Gets the list of available billing plans.
 698        Retrieves a list of the billing plans associated with a distributor.
 699        This method makes a synchronous HTTP request by default. To make an
 700        asynchronous HTTP request, please define a `callback` function
 701        to be invoked when receiving the response.
 702        >>> def callback_function(response):
 703        >>>     pprint(response)
 704        >>>
 705        >>> thread = api.list_billing_plans(callback=callback_function)
 706
 707        :param callback function: The callback function
 708            for asynchronous request. (optional)
 709        :return: BillingPlansResponse
 710                 If the method is called asynchronously,
 711                 returns the request thread.
 712        """
 713        kwargs['_return_http_data_only'] = True
 714        if kwargs.get('callback'):
 715            return self.list_billing_plans_with_http_info(**kwargs)
 716        else:
 717            (data) = self.list_billing_plans_with_http_info(**kwargs)
 718            return data
 719
 720    def list_billing_plans_with_http_info(self, **kwargs):
 721        """
 722        Gets the list of available billing plans.
 723        Retrieves a list of the billing plans associated with a distributor.
 724        This method makes a synchronous HTTP request by default. To make an
 725        asynchronous HTTP request, please define a `callback` function
 726        to be invoked when receiving the response.
 727        >>> def callback_function(response):
 728        >>>     pprint(response)
 729        >>>
 730        >>> thread = api.list_billing_plans_with_http_info(callback=callback_function)
 731
 732        :param callback function: The callback function
 733            for asynchronous request. (optional)
 734        :return: BillingPlansResponse
 735                 If the method is called asynchronously,
 736                 returns the request thread.
 737        """
 738
 739        all_params = []
 740        all_params.append('callback')
 741        all_params.append('_return_http_data_only')
 742        all_params.append('_preload_content')
 743        all_params.append('_request_timeout')
 744
 745        params = locals()
 746        for key, val in iteritems(params['kwargs']):
 747            if key not in all_params:
 748                raise TypeError(
 749                    "Got an unexpected keyword argument '%s'"
 750                    " to method list_billing_plans" % key
 751                )
 752            params[key] = val
 753        del params['kwargs']
 754
 755        collection_formats = {}
 756
 757        resource_path = '/v2.1/billing_plans'.replace('{format}', 'json')
 758        path_params = {}
 759
 760        query_params = {}
 761
 762        header_params = {}
 763
 764        form_params = []
 765        local_var_files = {}
 766
 767        body_params = None
 768        # HTTP header `Accept`
 769        header_params['Accept'] = self.api_client.\
 770            select_header_accept(['application/json'])
 771
 772        # Authentication setting
 773        auth_settings = []
 774
 775        return self.api_client.call_api(resource_path, 'GET',
 776                                        path_params,
 777                                        query_params,
 778                                        header_params,
 779                                        body=body_params,
 780                                        post_params=form_params,
 781                                        files=local_var_files,
 782                                        response_type='BillingPlansResponse',
 783                                        auth_settings=auth_settings,
 784                                        callback=params.get('callback'),
 785                                        _return_http_data_only=params.get('_return_http_data_only'),
 786                                        _preload_content=params.get('_preload_content', True),
 787                                        _request_timeout=params.get('_request_timeout'),
 788                                        collection_formats=collection_formats)
 789
 790    def list_invoices(self, account_id, **kwargs):
 791        """
 792        Get a List of Billing Invoices
 793        Retrieves a list of invoices for the account. If the from date or to date queries are not specified, the response returns invoices for the last 365 days.  Privileges required: account administrator 
 794        This method makes a synchronous HTTP request by default. To make an
 795        asynchronous HTTP request, please define a `callback` function
 796        to be invoked when receiving the response.
 797        >>> def callback_function(response):
 798        >>>     pprint(response)
 799        >>>
 800        >>> thread = api.list_invoices(account_id, callback=callback_function)
 801
 802        :param callback function: The callback function
 803            for asynchronous request. (optional)
 804        :param str account_id: The external account number (int) or account ID Guid. (required)
 805        :param str from_date: Specifies the date/time of the earliest invoice in the account to retrieve.
 806        :param str to_date: Specifies the date/time of the latest invoice in the account to retrieve.
 807        :return: BillingInvoicesResponse
 808                 If the method is called asynchronously,
 809                 returns the request thread.
 810        """
 811        kwargs['_return_http_data_only'] = True
 812        if kwargs.get('callback'):
 813            return self.list_invoices_with_http_info(account_id, **kwargs)
 814        else:
 815            (data) = self.list_invoices_with_http_info(account_id, **kwargs)
 816            return data
 817
 818    def list_invoices_with_http_info(self, account_id, **kwargs):
 819        """
 820        Get a List of Billing Invoices
 821        Retrieves a list of invoices for the account. If the from date or to date queries are not specified, the response returns invoices for the last 365 days.  Privileges required: account administrator 
 822        This method makes a synchronous HTTP request by default. To make an
 823        asynchronous HTTP request, please define a `callback` function
 824        to be invoked when receiving the response.
 825        >>> def callback_function(response):
 826        >>>     pprint(response)
 827        >>>
 828        >>> thread = api.list_invoices_with_http_info(account_id, callback=callback_function)
 829
 830        :param callback function: The callback function
 831            for asynchronous request. (optional)
 832        :param str account_id: The external account number (int) or account ID Guid. (required)
 833        :param str from_date: Specifies the date/time of the earliest invoice in the account to retrieve.
 834        :param str to_date: Specifies the date/time of the latest invoice in the account to retrieve.
 835        :return: BillingInvoicesResponse
 836                 If the method is called asynchronously,
 837                 returns the request thread.
 838        """
 839
 840        all_params = ['account_id', 'from_date', 'to_date']
 841        all_params.append('callback')
 842        all_params.append('_return_http_data_only')
 843        all_params.append('_preload_content')
 844        all_params.append('_request_timeout')
 845
 846        params = locals()
 847        for key, val in iteritems(params['kwargs']):
 848            if key not in all_params:
 849                raise TypeError(
 850                    "Got an unexpected keyword argument '%s'"
 851                    " to method list_invoices" % key
 852                )
 853            params[key] = val
 854        del params['kwargs']
 855        # verify the required parameter 'account_id' is set
 856        if ('account_id' not in params) or (params['account_id'] is None):
 857            raise ValueError("Missing the required parameter `account_id` when calling `list_invoices`")
 858
 859
 860        collection_formats = {}
 861
 862        resource_path = '/v2.1/accounts/{accountId}/billing_invoices'.replace('{format}', 'json')
 863        path_params = {}
 864        if 'account_id' in params:
 865            path_params['accountId'] = params['account_id']
 866
 867        query_params = {}
 868        if 'from_date' in params:
 869            query_params['from_date'] = params['from_date']
 870        if 'to_date' in params:
 871            query_params['to_date'] = params['to_date']
 872
 873        header_params = {}
 874
 875        form_params = []
 876        local_var_files = {}
 877
 878        body_params = None
 879        # HTTP header `Accept`
 880        header_params['Accept'] = self.api_client.\
 881            select_header_accept(['application/json'])
 882
 883        # Authentication setting
 884        auth_settings = []
 885
 886        return self.api_client.call_api(resource_path, 'GET',
 887                                        path_params,
 888                                        query_params,
 889                                        header_params,
 890                                        body=body_params,
 891                                        post_params=form_params,
 892                                        files=local_var_files,
 893                                        response_type='BillingInvoicesResponse',
 894                                        auth_settings=auth_settings,
 895                                        callback=params.get('callback'),
 896                                        _return_http_data_only=params.get('_return_http_data_only'),
 897                                        _preload_content=params.get('_preload_content', True),
 898                                        _request_timeout=params.get('_request_timeout'),
 899                                        collection_formats=collection_formats)
 900
 901    def list_invoices_past_due(self, account_id, **kwargs):
 902        """
 903        Get a list of past due invoices.
 904        Returns a list past due invoices for the account and notes if payment can be made through the REST API.   Privileges Required: account administrator
 905        This method makes a synchronous HTTP request by default. To make an
 906        asynchronous HTTP request, please define a `callback` function
 907        to be invoked when receiving the response.
 908        >>> def callback_function(response):
 909        >>>     pprint(response)
 910        >>>
 911        >>> thread = api.list_invoices_past_due(account_id, callback=callback_function)
 912
 913        :param callback function: The callback function
 914            for asynchronous request. (optional)
 915        :param str account_id: The external account number (int) or account ID Guid. (required)
 916        :return: BillingInvoicesSummary
 917                 If the method is called asynchronously,
 918                 returns the request thread.
 919        """
 920        kwargs['_return_http_data_only'] = True
 921        if kwargs.get('callback'):
 922            return self.list_invoices_past_due_with_http_info(account_id, **kwargs)
 923        else:
 924            (data) = self.list_invoices_past_due_with_http_info(account_id, **kwargs)
 925            return data
 926
 927    def list_invoices_past_due_with_http_info(self, account_id, **kwargs):
 928        """
 929        Get a list of past due invoices.
 930        Returns a list past due invoices for the account and notes if payment can be made through the REST API.   Privileges Required: account administrator
 931        This method makes a synchronous HTTP request by default. To make an
 932        asynchronous HTTP request, please define a `callback` function
 933        to be invoked when receiving the response.
 934        >>> def callback_function(response):
 935        >>>     pprint(response)
 936        >>>
 937        >>> thread = api.list_invoices_past_due_with_http_info(account_id, callback=callback_function)
 938
 939        :param callback function: The callback function
 940            for asynchronous request. (optional)
 941        :param str account_id: The external account number (int) or account ID Guid. (required)
 942        :return: BillingInvoicesSummary
 943                 If the method is called asynchronously,
 944                 returns the request thread.
 945        """
 946
 947        all_params = ['account_id']
 948        all_params.append('callback')
 949        all_params.append('_return_http_data_only')
 950        all_params.append('_preload_content')
 951        all_params.append('_request_timeout')
 952
 953        params = locals()
 954        for key, val in iteritems(params['kwargs']):
 955            if key not in all_params:
 956                raise TypeError(
 957                    "Got an unexpected keyword argument '%s'"
 958                    " to method list_invoices_past_due" % key
 959                )
 960            params[key] = val
 961        del params['kwargs']
 962        # verify the required parameter 'account_id' is set
 963        if ('account_id' not in params) or (params['account_id'] is None):
 964            raise ValueError("Missing the required parameter `account_id` when calling `list_invoices_past_due`")
 965
 966
 967        collection_formats = {}
 968
 969        resource_path = '/v2.1/accounts/{accountId}/billing_invoices_past_due'.replace('{format}', 'json')
 970        path_params = {}
 971        if 'account_id' in params:
 972            path_params['accountId'] = params['account_id']
 973
 974        query_params = {}
 975
 976        header_params = {}
 977
 978        form_params = []
 979        local_var_files = {}
 980
 981        body_params = None
 982        # HTTP header `Accept`
 983        header_params['Accept'] = self.api_client.\
 984            select_header_accept(['application/json'])
 985
 986        # Authentication setting
 987        auth_settings = []
 988
 989        return self.api_client.call_api(resource_path, 'GET',
 990                                        path_params,
 991                                        query_params,
 992                                        header_params,
 993                                        body=body_params,
 994                                        post_params=form_params,
 995                                        files=local_var_files,
 996                                        response_type='BillingInvoicesSummary',
 997                                        auth_settings=auth_settings,
 998                                        callback=params.get('callback'),
 999                                        _return_http_data_only=params.get('_return_http_data_only'),
1000                                        _preload_content=params.get('_preload_content', True),
1001                                        _request_timeout=params.get('_request_timeout'),
1002                                        collection_formats=collection_formats)
1003
1004    def list_payments(self, account_id, **kwargs):
1005        """
1006        Gets payment information for one or more payments.
1007        Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days.   Privileges required: account administrator 
1008        This method makes a synchronous HTTP request by default. To make an
1009        asynchronous HTTP request, please define a `callback` function
1010        to be invoked when receiving the response.
1011        >>> def callback_function(response):
1012        >>>     pprint(response)
1013        >>>
1014        >>> thread = api.list_payments(account_id, callback=callback_function)
1015
1016        :param callback function: The callback function
1017            for asynchronous request. (optional)
1018        :param str account_id: The external account number (int) or account ID Guid. (required)
1019        :param str from_date: Specifies the date/time of the earliest payment in the account to retrieve.
1020        :param str to_date: Specifies the date/time of the latest payment in the account to retrieve.
1021        :return: BillingPaymentsResponse
1022                 If the method is called asynchronously,
1023                 returns the request thread.
1024        """
1025        kwargs['_return_http_data_only'] = True
1026        if kwargs.get('callback'):
1027            return self.list_payments_with_http_info(account_id, **kwargs)
1028        else:
1029            (data) = self.list_payments_with_http_info(account_id, **kwargs)
1030            return data
1031
1032    def list_payments_with_http_info(self, account_id, **kwargs):
1033        """
1034        Gets payment information for one or more payments.
1035        Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days.   Privileges required: account administrator 
1036        This method makes a synchronous HTTP request by default. To make an
1037        asynchronous HTTP request, please define a `callback` function
1038        to be invoked when receiving the response.
1039        >>> def callback_function(response):
1040        >>>     pprint(response)
1041        >>>
1042        >>> thread = api.list_payments_with_http_info(account_id, callback=callback_function)
1043
1044        :param callback function: The callback function
1045            for asynchronous request. (optional)
1046        :param str account_id: The external account number (int) or account ID Guid. (required)
1047        :param str from_date: Specifies the date/time of the earliest payment in the account to retrieve.
1048        :param str to_date: Specifies the date/time of the latest payment in the account to retrieve.
1049        :return: BillingPaymentsResponse
1050                 If the method is called asynchronously,
1051                 returns the request thread.
1052        """
1053
1054        all_params = ['account_id', 'from_date', 'to_date']
1055        all_params.append('callback')
1056        all_params.append('_return_http_data_only')
1057        all_params.append('_preload_content')
1058        all_params.append('_request_timeout')
1059
1060        params = locals()
1061        for key, val in iteritems(params['kwargs']):
1062            if key not in all_params:
1063                raise TypeError(
1064                    "Got an unexpected keyword argument '%s'"
1065                    " to method list_payments" % key
1066                )
1067            params[key] = val
1068        del params['kwargs']
1069        # verify the required parameter 'account_id' is set
1070        if ('account_id' not in params) or (params['account_id'] is None):
1071            raise ValueError("Missing the required parameter `account_id` when calling `list_payments`")
1072
1073
1074        collection_formats = {}
1075
1076        resource_path = '/v2.1/accounts/{accountId}/billing_payments'.replace('{format}', 'json')
1077        path_params = {}
1078        if 'account_id' in params:
1079            path_params['accountId'] = params['account_id']
1080
1081        query_params = {}
1082        if 'from_date' in params:
1083            query_params['from_date'] = params['from_date']
1084        if 'to_date' in params:
1085            query_params['to_date'] = params['to_date']
1086
1087        header_params = {}
1088
1089        form_params = []
1090        local_var_files = {}
1091
1092        body_params = None
1093        # HTTP header `Accept`
1094        header_params['Accept'] = self.api_client.\
1095            select_header_accept(['application/json'])
1096
1097        # Authentication setting
1098        auth_settings = []
1099
1100        return self.api_client.call_api(resource_path, 'GET',
1101                                        path_params,
1102                                        query_params,
1103                                        header_params,
1104                                        body=body_params,
1105                                        post_params=form_params,
1106                                        files=local_var_files,
1107                                        response_type='BillingPaymentsResponse',
1108                                        auth_settings=auth_settings,
1109                                        callback=params.get('callback'),
1110                                        _return_http_data_only=params.get('_return_http_data_only'),
1111                                        _preload_content=params.get('_preload_content', True),
1112                                        _request_timeout=params.get('_request_timeout'),
1113                                        collection_formats=collection_formats)
1114
1115    def make_payment(self, account_id, **kwargs):
1116        """
1117        Posts a payment to a past due invoice.
1118        Posts a payment to a past due invoice.   ###### Note: This can only be used if the `paymentAllowed` value for a past due invoice is true. This can be determined calling [ML:GetBillingInvoicesPastDue].  The response returns information for a single payment, if a payment ID was used in the endpoint, or a list of payments. If the from date or to date queries or payment ID are not used, the response returns payment information for the last 365 days. If the request was for a single payment ID, the `nextUri` and `previousUri` properties are not returned.  Privileges required: account administrator
1119        This method makes a synchronous HTTP request by default. To make an
1120        asynchronous HTTP request, please define a `callback` function
1121        to be invoked when receiving the response.
1122        >>> def callback_function(response):
1123        >>>     pprint(response)
1124        >>>
1125        >>> thread = api.make_payment(account_id, callback=callback_function)
1126
1127        :param callback function: The callback function
1128            for asynchronous request. (optional)
1129        :param str account_id: The external account number (int) or account ID Guid. (required)
1130        :param BillingPaymentRequest billing_payment_request:
1131        :return: BillingPaymentResponse
1132                 If the method is called asynchronously,
1133                 returns the request thread.
1134        """
1135        kwargs['_return_http_data_only'] = True
1136        if kwargs.get('callback'):
1137            return self.make_payment_with_http_info(account_id, **kwargs)
1138        else:
1139            (data) = self.make_payment_with_http_info(account_id, **kwargs)
1140            return data
1141
1142    def make_payment_with_http_info(self, account_id, **kwargs):
1143        """
1144        Posts a payment to a past due invoice.
1145        Posts a payment to a past due invoice.   ###### Note: This can only be used if the `paymentAllowed` value for a past due invoice is true. This can be determined calling [ML:GetBillingInvoicesPastDue].  The response returns information for a single payment, if a payment ID was used in the endpoint, or a list of payments. If the from date or to date queries or payment ID are not used, the response returns payment information for the last 365 days. If the request was for a single payment ID, the `nextUri` and `previousUri` properties are not returned.  Privileges required: account administrator
1146        This method makes a synchronous HTTP request by default. To make an
1147        asynchronous HTTP request, please define a `callback` function
1148        to be invoked when receiving the response.
1149        >>> def callback_function(response):
1150        >>>     pprint(response)
1151        >>>
1152        >>> thread = api.make_payment_with_http_info(account_id, callback=callback_function)
1153
1154        :param callback function: The callback function
1155            for asynchronous request. (optional)
1156        :param str account_id: The external account number (int) or account ID Guid. (required)
1157        :param BillingPaymentRequest billing_payment_request:
1158        :return: BillingPaymentResponse
1159                 If the method is called asynchronously,
1160                 returns the request thread.
1161        """
1162
1163        all_params = ['account_id', 'billing_payment_request']
1164        all_params.append('callback')
1165        all_params.append('_return_http_data_only')
1166        all_params.append('_preload_content')
1167        all_params.append('_request_timeout')
1168
1169        params = locals()
1170        for key, val in iteritems(params['kwargs']):
1171            if key not in all_params:
1172                raise TypeError(
1173                    "Got an unexpected keyword argument '%s'"
1174                    " to method make_payment" % key
1175                )
1176            params[key] = val
1177        del params['kwargs']
1178        # verify the required parameter 'account_id' is set
1179        if ('account_id' not in params) or (params['account_id'] is None):
1180            raise ValueError("Missing the required parameter `account_id` when calling `make_payment`")
1181
1182
1183        collection_formats = {}
1184
1185        resource_path = '/v2.1/accounts/{accountId}/billing_payments'.replace('{format}', 'json')
1186        path_params = {}
1187        if 'account_id' in params:
1188            path_params['accountId'] = params['account_id']
1189
1190        query_params = {}
1191
1192        header_params = {}
1193
1194        form_params = []
1195        local_var_files = {}
1196
1197        body_params = None
1198        if 'billing_payment_request' in params:
1199            body_params = params['billing_payment_request']
1200        # HTTP header `Accept`
1201        header_params['Accept'] = self.api_client.\
1202            select_header_accept(['application/json'])
1203
1204        # Authentication setting
1205        auth_settings = []
1206
1207        return self.api_client.call_api(resource_path, 'POST',
1208                                        path_params,
1209                                        query_params,
1210                                        header_params,
1211                                        body=body_params,
1212                                        post_params=form_params,
1213                                        files=local_var_files,
1214                                        response_type='BillingPaymentResponse',
1215                                        auth_settings=auth_settings,
1216                                        callback=params.get('callback'),
1217                                        _return_http_data_only=params.get('_return_http_data_only'),
1218                                        _preload_content=params.get('_preload_content', True),
1219                                        _request_timeout=params.get('_request_timeout'),
1220                                        collection_formats=collection_formats)
1221
1222    def purchase_envelopes(self, account_id, **kwargs):
1223        """
1224        Reserverd: Purchase additional envelopes.
1225        Reserved: At this time, this endpoint is limited to DocuSign internal use only. Completes the purchase of envelopes for your account. The actual purchase is done as part of an internal workflow interaction with an envelope vendor.
1226        This method makes a synchronous HTTP request by default. To make an
1227        asynchronous HTTP request, please define a `callback` function
1228        to be invoked when receiving the response.
1229        >>> def callback_function(response):
1230        >>>     pprint(response)
1231        >>>
1232        >>> thread = api.purchase_envelopes(account_id, callback=callback_function)
1233
1234        :param callback function: The callback function
1235            for asynchronous request. (optional)
1236        :param str account_id: The external account number (int) or account ID Guid. (required)
1237        :param PurchasedEnvelopesInformation purchased_envelopes_information:
1238        :return: None
1239                 If the method is called asynchronously,
1240                 returns the request thread.
1241        """
1242        kwargs['_return_http_data_only'] = True
1243        if kwargs.get('callback'):
1244            return self.purchase_envelopes_with_http_info(account_id, **kwargs)
1245        else:
1246            (data) = self.purchase_envelopes_with_http_info(account_id, **kwargs)
1247            return data
1248
1249    def purchase_envelopes_with_http_info(self, account_id, **kwargs):
1250        """
1251        Reserverd: Purchase additional envelopes.
1252        Reserved: At this time, this endpoint is limited to DocuSign internal use only. Completes the purchase of envelopes for your account. The actual purchase is done as part of an internal workflow interaction with an envelope vendor.
1253        This method makes a synchronous HTTP request by default. To make an
1254        asynchronous HTTP request, please define a `callback` function
1255        to be invoked when receiving the response.
1256        >>> def callback_function(response):
1257        >>>     pprint(response)
1258        >>>
1259        >>> thread = api.purchase_envelopes_with_http_info(account_id, callback=callback_function)
1260
1261        :param callback function: The callback function
1262            for asynchronous request. (optional)
1263        :param str account_id: The external account number (int) or account ID Guid. (required)
1264        :param PurchasedEnvelopesInformation purchased_envelopes_information:
1265        :return: None
1266                 If the method is called asynchronously,
1267                 returns the request thread.
1268        """
1269
1270        all_params = ['account_id', 'purchased_envelopes_information']
1271        all_params.append('callback')
1272        all_params.append('_return_http_data_only')
1273        all_params.append('_preload_content')
1274        all_params.append('_request_timeout')
1275
1276        params = locals()
1277        for key, val in iteritems(params['kwargs']):
1278            if key not in all_params:
1279                raise TypeError(
1280                    "Got an unexpected keyword argument '%s'"
1281                    " to method purchase_envelopes" % key
1282                )
1283            params[key] = val
1284        del params['kwargs']
1285        # verify the required parameter 'account_id' is set
1286        if ('account_id' not in params) or (params['account_id'] is None):
1287            raise ValueError("Missing the required parameter `account_id` when calling `purchase_envelopes`")
1288
1289
1290        collection_formats = {}
1291
1292        resource_path = '/v2.1/accounts/{accountId}/billing_plan/purchased_envelopes'.replace('{format}', 'json')
1293        path_params = {}
1294        if 'account_id' in params:
1295            path_params['accountId'] = params['account_id']
1296
1297        query_params = {}
1298
1299        header_params = {}
1300
1301        form_params = []
1302        local_var_files = {}
1303
1304        body_params = None
1305        if 'purchased_envelopes_information' in params:
1306            body_params = params['purchased_envelopes_information']
1307        # HTTP header `Accept`
1308        header_params['Accept'] = self.api_client.\
1309            select_header_accept(['application/json'])
1310
1311        # Authentication setting
1312        auth_settings = []
1313
1314        return self.api_client.call_api(resource_path, 'PUT',
1315                                        path_params,
1316                                        query_params,
1317                                        header_params,
1318                                        body=body_params,
1319                                        post_params=form_params,
1320                                        files=local_var_files,
1321                                        response_type=None,
1322                                        auth_settings=auth_settings,
1323                                        callback=params.get('callback'),
1324                                        _return_http_data_only=params.get('_return_http_data_only'),
1325                                        _preload_content=params.get('_preload_content', True),
1326                                        _request_timeout=params.get('_request_timeout'),
1327                                        collection_formats=collection_formats)
1328
1329    def update_downgrade_account_billing_plan(self, account_id, **kwargs):
1330        """
1331        Queues downgrade billing plan request for an account.
1332        
1333        This method makes a synchronous HTTP request by default. To make an
1334        asynchronous HTTP request, please define a `callback` function
1335        to be invoked when receiving the response.
1336        >>> def callback_function(response):
1337        >>>     pprint(response)
1338        >>>
1339        >>> thread = api.update_downgrade_account_billing_plan(account_id, callback=callback_function)
1340
1341        :param callback function: The callback function
1342            for asynchronous request. (optional)
1343        :param str account_id: The external account number (int) or account ID Guid. (required)
1344        :param DowngradeBillingPlanInformation downgrade_billing_plan_information:
1345        :return: DowngradePlanUpdateResponse
1346                 If the method is called asynchronously,
1347                 returns the request thread.
1348        """
1349        kwargs['_return_http_data_only'] = True
1350        if kwargs.get('callback'):
1351            return self.update_downgrade_account_billing_plan_with_http_info(account_id, **kwargs)
1352        else:
1353            (data) = self.update_downgrade_account_billing_plan_with_http_info(account_id, **kwargs)
1354            return data
1355
1356    def update_downgrade_account_billing_plan_with_http_info(self, account_id, **kwargs):
1357        """
1358        Queues downgrade billing plan request for an account.
1359        
1360        This method makes a synchronous HTTP request by default. To make an
1361        asynchronous HTTP request, please define a `callback` function
1362        to be invoked when receiving the response.
1363        >>> def callback_function(response):
1364        >>>     pprint(response)
1365        >>>
1366        >>> thread = api.update_downgrade_account_billing_plan_with_http_info(account_id, callback=callback_function)
1367
1368        :param callback function: The callback function
1369            for asynchronous request. (optional)
1370        :param str account_id: The external account number (int) or account ID Guid. (required)
1371        :param DowngradeBillingPlanInformation downgrade_billing_plan_information:
1372        :return: DowngradePlanUpdateResponse
1373                 If the method is called asynchronously,
1374                 returns the request thread.
1375        """
1376
1377        all_params = ['account_id', 'downgrade_billing_plan_information']
1378        all_params.append('callback')
1379        all_params.append('_return_http_data_only')
1380        all_params.append('_preload_content')
1381        all_params.append('_request_timeout')
1382
1383        params = locals()
1384        for key, val in iteritems(params['kwargs']):
1385            if key not in all_params:
1386                raise TypeError(
1387                    "Got an unexpected keyword argument '%s'"
1388                    " to method update_downgrade_account_billing_plan" % key
1389                )
1390            params[key] = val
1391        del params['kwargs']
1392        # verify the required parameter 'account_id' is set
1393        if ('account_id' not in params) or (params['account_id'] is None):
1394            raise ValueError("Missing the required parameter `account_id` when calling `update_downgrade_account_billing_plan`")
1395
1396
1397        collection_formats = {}
1398
1399        resource_path = '/v2.1/accounts/{accountId}/billing_plan/downgrade'.replace('{format}', 'json')
1400        path_params = {}
1401        if 'account_id' in params:
1402            path_params['accountId'] = params['account_id']
1403
1404        query_params = {}
1405
1406        header_params = {}
1407
1408        form_params = []
1409        local_var_files = {}
1410
1411        body_params = None
1412        if 'downgrade_billing_plan_information' in params:
1413            body_params = params['downgrade_billing_plan_information']
1414        # HTTP header `Accept`
1415        header_params['Accept'] = self.api_client.\
1416            select_header_accept(['application/json'])
1417
1418        # Authentication setting
1419        auth_settings = []
1420
1421        return self.api_client.call_api(resource_path, 'PUT',
1422                                        path_params,
1423                                        query_params,
1424                                        header_params,
1425                                        body=body_params,
1426                                        post_params=form_params,
1427                                        files=local_var_files,
1428                                        response_type='DowngradePlanUpdateResponse',
1429                                        auth_settings=auth_settings,
1430                                        callback=params.get('callback'),
1431                                        _return_http_data_only=params.get('_return_http_data_only'),
1432                                        _preload_content=params.get('_preload_content', True),
1433                                        _request_timeout=params.get('_request_timeout'),
1434                                        collection_formats=collection_formats)
1435
1436    def update_plan(self, account_id, **kwargs):
1437        """
1438        Updates the account billing plan.
1439        Updates the billing plan information, billing address, and credit card information for the specified account.
1440        This method makes a synchronous HTTP request by default. To make an
1441        asynchronous HTTP request, please define a `callback` function
1442        to be invoked when receiving the response.
1443        >>> def callback_function(response):
1444        >>>     pprint(response)
1445        >>>
1446        >>> thread = api.update_plan(account_id, callback=callback_function)
1447
1448        :param callback function: The callback function
1449            for asynchronous request. (optional)
1450        :param str account_id: The external account number (int) or account ID Guid. (required)
1451        :param str preview_billing_plan: When set to **true**, updates the account using a preview billing plan.
1452        :param BillingPlanInformation billing_plan_information:
1453        :return: BillingPlanUpdateResponse
1454                 If the method is called asynchronously,
1455                 returns the request thread.
1456        """
1457        kwargs['_return_http_data_only'] = True
1458        if kwargs.get('callback'):
1459            return self.update_plan_with_http_info(account_id, **kwargs)
1460        else:
1461            (data) = self.update_plan_with_http_info(account_id, **kwargs)
1462            return data
1463
1464    def update_plan_with_http_info(self, account_id, **kwargs):
1465        """
1466        Updates the account billing plan.
1467        Updates the billing plan information, billing address, and credit card information for the specified account.
1468        This method makes a synchronous HTTP request by default. To make an
1469        asynchronous HTTP request, please define a `callback` function
1470        to be invoked when receiving the response.
1471        >>> def callback_function(response):
1472        >>>     pprint(response)
1473        >>>
1474        >>> thread = api.update_plan_with_http_info(account_id, callback=callback_function)
1475
1476        :param callback function: The callback function
1477            for asynchronous request. (optional)
1478        :param str account_id: The external account number (int) or account ID Guid. (required)
1479        :param str preview_billing_plan: When set to **true**, updates the account using a preview billing plan.
1480        :param BillingPlanInformation billing_plan_information:
1481        :return: BillingPlanUpdateResponse
1482                 If the method is called asynchronously,
1483                 returns the request thread.
1484        """
1485
1486        all_params = ['account_id', 'preview_billing_plan', 'billing_plan_information']
1487        all_params.append('callback')
1488        all_params.append('_return_http_data_only')
1489        all_params.append('_preload_content')
1490        all_params.append('_request_timeout')
1491
1492        params = locals()
1493        for key, val in iteritems(params['kwargs']):
1494            if key not in all_params:
1495                raise TypeError(
1496                    "Got an unexpected keyword argument '%s'"
1497                    " to method update_plan" % key
1498                )
1499            params[key] = val
1500        del params['kwargs']
1501        # verify the required parameter 'account_id' is set
1502        if ('account_id' not in params) or (params['account_id'] is None):
1503            raise ValueError("Missing the required parameter `account_id` when calling `update_plan`")
1504
1505
1506        collection_formats = {}
1507
1508        resource_path = '/v2.1/accounts/{accountId}/billing_plan'.replace('{format}', 'json')
1509        path_params = {}
1510        if 'account_id' in params:
1511            path_params['accountId'] = params['account_id']
1512
1513        query_params = {}
1514        if 'preview_billing_plan' in params:
1515            query_params['preview_billing_plan'] = params['preview_billing_plan']
1516
1517        header_params = {}
1518
1519        form_params = []
1520        local_var_files = {}
1521
1522        body_params = None
1523        if 'billing_plan_information' in params:
1524            body_params = params['billing_plan_information']
1525        # HTTP header `Accept`
1526        header_params['Accept'] = self.api_client.\
1527            select_header_accept(['application/json'])
1528
1529        # Authentication setting
1530        auth_settings = []
1531
1532        return self.api_client.call_api(resource_path, 'PUT',
1533                                        path_params,
1534                                        query_params,
1535                                        header_params,
1536                                        body=body_params,
1537                                        post_params=form_params,
1538                                        files=local_var_files,
1539                                        response_type='BillingPlanUpdateResponse',
1540                                        auth_settings=auth_settings,
1541                                        callback=params.get('callback'),
1542                                        _return_http_data_only=params.get('_return_http_data_only'),
1543                                        _preload_content=params.get('_preload_content', True),
1544                                        _request_timeout=params.get('_request_timeout'),
1545                                        collection_formats=collection_formats)
class BillingApi:
  28class BillingApi(object):
  29    """
  30    NOTE: This class is auto generated by the swagger code generator program.
  31    Do not edit the class manually.
  32    Ref: https://github.com/swagger-api/swagger-codegen
  33    """
  34
  35    def __init__(self, api_client=None):
  36        config = Configuration()
  37        if api_client:
  38            self.api_client = api_client
  39        else:
  40            if not config.api_client:
  41                config.api_client = ApiClient()
  42            self.api_client = config.api_client
  43
  44    def get_billing_plan(self, billing_plan_id, **kwargs):
  45        """
  46        Get the billing plan details.
  47        Retrieves the billing plan details for the specified billing plan ID.
  48        This method makes a synchronous HTTP request by default. To make an
  49        asynchronous HTTP request, please define a `callback` function
  50        to be invoked when receiving the response.
  51        >>> def callback_function(response):
  52        >>>     pprint(response)
  53        >>>
  54        >>> thread = api.get_billing_plan(billing_plan_id, callback=callback_function)
  55
  56        :param callback function: The callback function
  57            for asynchronous request. (optional)
  58        :param str billing_plan_id: The ID of the billing plan being accessed. (required)
  59        :return: BillingPlanResponse
  60                 If the method is called asynchronously,
  61                 returns the request thread.
  62        """
  63        kwargs['_return_http_data_only'] = True
  64        if kwargs.get('callback'):
  65            return self.get_billing_plan_with_http_info(billing_plan_id, **kwargs)
  66        else:
  67            (data) = self.get_billing_plan_with_http_info(billing_plan_id, **kwargs)
  68            return data
  69
  70    def get_billing_plan_with_http_info(self, billing_plan_id, **kwargs):
  71        """
  72        Get the billing plan details.
  73        Retrieves the billing plan details for the specified billing plan ID.
  74        This method makes a synchronous HTTP request by default. To make an
  75        asynchronous HTTP request, please define a `callback` function
  76        to be invoked when receiving the response.
  77        >>> def callback_function(response):
  78        >>>     pprint(response)
  79        >>>
  80        >>> thread = api.get_billing_plan_with_http_info(billing_plan_id, callback=callback_function)
  81
  82        :param callback function: The callback function
  83            for asynchronous request. (optional)
  84        :param str billing_plan_id: The ID of the billing plan being accessed. (required)
  85        :return: BillingPlanResponse
  86                 If the method is called asynchronously,
  87                 returns the request thread.
  88        """
  89
  90        all_params = ['billing_plan_id']
  91        all_params.append('callback')
  92        all_params.append('_return_http_data_only')
  93        all_params.append('_preload_content')
  94        all_params.append('_request_timeout')
  95
  96        params = locals()
  97        for key, val in iteritems(params['kwargs']):
  98            if key not in all_params:
  99                raise TypeError(
 100                    "Got an unexpected keyword argument '%s'"
 101                    " to method get_billing_plan" % key
 102                )
 103            params[key] = val
 104        del params['kwargs']
 105        # verify the required parameter 'billing_plan_id' is set
 106        if ('billing_plan_id' not in params) or (params['billing_plan_id'] is None):
 107            raise ValueError("Missing the required parameter `billing_plan_id` when calling `get_billing_plan`")
 108
 109
 110        collection_formats = {}
 111
 112        resource_path = '/v2.1/billing_plans/{billingPlanId}'.replace('{format}', 'json')
 113        path_params = {}
 114        if 'billing_plan_id' in params:
 115            path_params['billingPlanId'] = params['billing_plan_id']
 116
 117        query_params = {}
 118
 119        header_params = {}
 120
 121        form_params = []
 122        local_var_files = {}
 123
 124        body_params = None
 125        # HTTP header `Accept`
 126        header_params['Accept'] = self.api_client.\
 127            select_header_accept(['application/json'])
 128
 129        # Authentication setting
 130        auth_settings = []
 131
 132        return self.api_client.call_api(resource_path, 'GET',
 133                                        path_params,
 134                                        query_params,
 135                                        header_params,
 136                                        body=body_params,
 137                                        post_params=form_params,
 138                                        files=local_var_files,
 139                                        response_type='BillingPlanResponse',
 140                                        auth_settings=auth_settings,
 141                                        callback=params.get('callback'),
 142                                        _return_http_data_only=params.get('_return_http_data_only'),
 143                                        _preload_content=params.get('_preload_content', True),
 144                                        _request_timeout=params.get('_request_timeout'),
 145                                        collection_formats=collection_formats)
 146
 147    def get_credit_card_info(self, account_id, **kwargs):
 148        """
 149        Get metadata for a given credit card.
 150        This method returns information about a credit card associated with an account.
 151        This method makes a synchronous HTTP request by default. To make an
 152        asynchronous HTTP request, please define a `callback` function
 153        to be invoked when receiving the response.
 154        >>> def callback_function(response):
 155        >>>     pprint(response)
 156        >>>
 157        >>> thread = api.get_credit_card_info(account_id, callback=callback_function)
 158
 159        :param callback function: The callback function
 160            for asynchronous request. (optional)
 161        :param str account_id: The external account number (int) or account ID Guid. (required)
 162        :return: CreditCardInformation
 163                 If the method is called asynchronously,
 164                 returns the request thread.
 165        """
 166        kwargs['_return_http_data_only'] = True
 167        if kwargs.get('callback'):
 168            return self.get_credit_card_info_with_http_info(account_id, **kwargs)
 169        else:
 170            (data) = self.get_credit_card_info_with_http_info(account_id, **kwargs)
 171            return data
 172
 173    def get_credit_card_info_with_http_info(self, account_id, **kwargs):
 174        """
 175        Get metadata for a given credit card.
 176        This method returns information about a credit card associated with an account.
 177        This method makes a synchronous HTTP request by default. To make an
 178        asynchronous HTTP request, please define a `callback` function
 179        to be invoked when receiving the response.
 180        >>> def callback_function(response):
 181        >>>     pprint(response)
 182        >>>
 183        >>> thread = api.get_credit_card_info_with_http_info(account_id, callback=callback_function)
 184
 185        :param callback function: The callback function
 186            for asynchronous request. (optional)
 187        :param str account_id: The external account number (int) or account ID Guid. (required)
 188        :return: CreditCardInformation
 189                 If the method is called asynchronously,
 190                 returns the request thread.
 191        """
 192
 193        all_params = ['account_id']
 194        all_params.append('callback')
 195        all_params.append('_return_http_data_only')
 196        all_params.append('_preload_content')
 197        all_params.append('_request_timeout')
 198
 199        params = locals()
 200        for key, val in iteritems(params['kwargs']):
 201            if key not in all_params:
 202                raise TypeError(
 203                    "Got an unexpected keyword argument '%s'"
 204                    " to method get_credit_card_info" % key
 205                )
 206            params[key] = val
 207        del params['kwargs']
 208        # verify the required parameter 'account_id' is set
 209        if ('account_id' not in params) or (params['account_id'] is None):
 210            raise ValueError("Missing the required parameter `account_id` when calling `get_credit_card_info`")
 211
 212
 213        collection_formats = {}
 214
 215        resource_path = '/v2.1/accounts/{accountId}/billing_plan/credit_card'.replace('{format}', 'json')
 216        path_params = {}
 217        if 'account_id' in params:
 218            path_params['accountId'] = params['account_id']
 219
 220        query_params = {}
 221
 222        header_params = {}
 223
 224        form_params = []
 225        local_var_files = {}
 226
 227        body_params = None
 228        # HTTP header `Accept`
 229        header_params['Accept'] = self.api_client.\
 230            select_header_accept(['application/json'])
 231
 232        # Authentication setting
 233        auth_settings = []
 234
 235        return self.api_client.call_api(resource_path, 'GET',
 236                                        path_params,
 237                                        query_params,
 238                                        header_params,
 239                                        body=body_params,
 240                                        post_params=form_params,
 241                                        files=local_var_files,
 242                                        response_type='CreditCardInformation',
 243                                        auth_settings=auth_settings,
 244                                        callback=params.get('callback'),
 245                                        _return_http_data_only=params.get('_return_http_data_only'),
 246                                        _preload_content=params.get('_preload_content', True),
 247                                        _request_timeout=params.get('_request_timeout'),
 248                                        collection_formats=collection_formats)
 249
 250    def get_downgrade_request_billing_info(self, account_id, **kwargs):
 251        """
 252        Returns downgrade plan information for the specified account.
 253        
 254        This method makes a synchronous HTTP request by default. To make an
 255        asynchronous HTTP request, please define a `callback` function
 256        to be invoked when receiving the response.
 257        >>> def callback_function(response):
 258        >>>     pprint(response)
 259        >>>
 260        >>> thread = api.get_downgrade_request_billing_info(account_id, callback=callback_function)
 261
 262        :param callback function: The callback function
 263            for asynchronous request. (optional)
 264        :param str account_id: The external account number (int) or account ID Guid. (required)
 265        :return: DowngradRequestBillingInfoResponse
 266                 If the method is called asynchronously,
 267                 returns the request thread.
 268        """
 269        kwargs['_return_http_data_only'] = True
 270        if kwargs.get('callback'):
 271            return self.get_downgrade_request_billing_info_with_http_info(account_id, **kwargs)
 272        else:
 273            (data) = self.get_downgrade_request_billing_info_with_http_info(account_id, **kwargs)
 274            return data
 275
 276    def get_downgrade_request_billing_info_with_http_info(self, account_id, **kwargs):
 277        """
 278        Returns downgrade plan information for the specified account.
 279        
 280        This method makes a synchronous HTTP request by default. To make an
 281        asynchronous HTTP request, please define a `callback` function
 282        to be invoked when receiving the response.
 283        >>> def callback_function(response):
 284        >>>     pprint(response)
 285        >>>
 286        >>> thread = api.get_downgrade_request_billing_info_with_http_info(account_id, callback=callback_function)
 287
 288        :param callback function: The callback function
 289            for asynchronous request. (optional)
 290        :param str account_id: The external account number (int) or account ID Guid. (required)
 291        :return: DowngradRequestBillingInfoResponse
 292                 If the method is called asynchronously,
 293                 returns the request thread.
 294        """
 295
 296        all_params = ['account_id']
 297        all_params.append('callback')
 298        all_params.append('_return_http_data_only')
 299        all_params.append('_preload_content')
 300        all_params.append('_request_timeout')
 301
 302        params = locals()
 303        for key, val in iteritems(params['kwargs']):
 304            if key not in all_params:
 305                raise TypeError(
 306                    "Got an unexpected keyword argument '%s'"
 307                    " to method get_downgrade_request_billing_info" % key
 308                )
 309            params[key] = val
 310        del params['kwargs']
 311        # verify the required parameter 'account_id' is set
 312        if ('account_id' not in params) or (params['account_id'] is None):
 313            raise ValueError("Missing the required parameter `account_id` when calling `get_downgrade_request_billing_info`")
 314
 315
 316        collection_formats = {}
 317
 318        resource_path = '/v2.1/accounts/{accountId}/billing_plan/downgrade'.replace('{format}', 'json')
 319        path_params = {}
 320        if 'account_id' in params:
 321            path_params['accountId'] = params['account_id']
 322
 323        query_params = {}
 324
 325        header_params = {}
 326
 327        form_params = []
 328        local_var_files = {}
 329
 330        body_params = None
 331        # HTTP header `Accept`
 332        header_params['Accept'] = self.api_client.\
 333            select_header_accept(['application/json'])
 334
 335        # Authentication setting
 336        auth_settings = []
 337
 338        return self.api_client.call_api(resource_path, 'GET',
 339                                        path_params,
 340                                        query_params,
 341                                        header_params,
 342                                        body=body_params,
 343                                        post_params=form_params,
 344                                        files=local_var_files,
 345                                        response_type='DowngradRequestBillingInfoResponse',
 346                                        auth_settings=auth_settings,
 347                                        callback=params.get('callback'),
 348                                        _return_http_data_only=params.get('_return_http_data_only'),
 349                                        _preload_content=params.get('_preload_content', True),
 350                                        _request_timeout=params.get('_request_timeout'),
 351                                        collection_formats=collection_formats)
 352
 353    def get_invoice(self, account_id, invoice_id, **kwargs):
 354        """
 355        Retrieves a billing invoice.
 356        Retrieves the specified invoice.   ###### Note: If the `pdfAvailable` property in the response is set to *true*, you can download a PDF version of the invoice. To download the PDF, make the call again and change the value of the `Accept` property in the header to `Accept: application/pdf`.  Privileges required: account administrator  The response returns a list of charges and information about the charges. Quantities are usually shown as 'unlimited' or an integer. Amounts are shown in the currency set for the account.  **Response** The following table provides a description of the different `chargeName` property values. The information will grow as more chargeable items are added to the system.  | chargeName | Description | | --- | --- | | id_check | ID Check Charge | | in_person_signing | In Person Signing charge | | envelopes Included | Sent Envelopes for the account | | age_verify | Age verification check | | ofac | OFAC Check | | id_confirm | ID confirmation check | | student_authentication | STAN PIN authentication check | | wet_sign_fax | Pages for returning signed documents by fax | | attachment_fax | Pages for returning attachments by fax | | phone_authentication | Phone authentication charge | | powerforms | PowerForm envelopes sent | | signer_payments | Payment processing charge | | outbound_fax | Send by fax charge | | bulk_recipient_envelopes | Bulk Recipient Envelopes sent | | sms_authentications | SMS authentication charge | | saml_authentications | SAML authentication charge | | express_signer_certificate | DocuSign Express Certificate charge | | personal_signer_certificate | Personal Signer Certificate charge | | safe_certificate | SAFE BioPharma Signer Certificate charge | | seats | Included active seats charge | | open_trust_certificate | OpenTrust Signer Certificate charge | 
 357        This method makes a synchronous HTTP request by default. To make an
 358        asynchronous HTTP request, please define a `callback` function
 359        to be invoked when receiving the response.
 360        >>> def callback_function(response):
 361        >>>     pprint(response)
 362        >>>
 363        >>> thread = api.get_invoice(account_id, invoice_id, callback=callback_function)
 364
 365        :param callback function: The callback function
 366            for asynchronous request. (optional)
 367        :param str account_id: The external account number (int) or account ID Guid. (required)
 368        :param str invoice_id: (required)
 369        :return: BillingInvoice
 370                 If the method is called asynchronously,
 371                 returns the request thread.
 372        """
 373        kwargs['_return_http_data_only'] = True
 374        if kwargs.get('callback'):
 375            return self.get_invoice_with_http_info(account_id, invoice_id, **kwargs)
 376        else:
 377            (data) = self.get_invoice_with_http_info(account_id, invoice_id, **kwargs)
 378            return data
 379
 380    def get_invoice_with_http_info(self, account_id, invoice_id, **kwargs):
 381        """
 382        Retrieves a billing invoice.
 383        Retrieves the specified invoice.   ###### Note: If the `pdfAvailable` property in the response is set to *true*, you can download a PDF version of the invoice. To download the PDF, make the call again and change the value of the `Accept` property in the header to `Accept: application/pdf`.  Privileges required: account administrator  The response returns a list of charges and information about the charges. Quantities are usually shown as 'unlimited' or an integer. Amounts are shown in the currency set for the account.  **Response** The following table provides a description of the different `chargeName` property values. The information will grow as more chargeable items are added to the system.  | chargeName | Description | | --- | --- | | id_check | ID Check Charge | | in_person_signing | In Person Signing charge | | envelopes Included | Sent Envelopes for the account | | age_verify | Age verification check | | ofac | OFAC Check | | id_confirm | ID confirmation check | | student_authentication | STAN PIN authentication check | | wet_sign_fax | Pages for returning signed documents by fax | | attachment_fax | Pages for returning attachments by fax | | phone_authentication | Phone authentication charge | | powerforms | PowerForm envelopes sent | | signer_payments | Payment processing charge | | outbound_fax | Send by fax charge | | bulk_recipient_envelopes | Bulk Recipient Envelopes sent | | sms_authentications | SMS authentication charge | | saml_authentications | SAML authentication charge | | express_signer_certificate | DocuSign Express Certificate charge | | personal_signer_certificate | Personal Signer Certificate charge | | safe_certificate | SAFE BioPharma Signer Certificate charge | | seats | Included active seats charge | | open_trust_certificate | OpenTrust Signer Certificate charge | 
 384        This method makes a synchronous HTTP request by default. To make an
 385        asynchronous HTTP request, please define a `callback` function
 386        to be invoked when receiving the response.
 387        >>> def callback_function(response):
 388        >>>     pprint(response)
 389        >>>
 390        >>> thread = api.get_invoice_with_http_info(account_id, invoice_id, callback=callback_function)
 391
 392        :param callback function: The callback function
 393            for asynchronous request. (optional)
 394        :param str account_id: The external account number (int) or account ID Guid. (required)
 395        :param str invoice_id: (required)
 396        :return: BillingInvoice
 397                 If the method is called asynchronously,
 398                 returns the request thread.
 399        """
 400
 401        all_params = ['account_id', 'invoice_id']
 402        all_params.append('callback')
 403        all_params.append('_return_http_data_only')
 404        all_params.append('_preload_content')
 405        all_params.append('_request_timeout')
 406
 407        params = locals()
 408        for key, val in iteritems(params['kwargs']):
 409            if key not in all_params:
 410                raise TypeError(
 411                    "Got an unexpected keyword argument '%s'"
 412                    " to method get_invoice" % key
 413                )
 414            params[key] = val
 415        del params['kwargs']
 416        # verify the required parameter 'account_id' is set
 417        if ('account_id' not in params) or (params['account_id'] is None):
 418            raise ValueError("Missing the required parameter `account_id` when calling `get_invoice`")
 419        # verify the required parameter 'invoice_id' is set
 420        if ('invoice_id' not in params) or (params['invoice_id'] is None):
 421            raise ValueError("Missing the required parameter `invoice_id` when calling `get_invoice`")
 422
 423
 424        collection_formats = {}
 425
 426        resource_path = '/v2.1/accounts/{accountId}/billing_invoices/{invoiceId}'.replace('{format}', 'json')
 427        path_params = {}
 428        if 'account_id' in params:
 429            path_params['accountId'] = params['account_id']
 430        if 'invoice_id' in params:
 431            path_params['invoiceId'] = params['invoice_id']
 432
 433        query_params = {}
 434
 435        header_params = {}
 436
 437        form_params = []
 438        local_var_files = {}
 439
 440        body_params = None
 441        # HTTP header `Accept`
 442        header_params['Accept'] = self.api_client.\
 443            select_header_accept(['application/json'])
 444
 445        # Authentication setting
 446        auth_settings = []
 447
 448        return self.api_client.call_api(resource_path, 'GET',
 449                                        path_params,
 450                                        query_params,
 451                                        header_params,
 452                                        body=body_params,
 453                                        post_params=form_params,
 454                                        files=local_var_files,
 455                                        response_type='BillingInvoice',
 456                                        auth_settings=auth_settings,
 457                                        callback=params.get('callback'),
 458                                        _return_http_data_only=params.get('_return_http_data_only'),
 459                                        _preload_content=params.get('_preload_content', True),
 460                                        _request_timeout=params.get('_request_timeout'),
 461                                        collection_formats=collection_formats)
 462
 463    def get_payment(self, account_id, payment_id, **kwargs):
 464        """
 465        Gets billing payment information for a specific payment.
 466        Retrieves the information for a specified payment.   Privileges required: account administrator 
 467        This method makes a synchronous HTTP request by default. To make an
 468        asynchronous HTTP request, please define a `callback` function
 469        to be invoked when receiving the response.
 470        >>> def callback_function(response):
 471        >>>     pprint(response)
 472        >>>
 473        >>> thread = api.get_payment(account_id, payment_id, callback=callback_function)
 474
 475        :param callback function: The callback function
 476            for asynchronous request. (optional)
 477        :param str account_id: The external account number (int) or account ID Guid. (required)
 478        :param str payment_id: (required)
 479        :return: BillingPaymentItem
 480                 If the method is called asynchronously,
 481                 returns the request thread.
 482        """
 483        kwargs['_return_http_data_only'] = True
 484        if kwargs.get('callback'):
 485            return self.get_payment_with_http_info(account_id, payment_id, **kwargs)
 486        else:
 487            (data) = self.get_payment_with_http_info(account_id, payment_id, **kwargs)
 488            return data
 489
 490    def get_payment_with_http_info(self, account_id, payment_id, **kwargs):
 491        """
 492        Gets billing payment information for a specific payment.
 493        Retrieves the information for a specified payment.   Privileges required: account administrator 
 494        This method makes a synchronous HTTP request by default. To make an
 495        asynchronous HTTP request, please define a `callback` function
 496        to be invoked when receiving the response.
 497        >>> def callback_function(response):
 498        >>>     pprint(response)
 499        >>>
 500        >>> thread = api.get_payment_with_http_info(account_id, payment_id, callback=callback_function)
 501
 502        :param callback function: The callback function
 503            for asynchronous request. (optional)
 504        :param str account_id: The external account number (int) or account ID Guid. (required)
 505        :param str payment_id: (required)
 506        :return: BillingPaymentItem
 507                 If the method is called asynchronously,
 508                 returns the request thread.
 509        """
 510
 511        all_params = ['account_id', 'payment_id']
 512        all_params.append('callback')
 513        all_params.append('_return_http_data_only')
 514        all_params.append('_preload_content')
 515        all_params.append('_request_timeout')
 516
 517        params = locals()
 518        for key, val in iteritems(params['kwargs']):
 519            if key not in all_params:
 520                raise TypeError(
 521                    "Got an unexpected keyword argument '%s'"
 522                    " to method get_payment" % key
 523                )
 524            params[key] = val
 525        del params['kwargs']
 526        # verify the required parameter 'account_id' is set
 527        if ('account_id' not in params) or (params['account_id'] is None):
 528            raise ValueError("Missing the required parameter `account_id` when calling `get_payment`")
 529        # verify the required parameter 'payment_id' is set
 530        if ('payment_id' not in params) or (params['payment_id'] is None):
 531            raise ValueError("Missing the required parameter `payment_id` when calling `get_payment`")
 532
 533
 534        collection_formats = {}
 535
 536        resource_path = '/v2.1/accounts/{accountId}/billing_payments/{paymentId}'.replace('{format}', 'json')
 537        path_params = {}
 538        if 'account_id' in params:
 539            path_params['accountId'] = params['account_id']
 540        if 'payment_id' in params:
 541            path_params['paymentId'] = params['payment_id']
 542
 543        query_params = {}
 544
 545        header_params = {}
 546
 547        form_params = []
 548        local_var_files = {}
 549
 550        body_params = None
 551        # HTTP header `Accept`
 552        header_params['Accept'] = self.api_client.\
 553            select_header_accept(['application/json'])
 554
 555        # Authentication setting
 556        auth_settings = []
 557
 558        return self.api_client.call_api(resource_path, 'GET',
 559                                        path_params,
 560                                        query_params,
 561                                        header_params,
 562                                        body=body_params,
 563                                        post_params=form_params,
 564                                        files=local_var_files,
 565                                        response_type='BillingPaymentItem',
 566                                        auth_settings=auth_settings,
 567                                        callback=params.get('callback'),
 568                                        _return_http_data_only=params.get('_return_http_data_only'),
 569                                        _preload_content=params.get('_preload_content', True),
 570                                        _request_timeout=params.get('_request_timeout'),
 571                                        collection_formats=collection_formats)
 572
 573    def get_plan(self, account_id, **kwargs):
 574        """
 575        Get Account Billing Plan
 576        Retrieves the billing plan information for the specified account, including the current billing plan, successor plans, billing address, and billing credit card.  By default the successor plan and credit card information is included in the response. This information can be excluded from the response by adding the appropriate optional query string with the `setting` set to **false**.   Response  The response returns the billing plan information, including the currency code, for the plan. The `billingPlan` and `succesorPlans` property values are the same as those shown in the [ML:Get Billing Plan Details] reference. the `billingAddress` and `creditCardInformation` property values are the same as those shown in the [ML:Update Billing Plan] reference.  ###### Note: When credit card number information is shown, a mask is applied to the response so that only the last 4 digits of the card number are visible. 
 577        This method makes a synchronous HTTP request by default. To make an
 578        asynchronous HTTP request, please define a `callback` function
 579        to be invoked when receiving the response.
 580        >>> def callback_function(response):
 581        >>>     pprint(response)
 582        >>>
 583        >>> thread = api.get_plan(account_id, callback=callback_function)
 584
 585        :param callback function: The callback function
 586            for asynchronous request. (optional)
 587        :param str account_id: The external account number (int) or account ID Guid. (required)
 588        :param str include_credit_card_information: When set to **true**, excludes credit card information from the response.
 589        :param str include_downgrade_information:
 590        :param str include_metadata: When set to **true**, the `canUpgrade` and `renewalStatus` properities are included the response and an array of `supportedCountries` property is added to the `billingAddress` information. 
 591        :param str include_successor_plans: When set to **true**, excludes successor information from the response.
 592        :param str include_tax_exempt_id:
 593        :return: AccountBillingPlanResponse
 594                 If the method is called asynchronously,
 595                 returns the request thread.
 596        """
 597        kwargs['_return_http_data_only'] = True
 598        if kwargs.get('callback'):
 599            return self.get_plan_with_http_info(account_id, **kwargs)
 600        else:
 601            (data) = self.get_plan_with_http_info(account_id, **kwargs)
 602            return data
 603
 604    def get_plan_with_http_info(self, account_id, **kwargs):
 605        """
 606        Get Account Billing Plan
 607        Retrieves the billing plan information for the specified account, including the current billing plan, successor plans, billing address, and billing credit card.  By default the successor plan and credit card information is included in the response. This information can be excluded from the response by adding the appropriate optional query string with the `setting` set to **false**.   Response  The response returns the billing plan information, including the currency code, for the plan. The `billingPlan` and `succesorPlans` property values are the same as those shown in the [ML:Get Billing Plan Details] reference. the `billingAddress` and `creditCardInformation` property values are the same as those shown in the [ML:Update Billing Plan] reference.  ###### Note: When credit card number information is shown, a mask is applied to the response so that only the last 4 digits of the card number are visible. 
 608        This method makes a synchronous HTTP request by default. To make an
 609        asynchronous HTTP request, please define a `callback` function
 610        to be invoked when receiving the response.
 611        >>> def callback_function(response):
 612        >>>     pprint(response)
 613        >>>
 614        >>> thread = api.get_plan_with_http_info(account_id, callback=callback_function)
 615
 616        :param callback function: The callback function
 617            for asynchronous request. (optional)
 618        :param str account_id: The external account number (int) or account ID Guid. (required)
 619        :param str include_credit_card_information: When set to **true**, excludes credit card information from the response.
 620        :param str include_downgrade_information:
 621        :param str include_metadata: When set to **true**, the `canUpgrade` and `renewalStatus` properities are included the response and an array of `supportedCountries` property is added to the `billingAddress` information. 
 622        :param str include_successor_plans: When set to **true**, excludes successor information from the response.
 623        :param str include_tax_exempt_id:
 624        :return: AccountBillingPlanResponse
 625                 If the method is called asynchronously,
 626                 returns the request thread.
 627        """
 628
 629        all_params = ['account_id', 'include_credit_card_information', 'include_downgrade_information', 'include_metadata', 'include_successor_plans', 'include_tax_exempt_id']
 630        all_params.append('callback')
 631        all_params.append('_return_http_data_only')
 632        all_params.append('_preload_content')
 633        all_params.append('_request_timeout')
 634
 635        params = locals()
 636        for key, val in iteritems(params['kwargs']):
 637            if key not in all_params:
 638                raise TypeError(
 639                    "Got an unexpected keyword argument '%s'"
 640                    " to method get_plan" % key
 641                )
 642            params[key] = val
 643        del params['kwargs']
 644        # verify the required parameter 'account_id' is set
 645        if ('account_id' not in params) or (params['account_id'] is None):
 646            raise ValueError("Missing the required parameter `account_id` when calling `get_plan`")
 647
 648
 649        collection_formats = {}
 650
 651        resource_path = '/v2.1/accounts/{accountId}/billing_plan'.replace('{format}', 'json')
 652        path_params = {}
 653        if 'account_id' in params:
 654            path_params['accountId'] = params['account_id']
 655
 656        query_params = {}
 657        if 'include_credit_card_information' in params:
 658            query_params['include_credit_card_information'] = params['include_credit_card_information']
 659        if 'include_downgrade_information' in params:
 660            query_params['include_downgrade_information'] = params['include_downgrade_information']
 661        if 'include_metadata' in params:
 662            query_params['include_metadata'] = params['include_metadata']
 663        if 'include_successor_plans' in params:
 664            query_params['include_successor_plans'] = params['include_successor_plans']
 665        if 'include_tax_exempt_id' in params:
 666            query_params['include_tax_exempt_id'] = params['include_tax_exempt_id']
 667
 668        header_params = {}
 669
 670        form_params = []
 671        local_var_files = {}
 672
 673        body_params = None
 674        # HTTP header `Accept`
 675        header_params['Accept'] = self.api_client.\
 676            select_header_accept(['application/json'])
 677
 678        # Authentication setting
 679        auth_settings = []
 680
 681        return self.api_client.call_api(resource_path, 'GET',
 682                                        path_params,
 683                                        query_params,
 684                                        header_params,
 685                                        body=body_params,
 686                                        post_params=form_params,
 687                                        files=local_var_files,
 688                                        response_type='AccountBillingPlanResponse',
 689                                        auth_settings=auth_settings,
 690                                        callback=params.get('callback'),
 691                                        _return_http_data_only=params.get('_return_http_data_only'),
 692                                        _preload_content=params.get('_preload_content', True),
 693                                        _request_timeout=params.get('_request_timeout'),
 694                                        collection_formats=collection_formats)
 695
 696    def list_billing_plans(self, **kwargs):
 697        """
 698        Gets the list of available billing plans.
 699        Retrieves a list of the billing plans associated with a distributor.
 700        This method makes a synchronous HTTP request by default. To make an
 701        asynchronous HTTP request, please define a `callback` function
 702        to be invoked when receiving the response.
 703        >>> def callback_function(response):
 704        >>>     pprint(response)
 705        >>>
 706        >>> thread = api.list_billing_plans(callback=callback_function)
 707
 708        :param callback function: The callback function
 709            for asynchronous request. (optional)
 710        :return: BillingPlansResponse
 711                 If the method is called asynchronously,
 712                 returns the request thread.
 713        """
 714        kwargs['_return_http_data_only'] = True
 715        if kwargs.get('callback'):
 716            return self.list_billing_plans_with_http_info(**kwargs)
 717        else:
 718            (data) = self.list_billing_plans_with_http_info(**kwargs)
 719            return data
 720
 721    def list_billing_plans_with_http_info(self, **kwargs):
 722        """
 723        Gets the list of available billing plans.
 724        Retrieves a list of the billing plans associated with a distributor.
 725        This method makes a synchronous HTTP request by default. To make an
 726        asynchronous HTTP request, please define a `callback` function
 727        to be invoked when receiving the response.
 728        >>> def callback_function(response):
 729        >>>     pprint(response)
 730        >>>
 731        >>> thread = api.list_billing_plans_with_http_info(callback=callback_function)
 732
 733        :param callback function: The callback function
 734            for asynchronous request. (optional)
 735        :return: BillingPlansResponse
 736                 If the method is called asynchronously,
 737                 returns the request thread.
 738        """
 739
 740        all_params = []
 741        all_params.append('callback')
 742        all_params.append('_return_http_data_only')
 743        all_params.append('_preload_content')
 744        all_params.append('_request_timeout')
 745
 746        params = locals()
 747        for key, val in iteritems(params['kwargs']):
 748            if key not in all_params:
 749                raise TypeError(
 750                    "Got an unexpected keyword argument '%s'"
 751                    " to method list_billing_plans" % key
 752                )
 753            params[key] = val
 754        del params['kwargs']
 755
 756        collection_formats = {}
 757
 758        resource_path = '/v2.1/billing_plans'.replace('{format}', 'json')
 759        path_params = {}
 760
 761        query_params = {}
 762
 763        header_params = {}
 764
 765        form_params = []
 766        local_var_files = {}
 767
 768        body_params = None
 769        # HTTP header `Accept`
 770        header_params['Accept'] = self.api_client.\
 771            select_header_accept(['application/json'])
 772
 773        # Authentication setting
 774        auth_settings = []
 775
 776        return self.api_client.call_api(resource_path, 'GET',
 777                                        path_params,
 778                                        query_params,
 779                                        header_params,
 780                                        body=body_params,
 781                                        post_params=form_params,
 782                                        files=local_var_files,
 783                                        response_type='BillingPlansResponse',
 784                                        auth_settings=auth_settings,
 785                                        callback=params.get('callback'),
 786                                        _return_http_data_only=params.get('_return_http_data_only'),
 787                                        _preload_content=params.get('_preload_content', True),
 788                                        _request_timeout=params.get('_request_timeout'),
 789                                        collection_formats=collection_formats)
 790
 791    def list_invoices(self, account_id, **kwargs):
 792        """
 793        Get a List of Billing Invoices
 794        Retrieves a list of invoices for the account. If the from date or to date queries are not specified, the response returns invoices for the last 365 days.  Privileges required: account administrator 
 795        This method makes a synchronous HTTP request by default. To make an
 796        asynchronous HTTP request, please define a `callback` function
 797        to be invoked when receiving the response.
 798        >>> def callback_function(response):
 799        >>>     pprint(response)
 800        >>>
 801        >>> thread = api.list_invoices(account_id, callback=callback_function)
 802
 803        :param callback function: The callback function
 804            for asynchronous request. (optional)
 805        :param str account_id: The external account number (int) or account ID Guid. (required)
 806        :param str from_date: Specifies the date/time of the earliest invoice in the account to retrieve.
 807        :param str to_date: Specifies the date/time of the latest invoice in the account to retrieve.
 808        :return: BillingInvoicesResponse
 809                 If the method is called asynchronously,
 810                 returns the request thread.
 811        """
 812        kwargs['_return_http_data_only'] = True
 813        if kwargs.get('callback'):
 814            return self.list_invoices_with_http_info(account_id, **kwargs)
 815        else:
 816            (data) = self.list_invoices_with_http_info(account_id, **kwargs)
 817            return data
 818
 819    def list_invoices_with_http_info(self, account_id, **kwargs):
 820        """
 821        Get a List of Billing Invoices
 822        Retrieves a list of invoices for the account. If the from date or to date queries are not specified, the response returns invoices for the last 365 days.  Privileges required: account administrator 
 823        This method makes a synchronous HTTP request by default. To make an
 824        asynchronous HTTP request, please define a `callback` function
 825        to be invoked when receiving the response.
 826        >>> def callback_function(response):
 827        >>>     pprint(response)
 828        >>>
 829        >>> thread = api.list_invoices_with_http_info(account_id, callback=callback_function)
 830
 831        :param callback function: The callback function
 832            for asynchronous request. (optional)
 833        :param str account_id: The external account number (int) or account ID Guid. (required)
 834        :param str from_date: Specifies the date/time of the earliest invoice in the account to retrieve.
 835        :param str to_date: Specifies the date/time of the latest invoice in the account to retrieve.
 836        :return: BillingInvoicesResponse
 837                 If the method is called asynchronously,
 838                 returns the request thread.
 839        """
 840
 841        all_params = ['account_id', 'from_date', 'to_date']
 842        all_params.append('callback')
 843        all_params.append('_return_http_data_only')
 844        all_params.append('_preload_content')
 845        all_params.append('_request_timeout')
 846
 847        params = locals()
 848        for key, val in iteritems(params['kwargs']):
 849            if key not in all_params:
 850                raise TypeError(
 851                    "Got an unexpected keyword argument '%s'"
 852                    " to method list_invoices" % key
 853                )
 854            params[key] = val
 855        del params['kwargs']
 856        # verify the required parameter 'account_id' is set
 857        if ('account_id' not in params) or (params['account_id'] is None):
 858            raise ValueError("Missing the required parameter `account_id` when calling `list_invoices`")
 859
 860
 861        collection_formats = {}
 862
 863        resource_path = '/v2.1/accounts/{accountId}/billing_invoices'.replace('{format}', 'json')
 864        path_params = {}
 865        if 'account_id' in params:
 866            path_params['accountId'] = params['account_id']
 867
 868        query_params = {}
 869        if 'from_date' in params:
 870            query_params['from_date'] = params['from_date']
 871        if 'to_date' in params:
 872            query_params['to_date'] = params['to_date']
 873
 874        header_params = {}
 875
 876        form_params = []
 877        local_var_files = {}
 878
 879        body_params = None
 880        # HTTP header `Accept`
 881        header_params['Accept'] = self.api_client.\
 882            select_header_accept(['application/json'])
 883
 884        # Authentication setting
 885        auth_settings = []
 886
 887        return self.api_client.call_api(resource_path, 'GET',
 888                                        path_params,
 889                                        query_params,
 890                                        header_params,
 891                                        body=body_params,
 892                                        post_params=form_params,
 893                                        files=local_var_files,
 894                                        response_type='BillingInvoicesResponse',
 895                                        auth_settings=auth_settings,
 896                                        callback=params.get('callback'),
 897                                        _return_http_data_only=params.get('_return_http_data_only'),
 898                                        _preload_content=params.get('_preload_content', True),
 899                                        _request_timeout=params.get('_request_timeout'),
 900                                        collection_formats=collection_formats)
 901
 902    def list_invoices_past_due(self, account_id, **kwargs):
 903        """
 904        Get a list of past due invoices.
 905        Returns a list past due invoices for the account and notes if payment can be made through the REST API.   Privileges Required: account administrator
 906        This method makes a synchronous HTTP request by default. To make an
 907        asynchronous HTTP request, please define a `callback` function
 908        to be invoked when receiving the response.
 909        >>> def callback_function(response):
 910        >>>     pprint(response)
 911        >>>
 912        >>> thread = api.list_invoices_past_due(account_id, callback=callback_function)
 913
 914        :param callback function: The callback function
 915            for asynchronous request. (optional)
 916        :param str account_id: The external account number (int) or account ID Guid. (required)
 917        :return: BillingInvoicesSummary
 918                 If the method is called asynchronously,
 919                 returns the request thread.
 920        """
 921        kwargs['_return_http_data_only'] = True
 922        if kwargs.get('callback'):
 923            return self.list_invoices_past_due_with_http_info(account_id, **kwargs)
 924        else:
 925            (data) = self.list_invoices_past_due_with_http_info(account_id, **kwargs)
 926            return data
 927
 928    def list_invoices_past_due_with_http_info(self, account_id, **kwargs):
 929        """
 930        Get a list of past due invoices.
 931        Returns a list past due invoices for the account and notes if payment can be made through the REST API.   Privileges Required: account administrator
 932        This method makes a synchronous HTTP request by default. To make an
 933        asynchronous HTTP request, please define a `callback` function
 934        to be invoked when receiving the response.
 935        >>> def callback_function(response):
 936        >>>     pprint(response)
 937        >>>
 938        >>> thread = api.list_invoices_past_due_with_http_info(account_id, callback=callback_function)
 939
 940        :param callback function: The callback function
 941            for asynchronous request. (optional)
 942        :param str account_id: The external account number (int) or account ID Guid. (required)
 943        :return: BillingInvoicesSummary
 944                 If the method is called asynchronously,
 945                 returns the request thread.
 946        """
 947
 948        all_params = ['account_id']
 949        all_params.append('callback')
 950        all_params.append('_return_http_data_only')
 951        all_params.append('_preload_content')
 952        all_params.append('_request_timeout')
 953
 954        params = locals()
 955        for key, val in iteritems(params['kwargs']):
 956            if key not in all_params:
 957                raise TypeError(
 958                    "Got an unexpected keyword argument '%s'"
 959                    " to method list_invoices_past_due" % key
 960                )
 961            params[key] = val
 962        del params['kwargs']
 963        # verify the required parameter 'account_id' is set
 964        if ('account_id' not in params) or (params['account_id'] is None):
 965            raise ValueError("Missing the required parameter `account_id` when calling `list_invoices_past_due`")
 966
 967
 968        collection_formats = {}
 969
 970        resource_path = '/v2.1/accounts/{accountId}/billing_invoices_past_due'.replace('{format}', 'json')
 971        path_params = {}
 972        if 'account_id' in params:
 973            path_params['accountId'] = params['account_id']
 974
 975        query_params = {}
 976
 977        header_params = {}
 978
 979        form_params = []
 980        local_var_files = {}
 981
 982        body_params = None
 983        # HTTP header `Accept`
 984        header_params['Accept'] = self.api_client.\
 985            select_header_accept(['application/json'])
 986
 987        # Authentication setting
 988        auth_settings = []
 989
 990        return self.api_client.call_api(resource_path, 'GET',
 991                                        path_params,
 992                                        query_params,
 993                                        header_params,
 994                                        body=body_params,
 995                                        post_params=form_params,
 996                                        files=local_var_files,
 997                                        response_type='BillingInvoicesSummary',
 998                                        auth_settings=auth_settings,
 999                                        callback=params.get('callback'),
1000                                        _return_http_data_only=params.get('_return_http_data_only'),
1001                                        _preload_content=params.get('_preload_content', True),
1002                                        _request_timeout=params.get('_request_timeout'),
1003                                        collection_formats=collection_formats)
1004
1005    def list_payments(self, account_id, **kwargs):
1006        """
1007        Gets payment information for one or more payments.
1008        Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days.   Privileges required: account administrator 
1009        This method makes a synchronous HTTP request by default. To make an
1010        asynchronous HTTP request, please define a `callback` function
1011        to be invoked when receiving the response.
1012        >>> def callback_function(response):
1013        >>>     pprint(response)
1014        >>>
1015        >>> thread = api.list_payments(account_id, callback=callback_function)
1016
1017        :param callback function: The callback function
1018            for asynchronous request. (optional)
1019        :param str account_id: The external account number (int) or account ID Guid. (required)
1020        :param str from_date: Specifies the date/time of the earliest payment in the account to retrieve.
1021        :param str to_date: Specifies the date/time of the latest payment in the account to retrieve.
1022        :return: BillingPaymentsResponse
1023                 If the method is called asynchronously,
1024                 returns the request thread.
1025        """
1026        kwargs['_return_http_data_only'] = True
1027        if kwargs.get('callback'):
1028            return self.list_payments_with_http_info(account_id, **kwargs)
1029        else:
1030            (data) = self.list_payments_with_http_info(account_id, **kwargs)
1031            return data
1032
1033    def list_payments_with_http_info(self, account_id, **kwargs):
1034        """
1035        Gets payment information for one or more payments.
1036        Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days.   Privileges required: account administrator 
1037        This method makes a synchronous HTTP request by default. To make an
1038        asynchronous HTTP request, please define a `callback` function
1039        to be invoked when receiving the response.
1040        >>> def callback_function(response):
1041        >>>     pprint(response)
1042        >>>
1043        >>> thread = api.list_payments_with_http_info(account_id, callback=callback_function)
1044
1045        :param callback function: The callback function
1046            for asynchronous request. (optional)
1047        :param str account_id: The external account number (int) or account ID Guid. (required)
1048        :param str from_date: Specifies the date/time of the earliest payment in the account to retrieve.
1049        :param str to_date: Specifies the date/time of the latest payment in the account to retrieve.
1050        :return: BillingPaymentsResponse
1051                 If the method is called asynchronously,
1052                 returns the request thread.
1053        """
1054
1055        all_params = ['account_id', 'from_date', 'to_date']
1056        all_params.append('callback')
1057        all_params.append('_return_http_data_only')
1058        all_params.append('_preload_content')
1059        all_params.append('_request_timeout')
1060
1061        params = locals()
1062        for key, val in iteritems(params['kwargs']):
1063            if key not in all_params:
1064                raise TypeError(
1065                    "Got an unexpected keyword argument '%s'"
1066                    " to method list_payments" % key
1067                )
1068            params[key] = val
1069        del params['kwargs']
1070        # verify the required parameter 'account_id' is set
1071        if ('account_id' not in params) or (params['account_id'] is None):
1072            raise ValueError("Missing the required parameter `account_id` when calling `list_payments`")
1073
1074
1075        collection_formats = {}
1076
1077        resource_path = '/v2.1/accounts/{accountId}/billing_payments'.replace('{format}', 'json')
1078        path_params = {}
1079        if 'account_id' in params:
1080            path_params['accountId'] = params['account_id']
1081
1082        query_params = {}
1083        if 'from_date' in params:
1084            query_params['from_date'] = params['from_date']
1085        if 'to_date' in params:
1086            query_params['to_date'] = params['to_date']
1087
1088        header_params = {}
1089
1090        form_params = []
1091        local_var_files = {}
1092
1093        body_params = None
1094        # HTTP header `Accept`
1095        header_params['Accept'] = self.api_client.\
1096            select_header_accept(['application/json'])
1097
1098        # Authentication setting
1099        auth_settings = []
1100
1101        return self.api_client.call_api(resource_path, 'GET',
1102                                        path_params,
1103                                        query_params,
1104                                        header_params,
1105                                        body=body_params,
1106                                        post_params=form_params,
1107                                        files=local_var_files,
1108                                        response_type='BillingPaymentsResponse',
1109                                        auth_settings=auth_settings,
1110                                        callback=params.get('callback'),
1111                                        _return_http_data_only=params.get('_return_http_data_only'),
1112                                        _preload_content=params.get('_preload_content', True),
1113                                        _request_timeout=params.get('_request_timeout'),
1114                                        collection_formats=collection_formats)
1115
1116    def make_payment(self, account_id, **kwargs):
1117        """
1118        Posts a payment to a past due invoice.
1119        Posts a payment to a past due invoice.   ###### Note: This can only be used if the `paymentAllowed` value for a past due invoice is true. This can be determined calling [ML:GetBillingInvoicesPastDue].  The response returns information for a single payment, if a payment ID was used in the endpoint, or a list of payments. If the from date or to date queries or payment ID are not used, the response returns payment information for the last 365 days. If the request was for a single payment ID, the `nextUri` and `previousUri` properties are not returned.  Privileges required: account administrator
1120        This method makes a synchronous HTTP request by default. To make an
1121        asynchronous HTTP request, please define a `callback` function
1122        to be invoked when receiving the response.
1123        >>> def callback_function(response):
1124        >>>     pprint(response)
1125        >>>
1126        >>> thread = api.make_payment(account_id, callback=callback_function)
1127
1128        :param callback function: The callback function
1129            for asynchronous request. (optional)
1130        :param str account_id: The external account number (int) or account ID Guid. (required)
1131        :param BillingPaymentRequest billing_payment_request:
1132        :return: BillingPaymentResponse
1133                 If the method is called asynchronously,
1134                 returns the request thread.
1135        """
1136        kwargs['_return_http_data_only'] = True
1137        if kwargs.get('callback'):
1138            return self.make_payment_with_http_info(account_id, **kwargs)
1139        else:
1140            (data) = self.make_payment_with_http_info(account_id, **kwargs)
1141            return data
1142
1143    def make_payment_with_http_info(self, account_id, **kwargs):
1144        """
1145        Posts a payment to a past due invoice.
1146        Posts a payment to a past due invoice.   ###### Note: This can only be used if the `paymentAllowed` value for a past due invoice is true. This can be determined calling [ML:GetBillingInvoicesPastDue].  The response returns information for a single payment, if a payment ID was used in the endpoint, or a list of payments. If the from date or to date queries or payment ID are not used, the response returns payment information for the last 365 days. If the request was for a single payment ID, the `nextUri` and `previousUri` properties are not returned.  Privileges required: account administrator
1147        This method makes a synchronous HTTP request by default. To make an
1148        asynchronous HTTP request, please define a `callback` function
1149        to be invoked when receiving the response.
1150        >>> def callback_function(response):
1151        >>>     pprint(response)
1152        >>>
1153        >>> thread = api.make_payment_with_http_info(account_id, callback=callback_function)
1154
1155        :param callback function: The callback function
1156            for asynchronous request. (optional)
1157        :param str account_id: The external account number (int) or account ID Guid. (required)
1158        :param BillingPaymentRequest billing_payment_request:
1159        :return: BillingPaymentResponse
1160                 If the method is called asynchronously,
1161                 returns the request thread.
1162        """
1163
1164        all_params = ['account_id', 'billing_payment_request']
1165        all_params.append('callback')
1166        all_params.append('_return_http_data_only')
1167        all_params.append('_preload_content')
1168        all_params.append('_request_timeout')
1169
1170        params = locals()
1171        for key, val in iteritems(params['kwargs']):
1172            if key not in all_params:
1173                raise TypeError(
1174                    "Got an unexpected keyword argument '%s'"
1175                    " to method make_payment" % key
1176                )
1177            params[key] = val
1178        del params['kwargs']
1179        # verify the required parameter 'account_id' is set
1180        if ('account_id' not in params) or (params['account_id'] is None):
1181            raise ValueError("Missing the required parameter `account_id` when calling `make_payment`")
1182
1183
1184        collection_formats = {}
1185
1186        resource_path = '/v2.1/accounts/{accountId}/billing_payments'.replace('{format}', 'json')
1187        path_params = {}
1188        if 'account_id' in params:
1189            path_params['accountId'] = params['account_id']
1190
1191        query_params = {}
1192
1193        header_params = {}
1194
1195        form_params = []
1196        local_var_files = {}
1197
1198        body_params = None
1199        if 'billing_payment_request' in params:
1200            body_params = params['billing_payment_request']
1201        # HTTP header `Accept`
1202        header_params['Accept'] = self.api_client.\
1203            select_header_accept(['application/json'])
1204
1205        # Authentication setting
1206        auth_settings = []
1207
1208        return self.api_client.call_api(resource_path, 'POST',
1209                                        path_params,
1210                                        query_params,
1211                                        header_params,
1212                                        body=body_params,
1213                                        post_params=form_params,
1214                                        files=local_var_files,
1215                                        response_type='BillingPaymentResponse',
1216                                        auth_settings=auth_settings,
1217                                        callback=params.get('callback'),
1218                                        _return_http_data_only=params.get('_return_http_data_only'),
1219                                        _preload_content=params.get('_preload_content', True),
1220                                        _request_timeout=params.get('_request_timeout'),
1221                                        collection_formats=collection_formats)
1222
1223    def purchase_envelopes(self, account_id, **kwargs):
1224        """
1225        Reserverd: Purchase additional envelopes.
1226        Reserved: At this time, this endpoint is limited to DocuSign internal use only. Completes the purchase of envelopes for your account. The actual purchase is done as part of an internal workflow interaction with an envelope vendor.
1227        This method makes a synchronous HTTP request by default. To make an
1228        asynchronous HTTP request, please define a `callback` function
1229        to be invoked when receiving the response.
1230        >>> def callback_function(response):
1231        >>>     pprint(response)
1232        >>>
1233        >>> thread = api.purchase_envelopes(account_id, callback=callback_function)
1234
1235        :param callback function: The callback function
1236            for asynchronous request. (optional)
1237        :param str account_id: The external account number (int) or account ID Guid. (required)
1238        :param PurchasedEnvelopesInformation purchased_envelopes_information:
1239        :return: None
1240                 If the method is called asynchronously,
1241                 returns the request thread.
1242        """
1243        kwargs['_return_http_data_only'] = True
1244        if kwargs.get('callback'):
1245            return self.purchase_envelopes_with_http_info(account_id, **kwargs)
1246        else:
1247            (data) = self.purchase_envelopes_with_http_info(account_id, **kwargs)
1248            return data
1249
1250    def purchase_envelopes_with_http_info(self, account_id, **kwargs):
1251        """
1252        Reserverd: Purchase additional envelopes.
1253        Reserved: At this time, this endpoint is limited to DocuSign internal use only. Completes the purchase of envelopes for your account. The actual purchase is done as part of an internal workflow interaction with an envelope vendor.
1254        This method makes a synchronous HTTP request by default. To make an
1255        asynchronous HTTP request, please define a `callback` function
1256        to be invoked when receiving the response.
1257        >>> def callback_function(response):
1258        >>>     pprint(response)
1259        >>>
1260        >>> thread = api.purchase_envelopes_with_http_info(account_id, callback=callback_function)
1261
1262        :param callback function: The callback function
1263            for asynchronous request. (optional)
1264        :param str account_id: The external account number (int) or account ID Guid. (required)
1265        :param PurchasedEnvelopesInformation purchased_envelopes_information:
1266        :return: None
1267                 If the method is called asynchronously,
1268                 returns the request thread.
1269        """
1270
1271        all_params = ['account_id', 'purchased_envelopes_information']
1272        all_params.append('callback')
1273        all_params.append('_return_http_data_only')
1274        all_params.append('_preload_content')
1275        all_params.append('_request_timeout')
1276
1277        params = locals()
1278        for key, val in iteritems(params['kwargs']):
1279            if key not in all_params:
1280                raise TypeError(
1281                    "Got an unexpected keyword argument '%s'"
1282                    " to method purchase_envelopes" % key
1283                )
1284            params[key] = val
1285        del params['kwargs']
1286        # verify the required parameter 'account_id' is set
1287        if ('account_id' not in params) or (params['account_id'] is None):
1288            raise ValueError("Missing the required parameter `account_id` when calling `purchase_envelopes`")
1289
1290
1291        collection_formats = {}
1292
1293        resource_path = '/v2.1/accounts/{accountId}/billing_plan/purchased_envelopes'.replace('{format}', 'json')
1294        path_params = {}
1295        if 'account_id' in params:
1296            path_params['accountId'] = params['account_id']
1297
1298        query_params = {}
1299
1300        header_params = {}
1301
1302        form_params = []
1303        local_var_files = {}
1304
1305        body_params = None
1306        if 'purchased_envelopes_information' in params:
1307            body_params = params['purchased_envelopes_information']
1308        # HTTP header `Accept`
1309        header_params['Accept'] = self.api_client.\
1310            select_header_accept(['application/json'])
1311
1312        # Authentication setting
1313        auth_settings = []
1314
1315        return self.api_client.call_api(resource_path, 'PUT',
1316                                        path_params,
1317                                        query_params,
1318                                        header_params,
1319                                        body=body_params,
1320                                        post_params=form_params,
1321                                        files=local_var_files,
1322                                        response_type=None,
1323                                        auth_settings=auth_settings,
1324                                        callback=params.get('callback'),
1325                                        _return_http_data_only=params.get('_return_http_data_only'),
1326                                        _preload_content=params.get('_preload_content', True),
1327                                        _request_timeout=params.get('_request_timeout'),
1328                                        collection_formats=collection_formats)
1329
1330    def update_downgrade_account_billing_plan(self, account_id, **kwargs):
1331        """
1332        Queues downgrade billing plan request for an account.
1333        
1334        This method makes a synchronous HTTP request by default. To make an
1335        asynchronous HTTP request, please define a `callback` function
1336        to be invoked when receiving the response.
1337        >>> def callback_function(response):
1338        >>>     pprint(response)
1339        >>>
1340        >>> thread = api.update_downgrade_account_billing_plan(account_id, callback=callback_function)
1341
1342        :param callback function: The callback function
1343            for asynchronous request. (optional)
1344        :param str account_id: The external account number (int) or account ID Guid. (required)
1345        :param DowngradeBillingPlanInformation downgrade_billing_plan_information:
1346        :return: DowngradePlanUpdateResponse
1347                 If the method is called asynchronously,
1348                 returns the request thread.
1349        """
1350        kwargs['_return_http_data_only'] = True
1351        if kwargs.get('callback'):
1352            return self.update_downgrade_account_billing_plan_with_http_info(account_id, **kwargs)
1353        else:
1354            (data) = self.update_downgrade_account_billing_plan_with_http_info(account_id, **kwargs)
1355            return data
1356
1357    def update_downgrade_account_billing_plan_with_http_info(self, account_id, **kwargs):
1358        """
1359        Queues downgrade billing plan request for an account.
1360        
1361        This method makes a synchronous HTTP request by default. To make an
1362        asynchronous HTTP request, please define a `callback` function
1363        to be invoked when receiving the response.
1364        >>> def callback_function(response):
1365        >>>     pprint(response)
1366        >>>
1367        >>> thread = api.update_downgrade_account_billing_plan_with_http_info(account_id, callback=callback_function)
1368
1369        :param callback function: The callback function
1370            for asynchronous request. (optional)
1371        :param str account_id: The external account number (int) or account ID Guid. (required)
1372        :param DowngradeBillingPlanInformation downgrade_billing_plan_information:
1373        :return: DowngradePlanUpdateResponse
1374                 If the method is called asynchronously,
1375                 returns the request thread.
1376        """
1377
1378        all_params = ['account_id', 'downgrade_billing_plan_information']
1379        all_params.append('callback')
1380        all_params.append('_return_http_data_only')
1381        all_params.append('_preload_content')
1382        all_params.append('_request_timeout')
1383
1384        params = locals()
1385        for key, val in iteritems(params['kwargs']):
1386            if key not in all_params:
1387                raise TypeError(
1388                    "Got an unexpected keyword argument '%s'"
1389                    " to method update_downgrade_account_billing_plan" % key
1390                )
1391            params[key] = val
1392        del params['kwargs']
1393        # verify the required parameter 'account_id' is set
1394        if ('account_id' not in params) or (params['account_id'] is None):
1395            raise ValueError("Missing the required parameter `account_id` when calling `update_downgrade_account_billing_plan`")
1396
1397
1398        collection_formats = {}
1399
1400        resource_path = '/v2.1/accounts/{accountId}/billing_plan/downgrade'.replace('{format}', 'json')
1401        path_params = {}
1402        if 'account_id' in params:
1403            path_params['accountId'] = params['account_id']
1404
1405        query_params = {}
1406
1407        header_params = {}
1408
1409        form_params = []
1410        local_var_files = {}
1411
1412        body_params = None
1413        if 'downgrade_billing_plan_information' in params:
1414            body_params = params['downgrade_billing_plan_information']
1415        # HTTP header `Accept`
1416        header_params['Accept'] = self.api_client.\
1417            select_header_accept(['application/json'])
1418
1419        # Authentication setting
1420        auth_settings = []
1421
1422        return self.api_client.call_api(resource_path, 'PUT',
1423                                        path_params,
1424                                        query_params,
1425                                        header_params,
1426                                        body=body_params,
1427                                        post_params=form_params,
1428                                        files=local_var_files,
1429                                        response_type='DowngradePlanUpdateResponse',
1430                                        auth_settings=auth_settings,
1431                                        callback=params.get('callback'),
1432                                        _return_http_data_only=params.get('_return_http_data_only'),
1433                                        _preload_content=params.get('_preload_content', True),
1434                                        _request_timeout=params.get('_request_timeout'),
1435                                        collection_formats=collection_formats)
1436
1437    def update_plan(self, account_id, **kwargs):
1438        """
1439        Updates the account billing plan.
1440        Updates the billing plan information, billing address, and credit card information for the specified account.
1441        This method makes a synchronous HTTP request by default. To make an
1442        asynchronous HTTP request, please define a `callback` function
1443        to be invoked when receiving the response.
1444        >>> def callback_function(response):
1445        >>>     pprint(response)
1446        >>>
1447        >>> thread = api.update_plan(account_id, callback=callback_function)
1448
1449        :param callback function: The callback function
1450            for asynchronous request. (optional)
1451        :param str account_id: The external account number (int) or account ID Guid. (required)
1452        :param str preview_billing_plan: When set to **true**, updates the account using a preview billing plan.
1453        :param BillingPlanInformation billing_plan_information:
1454        :return: BillingPlanUpdateResponse
1455                 If the method is called asynchronously,
1456                 returns the request thread.
1457        """
1458        kwargs['_return_http_data_only'] = True
1459        if kwargs.get('callback'):
1460            return self.update_plan_with_http_info(account_id, **kwargs)
1461        else:
1462            (data) = self.update_plan_with_http_info(account_id, **kwargs)
1463            return data
1464
1465    def update_plan_with_http_info(self, account_id, **kwargs):
1466        """
1467        Updates the account billing plan.
1468        Updates the billing plan information, billing address, and credit card information for the specified account.
1469        This method makes a synchronous HTTP request by default. To make an
1470        asynchronous HTTP request, please define a `callback` function
1471        to be invoked when receiving the response.
1472        >>> def callback_function(response):
1473        >>>     pprint(response)
1474        >>>
1475        >>> thread = api.update_plan_with_http_info(account_id, callback=callback_function)
1476
1477        :param callback function: The callback function
1478            for asynchronous request. (optional)
1479        :param str account_id: The external account number (int) or account ID Guid. (required)
1480        :param str preview_billing_plan: When set to **true**, updates the account using a preview billing plan.
1481        :param BillingPlanInformation billing_plan_information:
1482        :return: BillingPlanUpdateResponse
1483                 If the method is called asynchronously,
1484                 returns the request thread.
1485        """
1486
1487        all_params = ['account_id', 'preview_billing_plan', 'billing_plan_information']
1488        all_params.append('callback')
1489        all_params.append('_return_http_data_only')
1490        all_params.append('_preload_content')
1491        all_params.append('_request_timeout')
1492
1493        params = locals()
1494        for key, val in iteritems(params['kwargs']):
1495            if key not in all_params:
1496                raise TypeError(
1497                    "Got an unexpected keyword argument '%s'"
1498                    " to method update_plan" % key
1499                )
1500            params[key] = val
1501        del params['kwargs']
1502        # verify the required parameter 'account_id' is set
1503        if ('account_id' not in params) or (params['account_id'] is None):
1504            raise ValueError("Missing the required parameter `account_id` when calling `update_plan`")
1505
1506
1507        collection_formats = {}
1508
1509        resource_path = '/v2.1/accounts/{accountId}/billing_plan'.replace('{format}', 'json')
1510        path_params = {}
1511        if 'account_id' in params:
1512            path_params['accountId'] = params['account_id']
1513
1514        query_params = {}
1515        if 'preview_billing_plan' in params:
1516            query_params['preview_billing_plan'] = params['preview_billing_plan']
1517
1518        header_params = {}
1519
1520        form_params = []
1521        local_var_files = {}
1522
1523        body_params = None
1524        if 'billing_plan_information' in params:
1525            body_params = params['billing_plan_information']
1526        # HTTP header `Accept`
1527        header_params['Accept'] = self.api_client.\
1528            select_header_accept(['application/json'])
1529
1530        # Authentication setting
1531        auth_settings = []
1532
1533        return self.api_client.call_api(resource_path, 'PUT',
1534                                        path_params,
1535                                        query_params,
1536                                        header_params,
1537                                        body=body_params,
1538                                        post_params=form_params,
1539                                        files=local_var_files,
1540                                        response_type='BillingPlanUpdateResponse',
1541                                        auth_settings=auth_settings,
1542                                        callback=params.get('callback'),
1543                                        _return_http_data_only=params.get('_return_http_data_only'),
1544                                        _preload_content=params.get('_preload_content', True),
1545                                        _request_timeout=params.get('_request_timeout'),
1546                                        collection_formats=collection_formats)

NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen

BillingApi(api_client=None)
35    def __init__(self, api_client=None):
36        config = Configuration()
37        if api_client:
38            self.api_client = api_client
39        else:
40            if not config.api_client:
41                config.api_client = ApiClient()
42            self.api_client = config.api_client
def get_billing_plan(self, billing_plan_id, **kwargs)
44    def get_billing_plan(self, billing_plan_id, **kwargs):
45        """
46        Get the billing plan details.
47        Retrieves the billing plan details for the specified billing plan ID.
48        This method makes a synchronous HTTP request by default. To make an
49        asynchronous HTTP request, please define a `callback` function
50        to be invoked when receiving the response.
51        >>> def callback_function(response):
52        >>>     pprint(response)
53        >>>
54        >>> thread = api.get_billing_plan(billing_plan_id, callback=callback_function)
55
56        :param callback function: The callback function
57            for asynchronous request. (optional)
58        :param str billing_plan_id: The ID of the billing plan being accessed. (required)
59        :return: BillingPlanResponse
60                 If the method is called asynchronously,
61                 returns the request thread.
62        """
63        kwargs['_return_http_data_only'] = True
64        if kwargs.get('callback'):
65            return self.get_billing_plan_with_http_info(billing_plan_id, **kwargs)
66        else:
67            (data) = self.get_billing_plan_with_http_info(billing_plan_id, **kwargs)
68            return data

Get the billing plan details. Retrieves the billing plan details for the specified billing plan ID. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_billing_plan(billing_plan_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str billing_plan_id: The ID of the billing plan being accessed. (required)
Returns

BillingPlanResponse If the method is called asynchronously, returns the request thread.

def get_billing_plan_with_http_info(self, billing_plan_id, **kwargs)
 70    def get_billing_plan_with_http_info(self, billing_plan_id, **kwargs):
 71        """
 72        Get the billing plan details.
 73        Retrieves the billing plan details for the specified billing plan ID.
 74        This method makes a synchronous HTTP request by default. To make an
 75        asynchronous HTTP request, please define a `callback` function
 76        to be invoked when receiving the response.
 77        >>> def callback_function(response):
 78        >>>     pprint(response)
 79        >>>
 80        >>> thread = api.get_billing_plan_with_http_info(billing_plan_id, callback=callback_function)
 81
 82        :param callback function: The callback function
 83            for asynchronous request. (optional)
 84        :param str billing_plan_id: The ID of the billing plan being accessed. (required)
 85        :return: BillingPlanResponse
 86                 If the method is called asynchronously,
 87                 returns the request thread.
 88        """
 89
 90        all_params = ['billing_plan_id']
 91        all_params.append('callback')
 92        all_params.append('_return_http_data_only')
 93        all_params.append('_preload_content')
 94        all_params.append('_request_timeout')
 95
 96        params = locals()
 97        for key, val in iteritems(params['kwargs']):
 98            if key not in all_params:
 99                raise TypeError(
100                    "Got an unexpected keyword argument '%s'"
101                    " to method get_billing_plan" % key
102                )
103            params[key] = val
104        del params['kwargs']
105        # verify the required parameter 'billing_plan_id' is set
106        if ('billing_plan_id' not in params) or (params['billing_plan_id'] is None):
107            raise ValueError("Missing the required parameter `billing_plan_id` when calling `get_billing_plan`")
108
109
110        collection_formats = {}
111
112        resource_path = '/v2.1/billing_plans/{billingPlanId}'.replace('{format}', 'json')
113        path_params = {}
114        if 'billing_plan_id' in params:
115            path_params['billingPlanId'] = params['billing_plan_id']
116
117        query_params = {}
118
119        header_params = {}
120
121        form_params = []
122        local_var_files = {}
123
124        body_params = None
125        # HTTP header `Accept`
126        header_params['Accept'] = self.api_client.\
127            select_header_accept(['application/json'])
128
129        # Authentication setting
130        auth_settings = []
131
132        return self.api_client.call_api(resource_path, 'GET',
133                                        path_params,
134                                        query_params,
135                                        header_params,
136                                        body=body_params,
137                                        post_params=form_params,
138                                        files=local_var_files,
139                                        response_type='BillingPlanResponse',
140                                        auth_settings=auth_settings,
141                                        callback=params.get('callback'),
142                                        _return_http_data_only=params.get('_return_http_data_only'),
143                                        _preload_content=params.get('_preload_content', True),
144                                        _request_timeout=params.get('_request_timeout'),
145                                        collection_formats=collection_formats)

Get the billing plan details. Retrieves the billing plan details for the specified billing plan ID. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_billing_plan_with_http_info(billing_plan_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str billing_plan_id: The ID of the billing plan being accessed. (required)
Returns

BillingPlanResponse If the method is called asynchronously, returns the request thread.

def get_credit_card_info(self, account_id, **kwargs)
147    def get_credit_card_info(self, account_id, **kwargs):
148        """
149        Get metadata for a given credit card.
150        This method returns information about a credit card associated with an account.
151        This method makes a synchronous HTTP request by default. To make an
152        asynchronous HTTP request, please define a `callback` function
153        to be invoked when receiving the response.
154        >>> def callback_function(response):
155        >>>     pprint(response)
156        >>>
157        >>> thread = api.get_credit_card_info(account_id, callback=callback_function)
158
159        :param callback function: The callback function
160            for asynchronous request. (optional)
161        :param str account_id: The external account number (int) or account ID Guid. (required)
162        :return: CreditCardInformation
163                 If the method is called asynchronously,
164                 returns the request thread.
165        """
166        kwargs['_return_http_data_only'] = True
167        if kwargs.get('callback'):
168            return self.get_credit_card_info_with_http_info(account_id, **kwargs)
169        else:
170            (data) = self.get_credit_card_info_with_http_info(account_id, **kwargs)
171            return data

Get metadata for a given credit card. This method returns information about a credit card associated with an account. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_credit_card_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
Returns

CreditCardInformation If the method is called asynchronously, returns the request thread.

def get_credit_card_info_with_http_info(self, account_id, **kwargs)
173    def get_credit_card_info_with_http_info(self, account_id, **kwargs):
174        """
175        Get metadata for a given credit card.
176        This method returns information about a credit card associated with an account.
177        This method makes a synchronous HTTP request by default. To make an
178        asynchronous HTTP request, please define a `callback` function
179        to be invoked when receiving the response.
180        >>> def callback_function(response):
181        >>>     pprint(response)
182        >>>
183        >>> thread = api.get_credit_card_info_with_http_info(account_id, callback=callback_function)
184
185        :param callback function: The callback function
186            for asynchronous request. (optional)
187        :param str account_id: The external account number (int) or account ID Guid. (required)
188        :return: CreditCardInformation
189                 If the method is called asynchronously,
190                 returns the request thread.
191        """
192
193        all_params = ['account_id']
194        all_params.append('callback')
195        all_params.append('_return_http_data_only')
196        all_params.append('_preload_content')
197        all_params.append('_request_timeout')
198
199        params = locals()
200        for key, val in iteritems(params['kwargs']):
201            if key not in all_params:
202                raise TypeError(
203                    "Got an unexpected keyword argument '%s'"
204                    " to method get_credit_card_info" % key
205                )
206            params[key] = val
207        del params['kwargs']
208        # verify the required parameter 'account_id' is set
209        if ('account_id' not in params) or (params['account_id'] is None):
210            raise ValueError("Missing the required parameter `account_id` when calling `get_credit_card_info`")
211
212
213        collection_formats = {}
214
215        resource_path = '/v2.1/accounts/{accountId}/billing_plan/credit_card'.replace('{format}', 'json')
216        path_params = {}
217        if 'account_id' in params:
218            path_params['accountId'] = params['account_id']
219
220        query_params = {}
221
222        header_params = {}
223
224        form_params = []
225        local_var_files = {}
226
227        body_params = None
228        # HTTP header `Accept`
229        header_params['Accept'] = self.api_client.\
230            select_header_accept(['application/json'])
231
232        # Authentication setting
233        auth_settings = []
234
235        return self.api_client.call_api(resource_path, 'GET',
236                                        path_params,
237                                        query_params,
238                                        header_params,
239                                        body=body_params,
240                                        post_params=form_params,
241                                        files=local_var_files,
242                                        response_type='CreditCardInformation',
243                                        auth_settings=auth_settings,
244                                        callback=params.get('callback'),
245                                        _return_http_data_only=params.get('_return_http_data_only'),
246                                        _preload_content=params.get('_preload_content', True),
247                                        _request_timeout=params.get('_request_timeout'),
248                                        collection_formats=collection_formats)

Get metadata for a given credit card. This method returns information about a credit card associated with an account. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_credit_card_info_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
Returns

CreditCardInformation If the method is called asynchronously, returns the request thread.

def get_downgrade_request_billing_info(self, account_id, **kwargs)
250    def get_downgrade_request_billing_info(self, account_id, **kwargs):
251        """
252        Returns downgrade plan information for the specified account.
253        
254        This method makes a synchronous HTTP request by default. To make an
255        asynchronous HTTP request, please define a `callback` function
256        to be invoked when receiving the response.
257        >>> def callback_function(response):
258        >>>     pprint(response)
259        >>>
260        >>> thread = api.get_downgrade_request_billing_info(account_id, callback=callback_function)
261
262        :param callback function: The callback function
263            for asynchronous request. (optional)
264        :param str account_id: The external account number (int) or account ID Guid. (required)
265        :return: DowngradRequestBillingInfoResponse
266                 If the method is called asynchronously,
267                 returns the request thread.
268        """
269        kwargs['_return_http_data_only'] = True
270        if kwargs.get('callback'):
271            return self.get_downgrade_request_billing_info_with_http_info(account_id, **kwargs)
272        else:
273            (data) = self.get_downgrade_request_billing_info_with_http_info(account_id, **kwargs)
274            return data

Returns downgrade plan information for the specified account.

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_downgrade_request_billing_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
Returns

DowngradRequestBillingInfoResponse If the method is called asynchronously, returns the request thread.

def get_downgrade_request_billing_info_with_http_info(self, account_id, **kwargs)
276    def get_downgrade_request_billing_info_with_http_info(self, account_id, **kwargs):
277        """
278        Returns downgrade plan information for the specified account.
279        
280        This method makes a synchronous HTTP request by default. To make an
281        asynchronous HTTP request, please define a `callback` function
282        to be invoked when receiving the response.
283        >>> def callback_function(response):
284        >>>     pprint(response)
285        >>>
286        >>> thread = api.get_downgrade_request_billing_info_with_http_info(account_id, callback=callback_function)
287
288        :param callback function: The callback function
289            for asynchronous request. (optional)
290        :param str account_id: The external account number (int) or account ID Guid. (required)
291        :return: DowngradRequestBillingInfoResponse
292                 If the method is called asynchronously,
293                 returns the request thread.
294        """
295
296        all_params = ['account_id']
297        all_params.append('callback')
298        all_params.append('_return_http_data_only')
299        all_params.append('_preload_content')
300        all_params.append('_request_timeout')
301
302        params = locals()
303        for key, val in iteritems(params['kwargs']):
304            if key not in all_params:
305                raise TypeError(
306                    "Got an unexpected keyword argument '%s'"
307                    " to method get_downgrade_request_billing_info" % key
308                )
309            params[key] = val
310        del params['kwargs']
311        # verify the required parameter 'account_id' is set
312        if ('account_id' not in params) or (params['account_id'] is None):
313            raise ValueError("Missing the required parameter `account_id` when calling `get_downgrade_request_billing_info`")
314
315
316        collection_formats = {}
317
318        resource_path = '/v2.1/accounts/{accountId}/billing_plan/downgrade'.replace('{format}', 'json')
319        path_params = {}
320        if 'account_id' in params:
321            path_params['accountId'] = params['account_id']
322
323        query_params = {}
324
325        header_params = {}
326
327        form_params = []
328        local_var_files = {}
329
330        body_params = None
331        # HTTP header `Accept`
332        header_params['Accept'] = self.api_client.\
333            select_header_accept(['application/json'])
334
335        # Authentication setting
336        auth_settings = []
337
338        return self.api_client.call_api(resource_path, 'GET',
339                                        path_params,
340                                        query_params,
341                                        header_params,
342                                        body=body_params,
343                                        post_params=form_params,
344                                        files=local_var_files,
345                                        response_type='DowngradRequestBillingInfoResponse',
346                                        auth_settings=auth_settings,
347                                        callback=params.get('callback'),
348                                        _return_http_data_only=params.get('_return_http_data_only'),
349                                        _preload_content=params.get('_preload_content', True),
350                                        _request_timeout=params.get('_request_timeout'),
351                                        collection_formats=collection_formats)

Returns downgrade plan information for the specified account.

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_downgrade_request_billing_info_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
Returns

DowngradRequestBillingInfoResponse If the method is called asynchronously, returns the request thread.

def get_invoice(self, account_id, invoice_id, **kwargs)
353    def get_invoice(self, account_id, invoice_id, **kwargs):
354        """
355        Retrieves a billing invoice.
356        Retrieves the specified invoice.   ###### Note: If the `pdfAvailable` property in the response is set to *true*, you can download a PDF version of the invoice. To download the PDF, make the call again and change the value of the `Accept` property in the header to `Accept: application/pdf`.  Privileges required: account administrator  The response returns a list of charges and information about the charges. Quantities are usually shown as 'unlimited' or an integer. Amounts are shown in the currency set for the account.  **Response** The following table provides a description of the different `chargeName` property values. The information will grow as more chargeable items are added to the system.  | chargeName | Description | | --- | --- | | id_check | ID Check Charge | | in_person_signing | In Person Signing charge | | envelopes Included | Sent Envelopes for the account | | age_verify | Age verification check | | ofac | OFAC Check | | id_confirm | ID confirmation check | | student_authentication | STAN PIN authentication check | | wet_sign_fax | Pages for returning signed documents by fax | | attachment_fax | Pages for returning attachments by fax | | phone_authentication | Phone authentication charge | | powerforms | PowerForm envelopes sent | | signer_payments | Payment processing charge | | outbound_fax | Send by fax charge | | bulk_recipient_envelopes | Bulk Recipient Envelopes sent | | sms_authentications | SMS authentication charge | | saml_authentications | SAML authentication charge | | express_signer_certificate | DocuSign Express Certificate charge | | personal_signer_certificate | Personal Signer Certificate charge | | safe_certificate | SAFE BioPharma Signer Certificate charge | | seats | Included active seats charge | | open_trust_certificate | OpenTrust Signer Certificate charge | 
357        This method makes a synchronous HTTP request by default. To make an
358        asynchronous HTTP request, please define a `callback` function
359        to be invoked when receiving the response.
360        >>> def callback_function(response):
361        >>>     pprint(response)
362        >>>
363        >>> thread = api.get_invoice(account_id, invoice_id, callback=callback_function)
364
365        :param callback function: The callback function
366            for asynchronous request. (optional)
367        :param str account_id: The external account number (int) or account ID Guid. (required)
368        :param str invoice_id: (required)
369        :return: BillingInvoice
370                 If the method is called asynchronously,
371                 returns the request thread.
372        """
373        kwargs['_return_http_data_only'] = True
374        if kwargs.get('callback'):
375            return self.get_invoice_with_http_info(account_id, invoice_id, **kwargs)
376        else:
377            (data) = self.get_invoice_with_http_info(account_id, invoice_id, **kwargs)
378            return data

Retrieves a billing invoice. Retrieves the specified invoice. ###### Note: If the pdfAvailable property in the response is set to true, you can download a PDF version of the invoice. To download the PDF, make the call again and change the value of the Accept property in the header to Accept: application/pdf. Privileges required: account administrator The response returns a list of charges and information about the charges. Quantities are usually shown as 'unlimited' or an integer. Amounts are shown in the currency set for the account. Response The following table provides a description of the different chargeName property values. The information will grow as more chargeable items are added to the system. | chargeName | Description | | --- | --- | | id_check | ID Check Charge | | in_person_signing | In Person Signing charge | | envelopes Included | Sent Envelopes for the account | | age_verify | Age verification check | | ofac | OFAC Check | | id_confirm | ID confirmation check | | student_authentication | STAN PIN authentication check | | wet_sign_fax | Pages for returning signed documents by fax | | attachment_fax | Pages for returning attachments by fax | | phone_authentication | Phone authentication charge | | powerforms | PowerForm envelopes sent | | signer_payments | Payment processing charge | | outbound_fax | Send by fax charge | | bulk_recipient_envelopes | Bulk Recipient Envelopes sent | | sms_authentications | SMS authentication charge | | saml_authentications | SAML authentication charge | | express_signer_certificate | DocuSign Express Certificate charge | | personal_signer_certificate | Personal Signer Certificate charge | | safe_certificate | SAFE BioPharma Signer Certificate charge | | seats | Included active seats charge | | open_trust_certificate | OpenTrust Signer Certificate charge | This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_invoice(account_id, invoice_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str invoice_id: (required)
Returns

BillingInvoice If the method is called asynchronously, returns the request thread.

def get_invoice_with_http_info(self, account_id, invoice_id, **kwargs)
380    def get_invoice_with_http_info(self, account_id, invoice_id, **kwargs):
381        """
382        Retrieves a billing invoice.
383        Retrieves the specified invoice.   ###### Note: If the `pdfAvailable` property in the response is set to *true*, you can download a PDF version of the invoice. To download the PDF, make the call again and change the value of the `Accept` property in the header to `Accept: application/pdf`.  Privileges required: account administrator  The response returns a list of charges and information about the charges. Quantities are usually shown as 'unlimited' or an integer. Amounts are shown in the currency set for the account.  **Response** The following table provides a description of the different `chargeName` property values. The information will grow as more chargeable items are added to the system.  | chargeName | Description | | --- | --- | | id_check | ID Check Charge | | in_person_signing | In Person Signing charge | | envelopes Included | Sent Envelopes for the account | | age_verify | Age verification check | | ofac | OFAC Check | | id_confirm | ID confirmation check | | student_authentication | STAN PIN authentication check | | wet_sign_fax | Pages for returning signed documents by fax | | attachment_fax | Pages for returning attachments by fax | | phone_authentication | Phone authentication charge | | powerforms | PowerForm envelopes sent | | signer_payments | Payment processing charge | | outbound_fax | Send by fax charge | | bulk_recipient_envelopes | Bulk Recipient Envelopes sent | | sms_authentications | SMS authentication charge | | saml_authentications | SAML authentication charge | | express_signer_certificate | DocuSign Express Certificate charge | | personal_signer_certificate | Personal Signer Certificate charge | | safe_certificate | SAFE BioPharma Signer Certificate charge | | seats | Included active seats charge | | open_trust_certificate | OpenTrust Signer Certificate charge | 
384        This method makes a synchronous HTTP request by default. To make an
385        asynchronous HTTP request, please define a `callback` function
386        to be invoked when receiving the response.
387        >>> def callback_function(response):
388        >>>     pprint(response)
389        >>>
390        >>> thread = api.get_invoice_with_http_info(account_id, invoice_id, callback=callback_function)
391
392        :param callback function: The callback function
393            for asynchronous request. (optional)
394        :param str account_id: The external account number (int) or account ID Guid. (required)
395        :param str invoice_id: (required)
396        :return: BillingInvoice
397                 If the method is called asynchronously,
398                 returns the request thread.
399        """
400
401        all_params = ['account_id', 'invoice_id']
402        all_params.append('callback')
403        all_params.append('_return_http_data_only')
404        all_params.append('_preload_content')
405        all_params.append('_request_timeout')
406
407        params = locals()
408        for key, val in iteritems(params['kwargs']):
409            if key not in all_params:
410                raise TypeError(
411                    "Got an unexpected keyword argument '%s'"
412                    " to method get_invoice" % key
413                )
414            params[key] = val
415        del params['kwargs']
416        # verify the required parameter 'account_id' is set
417        if ('account_id' not in params) or (params['account_id'] is None):
418            raise ValueError("Missing the required parameter `account_id` when calling `get_invoice`")
419        # verify the required parameter 'invoice_id' is set
420        if ('invoice_id' not in params) or (params['invoice_id'] is None):
421            raise ValueError("Missing the required parameter `invoice_id` when calling `get_invoice`")
422
423
424        collection_formats = {}
425
426        resource_path = '/v2.1/accounts/{accountId}/billing_invoices/{invoiceId}'.replace('{format}', 'json')
427        path_params = {}
428        if 'account_id' in params:
429            path_params['accountId'] = params['account_id']
430        if 'invoice_id' in params:
431            path_params['invoiceId'] = params['invoice_id']
432
433        query_params = {}
434
435        header_params = {}
436
437        form_params = []
438        local_var_files = {}
439
440        body_params = None
441        # HTTP header `Accept`
442        header_params['Accept'] = self.api_client.\
443            select_header_accept(['application/json'])
444
445        # Authentication setting
446        auth_settings = []
447
448        return self.api_client.call_api(resource_path, 'GET',
449                                        path_params,
450                                        query_params,
451                                        header_params,
452                                        body=body_params,
453                                        post_params=form_params,
454                                        files=local_var_files,
455                                        response_type='BillingInvoice',
456                                        auth_settings=auth_settings,
457                                        callback=params.get('callback'),
458                                        _return_http_data_only=params.get('_return_http_data_only'),
459                                        _preload_content=params.get('_preload_content', True),
460                                        _request_timeout=params.get('_request_timeout'),
461                                        collection_formats=collection_formats)

Retrieves a billing invoice. Retrieves the specified invoice. ###### Note: If the pdfAvailable property in the response is set to true, you can download a PDF version of the invoice. To download the PDF, make the call again and change the value of the Accept property in the header to Accept: application/pdf. Privileges required: account administrator The response returns a list of charges and information about the charges. Quantities are usually shown as 'unlimited' or an integer. Amounts are shown in the currency set for the account. Response The following table provides a description of the different chargeName property values. The information will grow as more chargeable items are added to the system. | chargeName | Description | | --- | --- | | id_check | ID Check Charge | | in_person_signing | In Person Signing charge | | envelopes Included | Sent Envelopes for the account | | age_verify | Age verification check | | ofac | OFAC Check | | id_confirm | ID confirmation check | | student_authentication | STAN PIN authentication check | | wet_sign_fax | Pages for returning signed documents by fax | | attachment_fax | Pages for returning attachments by fax | | phone_authentication | Phone authentication charge | | powerforms | PowerForm envelopes sent | | signer_payments | Payment processing charge | | outbound_fax | Send by fax charge | | bulk_recipient_envelopes | Bulk Recipient Envelopes sent | | sms_authentications | SMS authentication charge | | saml_authentications | SAML authentication charge | | express_signer_certificate | DocuSign Express Certificate charge | | personal_signer_certificate | Personal Signer Certificate charge | | safe_certificate | SAFE BioPharma Signer Certificate charge | | seats | Included active seats charge | | open_trust_certificate | OpenTrust Signer Certificate charge | This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_invoice_with_http_info(account_id, invoice_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str invoice_id: (required)
Returns

BillingInvoice If the method is called asynchronously, returns the request thread.

def get_payment(self, account_id, payment_id, **kwargs)
463    def get_payment(self, account_id, payment_id, **kwargs):
464        """
465        Gets billing payment information for a specific payment.
466        Retrieves the information for a specified payment.   Privileges required: account administrator 
467        This method makes a synchronous HTTP request by default. To make an
468        asynchronous HTTP request, please define a `callback` function
469        to be invoked when receiving the response.
470        >>> def callback_function(response):
471        >>>     pprint(response)
472        >>>
473        >>> thread = api.get_payment(account_id, payment_id, callback=callback_function)
474
475        :param callback function: The callback function
476            for asynchronous request. (optional)
477        :param str account_id: The external account number (int) or account ID Guid. (required)
478        :param str payment_id: (required)
479        :return: BillingPaymentItem
480                 If the method is called asynchronously,
481                 returns the request thread.
482        """
483        kwargs['_return_http_data_only'] = True
484        if kwargs.get('callback'):
485            return self.get_payment_with_http_info(account_id, payment_id, **kwargs)
486        else:
487            (data) = self.get_payment_with_http_info(account_id, payment_id, **kwargs)
488            return data

Gets billing payment information for a specific payment. Retrieves the information for a specified payment. Privileges required: account administrator This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_payment(account_id, payment_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str payment_id: (required)
Returns

BillingPaymentItem If the method is called asynchronously, returns the request thread.

def get_payment_with_http_info(self, account_id, payment_id, **kwargs)
490    def get_payment_with_http_info(self, account_id, payment_id, **kwargs):
491        """
492        Gets billing payment information for a specific payment.
493        Retrieves the information for a specified payment.   Privileges required: account administrator 
494        This method makes a synchronous HTTP request by default. To make an
495        asynchronous HTTP request, please define a `callback` function
496        to be invoked when receiving the response.
497        >>> def callback_function(response):
498        >>>     pprint(response)
499        >>>
500        >>> thread = api.get_payment_with_http_info(account_id, payment_id, callback=callback_function)
501
502        :param callback function: The callback function
503            for asynchronous request. (optional)
504        :param str account_id: The external account number (int) or account ID Guid. (required)
505        :param str payment_id: (required)
506        :return: BillingPaymentItem
507                 If the method is called asynchronously,
508                 returns the request thread.
509        """
510
511        all_params = ['account_id', 'payment_id']
512        all_params.append('callback')
513        all_params.append('_return_http_data_only')
514        all_params.append('_preload_content')
515        all_params.append('_request_timeout')
516
517        params = locals()
518        for key, val in iteritems(params['kwargs']):
519            if key not in all_params:
520                raise TypeError(
521                    "Got an unexpected keyword argument '%s'"
522                    " to method get_payment" % key
523                )
524            params[key] = val
525        del params['kwargs']
526        # verify the required parameter 'account_id' is set
527        if ('account_id' not in params) or (params['account_id'] is None):
528            raise ValueError("Missing the required parameter `account_id` when calling `get_payment`")
529        # verify the required parameter 'payment_id' is set
530        if ('payment_id' not in params) or (params['payment_id'] is None):
531            raise ValueError("Missing the required parameter `payment_id` when calling `get_payment`")
532
533
534        collection_formats = {}
535
536        resource_path = '/v2.1/accounts/{accountId}/billing_payments/{paymentId}'.replace('{format}', 'json')
537        path_params = {}
538        if 'account_id' in params:
539            path_params['accountId'] = params['account_id']
540        if 'payment_id' in params:
541            path_params['paymentId'] = params['payment_id']
542
543        query_params = {}
544
545        header_params = {}
546
547        form_params = []
548        local_var_files = {}
549
550        body_params = None
551        # HTTP header `Accept`
552        header_params['Accept'] = self.api_client.\
553            select_header_accept(['application/json'])
554
555        # Authentication setting
556        auth_settings = []
557
558        return self.api_client.call_api(resource_path, 'GET',
559                                        path_params,
560                                        query_params,
561                                        header_params,
562                                        body=body_params,
563                                        post_params=form_params,
564                                        files=local_var_files,
565                                        response_type='BillingPaymentItem',
566                                        auth_settings=auth_settings,
567                                        callback=params.get('callback'),
568                                        _return_http_data_only=params.get('_return_http_data_only'),
569                                        _preload_content=params.get('_preload_content', True),
570                                        _request_timeout=params.get('_request_timeout'),
571                                        collection_formats=collection_formats)

Gets billing payment information for a specific payment. Retrieves the information for a specified payment. Privileges required: account administrator This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_payment_with_http_info(account_id, payment_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str payment_id: (required)
Returns

BillingPaymentItem If the method is called asynchronously, returns the request thread.

def get_plan(self, account_id, **kwargs)
573    def get_plan(self, account_id, **kwargs):
574        """
575        Get Account Billing Plan
576        Retrieves the billing plan information for the specified account, including the current billing plan, successor plans, billing address, and billing credit card.  By default the successor plan and credit card information is included in the response. This information can be excluded from the response by adding the appropriate optional query string with the `setting` set to **false**.   Response  The response returns the billing plan information, including the currency code, for the plan. The `billingPlan` and `succesorPlans` property values are the same as those shown in the [ML:Get Billing Plan Details] reference. the `billingAddress` and `creditCardInformation` property values are the same as those shown in the [ML:Update Billing Plan] reference.  ###### Note: When credit card number information is shown, a mask is applied to the response so that only the last 4 digits of the card number are visible. 
577        This method makes a synchronous HTTP request by default. To make an
578        asynchronous HTTP request, please define a `callback` function
579        to be invoked when receiving the response.
580        >>> def callback_function(response):
581        >>>     pprint(response)
582        >>>
583        >>> thread = api.get_plan(account_id, callback=callback_function)
584
585        :param callback function: The callback function
586            for asynchronous request. (optional)
587        :param str account_id: The external account number (int) or account ID Guid. (required)
588        :param str include_credit_card_information: When set to **true**, excludes credit card information from the response.
589        :param str include_downgrade_information:
590        :param str include_metadata: When set to **true**, the `canUpgrade` and `renewalStatus` properities are included the response and an array of `supportedCountries` property is added to the `billingAddress` information. 
591        :param str include_successor_plans: When set to **true**, excludes successor information from the response.
592        :param str include_tax_exempt_id:
593        :return: AccountBillingPlanResponse
594                 If the method is called asynchronously,
595                 returns the request thread.
596        """
597        kwargs['_return_http_data_only'] = True
598        if kwargs.get('callback'):
599            return self.get_plan_with_http_info(account_id, **kwargs)
600        else:
601            (data) = self.get_plan_with_http_info(account_id, **kwargs)
602            return data

Get Account Billing Plan Retrieves the billing plan information for the specified account, including the current billing plan, successor plans, billing address, and billing credit card. By default the successor plan and credit card information is included in the response. This information can be excluded from the response by adding the appropriate optional query string with the setting set to false. Response The response returns the billing plan information, including the currency code, for the plan. The billingPlan and succesorPlans property values are the same as those shown in the [ML:Get Billing Plan Details] reference. the billingAddress and creditCardInformation property values are the same as those shown in the [ML:Update Billing Plan] reference. ###### Note: When credit card number information is shown, a mask is applied to the response so that only the last 4 digits of the card number are visible. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_plan(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str include_credit_card_information: When set to true, excludes credit card information from the response.
  • str include_downgrade_information:
  • str include_metadata: When set to true, the canUpgrade and renewalStatus properities are included the response and an array of supportedCountries property is added to the billingAddress information.
  • str include_successor_plans: When set to true, excludes successor information from the response.
  • str include_tax_exempt_id:
Returns

AccountBillingPlanResponse If the method is called asynchronously, returns the request thread.

def get_plan_with_http_info(self, account_id, **kwargs)
604    def get_plan_with_http_info(self, account_id, **kwargs):
605        """
606        Get Account Billing Plan
607        Retrieves the billing plan information for the specified account, including the current billing plan, successor plans, billing address, and billing credit card.  By default the successor plan and credit card information is included in the response. This information can be excluded from the response by adding the appropriate optional query string with the `setting` set to **false**.   Response  The response returns the billing plan information, including the currency code, for the plan. The `billingPlan` and `succesorPlans` property values are the same as those shown in the [ML:Get Billing Plan Details] reference. the `billingAddress` and `creditCardInformation` property values are the same as those shown in the [ML:Update Billing Plan] reference.  ###### Note: When credit card number information is shown, a mask is applied to the response so that only the last 4 digits of the card number are visible. 
608        This method makes a synchronous HTTP request by default. To make an
609        asynchronous HTTP request, please define a `callback` function
610        to be invoked when receiving the response.
611        >>> def callback_function(response):
612        >>>     pprint(response)
613        >>>
614        >>> thread = api.get_plan_with_http_info(account_id, callback=callback_function)
615
616        :param callback function: The callback function
617            for asynchronous request. (optional)
618        :param str account_id: The external account number (int) or account ID Guid. (required)
619        :param str include_credit_card_information: When set to **true**, excludes credit card information from the response.
620        :param str include_downgrade_information:
621        :param str include_metadata: When set to **true**, the `canUpgrade` and `renewalStatus` properities are included the response and an array of `supportedCountries` property is added to the `billingAddress` information. 
622        :param str include_successor_plans: When set to **true**, excludes successor information from the response.
623        :param str include_tax_exempt_id:
624        :return: AccountBillingPlanResponse
625                 If the method is called asynchronously,
626                 returns the request thread.
627        """
628
629        all_params = ['account_id', 'include_credit_card_information', 'include_downgrade_information', 'include_metadata', 'include_successor_plans', 'include_tax_exempt_id']
630        all_params.append('callback')
631        all_params.append('_return_http_data_only')
632        all_params.append('_preload_content')
633        all_params.append('_request_timeout')
634
635        params = locals()
636        for key, val in iteritems(params['kwargs']):
637            if key not in all_params:
638                raise TypeError(
639                    "Got an unexpected keyword argument '%s'"
640                    " to method get_plan" % key
641                )
642            params[key] = val
643        del params['kwargs']
644        # verify the required parameter 'account_id' is set
645        if ('account_id' not in params) or (params['account_id'] is None):
646            raise ValueError("Missing the required parameter `account_id` when calling `get_plan`")
647
648
649        collection_formats = {}
650
651        resource_path = '/v2.1/accounts/{accountId}/billing_plan'.replace('{format}', 'json')
652        path_params = {}
653        if 'account_id' in params:
654            path_params['accountId'] = params['account_id']
655
656        query_params = {}
657        if 'include_credit_card_information' in params:
658            query_params['include_credit_card_information'] = params['include_credit_card_information']
659        if 'include_downgrade_information' in params:
660            query_params['include_downgrade_information'] = params['include_downgrade_information']
661        if 'include_metadata' in params:
662            query_params['include_metadata'] = params['include_metadata']
663        if 'include_successor_plans' in params:
664            query_params['include_successor_plans'] = params['include_successor_plans']
665        if 'include_tax_exempt_id' in params:
666            query_params['include_tax_exempt_id'] = params['include_tax_exempt_id']
667
668        header_params = {}
669
670        form_params = []
671        local_var_files = {}
672
673        body_params = None
674        # HTTP header `Accept`
675        header_params['Accept'] = self.api_client.\
676            select_header_accept(['application/json'])
677
678        # Authentication setting
679        auth_settings = []
680
681        return self.api_client.call_api(resource_path, 'GET',
682                                        path_params,
683                                        query_params,
684                                        header_params,
685                                        body=body_params,
686                                        post_params=form_params,
687                                        files=local_var_files,
688                                        response_type='AccountBillingPlanResponse',
689                                        auth_settings=auth_settings,
690                                        callback=params.get('callback'),
691                                        _return_http_data_only=params.get('_return_http_data_only'),
692                                        _preload_content=params.get('_preload_content', True),
693                                        _request_timeout=params.get('_request_timeout'),
694                                        collection_formats=collection_formats)

Get Account Billing Plan Retrieves the billing plan information for the specified account, including the current billing plan, successor plans, billing address, and billing credit card. By default the successor plan and credit card information is included in the response. This information can be excluded from the response by adding the appropriate optional query string with the setting set to false. Response The response returns the billing plan information, including the currency code, for the plan. The billingPlan and succesorPlans property values are the same as those shown in the [ML:Get Billing Plan Details] reference. the billingAddress and creditCardInformation property values are the same as those shown in the [ML:Update Billing Plan] reference. ###### Note: When credit card number information is shown, a mask is applied to the response so that only the last 4 digits of the card number are visible. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_plan_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str include_credit_card_information: When set to true, excludes credit card information from the response.
  • str include_downgrade_information:
  • str include_metadata: When set to true, the canUpgrade and renewalStatus properities are included the response and an array of supportedCountries property is added to the billingAddress information.
  • str include_successor_plans: When set to true, excludes successor information from the response.
  • str include_tax_exempt_id:
Returns

AccountBillingPlanResponse If the method is called asynchronously, returns the request thread.

def list_billing_plans(self, **kwargs)
696    def list_billing_plans(self, **kwargs):
697        """
698        Gets the list of available billing plans.
699        Retrieves a list of the billing plans associated with a distributor.
700        This method makes a synchronous HTTP request by default. To make an
701        asynchronous HTTP request, please define a `callback` function
702        to be invoked when receiving the response.
703        >>> def callback_function(response):
704        >>>     pprint(response)
705        >>>
706        >>> thread = api.list_billing_plans(callback=callback_function)
707
708        :param callback function: The callback function
709            for asynchronous request. (optional)
710        :return: BillingPlansResponse
711                 If the method is called asynchronously,
712                 returns the request thread.
713        """
714        kwargs['_return_http_data_only'] = True
715        if kwargs.get('callback'):
716            return self.list_billing_plans_with_http_info(**kwargs)
717        else:
718            (data) = self.list_billing_plans_with_http_info(**kwargs)
719            return data

Gets the list of available billing plans. Retrieves a list of the billing plans associated with a distributor. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.list_billing_plans(callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
Returns

BillingPlansResponse If the method is called asynchronously, returns the request thread.

def list_billing_plans_with_http_info(self, **kwargs)
721    def list_billing_plans_with_http_info(self, **kwargs):
722        """
723        Gets the list of available billing plans.
724        Retrieves a list of the billing plans associated with a distributor.
725        This method makes a synchronous HTTP request by default. To make an
726        asynchronous HTTP request, please define a `callback` function
727        to be invoked when receiving the response.
728        >>> def callback_function(response):
729        >>>     pprint(response)
730        >>>
731        >>> thread = api.list_billing_plans_with_http_info(callback=callback_function)
732
733        :param callback function: The callback function
734            for asynchronous request. (optional)
735        :return: BillingPlansResponse
736                 If the method is called asynchronously,
737                 returns the request thread.
738        """
739
740        all_params = []
741        all_params.append('callback')
742        all_params.append('_return_http_data_only')
743        all_params.append('_preload_content')
744        all_params.append('_request_timeout')
745
746        params = locals()
747        for key, val in iteritems(params['kwargs']):
748            if key not in all_params:
749                raise TypeError(
750                    "Got an unexpected keyword argument '%s'"
751                    " to method list_billing_plans" % key
752                )
753            params[key] = val
754        del params['kwargs']
755
756        collection_formats = {}
757
758        resource_path = '/v2.1/billing_plans'.replace('{format}', 'json')
759        path_params = {}
760
761        query_params = {}
762
763        header_params = {}
764
765        form_params = []
766        local_var_files = {}
767
768        body_params = None
769        # HTTP header `Accept`
770        header_params['Accept'] = self.api_client.\
771            select_header_accept(['application/json'])
772
773        # Authentication setting
774        auth_settings = []
775
776        return self.api_client.call_api(resource_path, 'GET',
777                                        path_params,
778                                        query_params,
779                                        header_params,
780                                        body=body_params,
781                                        post_params=form_params,
782                                        files=local_var_files,
783                                        response_type='BillingPlansResponse',
784                                        auth_settings=auth_settings,
785                                        callback=params.get('callback'),
786                                        _return_http_data_only=params.get('_return_http_data_only'),
787                                        _preload_content=params.get('_preload_content', True),
788                                        _request_timeout=params.get('_request_timeout'),
789                                        collection_formats=collection_formats)

Gets the list of available billing plans. Retrieves a list of the billing plans associated with a distributor. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.list_billing_plans_with_http_info(callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
Returns

BillingPlansResponse If the method is called asynchronously, returns the request thread.

def list_invoices(self, account_id, **kwargs)
791    def list_invoices(self, account_id, **kwargs):
792        """
793        Get a List of Billing Invoices
794        Retrieves a list of invoices for the account. If the from date or to date queries are not specified, the response returns invoices for the last 365 days.  Privileges required: account administrator 
795        This method makes a synchronous HTTP request by default. To make an
796        asynchronous HTTP request, please define a `callback` function
797        to be invoked when receiving the response.
798        >>> def callback_function(response):
799        >>>     pprint(response)
800        >>>
801        >>> thread = api.list_invoices(account_id, callback=callback_function)
802
803        :param callback function: The callback function
804            for asynchronous request. (optional)
805        :param str account_id: The external account number (int) or account ID Guid. (required)
806        :param str from_date: Specifies the date/time of the earliest invoice in the account to retrieve.
807        :param str to_date: Specifies the date/time of the latest invoice in the account to retrieve.
808        :return: BillingInvoicesResponse
809                 If the method is called asynchronously,
810                 returns the request thread.
811        """
812        kwargs['_return_http_data_only'] = True
813        if kwargs.get('callback'):
814            return self.list_invoices_with_http_info(account_id, **kwargs)
815        else:
816            (data) = self.list_invoices_with_http_info(account_id, **kwargs)
817            return data

Get a List of Billing Invoices Retrieves a list of invoices for the account. If the from date or to date queries are not specified, the response returns invoices for the last 365 days. Privileges required: account administrator This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.list_invoices(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str from_date: Specifies the date/time of the earliest invoice in the account to retrieve.
  • str to_date: Specifies the date/time of the latest invoice in the account to retrieve.
Returns

BillingInvoicesResponse If the method is called asynchronously, returns the request thread.

def list_invoices_with_http_info(self, account_id, **kwargs)
819    def list_invoices_with_http_info(self, account_id, **kwargs):
820        """
821        Get a List of Billing Invoices
822        Retrieves a list of invoices for the account. If the from date or to date queries are not specified, the response returns invoices for the last 365 days.  Privileges required: account administrator 
823        This method makes a synchronous HTTP request by default. To make an
824        asynchronous HTTP request, please define a `callback` function
825        to be invoked when receiving the response.
826        >>> def callback_function(response):
827        >>>     pprint(response)
828        >>>
829        >>> thread = api.list_invoices_with_http_info(account_id, callback=callback_function)
830
831        :param callback function: The callback function
832            for asynchronous request. (optional)
833        :param str account_id: The external account number (int) or account ID Guid. (required)
834        :param str from_date: Specifies the date/time of the earliest invoice in the account to retrieve.
835        :param str to_date: Specifies the date/time of the latest invoice in the account to retrieve.
836        :return: BillingInvoicesResponse
837                 If the method is called asynchronously,
838                 returns the request thread.
839        """
840
841        all_params = ['account_id', 'from_date', 'to_date']
842        all_params.append('callback')
843        all_params.append('_return_http_data_only')
844        all_params.append('_preload_content')
845        all_params.append('_request_timeout')
846
847        params = locals()
848        for key, val in iteritems(params['kwargs']):
849            if key not in all_params:
850                raise TypeError(
851                    "Got an unexpected keyword argument '%s'"
852                    " to method list_invoices" % key
853                )
854            params[key] = val
855        del params['kwargs']
856        # verify the required parameter 'account_id' is set
857        if ('account_id' not in params) or (params['account_id'] is None):
858            raise ValueError("Missing the required parameter `account_id` when calling `list_invoices`")
859
860
861        collection_formats = {}
862
863        resource_path = '/v2.1/accounts/{accountId}/billing_invoices'.replace('{format}', 'json')
864        path_params = {}
865        if 'account_id' in params:
866            path_params['accountId'] = params['account_id']
867
868        query_params = {}
869        if 'from_date' in params:
870            query_params['from_date'] = params['from_date']
871        if 'to_date' in params:
872            query_params['to_date'] = params['to_date']
873
874        header_params = {}
875
876        form_params = []
877        local_var_files = {}
878
879        body_params = None
880        # HTTP header `Accept`
881        header_params['Accept'] = self.api_client.\
882            select_header_accept(['application/json'])
883
884        # Authentication setting
885        auth_settings = []
886
887        return self.api_client.call_api(resource_path, 'GET',
888                                        path_params,
889                                        query_params,
890                                        header_params,
891                                        body=body_params,
892                                        post_params=form_params,
893                                        files=local_var_files,
894                                        response_type='BillingInvoicesResponse',
895                                        auth_settings=auth_settings,
896                                        callback=params.get('callback'),
897                                        _return_http_data_only=params.get('_return_http_data_only'),
898                                        _preload_content=params.get('_preload_content', True),
899                                        _request_timeout=params.get('_request_timeout'),
900                                        collection_formats=collection_formats)

Get a List of Billing Invoices Retrieves a list of invoices for the account. If the from date or to date queries are not specified, the response returns invoices for the last 365 days. Privileges required: account administrator This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.list_invoices_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str from_date: Specifies the date/time of the earliest invoice in the account to retrieve.
  • str to_date: Specifies the date/time of the latest invoice in the account to retrieve.
Returns

BillingInvoicesResponse If the method is called asynchronously, returns the request thread.

def list_invoices_past_due(self, account_id, **kwargs)
902    def list_invoices_past_due(self, account_id, **kwargs):
903        """
904        Get a list of past due invoices.
905        Returns a list past due invoices for the account and notes if payment can be made through the REST API.   Privileges Required: account administrator
906        This method makes a synchronous HTTP request by default. To make an
907        asynchronous HTTP request, please define a `callback` function
908        to be invoked when receiving the response.
909        >>> def callback_function(response):
910        >>>     pprint(response)
911        >>>
912        >>> thread = api.list_invoices_past_due(account_id, callback=callback_function)
913
914        :param callback function: The callback function
915            for asynchronous request. (optional)
916        :param str account_id: The external account number (int) or account ID Guid. (required)
917        :return: BillingInvoicesSummary
918                 If the method is called asynchronously,
919                 returns the request thread.
920        """
921        kwargs['_return_http_data_only'] = True
922        if kwargs.get('callback'):
923            return self.list_invoices_past_due_with_http_info(account_id, **kwargs)
924        else:
925            (data) = self.list_invoices_past_due_with_http_info(account_id, **kwargs)
926            return data

Get a list of past due invoices. Returns a list past due invoices for the account and notes if payment can be made through the REST API. Privileges Required: account administrator This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.list_invoices_past_due(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
Returns

BillingInvoicesSummary If the method is called asynchronously, returns the request thread.

def list_invoices_past_due_with_http_info(self, account_id, **kwargs)
 928    def list_invoices_past_due_with_http_info(self, account_id, **kwargs):
 929        """
 930        Get a list of past due invoices.
 931        Returns a list past due invoices for the account and notes if payment can be made through the REST API.   Privileges Required: account administrator
 932        This method makes a synchronous HTTP request by default. To make an
 933        asynchronous HTTP request, please define a `callback` function
 934        to be invoked when receiving the response.
 935        >>> def callback_function(response):
 936        >>>     pprint(response)
 937        >>>
 938        >>> thread = api.list_invoices_past_due_with_http_info(account_id, callback=callback_function)
 939
 940        :param callback function: The callback function
 941            for asynchronous request. (optional)
 942        :param str account_id: The external account number (int) or account ID Guid. (required)
 943        :return: BillingInvoicesSummary
 944                 If the method is called asynchronously,
 945                 returns the request thread.
 946        """
 947
 948        all_params = ['account_id']
 949        all_params.append('callback')
 950        all_params.append('_return_http_data_only')
 951        all_params.append('_preload_content')
 952        all_params.append('_request_timeout')
 953
 954        params = locals()
 955        for key, val in iteritems(params['kwargs']):
 956            if key not in all_params:
 957                raise TypeError(
 958                    "Got an unexpected keyword argument '%s'"
 959                    " to method list_invoices_past_due" % key
 960                )
 961            params[key] = val
 962        del params['kwargs']
 963        # verify the required parameter 'account_id' is set
 964        if ('account_id' not in params) or (params['account_id'] is None):
 965            raise ValueError("Missing the required parameter `account_id` when calling `list_invoices_past_due`")
 966
 967
 968        collection_formats = {}
 969
 970        resource_path = '/v2.1/accounts/{accountId}/billing_invoices_past_due'.replace('{format}', 'json')
 971        path_params = {}
 972        if 'account_id' in params:
 973            path_params['accountId'] = params['account_id']
 974
 975        query_params = {}
 976
 977        header_params = {}
 978
 979        form_params = []
 980        local_var_files = {}
 981
 982        body_params = None
 983        # HTTP header `Accept`
 984        header_params['Accept'] = self.api_client.\
 985            select_header_accept(['application/json'])
 986
 987        # Authentication setting
 988        auth_settings = []
 989
 990        return self.api_client.call_api(resource_path, 'GET',
 991                                        path_params,
 992                                        query_params,
 993                                        header_params,
 994                                        body=body_params,
 995                                        post_params=form_params,
 996                                        files=local_var_files,
 997                                        response_type='BillingInvoicesSummary',
 998                                        auth_settings=auth_settings,
 999                                        callback=params.get('callback'),
1000                                        _return_http_data_only=params.get('_return_http_data_only'),
1001                                        _preload_content=params.get('_preload_content', True),
1002                                        _request_timeout=params.get('_request_timeout'),
1003                                        collection_formats=collection_formats)

Get a list of past due invoices. Returns a list past due invoices for the account and notes if payment can be made through the REST API. Privileges Required: account administrator This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.list_invoices_past_due_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
Returns

BillingInvoicesSummary If the method is called asynchronously, returns the request thread.

def list_payments(self, account_id, **kwargs)
1005    def list_payments(self, account_id, **kwargs):
1006        """
1007        Gets payment information for one or more payments.
1008        Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days.   Privileges required: account administrator 
1009        This method makes a synchronous HTTP request by default. To make an
1010        asynchronous HTTP request, please define a `callback` function
1011        to be invoked when receiving the response.
1012        >>> def callback_function(response):
1013        >>>     pprint(response)
1014        >>>
1015        >>> thread = api.list_payments(account_id, callback=callback_function)
1016
1017        :param callback function: The callback function
1018            for asynchronous request. (optional)
1019        :param str account_id: The external account number (int) or account ID Guid. (required)
1020        :param str from_date: Specifies the date/time of the earliest payment in the account to retrieve.
1021        :param str to_date: Specifies the date/time of the latest payment in the account to retrieve.
1022        :return: BillingPaymentsResponse
1023                 If the method is called asynchronously,
1024                 returns the request thread.
1025        """
1026        kwargs['_return_http_data_only'] = True
1027        if kwargs.get('callback'):
1028            return self.list_payments_with_http_info(account_id, **kwargs)
1029        else:
1030            (data) = self.list_payments_with_http_info(account_id, **kwargs)
1031            return data

Gets payment information for one or more payments. Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days. Privileges required: account administrator This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.list_payments(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str from_date: Specifies the date/time of the earliest payment in the account to retrieve.
  • str to_date: Specifies the date/time of the latest payment in the account to retrieve.
Returns

BillingPaymentsResponse If the method is called asynchronously, returns the request thread.

def list_payments_with_http_info(self, account_id, **kwargs)
1033    def list_payments_with_http_info(self, account_id, **kwargs):
1034        """
1035        Gets payment information for one or more payments.
1036        Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days.   Privileges required: account administrator 
1037        This method makes a synchronous HTTP request by default. To make an
1038        asynchronous HTTP request, please define a `callback` function
1039        to be invoked when receiving the response.
1040        >>> def callback_function(response):
1041        >>>     pprint(response)
1042        >>>
1043        >>> thread = api.list_payments_with_http_info(account_id, callback=callback_function)
1044
1045        :param callback function: The callback function
1046            for asynchronous request. (optional)
1047        :param str account_id: The external account number (int) or account ID Guid. (required)
1048        :param str from_date: Specifies the date/time of the earliest payment in the account to retrieve.
1049        :param str to_date: Specifies the date/time of the latest payment in the account to retrieve.
1050        :return: BillingPaymentsResponse
1051                 If the method is called asynchronously,
1052                 returns the request thread.
1053        """
1054
1055        all_params = ['account_id', 'from_date', 'to_date']
1056        all_params.append('callback')
1057        all_params.append('_return_http_data_only')
1058        all_params.append('_preload_content')
1059        all_params.append('_request_timeout')
1060
1061        params = locals()
1062        for key, val in iteritems(params['kwargs']):
1063            if key not in all_params:
1064                raise TypeError(
1065                    "Got an unexpected keyword argument '%s'"
1066                    " to method list_payments" % key
1067                )
1068            params[key] = val
1069        del params['kwargs']
1070        # verify the required parameter 'account_id' is set
1071        if ('account_id' not in params) or (params['account_id'] is None):
1072            raise ValueError("Missing the required parameter `account_id` when calling `list_payments`")
1073
1074
1075        collection_formats = {}
1076
1077        resource_path = '/v2.1/accounts/{accountId}/billing_payments'.replace('{format}', 'json')
1078        path_params = {}
1079        if 'account_id' in params:
1080            path_params['accountId'] = params['account_id']
1081
1082        query_params = {}
1083        if 'from_date' in params:
1084            query_params['from_date'] = params['from_date']
1085        if 'to_date' in params:
1086            query_params['to_date'] = params['to_date']
1087
1088        header_params = {}
1089
1090        form_params = []
1091        local_var_files = {}
1092
1093        body_params = None
1094        # HTTP header `Accept`
1095        header_params['Accept'] = self.api_client.\
1096            select_header_accept(['application/json'])
1097
1098        # Authentication setting
1099        auth_settings = []
1100
1101        return self.api_client.call_api(resource_path, 'GET',
1102                                        path_params,
1103                                        query_params,
1104                                        header_params,
1105                                        body=body_params,
1106                                        post_params=form_params,
1107                                        files=local_var_files,
1108                                        response_type='BillingPaymentsResponse',
1109                                        auth_settings=auth_settings,
1110                                        callback=params.get('callback'),
1111                                        _return_http_data_only=params.get('_return_http_data_only'),
1112                                        _preload_content=params.get('_preload_content', True),
1113                                        _request_timeout=params.get('_request_timeout'),
1114                                        collection_formats=collection_formats)

Gets payment information for one or more payments. Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days. Privileges required: account administrator This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.list_payments_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str from_date: Specifies the date/time of the earliest payment in the account to retrieve.
  • str to_date: Specifies the date/time of the latest payment in the account to retrieve.
Returns

BillingPaymentsResponse If the method is called asynchronously, returns the request thread.

def make_payment(self, account_id, **kwargs)
1116    def make_payment(self, account_id, **kwargs):
1117        """
1118        Posts a payment to a past due invoice.
1119        Posts a payment to a past due invoice.   ###### Note: This can only be used if the `paymentAllowed` value for a past due invoice is true. This can be determined calling [ML:GetBillingInvoicesPastDue].  The response returns information for a single payment, if a payment ID was used in the endpoint, or a list of payments. If the from date or to date queries or payment ID are not used, the response returns payment information for the last 365 days. If the request was for a single payment ID, the `nextUri` and `previousUri` properties are not returned.  Privileges required: account administrator
1120        This method makes a synchronous HTTP request by default. To make an
1121        asynchronous HTTP request, please define a `callback` function
1122        to be invoked when receiving the response.
1123        >>> def callback_function(response):
1124        >>>     pprint(response)
1125        >>>
1126        >>> thread = api.make_payment(account_id, callback=callback_function)
1127
1128        :param callback function: The callback function
1129            for asynchronous request. (optional)
1130        :param str account_id: The external account number (int) or account ID Guid. (required)
1131        :param BillingPaymentRequest billing_payment_request:
1132        :return: BillingPaymentResponse
1133                 If the method is called asynchronously,
1134                 returns the request thread.
1135        """
1136        kwargs['_return_http_data_only'] = True
1137        if kwargs.get('callback'):
1138            return self.make_payment_with_http_info(account_id, **kwargs)
1139        else:
1140            (data) = self.make_payment_with_http_info(account_id, **kwargs)
1141            return data

Posts a payment to a past due invoice. Posts a payment to a past due invoice. ###### Note: This can only be used if the paymentAllowed value for a past due invoice is true. This can be determined calling [ML:GetBillingInvoicesPastDue]. The response returns information for a single payment, if a payment ID was used in the endpoint, or a list of payments. If the from date or to date queries or payment ID are not used, the response returns payment information for the last 365 days. If the request was for a single payment ID, the nextUri and previousUri properties are not returned. Privileges required: account administrator This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.make_payment(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • BillingPaymentRequest billing_payment_request:
Returns

BillingPaymentResponse If the method is called asynchronously, returns the request thread.

def make_payment_with_http_info(self, account_id, **kwargs)
1143    def make_payment_with_http_info(self, account_id, **kwargs):
1144        """
1145        Posts a payment to a past due invoice.
1146        Posts a payment to a past due invoice.   ###### Note: This can only be used if the `paymentAllowed` value for a past due invoice is true. This can be determined calling [ML:GetBillingInvoicesPastDue].  The response returns information for a single payment, if a payment ID was used in the endpoint, or a list of payments. If the from date or to date queries or payment ID are not used, the response returns payment information for the last 365 days. If the request was for a single payment ID, the `nextUri` and `previousUri` properties are not returned.  Privileges required: account administrator
1147        This method makes a synchronous HTTP request by default. To make an
1148        asynchronous HTTP request, please define a `callback` function
1149        to be invoked when receiving the response.
1150        >>> def callback_function(response):
1151        >>>     pprint(response)
1152        >>>
1153        >>> thread = api.make_payment_with_http_info(account_id, callback=callback_function)
1154
1155        :param callback function: The callback function
1156            for asynchronous request. (optional)
1157        :param str account_id: The external account number (int) or account ID Guid. (required)
1158        :param BillingPaymentRequest billing_payment_request:
1159        :return: BillingPaymentResponse
1160                 If the method is called asynchronously,
1161                 returns the request thread.
1162        """
1163
1164        all_params = ['account_id', 'billing_payment_request']
1165        all_params.append('callback')
1166        all_params.append('_return_http_data_only')
1167        all_params.append('_preload_content')
1168        all_params.append('_request_timeout')
1169
1170        params = locals()
1171        for key, val in iteritems(params['kwargs']):
1172            if key not in all_params:
1173                raise TypeError(
1174                    "Got an unexpected keyword argument '%s'"
1175                    " to method make_payment" % key
1176                )
1177            params[key] = val
1178        del params['kwargs']
1179        # verify the required parameter 'account_id' is set
1180        if ('account_id' not in params) or (params['account_id'] is None):
1181            raise ValueError("Missing the required parameter `account_id` when calling `make_payment`")
1182
1183
1184        collection_formats = {}
1185
1186        resource_path = '/v2.1/accounts/{accountId}/billing_payments'.replace('{format}', 'json')
1187        path_params = {}
1188        if 'account_id' in params:
1189            path_params['accountId'] = params['account_id']
1190
1191        query_params = {}
1192
1193        header_params = {}
1194
1195        form_params = []
1196        local_var_files = {}
1197
1198        body_params = None
1199        if 'billing_payment_request' in params:
1200            body_params = params['billing_payment_request']
1201        # HTTP header `Accept`
1202        header_params['Accept'] = self.api_client.\
1203            select_header_accept(['application/json'])
1204
1205        # Authentication setting
1206        auth_settings = []
1207
1208        return self.api_client.call_api(resource_path, 'POST',
1209                                        path_params,
1210                                        query_params,
1211                                        header_params,
1212                                        body=body_params,
1213                                        post_params=form_params,
1214                                        files=local_var_files,
1215                                        response_type='BillingPaymentResponse',
1216                                        auth_settings=auth_settings,
1217                                        callback=params.get('callback'),
1218                                        _return_http_data_only=params.get('_return_http_data_only'),
1219                                        _preload_content=params.get('_preload_content', True),
1220                                        _request_timeout=params.get('_request_timeout'),
1221                                        collection_formats=collection_formats)

Posts a payment to a past due invoice. Posts a payment to a past due invoice. ###### Note: This can only be used if the paymentAllowed value for a past due invoice is true. This can be determined calling [ML:GetBillingInvoicesPastDue]. The response returns information for a single payment, if a payment ID was used in the endpoint, or a list of payments. If the from date or to date queries or payment ID are not used, the response returns payment information for the last 365 days. If the request was for a single payment ID, the nextUri and previousUri properties are not returned. Privileges required: account administrator This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.make_payment_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • BillingPaymentRequest billing_payment_request:
Returns

BillingPaymentResponse If the method is called asynchronously, returns the request thread.

def purchase_envelopes(self, account_id, **kwargs)
1223    def purchase_envelopes(self, account_id, **kwargs):
1224        """
1225        Reserverd: Purchase additional envelopes.
1226        Reserved: At this time, this endpoint is limited to DocuSign internal use only. Completes the purchase of envelopes for your account. The actual purchase is done as part of an internal workflow interaction with an envelope vendor.
1227        This method makes a synchronous HTTP request by default. To make an
1228        asynchronous HTTP request, please define a `callback` function
1229        to be invoked when receiving the response.
1230        >>> def callback_function(response):
1231        >>>     pprint(response)
1232        >>>
1233        >>> thread = api.purchase_envelopes(account_id, callback=callback_function)
1234
1235        :param callback function: The callback function
1236            for asynchronous request. (optional)
1237        :param str account_id: The external account number (int) or account ID Guid. (required)
1238        :param PurchasedEnvelopesInformation purchased_envelopes_information:
1239        :return: None
1240                 If the method is called asynchronously,
1241                 returns the request thread.
1242        """
1243        kwargs['_return_http_data_only'] = True
1244        if kwargs.get('callback'):
1245            return self.purchase_envelopes_with_http_info(account_id, **kwargs)
1246        else:
1247            (data) = self.purchase_envelopes_with_http_info(account_id, **kwargs)
1248            return data

Reserverd: Purchase additional envelopes. Reserved: At this time, this endpoint is limited to DocuSign internal use only. Completes the purchase of envelopes for your account. The actual purchase is done as part of an internal workflow interaction with an envelope vendor. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.purchase_envelopes(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • PurchasedEnvelopesInformation purchased_envelopes_information:
Returns

None If the method is called asynchronously, returns the request thread.

def purchase_envelopes_with_http_info(self, account_id, **kwargs)
1250    def purchase_envelopes_with_http_info(self, account_id, **kwargs):
1251        """
1252        Reserverd: Purchase additional envelopes.
1253        Reserved: At this time, this endpoint is limited to DocuSign internal use only. Completes the purchase of envelopes for your account. The actual purchase is done as part of an internal workflow interaction with an envelope vendor.
1254        This method makes a synchronous HTTP request by default. To make an
1255        asynchronous HTTP request, please define a `callback` function
1256        to be invoked when receiving the response.
1257        >>> def callback_function(response):
1258        >>>     pprint(response)
1259        >>>
1260        >>> thread = api.purchase_envelopes_with_http_info(account_id, callback=callback_function)
1261
1262        :param callback function: The callback function
1263            for asynchronous request. (optional)
1264        :param str account_id: The external account number (int) or account ID Guid. (required)
1265        :param PurchasedEnvelopesInformation purchased_envelopes_information:
1266        :return: None
1267                 If the method is called asynchronously,
1268                 returns the request thread.
1269        """
1270
1271        all_params = ['account_id', 'purchased_envelopes_information']
1272        all_params.append('callback')
1273        all_params.append('_return_http_data_only')
1274        all_params.append('_preload_content')
1275        all_params.append('_request_timeout')
1276
1277        params = locals()
1278        for key, val in iteritems(params['kwargs']):
1279            if key not in all_params:
1280                raise TypeError(
1281                    "Got an unexpected keyword argument '%s'"
1282                    " to method purchase_envelopes" % key
1283                )
1284            params[key] = val
1285        del params['kwargs']
1286        # verify the required parameter 'account_id' is set
1287        if ('account_id' not in params) or (params['account_id'] is None):
1288            raise ValueError("Missing the required parameter `account_id` when calling `purchase_envelopes`")
1289
1290
1291        collection_formats = {}
1292
1293        resource_path = '/v2.1/accounts/{accountId}/billing_plan/purchased_envelopes'.replace('{format}', 'json')
1294        path_params = {}
1295        if 'account_id' in params:
1296            path_params['accountId'] = params['account_id']
1297
1298        query_params = {}
1299
1300        header_params = {}
1301
1302        form_params = []
1303        local_var_files = {}
1304
1305        body_params = None
1306        if 'purchased_envelopes_information' in params:
1307            body_params = params['purchased_envelopes_information']
1308        # HTTP header `Accept`
1309        header_params['Accept'] = self.api_client.\
1310            select_header_accept(['application/json'])
1311
1312        # Authentication setting
1313        auth_settings = []
1314
1315        return self.api_client.call_api(resource_path, 'PUT',
1316                                        path_params,
1317                                        query_params,
1318                                        header_params,
1319                                        body=body_params,
1320                                        post_params=form_params,
1321                                        files=local_var_files,
1322                                        response_type=None,
1323                                        auth_settings=auth_settings,
1324                                        callback=params.get('callback'),
1325                                        _return_http_data_only=params.get('_return_http_data_only'),
1326                                        _preload_content=params.get('_preload_content', True),
1327                                        _request_timeout=params.get('_request_timeout'),
1328                                        collection_formats=collection_formats)

Reserverd: Purchase additional envelopes. Reserved: At this time, this endpoint is limited to DocuSign internal use only. Completes the purchase of envelopes for your account. The actual purchase is done as part of an internal workflow interaction with an envelope vendor. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.purchase_envelopes_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • PurchasedEnvelopesInformation purchased_envelopes_information:
Returns

None If the method is called asynchronously, returns the request thread.

def update_downgrade_account_billing_plan(self, account_id, **kwargs)
1330    def update_downgrade_account_billing_plan(self, account_id, **kwargs):
1331        """
1332        Queues downgrade billing plan request for an account.
1333        
1334        This method makes a synchronous HTTP request by default. To make an
1335        asynchronous HTTP request, please define a `callback` function
1336        to be invoked when receiving the response.
1337        >>> def callback_function(response):
1338        >>>     pprint(response)
1339        >>>
1340        >>> thread = api.update_downgrade_account_billing_plan(account_id, callback=callback_function)
1341
1342        :param callback function: The callback function
1343            for asynchronous request. (optional)
1344        :param str account_id: The external account number (int) or account ID Guid. (required)
1345        :param DowngradeBillingPlanInformation downgrade_billing_plan_information:
1346        :return: DowngradePlanUpdateResponse
1347                 If the method is called asynchronously,
1348                 returns the request thread.
1349        """
1350        kwargs['_return_http_data_only'] = True
1351        if kwargs.get('callback'):
1352            return self.update_downgrade_account_billing_plan_with_http_info(account_id, **kwargs)
1353        else:
1354            (data) = self.update_downgrade_account_billing_plan_with_http_info(account_id, **kwargs)
1355            return data

Queues downgrade billing plan request for an account.

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.update_downgrade_account_billing_plan(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • DowngradeBillingPlanInformation downgrade_billing_plan_information:
Returns

DowngradePlanUpdateResponse If the method is called asynchronously, returns the request thread.

def update_downgrade_account_billing_plan_with_http_info(self, account_id, **kwargs)
1357    def update_downgrade_account_billing_plan_with_http_info(self, account_id, **kwargs):
1358        """
1359        Queues downgrade billing plan request for an account.
1360        
1361        This method makes a synchronous HTTP request by default. To make an
1362        asynchronous HTTP request, please define a `callback` function
1363        to be invoked when receiving the response.
1364        >>> def callback_function(response):
1365        >>>     pprint(response)
1366        >>>
1367        >>> thread = api.update_downgrade_account_billing_plan_with_http_info(account_id, callback=callback_function)
1368
1369        :param callback function: The callback function
1370            for asynchronous request. (optional)
1371        :param str account_id: The external account number (int) or account ID Guid. (required)
1372        :param DowngradeBillingPlanInformation downgrade_billing_plan_information:
1373        :return: DowngradePlanUpdateResponse
1374                 If the method is called asynchronously,
1375                 returns the request thread.
1376        """
1377
1378        all_params = ['account_id', 'downgrade_billing_plan_information']
1379        all_params.append('callback')
1380        all_params.append('_return_http_data_only')
1381        all_params.append('_preload_content')
1382        all_params.append('_request_timeout')
1383
1384        params = locals()
1385        for key, val in iteritems(params['kwargs']):
1386            if key not in all_params:
1387                raise TypeError(
1388                    "Got an unexpected keyword argument '%s'"
1389                    " to method update_downgrade_account_billing_plan" % key
1390                )
1391            params[key] = val
1392        del params['kwargs']
1393        # verify the required parameter 'account_id' is set
1394        if ('account_id' not in params) or (params['account_id'] is None):
1395            raise ValueError("Missing the required parameter `account_id` when calling `update_downgrade_account_billing_plan`")
1396
1397
1398        collection_formats = {}
1399
1400        resource_path = '/v2.1/accounts/{accountId}/billing_plan/downgrade'.replace('{format}', 'json')
1401        path_params = {}
1402        if 'account_id' in params:
1403            path_params['accountId'] = params['account_id']
1404
1405        query_params = {}
1406
1407        header_params = {}
1408
1409        form_params = []
1410        local_var_files = {}
1411
1412        body_params = None
1413        if 'downgrade_billing_plan_information' in params:
1414            body_params = params['downgrade_billing_plan_information']
1415        # HTTP header `Accept`
1416        header_params['Accept'] = self.api_client.\
1417            select_header_accept(['application/json'])
1418
1419        # Authentication setting
1420        auth_settings = []
1421
1422        return self.api_client.call_api(resource_path, 'PUT',
1423                                        path_params,
1424                                        query_params,
1425                                        header_params,
1426                                        body=body_params,
1427                                        post_params=form_params,
1428                                        files=local_var_files,
1429                                        response_type='DowngradePlanUpdateResponse',
1430                                        auth_settings=auth_settings,
1431                                        callback=params.get('callback'),
1432                                        _return_http_data_only=params.get('_return_http_data_only'),
1433                                        _preload_content=params.get('_preload_content', True),
1434                                        _request_timeout=params.get('_request_timeout'),
1435                                        collection_formats=collection_formats)

Queues downgrade billing plan request for an account.

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.update_downgrade_account_billing_plan_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • DowngradeBillingPlanInformation downgrade_billing_plan_information:
Returns

DowngradePlanUpdateResponse If the method is called asynchronously, returns the request thread.

def update_plan(self, account_id, **kwargs)
1437    def update_plan(self, account_id, **kwargs):
1438        """
1439        Updates the account billing plan.
1440        Updates the billing plan information, billing address, and credit card information for the specified account.
1441        This method makes a synchronous HTTP request by default. To make an
1442        asynchronous HTTP request, please define a `callback` function
1443        to be invoked when receiving the response.
1444        >>> def callback_function(response):
1445        >>>     pprint(response)
1446        >>>
1447        >>> thread = api.update_plan(account_id, callback=callback_function)
1448
1449        :param callback function: The callback function
1450            for asynchronous request. (optional)
1451        :param str account_id: The external account number (int) or account ID Guid. (required)
1452        :param str preview_billing_plan: When set to **true**, updates the account using a preview billing plan.
1453        :param BillingPlanInformation billing_plan_information:
1454        :return: BillingPlanUpdateResponse
1455                 If the method is called asynchronously,
1456                 returns the request thread.
1457        """
1458        kwargs['_return_http_data_only'] = True
1459        if kwargs.get('callback'):
1460            return self.update_plan_with_http_info(account_id, **kwargs)
1461        else:
1462            (data) = self.update_plan_with_http_info(account_id, **kwargs)
1463            return data

Updates the account billing plan. Updates the billing plan information, billing address, and credit card information for the specified account. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.update_plan(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str preview_billing_plan: When set to true, updates the account using a preview billing plan.
  • BillingPlanInformation billing_plan_information:
Returns

BillingPlanUpdateResponse If the method is called asynchronously, returns the request thread.

def update_plan_with_http_info(self, account_id, **kwargs)
1465    def update_plan_with_http_info(self, account_id, **kwargs):
1466        """
1467        Updates the account billing plan.
1468        Updates the billing plan information, billing address, and credit card information for the specified account.
1469        This method makes a synchronous HTTP request by default. To make an
1470        asynchronous HTTP request, please define a `callback` function
1471        to be invoked when receiving the response.
1472        >>> def callback_function(response):
1473        >>>     pprint(response)
1474        >>>
1475        >>> thread = api.update_plan_with_http_info(account_id, callback=callback_function)
1476
1477        :param callback function: The callback function
1478            for asynchronous request. (optional)
1479        :param str account_id: The external account number (int) or account ID Guid. (required)
1480        :param str preview_billing_plan: When set to **true**, updates the account using a preview billing plan.
1481        :param BillingPlanInformation billing_plan_information:
1482        :return: BillingPlanUpdateResponse
1483                 If the method is called asynchronously,
1484                 returns the request thread.
1485        """
1486
1487        all_params = ['account_id', 'preview_billing_plan', 'billing_plan_information']
1488        all_params.append('callback')
1489        all_params.append('_return_http_data_only')
1490        all_params.append('_preload_content')
1491        all_params.append('_request_timeout')
1492
1493        params = locals()
1494        for key, val in iteritems(params['kwargs']):
1495            if key not in all_params:
1496                raise TypeError(
1497                    "Got an unexpected keyword argument '%s'"
1498                    " to method update_plan" % key
1499                )
1500            params[key] = val
1501        del params['kwargs']
1502        # verify the required parameter 'account_id' is set
1503        if ('account_id' not in params) or (params['account_id'] is None):
1504            raise ValueError("Missing the required parameter `account_id` when calling `update_plan`")
1505
1506
1507        collection_formats = {}
1508
1509        resource_path = '/v2.1/accounts/{accountId}/billing_plan'.replace('{format}', 'json')
1510        path_params = {}
1511        if 'account_id' in params:
1512            path_params['accountId'] = params['account_id']
1513
1514        query_params = {}
1515        if 'preview_billing_plan' in params:
1516            query_params['preview_billing_plan'] = params['preview_billing_plan']
1517
1518        header_params = {}
1519
1520        form_params = []
1521        local_var_files = {}
1522
1523        body_params = None
1524        if 'billing_plan_information' in params:
1525            body_params = params['billing_plan_information']
1526        # HTTP header `Accept`
1527        header_params['Accept'] = self.api_client.\
1528            select_header_accept(['application/json'])
1529
1530        # Authentication setting
1531        auth_settings = []
1532
1533        return self.api_client.call_api(resource_path, 'PUT',
1534                                        path_params,
1535                                        query_params,
1536                                        header_params,
1537                                        body=body_params,
1538                                        post_params=form_params,
1539                                        files=local_var_files,
1540                                        response_type='BillingPlanUpdateResponse',
1541                                        auth_settings=auth_settings,
1542                                        callback=params.get('callback'),
1543                                        _return_http_data_only=params.get('_return_http_data_only'),
1544                                        _preload_content=params.get('_preload_content', True),
1545                                        _request_timeout=params.get('_request_timeout'),
1546                                        collection_formats=collection_formats)

Updates the account billing plan. Updates the billing plan information, billing address, and credit card information for the specified account. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.update_plan_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str preview_billing_plan: When set to true, updates the account using a preview billing plan.
  • BillingPlanInformation billing_plan_information:
Returns

BillingPlanUpdateResponse If the method is called asynchronously, returns the request thread.