NAV Navbar
shell java ruby python
  • Using Kill Bill APIs
  • Account
  • Bundle
  • Catalog
  • Credit
  • Invoice Payment
  • Invoice
  • Payment Method
  • Payment
  • Subscription
  • Using Kill Bill APIs

    Introduction

    Kill Bill offers a set of HTTP apis, commonly called REST apis, that rely on HTTP verbs POST, GET, PUT, DELETE to match CRUD operations, and that use HTTP response codes to indicate errors. These apis allow to manage Kill Bill resources -- e.g Account -- through the use of JSON input and output.

    Kill Bill also offers a set of java apis that can be used by plugins to make requests, and a set of java plugin api for Kill Bill core to interact with the plugins. Such apis are beyond the scope of this documentation.

    API client libraries

    Official libraries for the Kill Bill API are available in several languages,
    including java, php, python, ruby, Node, and go. Community-supported libraries
    such as .NET are also available. In the following documentation, we assume 
    you have a Kill Bill server instance running on `127.0.0.1` on port `8080`.
    While Kill Bill supports `https` protocol, all example rely on standard http scheme.
    
    //
    // You can find the java client on github: https://github.com/killbill/killbill-client-java
    //
    
    #
    # You can find the ruby client on github: https://github.com/killbill/killbill-client-ruby
    #
    

    The description of the api in this documentation is limited to the most common use cases and does not include advanced features that we have crafted over the years from all the use cases we have seen from our users.

    For questions about api use, or to report bugs, you can subscribe to the Kill Bill user mailing list.

    Authentication and RBAC

    In order to make apis calls, one needs to authenticate each request by passing an HTTP Authorization header and respect the HTTP Basic authentication scheme.

    Depending on how the system has been configured, the authentication mechanism can happen using different options -- some or all at the same time:

    The system also supports configuring roles and permissions, to restrict user access to certain resources and operations. The permissions are quite granular and are defined here

    Multi-Tenancy

    Specifying the basic authentication headers and multi-tenancy headers:

    curl \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    ...
    
    // Initialization of the KillBillClient instance
    KillBillHttpClient killBillHttpClient = new KillBillHttpClient(String.format("http://%s:%d", "127.0.0.1", 8080),
                                                username,
                                                password,
                                                apiKey,
                                                apiSecret,
                                                null,
                                                null,
                                                DEFAULT_CONNECT_TIMEOUT_SEC * 1000,
                                                DEFAULT_READ_TIMEOUT_SEC * 1000,
                                                DEFAULT_REQUEST_TIMEOUT_SEC * 1000);
    
    KillBillClient killBillClient = new KillBillClient(killBillHttpClient);
    
    // Request Options example
    protected static final String createdBy = "me";
    protected static final String reason = "Going through my first tutorial";
    protected static final String comment = "I like it!";
    RequestOptions requestOptions = RequestOptions.builder()
                                                          .withCreatedBy(createdBy)
                                                          .withReason(reason)
                                                          .withComment(comment)
                                                          .withQueryParams(queryParams).build();
    
    require 'killbill_client'
    
    KillBillClient.url = 'http://127.0.0.1:8080'
    
    # Multi-tenancy and RBAC credentials
    options = {
      :username => 'admin',
      :password => 'password',
      :api_key => 'bob',
      :api_secret => 'lazar'
    }
    
    # Audit log data
    user = 'me'
    reason = 'Going through my first tutorial'
    comment = 'I like it!'
    
    # Start using....
    
    
    # Edit file: configuration.py, lines:50-62
    
    # Default Base url
    self.host = "http://localhost:8080"
    # Temp file folder for downloading files
    self.temp_folder_path = None
    
    # Authentication Settings
    # dict to store API key(s)
    self.api_key = {}
    # dict to store API prefix (e.g. Bearer)
    self.api_key_prefix = {}
    # Username for HTTP basic authentication
    self.username = "admin"
    # Password for HTTP basic authentication
    self.password = "password"
    
    ####################################################
    
    # Basic example using the client
    exampleApi = killbill.api.ExampleApi()
    body = Example(name='John', last_name = 'Doe')
    created_by = 'me'
    api_key = 'bob'
    api_secret = 'lazar'
    
    exampleApi.create(body, 
                      created_by, 
                      api_key, 
                      api_secret)
    

    Kill Bill has been designed from the ground up to run multiple logical instances on the same set of servers and database. This allows for instance to cleanly separate different customer data sets. Another common use case is to configure both a production tenant and a test tenant, the later being used for test requests during deployment and for sanity after deployment.

    Each api call requires to identify the tenant being used, through the use of 2 http headers:

    Resource IDs and External Keys

    When creating a new resource, there are 2 IDS associated with it: Kill Bill will allocate a unique ID, and the user of the api will also be able to associated its own unique key, also called external key. The external key is used for 2 scenarios:

    Pagination

    Besides the traditional CRUD apis associated with each resource, we also offer pagination apis to allow listing per-tenant resources -- e.g all Account in a given tenant. Such apis will allow to pass an offset and a limit, provided as query parameters, to allow the listing of all resources of a given type, on a page by page basis. In addition to the json list, each response will also include the following http headers:

    TODO coding example
    

    Audit and History

    Every api in Kill Bill that creates, or modifies state will create an audit log record to track who made the change. In addition, we also allow to specify why this change was made. Such information is passed for every POST, PUT, DELETE request and relies on special HTTP headers:

    In addition to the audit log, Kill Bill also records the history of the changes. For instance updating the billing addess of a customer would create an additonal row to track the change and link it to the audit log. The audit query parameter can take the following values:

    Request: Fetching an account specifying audit=MINIMAL

    curl \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Content-Type: application/json" \
    -H "X-Killbill-CreatedBy: demo" \
    "http://127.0.0.1:8080/1.0/kb/accounts/e8877928-0226-488d-9272-07a5e66d897f?audit=MINIMAL" 
    
    TODO  Api does not exist ;-( but would look like:
    Account result = killBillClient.getAccount(accountId, AuditLevel.MINIMAL, inputOptions);
    
    TODO  Api does not exist ;-(
    
    

    Response:

    {
      ...
      "auditLogs": [
        {
          "changeType": "INSERT",
          "changeDate": "2018-02-05T22:39:53.000Z",
          "changedBy": "demo",
          "reasonCode": null,
          "comments": null,
          "userToken": "4858a67e-03b0-4d94-8a8c-bcd6e8599452"
        }
      ]
    }  
    

    Every api that retrieves information, whether associated to a specific resource, or for a list of resources -- pagination -- will allow to return audit logs.

    Audit and history information associated to a given resource is always stored atomically to ensure that if state was changed, such audit and history information exists and is acurate.

    Versioning

    TODO

    Errors

    Kill Bill relies on HTTP response codes to indicate the success or failure of an API request:

    HTTP status code summary:
    200 - OK: A response body may be returned.
    201 - Created: Success in creating a new resource. A Location header is returned to indicate the uri that can be used to fetch the resource
    202 - Accepted: The request has been accepted and will be processed asynchronously.
    204 - No Content: The request was processed sucesfully but no response body is returned.
    400 - Bad Request: Invalid/missing parameter from client.
    401 - Unauthorized: Authorization failed.
    402 - Request Failed: Request parameter were valid but request failed -- insufficient fund on a payment request.
    404 - Not Found: The requested resource does not exist.
    409 - Conflict: The request conflicts with another request.
    422 - Unprocessable Entity: Payment control plugin aborted the call.
    500 - Unexpected system error.
    502 - Bad Gateway : Unknow failure from payment plugin (PLUGIN_FAILURE).
    503 - Service Unavailable: Kill Bill or a third party system -- e.g payment gateway -- is unavailable.
    504 - Gateway Timeout: Payment gateway timed out.
    

    In addition to these error codes, the system will often return some json to provide more details about the error:

    Additional Resources

    TODO: Provide pointers to documentation manual and explain what they are.

    Account

    Account Resource

    The Account resource represents the customer, and tracks typical information such as name, address, email, ... This is the top level per-customer resource, and all other per-customer data will be linked to this resource -- e.g invoices, payments, ...

    The attributes are the following:

    Create an Account

    Create a new customer Account.

    HTTP Request

    POST http://example.com/1.0/kb/accounts

    Example Request:

    curl -v \
      -u admin:password \
      -H "X-Killbill-ApiKey: bob" \
      -H "X-Killbill-ApiSecret: lazar" \
      -H "Content-Type: application/json" \
      -H "X-Killbill-CreatedBy: demo" \
      -X POST \
      --data-binary '{"name":"John Doe","email":"john@example.com","currency":"USD"}' \
      "http://127.0.0.1:8080/1.0/kb/accounts"
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    Account body = new Account();
    body.setName("John Doe");
    body.setEmail("john@example.com");
    body.setCurrency(Currency.USD);
    
    Account result = accountApi.createAccount(body, requestOptions);
    
    account = KillBillClient::Model::Account.new
    account.name = "John Doe"
    account.email = "john@example.com"
    account.currency = "USD"
    
    account.create(user, reason, comment, options)
    
    accountApi = killbill.api.AccountApi()
    created_by = 'example'
    body = Account(name='John Doe', 
                   email='john@example.com', 
                   currency='USD')
    
    accountApi.create_account(body, 
                              created_by, 
                              api_key, 
                              api_secret)
    

    Example Response:

    # Subset of headers returned when specifying -v curl option
    < HTTP/1.1 201 Created
    < Location: http://127.0.0.1:8080/1.0/kb/accounts/e8877928-0226-488d-9272-07a5e66d897f
    < Content-Type: application/json
    < Content-Length: 0
    
    class Account {
        org.killbill.billing.client.model.gen.Account@3f77a367
        accountId: e1342e5c-db2a-4439-b52c-8597fde4390f
        name: John Doe
        firstNameLength: null
        externalKey: e1342e5c-db2a-4439-b52c-8597fde4390f
        email: john@example.com
        billCycleDayLocal: 0
        currency: USD
        parentAccountId: null
        isPaymentDelegatedToParent: false
        paymentMethodId: null
        referenceTime: 2012-08-25T00:02:47.000Z
        timeZone: UTC
        address1: null
        address2: null
        postalCode: null
        company: null
        city: null
        state: null
        country: null
        locale: null
        phone: null
        notes: null
        isMigrated: false
        accountBalance: null
        accountCBA: null
        auditLogs: []
    }
    
    {
       "accountId":"87dccc88-f504-493e-a05f-9b4a702c3add",
       "name":"John Doe",
       "externalKey":"87dccc88-f504-493e-a05f-9b4a702c3add",
       "email":"john@example.com",
       "billCycleDayLocal":0,
       "currency":"USD",
       "isPaymentDelegatedToParent":false,
       "timeZone":"UTC",
       "auditLogs":[]
    }
    
    no content
    

    Query Parameters

    None.

    Responses

    A 201 http status if this was successful and a Location header to indicate how to fetch the resource.

    Retrieve an Account by its ID

    Retrieves the details information for the Account using its accountId.

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}

    Example Request:

    curl \
      -u admin:password \
      -H "X-Killbill-ApiKey: bob" \
      -H "X-Killbill-ApiSecret: lazar" \
      -H "Content-Type: application/json" \
      -H "X-Killbill-CreatedBy: demo" \
      "http://127.0.0.1:8080/1.0/kb/accounts/e8877928-0226-488d-9272-07a5e66d897f"  
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("864c1418-e768-4cd5-a0db-67537144b685");
    Boolean accountWithBalance = false; // Will not include account balance
    Boolean accountWithBalanceAndCBA = false; // Will not include account balance and CBA info
    
    Account result = accountApi.getAccount(accountId, 
                                           accountWithBalance, 
                                           accountWithBalanceAndCBA, 
                                           AuditLevel.NONE, 
                                           requestOptions);
    
    account_id = "e8877928-0226-488d-9272-07a5e66d897f"
    with_balance = false
    with_balance_and_cba = false
    account = KillBillClient::Model::Account.new
    account.find_by_id(account_id,
                       with_balance, 
                       with_balance_and_cba,
                       options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '07c0cef4-41c5-4606-b2cd-661332cdd41c'
    
    accountApi.get_account(account_id, api_key, api_secret)
    

    Example Response:

    **TODO**
    
    class Account {
        org.killbill.billing.client.model.gen.Account@4be0cf3a
        accountId: 864c1418-e768-4cd5-a0db-67537144b685
        name: John Doe
        firstNameLength: null
        externalKey: 864c1418-e768-4cd5-a0db-67537144b685
        email: john@example.com
        billCycleDayLocal: 0
        currency: USD
        parentAccountId: null
        isPaymentDelegatedToParent: false
        paymentMethodId: null
        referenceTime: 2012-08-25T00:00:25.000Z
        timeZone: UTC
        address1: null
        address2: null
        postalCode: null
        company: null
        city: null
        state: null
        country: null
        locale: null
        phone: null
        notes: null
        isMigrated: false
        accountBalance: null
        accountCBA: null
        auditLogs: []
    }
    
    {
       "accountId":"e8877928-0226-488d-9272-07a5e66d897f",
       "name":"John Doe",
       "firstNameLength":null,
       "externalKey":"e8877928-0226-488d-9272-07a5e66d897f",
       "email":"john@example.com",
       "billCycleDayLocal":0,
       "currency":"USD",
       "parentAccountId":null,
       "isPaymentDelegatedToParent":false,
       "paymentMethodId":null,
       "referenceTime":"2018-02-05T22:39:53.000Z",
       "timeZone":"UTC",
       "address1":null,
       "address2":null,
       "postalCode":null,
       "company":null,
       "city":null,
       "state":null,
       "country":null,
       "locale":null,
       "phone":null,
       "notes":null,
       "isMigrated":null,
       "accountBalance":null,
       "accountCBA":null,
       "auditLogs":[]
    }
    
    {
     'account_balance': None,
     'account_cba': None,
     'account_id': '07c0cef4-41c5-4606-b2cd-661332cdd41c',
     'address1': None,
     'address2': None,
     'audit_logs': [],
     'bill_cycle_day_local': 0,
     'city': None,
     'company': None,
     'country': 'USA',
     'currency': 'USD',
     'email': None,
     'external_key': 'rpwtgr',
     'first_name_length': None,
     'is_migrated': False,
     'is_notified_for_invoices': False,
     'is_payment_delegated_to_parent': False,
     'locale': None,
     'name': 'John',
     'notes': None,
     'parent_account_id': None,
     'payment_method_id': None,
     'phone': None,
     'postal_code': None,
     'reference_time': datetime.datetime(2018, 5, 3, 15, 53, 44, tzinfo=tzutc()),
     'state': 'CA',
     'time_zone': 'UTC'
    }
    

    Query Parameters

    Name Type Required Description
    accountWithBalance boolean false if true, returns accountBalance info
    accountWithBalanceAndCBA boolean false if true, returns accountBalance and accountCBA info
    audit enum false level of audit logs returned

    Returns

    Returns an account object if a valid identifier was provided.

    Retrieve an Account by its external key

    Retrieves the details information for the Account using its externalKey.

    HTTP Request

    GET http://example.com/1.0/kb/accounts

    Example Request:

    TODO
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    String externalKey = "example_external_key";
    Boolean accountWithBalance = false; // Will not include account balance
    Boolean accountWithBalanceAndCBA = false; // Will not include account balance and CBA info
    
    Account result = accountApi.getAccountByKey(externalKey, 
                                                accountWithBalance, 
                                                accountWithBalanceAndCBA, 
                                                AuditLevel.NONE, 
                                                requestOptions);
    
    external_key = 'example_external_key'
    with_balance = false
    with_balance_and_cba = false
    
    account = KillBillClient::Model::Account.new
    account.find_by_external_key(external_key,
                                 with_balance,
                                 with_balance_and_cba, 
                                 options)
    
    accountApi = killbill.api.AccountApi()
    external_key = 'example_external_key'
    
    accountApi.get_account(external_key, api_key, api_secret)
    

    Example Response:

    **TODO**
    
    class Account {
        org.killbill.billing.client.model.gen.Account@4be0cf3a
        accountId: 864c1418-e768-4cd5-a0db-67537144b685
        name: John Doe
        firstNameLength: null
        externalKey: example_external_key
        email: john@example.com
        billCycleDayLocal: 0
        currency: USD
        parentAccountId: null
        isPaymentDelegatedToParent: false
        paymentMethodId: null
        referenceTime: 2012-08-25T00:00:25.000Z
        timeZone: UTC
        address1: null
        address2: null
        postalCode: null
        company: null
        city: null
        state: null
        country: null
        locale: null
        phone: null
        notes: null
        isMigrated: false
        accountBalance: null
        accountCBA: null
        auditLogs: []
    }
    
    {
       "accountId":"e8877928-0226-488d-9272-07a5e66d897f",
       "name":"John Doe",
       "firstNameLength":null,
       "externalKey":"example_external_key",
       "email":"john@example.com",
       "billCycleDayLocal":0,
       "currency":"USD",
       "parentAccountId":null,
       "isPaymentDelegatedToParent":false,
       "paymentMethodId":null,
       "referenceTime":"2018-02-05T22:39:53.000Z",
       "timeZone":"UTC",
       "address1":null,
       "address2":null,
       "postalCode":null,
       "company":null,
       "city":null,
       "state":null,
       "country":null,
       "locale":null,
       "phone":null,
       "notes":null,
       "isMigrated":null,
       "accountBalance":null,
       "accountCBA":null,
       "auditLogs":[]
    }
    
    {
     'account_balance': None,
     'account_cba': None,
     'account_id': '07c0cef4-41c5-4606-b2cd-661332cdd41c',
     'address1': None,
     'address2': None,
     'audit_logs': [],
     'bill_cycle_day_local': 0,
     'city': None,
     'company': None,
     'country': 'USA',
     'currency': 'USD',
     'email': None,
     'external_key': 'example_external_key',
     'first_name_length': None,
     'is_migrated': False,
     'is_notified_for_invoices': False,
     'is_payment_delegated_to_parent': False,
     'locale': None,
     'name': 'John',
     'notes': None,
     'parent_account_id': None,
     'payment_method_id': None,
     'phone': None,
     'postal_code': None,
     'reference_time': datetime.datetime(2018, 5, 3, 15, 53, 44, tzinfo=tzutc()),
     'state': 'CA',
     'time_zone': 'UTC'
    }
    

    Query Parameters

    Name Type Required Description
    accountWithBalance boolean false if true, returns accountBalance info
    accountWithBalanceAndCBA boolean false if true, returns accountBalance and accountCBA info
    audit enum false level of audit logs returned

    Returns

    Returns an account object if a valid external key was provided.

    Update an Account

    HTTP Request

    PUT http://example.com/1.0/kb/accounts/{accountId}

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("864c1418-e768-4cd5-a0db-67537144b685");
    
    Account body = new Account();
    body.setAccountId(accountId);
    body.setName("Another Name");
    
    Boolean treatNullAsReset = true; // Any null value will be set to null
    
    accountApi.updateAccount(accountId, 
                             body, 
                             treatNullAsReset,
                             requestOptions);
    
    account.name = 'Another Name'
    treat_null_as_reset = true
    
    account.update(treat_null_as_reset,
                   user,
                   reason,
                   comment, 
                   options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '07c0cef4-41c5-4606-b2cd-661332cdd41c'
    created_by = 'example'
    body = Account(name='Another Name')
    
    accountApi.update_account(account_id, 
                              body, 
                              created_by, 
                              api_key, 
                              api_secret)
    

    Example Response:

    **TODO**
    
    no content
    
    {
       "accountId":"37e759ed-e769-4e81-9e39-afb75a33056d",
       "name":"Another Name",
       "externalKey":"1521656367-130272",
       "email":"kill@bill.com",
       "billCycleDayLocal":0,
       "currency":"USD",
       "isPaymentDelegatedToParent":false,
       "timeZone":"UTC",
       "address1":"7, yoyo road",
       "address2":"Apt 5",
       "postalCode":"94105",
       "company":"Unemployed",
       "city":"San Francisco",
       "state":"California",
       "country":"US",
       "locale":"fr_FR",
       "notes":"My notes",
       "auditLogs":[]
    }
    
    no content
    

    Query Parameters

    Name Type Required Description
    treatNullAsReset boolean false If set to true, any null value will be set to null. If set to false, any null value will be ignored.

    Returns

    A 204 http status without content.

    Close account

    HTTP Request

    DELETE http://example.com/1.0/kb/accounts/{accountId}

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("864c1418-e768-4cd5-a0db-67537144b685");
    Boolean cancelAllSubscriptions = true; // Will cancel all subscriptions
    Boolean writeOffUnpaidInvoices = true; // Will write off unpaid invoices
    Boolean itemAdjustUnpaidInvoices = false // Will not adjust unpaid invoices
    Boolean removeFutureNotifications = true; // Will remove future notifications 
    
    accountApi.closeAccount(accountId, 
                            cancelAllSubscriptions, 
                            writeOffUnpaidInvoices, 
                            itemAdjustUnpaidInvoices, 
                            removeFutureNotifications, 
                            requestOptions);
    
    cancel_subscriptions = false
    writeoff_unpaid_invoices = false
    item_adjust_unpaid_invoices = false
    
    account.close(cancel_subscriptions, 
                  writeoff_unpaid_invoices, 
                  item_adjust_unpaid_invoices,
                  user,
                  reason,
                  comment, 
                  options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '07c0cef4-41c5-4606-b2cd-661332cdd41c'
    
    accountApi.close_account(account_id,
                             created_by,
                             api_key,
                             api_secret)
    

    Example Response:

    **TODO**
    
    no content
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    cancelAllSubscriptions boolean false Choose true if you want to cancel all subscriptions (default: false)
    writeOffUnpaidInvoices boolean false Choose true if you want to write off unpaid invoices (default: false)
    itemAdjustUnpaidInvoices boolean false Choose true if you want to adjust unpaid invoices (default: false)
    removeFutureNotifications boolean false Choose true if you want to remove future notifications (default: true)

    Returns

    A 204 http status without content.

    Retrieve account customFields

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/allCustomFields

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("b38de59f-7dd0-447a-a508-9b022b808250");
    
    CustomFields allAccountCustomFields = accountApi.getAllCustomFields(accountId, 
                                                                        ObjectType.ACCOUNT, 
                                                                        AuditLevel.FULL, 
                                                                        requestOptions);
    
    accountApi = killbill.api.AccountApi()
    account_id = '07c0cef4-41c5-4606-b2cd-661332cdd41c'
    
    accountApi.get_all_custom_fields(account_id, 
                                     api_key, 
                                     api_secret, 
                                     object_type='ACCOUNT')
    
    object_type = 'ACCOUNT'
    audit = 'NONE'
    
    account.all_custom_fields(object_type,
                              audit, 
                              options)
    

    Example Response:

    **TODO**
    
    //First element of the list
    class CustomField {
        org.killbill.billing.client.model.gen.CustomField@238cc919
        customFieldId: dba8ec60-ee02-4231-9fa0-6613773b4e9e
        objectId: b38de59f-7dd0-447a-a508-9b022b808250
        objectType: ACCOUNT
        name: 385af
        value: 8296f
        auditLogs: [class AuditLog {
            changeType: INSERT
            changeDate: 2012-08-25T00:00:01.000Z
            objectType: CUSTOM_FIELD
            objectId: dba8ec60-ee02-4231-9fa0-6613773b4e9e
            changedBy: Toto
            reasonCode: i am god
            comments: no comment
            userToken: 10e278f1-61b8-4885-b1f6-d6f4db19c998
            history: null
        }]
    }
    
    [
       {
          "tagId":"ce1715f6-35e8-4d86-9063-65a54625992d",
          "objectType":"ACCOUNT",
          "objectId":"0f55a05d-9946-41d7-be75-ee71f49829b1",
          "tagDefinitionId":"00000000-0000-0000-0000-000000000006",
          "tagDefinitionName":"TEST",
          "auditLogs":[]
       }
    ]
    
    [
      {
        'audit_logs': [],
        'object_id': '8f2618dc-9e8e-4df6-b835-68c747a48313',
        'object_type': 'ACCOUNT',
        'tag_definition_id': '00000000-0000-0000-0000-000000000002',
        'tag_definition_name': 'AUTO_INVOICING_OFF',
        'tag_id': '726a64eb-0fc2-4e1b-81c4-ebf879a3b5b6'
      }
    ]
    

    Query Parameters

    Name Type Required Description
    objectType string false choose type of object (e.g. ACCOUNT, BUNDLE, SUBSCRIPTION)
    audit enum false level of audit logs returned

    Returns

    Returns a list of custom fields objects

    Retrieve account tags

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/allTags

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("ee6835f0-8347-42d3-958c-9a939383ba28");
    
    Tags allAccountTags = accountApi.getAllTags(accountId,
                                                ObjectType.ACCOUNT,
                                                AuditLevel.NONE,
                                                requestOptions);
    
    accountApi = killbill.api.AccountApi()
    account_id = '07c0cef4-41c5-4606-b2cd-661332cdd41c'
    
    accountApi.get_account_tags(account_id, api_key, api_secret)
    
    object_type = 'ACCOUNT'
    included_deleted = false
    audit = 'NONE'
    
    account.all_tags(object_type, 
                     included_deleted, 
                     audit, 
                     options)
    

    Example Response:

    **TODO**
    
    //First element of the list
    class Tag {
        org.killbill.billing.client.model.gen.Tag@45e9c8ec
        tagId: 659b37ed-59d7-4b46-b4e4-37d11cdc0bce
        objectType: ACCOUNT
        objectId: ee6835f0-8347-42d3-958c-9a939383ba28
        tagDefinitionId: 00000000-0000-0000-0000-000000000001
        tagDefinitionName: AUTO_PAY_OFF
        auditLogs: []
    }
    
    [
       {
          "tagId":"ce1715f6-35e8-4d86-9063-65a54625992d",
          "objectType":"ACCOUNT",
          "objectId":"0f55a05d-9946-41d7-be75-ee71f49829b1",
          "tagDefinitionId":"00000000-0000-0000-0000-000000000006",
          "tagDefinitionName":"TEST",
          "auditLogs":[]
       }
    ]
    
    [
      {
        'audit_logs': [],
        'object_id': '8f2618dc-9e8e-4df6-b835-68c747a48313',
        'object_type': 'ACCOUNT',
        'tag_definition_id': '00000000-0000-0000-0000-000000000002',
        'tag_definition_name': 'AUTO_INVOICING_OFF',
        'tag_id': '726a64eb-0fc2-4e1b-81c4-ebf879a3b5b6'
      }
    ]
    

    Query Parameters

    Name Type Required Description
    objectType string false choose type of object (e.g. ACCOUNT, BUNDLE, SUBSCRIPTION)
    includedDeleted boolean true choose true to include deleted tags
    audit enum false level of audit logs returned

    Returns

    Returns a list of tag objects

    Retrieve audit logs by account id

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/auditLogs

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("e9432491-6558-4007-85ef-cdae171d240c");
    
    AuditLogs auditLogsJson = accountApi.getAccountAuditLogs(accountId, 
                                                             requestOptions);
    
    accountApi = killbill.api.AccountApi()
    account_id = '4e4d8acd-c97d-447a-814b-28f995a9106c'
    
    accountApi.get_account_audit_logs(account_id, api_key, api_secret)
    
    account.audit(options)
    

    Example Response:

    **TODO**
    
    //First element of the list
    class AuditLog {
        changeType: INSERT
        changeDate: 2012-08-25T00:00:01.000Z
        objectType: ACCOUNT
        objectId: e9432491-6558-4007-85ef-cdae171d240c
        changedBy: Toto
        reasonCode: i am god
        comments: no comment
        userToken: 6cd7a8ec-0678-436f-a2cb-a58f9ee3668b
        history: null
    }
    
    [
       {
          "changeType":"INSERT",
          "changeDate":"2013-08-01T06:00:00.000Z",
          "objectType":"ACCOUNT",
          "objectId":"ccaf0822-a58b-4f1d-82d2-907439b68054",
          "changedBy":"test_account_tags",
          "userToken":"17d7807c-5c44-4e57-adc5-d0323c779b1f"
       }
    ]
    
    [{'change_date': datetime.datetime(2018, 5, 23, 14, 30, 5, tzinfo=tzutc()),
     'change_type': 'INSERT',
     'changed_by': 'test',
     'comments': None,
     'object_id': '4e4d8acd-c97d-447a-814b-28f995a9106c',
     'object_type': 'ACCOUNT',
     'reason_code': None,
     'user_token': '89ef6e86-4869-4974-abb9-0d870e8578b2'}]
    

    Query Parameters

    None.

    Returns

    Returns a list of account audit logs.

    Retrieve account audit logs with history by account id

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/auditLogsWithHistory

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("ecbff3be-3cbf-4e1d-ae05-d323d4597877");
    
    List<AuditLog> auditLogWithHistories = accountApi.getAccountAuditLogsWithHistory(accountId, 
                                                                                     requestOptions);
    
    accountApi = killbill.api.AccountApi()
    account_id = 'c62d5f6d-0b57-444d-bf9b-dd23e781fbda'
    
    accountApi.get_account_audit_logs_with_history(account_id, api_key, api_secret)
    
    account.audit_logs_with_history(options)
    

    Example Response:

    **TODO**
    
    //First element of the list
    class AuditLog {
        changeType: INSERT
        changeDate: 2012-08-25T00:00:01.000Z
        objectType: ACCOUNT
        objectId: ecbff3be-3cbf-4e1d-ae05-d323d4597877
        changedBy: Toto
        reasonCode: i am god
        comments: no comment
        userToken: d698ba59-cacd-4739-9e40-68506ec046ca
        history: {id=null, 
                  createdDate=2012-08-25T00:00:01.000Z, 
                  updatedDate=2012-08-25T00:00:01.000Z, 
                  recordId=1, accountRecordId=1, 
                  tenantRecordId=1, 
                  externalKey=5bb29c30-c83a-4237-b886-6605319baf8f, 
                  email=a946d@6a7f4, 
                  name=40f79b31-64eb-429b-96b5-89c05a21883f, 
                  firstNameLength=4, 
                  currency=USD, 
                  parentAccountId=null, 
                  isPaymentDelegatedToParent=false, 
                  billingCycleDayLocal=0, 
                  paymentMethodId=null, 
                  referenceTime=2012-08-25T00:00:01.000Z, 
                  timeZone=UTC, 
                  locale=fr, 
                  address1=12 rue des ecoles, 
                  address2=Poitier, 
                  companyName=Renault, 
                  city=Quelque part, 
                  stateOrProvince=Poitou, 
                  country=France, 
                  postalCode=44 567, 
                  phone=81 53 26 56, 
                  notes=notes, 
                  migrated=false, 
                  tableName=ACCOUNT, 
                  historyTableName=ACCOUNT_HISTORY}
    }
    
    [
       {
          "changeType":"INSERT",
          "changeDate":"2013-08-01T06:00:00.000Z",
          "objectType":"ACCOUNT",
          "objectId":"08a1c2e4-687f-48ca-9c38-888108a2ce0a",
          "changedBy":"test_account_tags",
          "userToken":"5c0632c3-6567-4b0b-8e37-e2a9bb9ab6b2",
          "history":{
             "id":null,
             "createdDate":"2013-08-01T06:00:00.000Z",
             "updatedDate":"2013-08-01T06:00:00.000Z",
             "recordId":505,
             "accountRecordId":505,
             "tenantRecordId":822,
             "externalKey":"1527086785-621747",
             "email":"kill@bill.com",
             "name":"KillBillClient",
             "firstNameLength":null,
             "currency":"USD",
             "parentAccountId":null,
             "isPaymentDelegatedToParent":null,
             "billingCycleDayLocal":0,
             "paymentMethodId":null,
             "referenceTime":"2013-08-01T06:00:00.000Z",
             "timeZone":"UTC",
             "locale":"fr_FR",
             "address1":"7, yoyo road",
             "address2":"Apt 5",
             "companyName":"Unemployed",
             "city":"San Francisco",
             "stateOrProvince":"California",
             "country":"US",
             "postalCode":"94105",
             "phone":null,
             "notes":null,
             "migrated":null,
             "tableName":"ACCOUNT",
             "historyTableName":"ACCOUNT_HISTORY"
          }
       }
    ]
    
    [{'change_date': datetime.datetime(2018, 5, 23, 14, 43, 41, tzinfo=tzutc()),
     'change_type': 'INSERT',
     'changed_by': 'test',
     'comments': None,
     'history': {'created_date': datetime.datetime(2018, 5, 23, 14, 43, 41, tzinfo=tzutc()),
                 'id': None,
                 'updated_date': datetime.datetime(2018, 5, 23, 14, 43, 41, tzinfo=tzutc())},
     'object_id': 'c62d5f6d-0b57-444d-bf9b-dd23e781fbda',
     'object_type': 'ACCOUNT',
     'reason_code': None,
     'user_token': '40e771bf-160e-4ff6-82be-463f2d9e634d'}]
    

    Query Parameters

    None.

    Returns

    Returns a list of account audit logs with history.

    Block an account

    HTTP Request

    POST http://example.com/1.0/kb/accounts/{accountId}/block

    Example Request:

    TODO    
    
    TODO
    
    state_name = "STATE1"
    service = "ServiceStateService"
    block_change = false
    block_entitlement = false
    block_billing = false
    requested_date = "2013-08-01"
    
    account.set_blocking_state(state_name,
                               service,
                               block_change, 
                               block_entitlement,
                               block_billing, 
                               requested_date,
                               user, 
                               reason, 
                               comment,
                               options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '07c0cef4-41c5-4606-b2cd-661332cdd41c'
    body = BlockingState(state_name='STATE1',
                         service='ServiceStateService',
                         is_block_change=False,
                         is_block_entitlement=False,
                         is_block_billing=False)
    
    accountApi.add_account_blocking_state(account_id, 
                                          body, 
                                          created_by, 
                                          api_key, 
                                          api_secret)
    

    Example Response:

    **TODO**
    
    **TODO**
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    requestedDate string true Requested date for block an account

    Returns

    A 201 http status without content.

    Retrieve blocking states for account

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/block

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("ee6835f0-8347-42d3-958c-9a939383ba28");
    
    List<BlockingStateType> blockingStateTypes = ImmutableList.<BlockingStateType>of(BlockingStateType.SUBSCRIPTION_BUNDLE);
    List<String> blockingStateSvcs = ImmutableList.<String>of("service");
    
    BlockingStates blockingStates = accountApi.getBlockingStates(accountId, 
                                                                 blockingStateTypes, 
                                                                 blockingStateSvcs, 
                                                                 AuditLevel.FULL, 
                                                                 requestOptions);
    
    blocking_state_types = 'ACCOUNT'
    blocking_state_svcs = nil
    audit = 'NONE'
    
    account.blocking_states(blocking_state_types,
                            blocking_state_svcs, 
                            audit,
                            options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '07c0cef4-41c5-4606-b2cd-661332cdd41c'
    
    accountApi.get_blocking_states(account_id, api_key, api_secret)
    

    Example Response:

    **TODO**
    
    //First element of the list
    class BlockingState {
        org.killbill.billing.client.model.gen.BlockingState@95047f38
        blockedId: e3d9aa57-1c1e-4206-a44a-d87e69d5bf2a
        stateName: block
        service: service
        isBlockChange: false
        isBlockEntitlement: true
        isBlockBilling: true
        effectiveDate: 2012-04-25T00:03:42.000Z
        type: SUBSCRIPTION_BUNDLE
        auditLogs: [class AuditLog {
            changeType: INSERT
            changeDate: 2012-04-25T00:03:45.000Z
            objectType: BLOCKING_STATES
            objectId: 8fc09849-bd98-417f-a0ab-943f9ce8e15d
            changedBy: Toto
            reasonCode: i am god
            comments: no comment
            userToken: 46d56616-1545-424a-882b-b158442534ff
            history: null
        }]
    }
    
    [
       {
          "blockedId":"d13b2272-d182-499c-a393-8efed203ae7d",
          "stateName":"STATE1",
          "service":"ServiceStateService",
          "blockChange":false,
          "blockEntitlement":false,
          "blockBilling":false,
          "effectiveDate":"2013-08-01T06:00:00.000Z",
          "type":"ACCOUNT",
          "auditLogs":[]
       }
    ]
    
    [
      {
        'audit_logs': [],
        'blocked_id': '7e7dd5a9-6b65-4f40-a14b-1f4f408ef83c',
        'effective_date': datetime.datetime(2018, 5, 3, 19, 19, 12, tzinfo=tzutc()),
        'is_block_billing': False,
        'is_block_change': False,
        'is_block_entitlement': False,
        'service': 'ServiceStateService',
        'state_name': 'STATE1',
        'type': 'ACCOUNT'
      }
    ]
    

    Query Parameters

    Name Type Required Description
    blockingStateTypes string true blocking state types
    blockingStateSvcs string false blocking state svcs
    audit enum false level of audit logs returned

    Returns

    Returns a blocking state object

    Retrieve bundles for account

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/bundles

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("15434b45-54c1-4a44-851c-b1f2f7a52f03");
    String externalKey = "123467";
    String bundlesFilter = null;
    
    List<Bundle> accountBundles = accountApi.getAccountBundles(accountId, 
                                                               externalKey, 
                                                               bundlesFilter,
                                                               AuditLevel.NONE,
                                                               requestOptions);
    
    account.bundles(options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '8992e146-bfa1-4126-a045-98b844a4adcb'
    
    accountApi.get_account_bundles(account_id, api_key, api_secret)
    

    Example Response:

    **TODO**
    
    //First element of the list
    class Bundle {
        org.killbill.billing.client.model.gen.Bundle@53060d66
        accountId: 15434b45-54c1-4a44-851c-b1f2f7a52f03
        bundleId: e17a7805-42cf-4464-aea7-963cf0078651
        externalKey: 123467
        subscriptions: [class Subscription {
            org.killbill.billing.client.model.gen.Subscription@e1d5debf
            accountId: 15434b45-54c1-4a44-851c-b1f2f7a52f03
            bundleId: e17a7805-42cf-4464-aea7-963cf0078651
            subscriptionId: 7b9de82a-319c-4334-b676-f1644591077e
            externalKey: 123467
            startDate: 2012-08-25
            productName: Shotgun
            productCategory: BASE
            billingPeriod: MONTHLY
            phaseType: TRIAL
            priceList: DEFAULT
            planName: shotgun-monthly
            state: ACTIVE
            sourceType: NATIVE
            cancelledDate: null
            chargedThroughDate: 2012-08-25
            billingStartDate: 2012-08-25
            billingEndDate: null
            billCycleDayLocal: 24
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@6ea5e183
                eventId: a6e0c854-16b7-4729-bc6c-cb019b3441ce
                billingPeriod: MONTHLY
                effectiveDate: 2012-08-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@3635a9d5
                eventId: 2cb255be-0008-44b0-9161-47760a5e2828
                billingPeriod: MONTHLY
                effectiveDate: 2012-08-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@a561e242
                eventId: a34e0990-80bb-42e1-a593-0a0bc952ef2c
                billingPeriod: MONTHLY
                effectiveDate: 2012-09-24
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: PHASE
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement+billing-service
                serviceStateName: PHASE
                phase: shotgun-monthly-evergreen
                auditLogs: []
            }]
            priceOverrides: [class PhasePriceOverride {
                planName: shotgun-monthly
                phaseName: shotgun-monthly-trial
                phaseType: TRIAL
                fixedPrice: 0
                recurringPrice: null
                usagePriceOverrides: []
            }, class PhasePriceOverride {
                planName: shotgun-monthly
                phaseName: shotgun-monthly-evergreen
                phaseType: EVERGREEN
                fixedPrice: null
                recurringPrice: 249.95
                usagePriceOverrides: []
            }]
            auditLogs: []
        }]
        timeline: class BundleTimeline {
            org.killbill.billing.client.model.gen.BundleTimeline@e70542
            accountId: 15434b45-54c1-4a44-851c-b1f2f7a52f03
            bundleId: e17a7805-42cf-4464-aea7-963cf0078651
            externalKey: 123467
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@1852601c
                eventId: a6e0c854-16b7-4729-bc6c-cb019b3441ce
                billingPeriod: MONTHLY
                effectiveDate: 2012-08-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@1d0ca762
                eventId: 2cb255be-0008-44b0-9161-47760a5e2828
                billingPeriod: MONTHLY
                effectiveDate: 2012-08-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@a8ba9854
                eventId: a34e0990-80bb-42e1-a593-0a0bc952ef2c
                billingPeriod: MONTHLY
                effectiveDate: 2012-09-24
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: PHASE
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement+billing-service
                serviceStateName: PHASE
                phase: shotgun-monthly-evergreen
                auditLogs: []
            }]
            auditLogs: []
        }
        auditLogs: []
    }
    
    [
       {
          "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
          "bundleId":"a5221798-699a-48ac-a2d1-962839fd8fc9",
          "externalKey":"3-6138e5ee-2763-4729-829b-e7de038b46d0-889153",
          "subscriptions":[
             {
                "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
                "bundleId":"a5221798-699a-48ac-a2d1-962839fd8fc9",
                "subscriptionId":"937ff1a8-2290-4bb5-9166-7b7bb99cbccf",
                "externalKey":"3-6138e5ee-2763-4729-829b-e7de038b46d0-889153",
                "startDate":"2013-08-01",
                "productName":"Super",
                "productCategory":"BASE",
                "billingPeriod":"MONTHLY",
                "phaseType":"TRIAL",
                "priceList":"DEFAULT",
                "planName":"super-monthly",
                "state":"ACTIVE",
                "sourceType":"NATIVE",
                "chargedThroughDate":"2013-08-01",
                "billingStartDate":"2013-08-01",
                "billCycleDayLocal":31,
                "events":[
                   {
                      "eventId":"c5ba5861-d4e4-46de-9ac5-d72ddf086ff2",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-01",
                      "plan":"super-monthly",
                      "product":"Super",
                      "priceList":"DEFAULT",
                      "eventType":"START_ENTITLEMENT",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement-service",
                      "serviceStateName":"ENT_STARTED",
                      "phase":"super-monthly-trial",
                      "auditLogs":[]
                   },
                   {
                      "eventId":"2add66b9-cd9f-47c3-906a-899aad32a350",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-01",
                      "plan":"super-monthly",
                      "product":"Super",
                      "priceList":"DEFAULT",
                      "eventType":"START_BILLING",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"billing-service",
                      "serviceStateName":"START_BILLING",
                      "phase":"super-monthly-trial",
                      "auditLogs":[]
                   },
                   {
                      "eventId":"86be39b0-0a70-4e15-a891-ed20aed6c12d",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-31",
                      "plan":"super-monthly",
                      "product":"Super",
                      "priceList":"DEFAULT",
                      "eventType":"PHASE",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement+billing-service",
                      "serviceStateName":"PHASE",
                      "phase":"super-monthly-evergreen",
                      "auditLogs":[]
                   }
                ],
                "priceOverrides":[
                   {
                      "planName":"super-monthly",
                      "phaseName":"super-monthly-trial",
                      "phaseType":"TRIAL",
                      "fixedPrice":0
                   },
                   {
                      "planName":"super-monthly",
                      "phaseName":"super-monthly-evergreen",
                      "phaseType":"EVERGREEN",
                      "recurringPrice":1000.0
                   }
                ],
                "auditLogs":[]
             },
             {
                "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
                "bundleId":"a5221798-699a-48ac-a2d1-962839fd8fc9",
                "subscriptionId":"cf1c90f9-928c-43c1-9b88-633a0ac6d7f2",
                "externalKey":"3-6138e5ee-2763-4729-829b-e7de038b46d0-889153",
                "startDate":"2013-08-01",
                "productName":"Gas",
                "productCategory":"ADD_ON",
                "billingPeriod":"NO_BILLING_PERIOD",
                "phaseType":"EVERGREEN",
                "priceList":"DEFAULT",
                "planName":"gas-monthly",
                "state":"ACTIVE",
                "sourceType":"NATIVE",
                "billingStartDate":"2013-08-01",
                "billCycleDayLocal":31,
                "events":[
                   {
                      "eventId":"08ec39ef-e9f5-4e58-957d-650d174938ab",
                      "billingPeriod":"NO_BILLING_PERIOD",
                      "effectiveDate":"2013-08-01",
                      "plan":"gas-monthly",
                      "product":"Gas",
                      "priceList":"DEFAULT",
                      "eventType":"START_ENTITLEMENT",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement-service",
                      "serviceStateName":"ENT_STARTED",
                      "phase":"gas-monthly-evergreen",
                      "auditLogs":[]
                   },
                   {
                      "eventId":"729268e7-583b-49f2-be84-477ae444c363",
                      "billingPeriod":"NO_BILLING_PERIOD",
                      "effectiveDate":"2013-08-01",
                      "plan":"gas-monthly",
                      "product":"Gas",
                      "priceList":"DEFAULT",
                      "eventType":"START_BILLING",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"billing-service",
                      "serviceStateName":"START_BILLING",
                      "phase":"gas-monthly-evergreen",
                      "auditLogs":[]
                   }
                ],
                "priceOverrides":[
                   {
                      "planName":"gas-monthly",
                      "phaseName":"gas-monthly-evergreen",
                      "phaseType":"EVERGREEN"
                   }
                ],
                "auditLogs":[]
             }
          ],
          "timeline":{
             "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
             "bundleId":"a5221798-699a-48ac-a2d1-962839fd8fc9",
             "externalKey":"3-6138e5ee-2763-4729-829b-e7de038b46d0-889153",
             "events":[
                {
                   "eventId":"08ec39ef-e9f5-4e58-957d-650d174938ab",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"super-monthly",
                   "product":"Super",
                   "priceList":"DEFAULT",
                   "eventType":"START_ENTITLEMENT",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement-service",
                   "serviceStateName":"ENT_STARTED",
                   "phase":"super-monthly-trial",
                   "auditLogs":[]
                },
                {
                   "eventId":"c5ba5861-d4e4-46de-9ac5-d72ddf086ff2",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"super-monthly",
                   "product":"Super",
                   "priceList":"DEFAULT",
                   "eventType":"START_ENTITLEMENT",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement-service",
                   "serviceStateName":"ENT_STARTED",
                   "phase":"super-monthly-trial",
                   "auditLogs":[]
                },
                {
                   "eventId":"2add66b9-cd9f-47c3-906a-899aad32a350",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"super-monthly",
                   "product":"Super",
                   "priceList":"DEFAULT",
                   "eventType":"START_BILLING",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"billing-service",
                   "serviceStateName":"START_BILLING",
                   "phase":"super-monthly-trial",
                   "auditLogs":[]
                },
                {
                   "eventId":"729268e7-583b-49f2-be84-477ae444c363",
                   "billingPeriod":"NO_BILLING_PERIOD",
                   "effectiveDate":"2013-08-01",
                   "plan":"gas-monthly",
                   "product":"Gas",
                   "priceList":"DEFAULT",
                   "eventType":"START_BILLING",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"billing-service",
                   "serviceStateName":"START_BILLING",
                   "phase":"gas-monthly-evergreen",
                   "auditLogs":[]
                },
                {
                   "eventId":"86be39b0-0a70-4e15-a891-ed20aed6c12d",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-31",
                   "plan":"super-monthly",
                   "product":"Super",
                   "priceList":"DEFAULT",
                   "eventType":"PHASE",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement+billing-service",
                   "serviceStateName":"PHASE",
                   "phase":"super-monthly-evergreen",
                   "auditLogs":[]
                }
             ],
             "auditLogs":[]
          },
          "auditLogs":[]
       },
       {
          "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
          "bundleId":"e71f6dc2-ece9-4d31-8cea-81472784ded3",
          "externalKey":"2-6138e5ee-2763-4729-829b-e7de038b46d0-979751",
          "subscriptions":[
             {
                "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
                "bundleId":"e71f6dc2-ece9-4d31-8cea-81472784ded3",
                "subscriptionId":"2be86a1f-0516-4fda-a094-7467f2171d7f",
                "externalKey":"2-6138e5ee-2763-4729-829b-e7de038b46d0-979751",
                "startDate":"2013-08-01",
                "productName":"Standard",
                "productCategory":"BASE",
                "billingPeriod":"MONTHLY",
                "phaseType":"TRIAL",
                "priceList":"DEFAULT",
                "planName":"standard-monthly",
                "state":"ACTIVE",
                "sourceType":"NATIVE",
                "chargedThroughDate":"2013-08-01",
                "billingStartDate":"2013-08-01",
                "billCycleDayLocal":31,
                "events":[
                   {
                      "eventId":"4e9cff06-c558-48b0-adad-6dda59ac551c",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-01",
                      "plan":"standard-monthly",
                      "product":"Standard",
                      "priceList":"DEFAULT",
                      "eventType":"START_ENTITLEMENT",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement-service",
                      "serviceStateName":"ENT_STARTED",
                      "phase":"standard-monthly-trial",
                      "auditLogs":[]
                   },
                   {
                      "eventId":"2d32bd25-46d6-448e-a5ca-f07c56dd2feb",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-01",
                      "plan":"standard-monthly",
                      "product":"Standard",
                      "priceList":"DEFAULT",
                      "eventType":"START_BILLING",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"billing-service",
                      "serviceStateName":"START_BILLING",
                      "phase":"standard-monthly-trial",
                      "auditLogs":[]
                   },
                   {
                      "eventId":"d7754b8e-cc06-4bb7-afbf-022860261f14",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-31",
                      "plan":"standard-monthly",
                      "product":"Standard",
                      "priceList":"DEFAULT",
                      "eventType":"PHASE",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement+billing-service",
                      "serviceStateName":"PHASE",
                      "phase":"standard-monthly-evergreen",
                      "auditLogs":[]
                   }
                ],
                "priceOverrides":[
                   {
                      "planName":"standard-monthly",
                      "phaseName":"standard-monthly-trial",
                      "phaseType":"TRIAL",
                      "fixedPrice":0
                   },
                   {
                      "planName":"standard-monthly",
                      "phaseName":"standard-monthly-evergreen",
                      "phaseType":"EVERGREEN",
                      "recurringPrice":100.0
                   }
                ],
                "auditLogs":[]
             }
          ],
          "timeline":{
             "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
             "bundleId":"e71f6dc2-ece9-4d31-8cea-81472784ded3",
             "externalKey":"2-6138e5ee-2763-4729-829b-e7de038b46d0-979751",
             "events":[
                {
                   "eventId":"4e9cff06-c558-48b0-adad-6dda59ac551c",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"standard-monthly",
                   "product":"Standard",
                   "priceList":"DEFAULT",
                   "eventType":"START_ENTITLEMENT",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement-service",
                   "serviceStateName":"ENT_STARTED",
                   "phase":"standard-monthly-trial",
                   "auditLogs":[]
                },
                {
                   "eventId":"2d32bd25-46d6-448e-a5ca-f07c56dd2feb",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"standard-monthly",
                   "product":"Standard",
                   "priceList":"DEFAULT",
                   "eventType":"START_BILLING",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"billing-service",
                   "serviceStateName":"START_BILLING",
                   "phase":"standard-monthly-trial",
                   "auditLogs":[]
                },
                {
                   "eventId":"d7754b8e-cc06-4bb7-afbf-022860261f14",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-31",
                   "plan":"standard-monthly",
                   "product":"Standard",
                   "priceList":"DEFAULT",
                   "eventType":"PHASE",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement+billing-service",
                   "serviceStateName":"PHASE",
                   "phase":"standard-monthly-evergreen",
                   "auditLogs":[]
                }
             ],
             "auditLogs":[]
          },
          "auditLogs":[]
       },
       {
          "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
          "bundleId":"3c7d6f02-bd9b-4f23-8a44-d806d3cbe330",
          "externalKey":"1-6138e5ee-2763-4729-829b-e7de038b46d0-909112",
          "subscriptions":[
             {
                "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
                "bundleId":"3c7d6f02-bd9b-4f23-8a44-d806d3cbe330",
                "subscriptionId":"d64a410b-49b6-47af-88a3-cbd203289246",
                "externalKey":"1-6138e5ee-2763-4729-829b-e7de038b46d0-909112",
                "startDate":"2013-08-01",
                "productName":"Sports",
                "productCategory":"BASE",
                "billingPeriod":"MONTHLY",
                "phaseType":"TRIAL",
                "priceList":"DEFAULT",
                "planName":"sports-monthly",
                "state":"ACTIVE",
                "sourceType":"NATIVE",
                "chargedThroughDate":"2013-08-01",
                "billingStartDate":"2013-08-01",
                "billCycleDayLocal":31,
                "events":[
                   {
                      "eventId":"ae420517-05d4-4a5d-bbe9-0f81a433efd3",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-01",
                      "plan":"sports-monthly",
                      "product":"Sports",
                      "priceList":"DEFAULT",
                      "eventType":"START_ENTITLEMENT",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement-service",
                      "serviceStateName":"ENT_STARTED",
                      "phase":"sports-monthly-trial",
                      "auditLogs":[]
                   },
                   {
                      "eventId":"d2179af5-1deb-4e2a-a934-9bad8cac04bd",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-01",
                      "plan":"sports-monthly",
                      "product":"Sports",
                      "priceList":"DEFAULT",
                      "eventType":"START_BILLING",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"billing-service",
                      "serviceStateName":"START_BILLING",
                      "phase":"sports-monthly-trial",
                      "auditLogs":[]
                   },
                   {
                      "eventId":"d45754a1-eb41-4a87-9714-80e2975a9f9a",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-31",
                      "plan":"sports-monthly",
                      "product":"Sports",
                      "priceList":"DEFAULT",
                      "eventType":"PHASE",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement+billing-service",
                      "serviceStateName":"PHASE",
                      "phase":"sports-monthly-evergreen",
                      "auditLogs":[]
                   }
                ],
                "priceOverrides":[
                   {
                      "planName":"sports-monthly",
                      "phaseName":"sports-monthly-trial",
                      "phaseType":"TRIAL",
                      "fixedPrice":0
                   },
                   {
                      "planName":"sports-monthly",
                      "phaseName":"sports-monthly-evergreen",
                      "phaseType":"EVERGREEN",
                      "recurringPrice":500.0
                   }
                ],
                "auditLogs":[]
             },
             {
                "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
                "bundleId":"3c7d6f02-bd9b-4f23-8a44-d806d3cbe330",
                "subscriptionId":"b313e0f1-0c2e-4be7-bb6a-b4c8aff36341",
                "externalKey":"1-6138e5ee-2763-4729-829b-e7de038b46d0-909112",
                "startDate":"2013-08-01",
                "productName":"OilSlick",
                "productCategory":"ADD_ON",
                "billingPeriod":"MONTHLY",
                "phaseType":"DISCOUNT",
                "priceList":"DEFAULT",
                "planName":"oilslick-monthly",
                "state":"ACTIVE",
                "sourceType":"NATIVE",
                "chargedThroughDate":"2013-08-31",
                "billingStartDate":"2013-08-01",
                "billCycleDayLocal":31,
                "events":[
                   {
                      "eventId":"1f06a132-d7e7-4fb6-ad96-8ef0a55ec38b",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-01",
                      "plan":"oilslick-monthly",
                      "product":"OilSlick",
                      "priceList":"DEFAULT",
                      "eventType":"START_ENTITLEMENT",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement-service",
                      "serviceStateName":"ENT_STARTED",
                      "phase":"oilslick-monthly-discount",
                      "auditLogs":[]
                   },
                   {
                      "eventId":"d783e243-2aa9-4463-a81b-030772d7945c",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-01",
                      "plan":"oilslick-monthly",
                      "product":"OilSlick",
                      "priceList":"DEFAULT",
                      "eventType":"START_BILLING",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"billing-service",
                      "serviceStateName":"START_BILLING",
                      "phase":"oilslick-monthly-discount",
                      "auditLogs":[]
                   },
                   {
                      "eventId":"267a056b-85b9-4912-8231-597e9905519c",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-09-01",
                      "plan":"oilslick-monthly",
                      "product":"OilSlick",
                      "priceList":"DEFAULT",
                      "eventType":"PHASE",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement+billing-service",
                      "serviceStateName":"PHASE",
                      "phase":"oilslick-monthly-evergreen",
                      "auditLogs":[]
                   }
                ],
                "priceOverrides":[
                   {
                      "planName":"oilslick-monthly",
                      "phaseName":"oilslick-monthly-discount",
                      "phaseType":"DISCOUNT",
                      "recurringPrice":4.0
                   },
                   {
                      "planName":"oilslick-monthly",
                      "phaseName":"oilslick-monthly-evergreen",
                      "phaseType":"EVERGREEN",
                      "recurringPrice":7.95
                   }
                ],
                "auditLogs":[]
             }
          ],
          "timeline":{
             "accountId":"6138e5ee-2763-4729-829b-e7de038b46d0",
             "bundleId":"3c7d6f02-bd9b-4f23-8a44-d806d3cbe330",
             "externalKey":"1-6138e5ee-2763-4729-829b-e7de038b46d0-909112",
             "events":[
                {
                   "eventId":"1f06a132-d7e7-4fb6-ad96-8ef0a55ec38b",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"oilslick-monthly",
                   "product":"OilSlick",
                   "priceList":"DEFAULT",
                   "eventType":"START_ENTITLEMENT",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement-service",
                   "serviceStateName":"ENT_STARTED",
                   "phase":"oilslick-monthly-discount",
                   "auditLogs":[]
                },
                {
                   "eventId":"ae420517-05d4-4a5d-bbe9-0f81a433efd3",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"oilslick-monthly",
                   "product":"OilSlick",
                   "priceList":"DEFAULT",
                   "eventType":"START_ENTITLEMENT",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement-service",
                   "serviceStateName":"ENT_STARTED",
                   "phase":"oilslick-monthly-discount",
                   "auditLogs":[]
                },
                {
                   "eventId":"d783e243-2aa9-4463-a81b-030772d7945c",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"oilslick-monthly",
                   "product":"OilSlick",
                   "priceList":"DEFAULT",
                   "eventType":"START_BILLING",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"billing-service",
                   "serviceStateName":"START_BILLING",
                   "phase":"oilslick-monthly-discount",
                   "auditLogs":[]
                },
                {
                   "eventId":"d2179af5-1deb-4e2a-a934-9bad8cac04bd",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"sports-monthly",
                   "product":"Sports",
                   "priceList":"DEFAULT",
                   "eventType":"START_BILLING",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"billing-service",
                   "serviceStateName":"START_BILLING",
                   "phase":"sports-monthly-trial",
                   "auditLogs":[]
                },
                {
                   "eventId":"d45754a1-eb41-4a87-9714-80e2975a9f9a",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-31",
                   "plan":"sports-monthly",
                   "product":"Sports",
                   "priceList":"DEFAULT",
                   "eventType":"PHASE",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement+billing-service",
                   "serviceStateName":"PHASE",
                   "phase":"sports-monthly-evergreen",
                   "auditLogs":[]
                },
                {
                   "eventId":"267a056b-85b9-4912-8231-597e9905519c",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-09-01",
                   "plan":"oilslick-monthly",
                   "product":"OilSlick",
                   "priceList":"DEFAULT",
                   "eventType":"PHASE",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement+billing-service",
                   "serviceStateName":"PHASE",
                   "phase":"oilslick-monthly-evergreen",
                   "auditLogs":[]
                }
             ],
             "auditLogs":[]
          },
          "auditLogs":[]
       }
    ]
    
    [{'account_id': '8992e146-bfa1-4126-a045-98b844a4adcb',
     'audit_logs': [],
     'bundle_id': 'd636e7e9-e1e3-43ff-94a6-01a868b064cc',
     'external_key': 'd636e7e9-e1e3-43ff-94a6-01a868b064cc',
     'subscriptions': [{'account_id': '8992e146-bfa1-4126-a045-98b844a4adcb',
                        'audit_logs': [],
                        'bill_cycle_day_local': 2,
                        'billing_end_date': None,
                        'billing_period': 'MONTHLY',
                        'billing_start_date': datetime.date(2018, 5, 3),
                        'bundle_id': 'd636e7e9-e1e3-43ff-94a6-01a868b064cc',
                        'cancelled_date': None,
                        'charged_through_date': None,
                        'events': [{'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 5, 3),
                                    'event_id': 'efa8c4ae-a514-4950-b6f5-58f1e1d17846',
                                    'event_type': 'START_ENTITLEMENT',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-trial',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'entitlement-service',
                                    'service_state_name': 'ENT_STARTED'},
                                   {'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 5, 3),
                                    'event_id': '94470035-33c0-42bc-a041-58aa13bdae93',
                                    'event_type': 'START_BILLING',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-trial',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'billing-service',
                                    'service_state_name': 'START_BILLING'},
                                   {'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 6, 2),
                                    'event_id': '9d369364-1a5d-4291-9ecd-4cb0617ef5b3',
                                    'event_type': 'PHASE',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-evergreen',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'entitlement+billing-service',
                                    'service_state_name': 'PHASE'}],
                        'external_key': 'd636e7e9-e1e3-43ff-94a6-01a868b064cc',
                        'phase_type': 'TRIAL',
                        'plan_name': 'standard-monthly',
                        'price_list': 'DEFAULT',
                        'price_overrides': [{'fixed_price': 0.0,
                                             'phase_name': 'standard-monthly-trial',
                                             'phase_type': 'TRIAL',
                                             'plan_name': 'standard-monthly',
                                             'recurring_price': None,
                                             'usage_price_overrides': []},
                                            {'fixed_price': None,
                                             'phase_name': 'standard-monthly-evergreen',
                                             'phase_type': 'EVERGREEN',
                                             'plan_name': 'standard-monthly',
                                             'recurring_price': 100.0,
                                             'usage_price_overrides': []}],
                        'product_category': 'BASE',
                        'product_name': 'Standard',
                        'source_type': 'NATIVE',
                        'start_date': datetime.date(2018, 5, 3),
                        'state': 'ACTIVE',
                        'subscription_id': 'a0f6dcd9-4dbc-43d2-876a-9dcc7dfb7d3b'}],
     'timeline': {'account_id': '8992e146-bfa1-4126-a045-98b844a4adcb',
                  'audit_logs': [],
                  'bundle_id': 'd636e7e9-e1e3-43ff-94a6-01a868b064cc',
                  'events': [{'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 5, 3),
                              'event_id': 'efa8c4ae-a514-4950-b6f5-58f1e1d17846',
                              'event_type': 'START_ENTITLEMENT',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-trial',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'entitlement-service',
                              'service_state_name': 'ENT_STARTED'},
                             {'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 5, 3),
                              'event_id': '94470035-33c0-42bc-a041-58aa13bdae93',
                              'event_type': 'START_BILLING',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-trial',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'billing-service',
                              'service_state_name': 'START_BILLING'},
                             {'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 6, 2),
                              'event_id': '9d369364-1a5d-4291-9ecd-4cb0617ef5b3',
                              'event_type': 'PHASE',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-evergreen',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'entitlement+billing-service',
                              'service_state_name': 'PHASE'}],
                  'external_key': 'd636e7e9-e1e3-43ff-94a6-01a868b064cc'}}]
    

    Query Parameters

    Name Type Required Description
    externalKey string false bundle external key
    bundlesFilter string false bundles filter
    audit enum false level of audit logs returned

    Returns

    Returns a list of account bundle objects.

    Rebalance account CBA

    HTTP Request

    PUT http://example.com/1.0/kb/accounts/{accountId}/cbaRebalancing

    Example Request:

    TODO    
    
    TODO
    
    account.cba_rebalancing(user, 
                            reason,
                            comment,
                            options)
    
    accountApi = killbill.api.AccountApi()
    
    accountApi.rebalance_existing_cba_on_account(account_id, 
                                                 created_by, 
                                                 api_key, 
                                                 api_secret)
    

    Example Response:

    no content
    
    no content
    

    Query Parameters

    None.

    Response

    A 204 http status without content.

    List children accounts

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/children

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID parentAccountId = UUID.fromString("ee6835f0-8347-42d3-958c-9a939383ba28");
    Boolean accountWithBalance = true; // Will include account balance
    Boolean accountWithBalanceAndCBA = true; // Will include account balance and CBA info
    
    Accounts childrenAccounts = accountApi.getChildrenAccounts(parentAccountId, 
                                                               accountWithBalance, 
                                                               accountWithBalanceAndCBA, 
                                                               AuditLevel.NONE, 
                                                               requestOptions);
    
    account_id = account.account_id
    with_balance = false
    with_balance_and_cba = false
    audit = 'NONE'
    
    childrens_account = KillBillClient::Model::Account.children(account_id,
                                                                with_balance, 
                                                                with_balance_and_cba, 
                                                                audit, 
                                                                options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '8992e146-bfa1-4126-a045-98b844a4adcb'
    
    accountApi.get_children_accounts(account_id, api_key, api_secret)
    

    Example Response:

    **TODO**
    
    //First element of the list
    class Account {
        org.killbill.billing.client.model.gen.Account@cfbf4058
        accountId: b58e1b76-461c-4681-9ecf-3a3e5e95fc27
        name: 01f814b3-b4c2-41e9-9d6c-4a010916424c
        firstNameLength: 4
        externalKey: 3bf9144f-11a3-4a0b-9923-03a1c667ba93
        email: 8c0f9@f059d
        billCycleDayLocal: 0
        currency: USD
        parentAccountId: e72357f9-76ff-4533-b846-b61f39973b70
        isPaymentDelegatedToParent: true
        paymentMethodId: null
        referenceTime: 2012-08-25T00:00:02.000Z
        timeZone: UTC
        address1: 12 rue des ecoles
        address2: Poitier
        postalCode: 44 567
        company: Renault
        city: Quelque part
        state: Poitou
        country: France
        locale: fr
        phone: 81 53 26 56
        notes: notes
        isMigrated: false
        accountBalance: 0
        accountCBA: 0E-9
        auditLogs: []
    }
    
    [
       {
          "accountId":"e19c6ab3-1a21-42f2-8ea2-9859c082b093",
          "name":"John Doe",
          "externalKey":"1522172592-516014",
          "email":"John@example.com",
          "billCycleDayLocal":0,
          "currency":"USD",
          "parentAccountId":"01ab962b-3c66-4b17-b391-ffcc9fe51884",
          "isPaymentDelegatedToParent":true,
          "timeZone":"UTC",
          "address1":"7, yoyo road",
          "address2":"Apt 5",
          "postalCode":"94105",
          "company":"Unemployed",
          "city":"San Francisco",
          "state":"California",
          "country":"US",
          "locale":"fr_FR",
          "auditLogs":[
    
          ]
       }
    ]
    
    [
        {
         'account_balance': None,
         'account_cba': None,
         'account_id': '07c0cef4-41c5-4606-b2cd-661332cdd41c',
         'address1': None,
         'address2': None,
         'audit_logs': [],
         'bill_cycle_day_local': 0,
         'city': None,
         'company': None,
         'country': 'USA',
         'currency': 'USD',
         'email': None,
         'external_key': 'rpwtgr',
         'first_name_length': None,
         'is_migrated': False,
         'is_notified_for_invoices': False,
         'is_payment_delegated_to_parent': False,
         'locale': None,
         'name': 'John',
         'notes': None,
         'parent_account_id': None,
         'payment_method_id': None,
         'phone': None,
         'postal_code': None,
         'reference_time': datetime.datetime(2018, 5, 3, 15, 53, 44, tzinfo=tzutc()),
         'state': 'CA',
         'time_zone': 'UTC'
        }
    ]
    

    Query Parameters

    Name Type Required Description
    accountWithBalance boolean false if true, returns accountBalance info
    accountWithBalanceAndCBA boolean false if true, returns accountBalance and accountCBA info
    audit enum false level of audit logs returned

    Returns

    Returns a list of account objects.

    Add custom fields to account

    HTTP Request

    POST http://example.com/1.0/kb/accounts/{accountId}/customFields

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("15434b45-54c1-4a44-851c-b1f2f7a52f03");
    final ImmutableList<AuditLog> EMPTY_AUDIT_LOGS = ImmutableList.<AuditLog>of();
    
    CustomFields customFields = new CustomFields();
    customFields.add(new CustomField(null, 
                                     accountId,
                                     "Test Custom Field", 
                                     "test_value", 
                                     EMPTY_AUDIT_LOGS));
    
    accountApi.createAccountCustomFields(accountId, 
                                         customFields, 
                                         requestOptions);
    
    custom_field = KillBillClient::Model::CustomFieldAttributes.new
    custom_field.object_type = 'ACCOUNT'
    custom_field.name = 'Test Custom Field'
    custom_field.value = 'test_value'
    
    account.add_custom_field(custom_field, 
                             user,
                             reason,
                             comment,
                             options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '8992e146-bfa1-4126-a045-98b844a4adcb'
    body = CustomField(name='Test Custom Field', value='test_value')
    
    accountApi.create_account_custom_fields(account_id,
                                            [body],
                                            created_by,
                                            api_key,
                                            api_secret)
    

    Example Response:

    //First element of the list
    class CustomField {
        org.killbill.billing.client.model.gen.CustomField@c7d0c38a
        customFieldId: null
        objectId: 59860a0d-c032-456d-a35e-3a48fe8579e5
        objectType: ACCOUNT
        name: Test Custom Field
        value: test_value
        auditLogs: []
    }
    
    [
       {
          "customFieldId":"6e571e22-b794-413c-be6f-1b2aa4bf9824",
          "objectId":"0149ffc6-fdfd-40b1-8cf4-29a66aef51d4",
          "objectType":"ACCOUNT",
          "name":"Test Custom Field",
          "value":"test_value",
          "auditLogs":[]
       }
    ]
    
    no content
    

    Query Parameters

    None.

    Returns

    Returns a custom field object.

    Retrieve account custom fields

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/customFields

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("59860a0d-c032-456d-a35e-3a48fe8579e5");
    
    List<CustomField> accountCustomFields = accountApi.getAccountCustomFields(accountId,
                                                                              AuditLevel.NONE, 
                                                                              requestOptions);
    
    audit = 'NONE'
    
    account.custom_fields(audit, options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '8992e146-bfa1-4126-a045-98b844a4adcb'
    
    accountApi.get_account_custom_fields(account_id, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class CustomField {
        org.killbill.billing.client.model.gen.CustomField@c7d0c38a
        customFieldId: null
        objectId: 59860a0d-c032-456d-a35e-3a48fe8579e5
        objectType: ACCOUNT
        name: Test Custom Field
        value: test_value
        auditLogs: []
    }
    
    [
       {
          "customFieldId":"7fb3dde7-0911-4477-99e3-69d142509bb9",
          "objectId":"4927c1a2-3959-4f71-98e7-ce3ba19c92ac",
          "objectType":"ACCOUNT",
          "name":"Test Custom Field",
          "value":"test_value",
          "auditLogs":[]
       }
    ]
    
    [
     {
       'audit_logs': [],
       'custom_field_id': 'd7bb1afb-df19-4db2-ba7f-9a4f71e9b131',
       'name': 'Test Custom Field',
       'object_id': '89c45186-8ab0-44f8-8bc9-e670924830a2',
       'object_type': 'ACCOUNT',
       'value': 'test_value'
     }
    ]
    

    Query Parameters

    Name Type Required Description
    audit enum false level of audit logs returned

    Returns

    Returns a list of custom field objects.

    Modify custom fields to account

    HTTP Request

    PUT http://example.com/1.0/kb/bundles/{accountId}/customFields

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("59860a0d-c032-456d-a35e-3a48fe8579e5");
    UUID customFieldsId = UUID.fromString("9913e0f6-b5ef-498b-ac47-60e1626eba8f");
    
    CustomField customFieldModified = new CustomField();
    customFieldModified.setCustomFieldId(customFieldsId);
    customFieldModified.setValue("NewValue");
    
    accountApi.modifyAccountCustomFields(accountId, 
                                         customFieldModified, 
                                         requestOptions);
    
    custom_field.custom_field_id = '7fb3dde7-0911-4477-99e3-69d142509bb9'
    custom_field.name = 'Test Modify'
    custom_field.value = 'test_modify_value'
    
    account.modify_custom_field(custom_field,                                                                                            
                                user, 
                                reason,
                                comment, 
                                options)
    
    account = killbill.api.AccountApi()
    body = CustomField(custom_field_id=custom_field_id, 
                       name='Test Custom Field', 
                       value='test_value')
    
    account.modify_account_custom_fields(account_id, 
                                         [body], 
                                         created_by, 
                                         api_key, 
                                         api_secret)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    None.

    Returns

    A 204 http status without content.

    Remove custom fields from account

    HTTP Request

    DELETE http://example.com/1.0/kb/accounts/{accountId}/customField

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("59860a0d-c032-456d-a35e-3a48fe8579e5");
    UUID customFieldsId = UUID.fromString("9913e0f6-b5ef-498b-ac47-60e1626eba8f");
    
    accountApi.deleteAccountCustomFields(accountId, 
                                         customFieldsId, 
                                         requestOptions);
    
    custom_field_id = custom_field.id
    
    account.remove_custom_field(custom_field_id, 
                                user, 
                                reason,
                                comment, 
                                options)
    
    account = killbill.api.AccountApi()
    account_id = '8992e146-bfa1-4126-a045-98b844a4adcb'
    custom_field_id = '9913e0f6-b5ef-498b-ac47-60e1626eba8f'
    custom_field = [custom_field_id]
    
    account.delete_account_custom_fields(account_id,
                                         created_by,
                                         api_key,
                                         api_secret,
                                         custom_field=custom_field)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    customFieldList string true a list of custom field objects that you want to remove it

    Response

    A 204 http status without content.

    Add account email

    HTTP Request

    POST http://example.com/1.0/kb/accounts/{accountId}/emails

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("873c26ef-a3fa-4942-b2f5-549b51f20b1a");
    String email = "email@example.com";
    
    AccountEmail accountEmail = new AccountEmail(accountId, 
                                                 email, 
                                                 AuditLevel.NONE);
    
    accountApi.addEmail(accountId, 
                        accountEmail, 
                        requestOptions);
    
    account.email = 'email@example.com'
    
    account.add_email(account.email,
                      user,
                      reason,
                      comment,
                      options)
    
    accountApi = killbill.api.AccountApi()
    account_id = 'c84de569-b654-4f7f-ab13-17616302d310'
    body = AccountEmail(account_id=account_id, email='email@example.com')
    
    accountApi.add_email(account_id,
                         body,
                         created_by,
                         api_key,
                         api_secret)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    None.

    Response

    A 201 http status without content.

    Retrieve an account emails

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/emails

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("cd026587-c93b-471c-a98d-224c21636fbc");
    
    List<AccountEmail> emails = accountApi.getEmails(accountId, requestOptions);
    
    audit = 'NONE'
    account.emails(audit, options)
    
    accountApi = killbill.api.AccountApi()
    account_id = 'c8f51346-562d-429b-8c89-27a0f72009b3'
    
    accountApi.get_emails(account_id, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class AccountEmail {
        org.killbill.billing.client.model.gen.AccountEmail@bdc0f8ad
        accountId: cd026587-c93b-471c-a98d-224c21636fbc
        email: email@example.com
        auditLogs: []
    }
    
    [
       {
          "accountId":"e4ca38b3-934d-42e8-a292-ffb0af5549f2",
          "email":"email@example.com"
       }
    ]
    
    [
      {
        'account_id': 'c8f51346-562d-429b-8c89-27a0f72009b3',
        'audit_logs': [],
        'email': 'email@example.com'
      }
    ]
    

    Query Parameters

    None.

    Returns

    Returns a list of objects with account id's and their emails.

    Delete email from account

    HTTP Request

    DELETE http://example.com/1.0/kb/accounts/{accountId}/emails/{email}

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("873c26ef-a3fa-4942-b2f5-549b51f20b1a");
    String email = "email@example.com";
    
    accountApi.removeEmail(accountId, 
                           email, 
                           requestOptions);
    
    email = 'email@example.com'
    
    account.remove_email(email,
                         user,
                         reason,
                         comment,
                         options)
    
    accountApi = killbill.api.AccountApi()
    account_id = 'c84de569-b654-4f7f-ab13-17616302d310'
    email = 'email@example.com'
    
    accountApi.remove_email(account_id,
                            email,
                            created_by,
                            api_key,
                            api_secret)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    None.

    Response

    A 204 http status without content.

    Retrieve account email audit logs with history by id

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/emails/{accountEmailId}/auditLogsWithHistory

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("873c26ef-a3fa-4942-b2f5-549b51f20b1a");
    UUID accountEmailId = UUID.fromString("f637441d-855e-4bf5-bac1-6426bdb116d6");
    
    List<AuditLog> result = accountApi.getAccountEmailAuditLogsWithHistory(accountId, 
                                                                           accountEmailId, 
                                                                           requestOptions);
    
    accountApi = killbill.api.AccountApi()
    account_id = 'c62d5f6d-0b57-444d-bf9b-dd23e781fbda'
    account_email_id = 'bb390282-6757-4f4f-8dd5-456abd9f30b2'
    
    accountApi.get_account_email_audit_logs_with_history(account_id,
                                                         account_email_id,
                                                         api_key,
                                                         api_secret)
    
    account_email_id = 'a4627e89-a73b-4167-a7ba-92a2881eb3c4'
    
    account.email_audit_logs_with_history(account_email_id, options)
    

    Example Response:

    **TODO**
    
    //First element of the list
    class AuditLog {
        changeType: INSERT
        changeDate: 2012-08-25T00:00:02.000Z
        objectType: ACCOUNT_EMAIL
        objectId: f637441d-855e-4bf5-bac1-6426bdb116d6
        changedBy: Toto
        reasonCode: i am god
        comments: no comment
        userToken: 317c943b-f137-4866-9798-33c5818339f9
        history: {id=null, 
                  createdDate=2012-08-25T00:00:02.000Z, 
                  updatedDate=2012-08-25T00:00:02.000Z, 
                  recordId=1, 
                  accountRecordId=1, 
                  tenantRecordId=1, 
                  accountId=9f86c177-addd-48da-b734-da219b33f655, 
                  email=af6c8ec2-bed8-4a86-aa23-535276aad7ca, 
                  isActive=true, 
                  tableName=ACCOUNT_EMAIL, 
                  historyTableName=ACCOUNT_EMAIL_HISTORY}
    }
    
    [
       {
          "changeType":"INSERT",
          "changeDate":"2013-08-01T06:00:00.000Z",
          "objectType":"ACCOUNT_EMAIL",
          "objectId":"a4627e89-a73b-4167-a7ba-92a2881eb3c4",
          "changedBy":"test_account_tags",
          "userToken":"79005abf-a8cf-44e1-84fc-945381d35bd5",
          "history":{
             "id":null,
             "createdDate":"2013-08-01T06:00:00.000Z",
             "updatedDate":"2013-08-01T06:00:00.000Z",
             "recordId":18,
             "accountRecordId":525,
             "tenantRecordId":842,
             "accountId":"1ced5fc2-b032-4969-a38b-d4db9ab5368f",
             "email":"email@example.com",
             "isActive":true,
             "tableName":"ACCOUNT_EMAIL",
             "historyTableName":"ACCOUNT_EMAIL_HISTORY"
          }
       }
    ]
    
    [{'change_date': datetime.datetime(2018, 5, 23, 16, 7, 1, tzinfo=tzutc()),
     'change_type': 'INSERT',
     'changed_by': 'Me',
     'comments': None,
     'history': {'created_date': datetime.datetime(2018, 5, 23, 16, 7, 1, tzinfo=tzutc()),
                 'id': None,
                 'updated_date': datetime.datetime(2018, 5, 23, 16, 7, 1, tzinfo=tzutc())},
     'object_id': 'bb390282-6757-4f4f-8dd5-456abd9f30b2',
     'object_type': 'ACCOUNT_EMAIL',
     'reason_code': None,
     'user_token': '548055b7-2c5e-4315-9293-d76c00bd9737'}]
    

    Query Parameters

    None.

    Returns

    Returns a list of account email audit logs with history.

    Retrieve account invoice payments

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/invoicePayments

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("e011caa5-ba35-4ac6-81cb-63b4f08122dc");
    ImmutableMap<String, String> NULL_PLUGIN_PROPERTIES = null;
    
    InvoicePayments result = accountApi.getInvoicePayments(accountId, 
                                                           NULL_PLUGIN_PROPERTIES, 
                                                           requestOptions);
    
    audit ='NONE'
    with_plugin_info = false
    with_attempts = false
    
    account.invoice_payments(audit,
                             with_plugin_info,
                             with_attempts,
                             options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '110952d7-1b7e-482c-b6bb-103e46794927'
    
    accountApi.get_invoice_payments(account_id, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class InvoicePayment {
        org.killbill.billing.client.model.gen.InvoicePayment@40d72f3f
        targetInvoiceId: a84bb73f-bafc-48cc-880f-3b2fa7d80d58
        accountId: e011caa5-ba35-4ac6-81cb-63b4f08122dc
        paymentId: 66d4954d-f8f3-4611-903e-371a6e6d076c
        paymentNumber: 1
        paymentExternalKey: 66d4954d-f8f3-4611-903e-371a6e6d076c
        authAmount: 0
        capturedAmount: 0
        purchasedAmount: 249.95
        refundedAmount: 0
        creditedAmount: 0
        currency: USD
        paymentMethodId: 9934bcc5-3ea5-4eb9-85fb-bef74225e1de
        transactions: [class PaymentTransaction {
            org.killbill.billing.client.model.gen.PaymentTransaction@5ad9bcb6
            transactionId: 5a7b1d87-98a1-4cbb-8967-f53733d032be
            transactionExternalKey: 5a7b1d87-98a1-4cbb-8967-f53733d032be
            paymentId: 66d4954d-f8f3-4611-903e-371a6e6d076c
            paymentExternalKey: 66d4954d-f8f3-4611-903e-371a6e6d076c
            transactionType: PURCHASE
            amount: 249.95
            currency: USD
            effectiveDate: 2012-09-26T00:00:04.000Z
            processedAmount: 249.95
            processedCurrency: USD
            status: SUCCESS
            gatewayErrorCode: 
            gatewayErrorMsg: 
            firstPaymentReferenceId: null
            secondPaymentReferenceId: null
            properties: null
            auditLogs: []
        }]
        paymentAttempts: null
        auditLogs: []
    }
    
    [
       {
          "targetInvoiceId":"d1d6e8d8-c476-4b53-badf-c23f78c02c09",
          "accountId":"e967f6ac-e713-4bbd-aa7e-473e6d35674c",
          "paymentId":"3f84661c-4fb7-42ac-8a02-3e8f48840e51",
          "paymentNumber":"319",
          "paymentExternalKey":"3f84661c-4fb7-42ac-8a02-3e8f48840e51",
          "authAmount":0,
          "capturedAmount":0,
          "purchasedAmount":50.0,
          "refundedAmount":0,
          "creditedAmount":0,
          "currency":"USD",
          "paymentMethodId":"6c064894-60cb-4d7e-a679-7b2464522968",
          "transactions":[
             {
                "transactionId":"91c7363c-76b9-48f5-aafa-f098d4470a2a",
                "transactionExternalKey":"91c7363c-76b9-48f5-aafa-f098d4470a2a",
                "paymentId":"3f84661c-4fb7-42ac-8a02-3e8f48840e51",
                "paymentExternalKey":"3f84661c-4fb7-42ac-8a02-3e8f48840e51",
                "transactionType":"PURCHASE",
                "amount":50.0,
                "currency":"USD",
                "effectiveDate":"2013-08-01T06:00:01.000Z",
                "processedAmount":50.0,
                "processedCurrency":"USD",
                "status":"SUCCESS",
                "auditLogs":[]
             }
          ],
          "auditLogs":[]
       }
    ]
    
    [{'account_id': '110952d7-1b7e-482c-b6bb-103e46794927',
     'audit_logs': [],
     'auth_amount': 0.0,
     'captured_amount': 0.0,
     'credited_amount': 0.0,
     'currency': 'USD',
     'payment_attempts': None,
     'payment_external_key': '00ac58a6-7f0e-4149-9682-7d2110a18fb7',
     'payment_id': '00ac58a6-7f0e-4149-9682-7d2110a18fb7',
     'payment_method_id': '4a2a793a-48b0-41f1-ab7e-eff4efda3747',
     'payment_number': '291',
     'purchased_amount': 50.0,
     'refunded_amount': 0.0,
     'target_invoice_id': '9696fb14-6016-484d-b288-f57854d61193',
     'transactions': [{'amount': 50.0,
                       'audit_logs': [],
                       'currency': 'USD',
                       'effective_date': datetime.datetime(2018, 5, 4, 16, 51, 1, tzinfo=tzutc()),
                       'first_payment_reference_id': None,
                       'gateway_error_code': None,
                       'gateway_error_msg': None,
                       'payment_external_key': '00ac58a6-7f0e-4149-9682-7d2110a18fb7',
                       'payment_id': '00ac58a6-7f0e-4149-9682-7d2110a18fb7',
                       'processed_amount': 50.0,
                       'processed_currency': 'USD',
                       'properties': None,
                       'second_payment_reference_id': None,
                       'status': 'SUCCESS',
                       'transaction_external_key': '1063f716-cf90-42fe-aa2c-888fa21cf4bb',
                       'transaction_id': '1063f716-cf90-42fe-aa2c-888fa21cf4bb',
                       'transaction_type': 'PURCHASE'}]}]
    

    Query Parameters

    Name Type Required Description
    audit enum false level of audit logs returned
    withPluginInfo boolean false Choose true if you want plugin info.
    withAttempts boolean false Choose true if you want payment attempts.

    Returns

    Return a list of invoice payments objects.

    Trigger a payment for all unpaid invoices

    HTTP Request

    POST http://example.com/1.0/kb/accounts/{accountId}/invoicePayments

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("e011caa5-ba35-4ac6-81cb-63b4f08122dc");
    UUID paymentMethodId = null;
    Boolean externalPayment = true; // Will use a external payment method
    BigDecimal paymentAmount = null;
    LocalDate targetDate = null;
    ImmutableMap<String, String> NULL_PLUGIN_PROPERTIES = null;
    
    accountApi.payAllInvoices(accountId, 
                              paymentMethodId, 
                              externalPayment, 
                              paymentAmount, 
                              targetDate,
                              NULL_PLUGIN_PROPERTIES, 
                              requestOptions);
    
    invoice_payment                  = KillBillClient::Model::InvoicePayment.new
    invoice_payment.account_id       = account.account_id
    invoice_payment.purchased_amount = '50.0'
    
    external_payment  = true
    payment_method_id = nil
    target_date       = nil
    
    invoice_payment.bulk_create(external_payment,
                                payment_method_id,
                                target_date,
                                user,
                                reason,
                                comment,
                                options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '82ecbf80-ddd2-4208-92be-2d3b2b7fc266'
    
    accountApi.pay_all_invoices(account_id, 
                                created_by,
                                api_key, 
                                api_secret, 
                                external_payment=True,
                                payment_method_id=None,
                                target_date=None)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    paymentMethodId string false Payment method id.
    externalPayment boolean true Choose true if you use a external payment method.
    paymentAmount string false Total payment amount.
    targetDate string false Total payment amount.

    Response

    A 201 http status without content.

    Retrieve account invoices

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/invoices

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("d3a82897-ae72-4a2e-9bca-e3c1fe087f84");
    Boolean withItems = true; // Will fetch invoice items as well
    Boolean withMigrationInvoices = false; // Will not fetch migrated invoice - if any
    Boolean unpaidInvoicesOnly = false; // Will not restrict to unpaid invoices
    Boolean includeVoidedInvoices = false; // Will not include void invoices
    
    Invoices invoices = accountApi.getInvoicesForAccount(accountId, 
                                                         withItems, 
                                                         withMigrationInvoices, 
                                                         unpaidInvoicesOnly, 
                                                         includeVoidedInvoices, 
                                                         AuditLevel.FULL, 
                                                         requestOptions);
    
    account.invoices(with_items,
                     options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '82ecbf80-ddd2-4208-92be-2d3b2b7fc266'
    
    accountApi.get_invoices_for_account(account_id, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class Invoice {
        org.killbill.billing.client.model.gen.Invoice@df84aad8
        amount: 0.00
        currency: USD
        status: COMMITTED
        creditAdj: 0.00
        refundAdj: 0.00
        invoiceId: 66448454-4ff2-4a4c-9817-167c062fcde9
        invoiceDate: 2012-04-25
        targetDate: 2012-04-25
        invoiceNumber: 1
        balance: 0.00
        accountId: d3a82897-ae72-4a2e-9bca-e3c1fe087f84
        bundleKeys: null
        credits: null
        items: [class InvoiceItem {
            org.killbill.billing.client.model.gen.InvoiceItem@7e405309
            invoiceItemId: 898d4b59-9e85-48cc-b05e-33d2059b6250
            invoiceId: 66448454-4ff2-4a4c-9817-167c062fcde9
            linkedInvoiceItemId: null
            accountId: d3a82897-ae72-4a2e-9bca-e3c1fe087f84
            childAccountId: null
            bundleId: 823db38d-864f-4123-96e1-86218663e1bd
            subscriptionId: 8c0b5800-c892-4898-9295-837ecadad2f0
            productName: Shotgun
            planName: shotgun-monthly
            phaseName: shotgun-monthly-trial
            usageName: null
            prettyProductName: Shotgun
            prettyPlanName: Shotgun Monthly
            prettyPhaseName: shotgun-monthly-trial
            prettyUsageName: null
            itemType: FIXED
            description: shotgun-monthly-trial
            startDate: 2012-04-25
            endDate: null
            amount: 0.00
            rate: null
            currency: USD
            quantity: null
            itemDetails: null
            childItems: null
            auditLogs: [class AuditLog {
                changeType: INSERT
                changeDate: 2012-04-25T00:03:43.000Z
                objectType: INVOICE_ITEM
                objectId: 898d4b59-9e85-48cc-b05e-33d2059b6250
                changedBy: SubscriptionBaseTransition
                reasonCode: null
                comments: null
                userToken: fc3e7a8d-7e8c-4b9d-a6ac-557cd2e74ccd
                history: null
            }]
        }]
        isParentInvoice: false
        parentInvoiceId: null
        parentAccountId: null
        auditLogs: [class AuditLog {
            changeType: INSERT
            changeDate: 2012-04-25T00:03:43.000Z
            objectType: INVOICE
            objectId: 66448454-4ff2-4a4c-9817-167c062fcde9
            changedBy: SubscriptionBaseTransition
            reasonCode: null
            comments: null
            userToken: fc3e7a8d-7e8c-4b9d-a6ac-557cd2e74ccd
            history: null
        }]
    }
    
    [
       {
          "amount":50.0,
          "currency":"USD",
          "status":"COMMITTED",
          "creditAdj":0.0,
          "refundAdj":0.0,
          "invoiceId":"d981abbb-3622-487a-9564-d594c9d04f83",
          "invoiceDate":"2013-08-01",
          "targetDate":"2013-08-01",
          "invoiceNumber":"1563",
          "balance":0.0,
          "accountId":"1f310060-dad6-4151-87af-c58a4fe87679",
          "items":[
             {
                "invoiceItemId":"5f3b4e9c-66bd-4c5c-b84a-4ae951cc2f1d",
                "invoiceId":"d981abbb-3622-487a-9564-d594c9d04f83",
                "accountId":"1f310060-dad6-4151-87af-c58a4fe87679",
                "itemType":"EXTERNAL_CHARGE",
                "description":"Some description",
                "startDate":"2013-08-01",
                "amount":50.0,
                "currency":"USD",
                "auditLogs":[]
             }
          ],
          "isParentInvoice":false,
          "auditLogs":[]
       }
    ]
    
    [{'account_id': '82ecbf80-ddd2-4208-92be-2d3b2b7fc266',
     'amount': 0.0,
     'audit_logs': [],
     'balance': 0.0,
     'bundle_keys': None,
     'credit_adj': 0.0,
     'credits': None,
     'currency': 'USD',
     'invoice_date': datetime.date(2018, 5, 4),
     'invoice_id': 'da4a1c85-c18c-4d88-8005-e3c4039c218b',
     'invoice_number': '764',
     'is_parent_invoice': False,
     'items': [],
     'parent_account_id': None,
     'parent_invoice_id': None,
     'refund_adj': 0.0,
     'status': 'COMMITTED',
     'target_date': datetime.date(2018, 5, 4)}, {'account_id': '82ecbf80-ddd2-4208-92be-2d3b2b7fc266',
     'amount': 0.0,
     'audit_logs': [],
     'balance': 0.0,
     'bundle_keys': None,
     'credit_adj': 0.0,
     'credits': None,
     'currency': 'USD',
     'invoice_date': datetime.date(2018, 5, 4),
     'invoice_id': '00b24709-160b-4472-8741-e0f271a67fe0',
     'invoice_number': '765',
     'is_parent_invoice': False,
     'items': [],
     'parent_account_id': None,
     'parent_invoice_id': None,
     'refund_adj': 0.0,
     'status': 'COMMITTED',
     'target_date': datetime.date(2018, 5, 4)}, {'account_id': '82ecbf80-ddd2-4208-92be-2d3b2b7fc266',
     'amount': 50.0,
     'audit_logs': [],
     'balance': 50.0,
     'bundle_keys': None,
     'credit_adj': 0.0,
     'credits': None,
     'currency': 'USD',
     'invoice_date': datetime.date(2018, 5, 4),
     'invoice_id': '6e2be596-f6f0-4453-9551-3638af9088d2',
     'invoice_number': '766',
     'is_parent_invoice': False,
     'items': [],
     'parent_account_id': None,
     'parent_invoice_id': None,
     'refund_adj': 0.0,
     'status': 'COMMITTED',
     'target_date': datetime.date(2018, 5, 4)}]
    

    Query Parameters

    Name Type Required Description
    withItems boolean true Choose true if you want items info.
    withMigrationInvoices boolean true Choose true if you want migration invoices
    unpaidInvoicesOnly boolean true Choose true if you want unpaid invoices only
    includeVoidedInvoices boolean true Choose true if you want to include voided invoices
    audit enum false level of audit logs returned

    Returns

    Return a list with invoice objects.

    Retrieve overdue state for account

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/overdue

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("d3a82897-ae72-4a2e-9bca-e3c1fe087f84");
    
    OverdueState result = accountApi.getOverdueAccount(accountId, requestOptions);
    
    account.overdue(options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '82ecbf80-ddd2-4208-92be-2d3b2b7fc266'
    
    accountApi.get_overdue_account(account_id, api_key, api_secret)
    

    Example Response:

    class OverdueState {
        name: OD3
        externalMessage: Reached OD3
        daysBetweenPaymentRetries: [8, 8, 8]
        isDisableEntitlementAndChangesBlocked: true
        isBlockChanges: true
        isClearState: false
        reevaluationIntervalDays: 5
    }
    
    {
       "name":"__KILLBILL__CLEAR__OVERDUE_STATE__",
       "externalMessage":"",
       "daysBetweenPaymentRetries":[
          8,
          8,
          8
       ],
       "disableEntitlementAndChangesBlocked":false,
       "blockChanges":false,
       "clearState":true
    }
    
    {
     'days_between_payment_retries': [8, 8, 8],
     'external_message': '',
     'is_block_changes': False,
     'is_clear_state': True,
     'is_disable_entitlement_and_changes_blocked': False,
     'name': '__KILLBILL__CLEAR__OVERDUE_STATE__',
     'reevaluation_interval_days': None
    }
    

    Query Parameters

    None.

    Returns

    Returns a overdue state object.

    Add a payment method

    HTTP Request

    POST http://example.com/1.0/kb/accounts/{accountId}/paymentMethods

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("d751dd57-7644-469a-9e69-f98d36d86f67");
    
    UUID paymentMethodId = null;
    String externalKey = UUID.randomUUID().toString();
    Boolean isDefault = true; // Will set this new payment method as default
    String pluginName = "__EXTERNAL_PAYMENT__"; 
    PaymentMethodPluginDetail info = new PaymentMethodPluginDetail();
    ImmutableList<AuditLog> EMPTY_AUDIT_LOGS = ImmutableList.<AuditLog>of();
    
    PaymentMethod paymentMethod = new PaymentMethod(paymentMethodId, 
                                                    externalKey, 
                                                    accountId, 
                                                    isDefault, 
                                                    pluginName, 
                                                    info, 
                                                    EMPTY_AUDIT_LOGS);
    ImmutableList<String> NULL_PLUGIN_NAMES = null;
    ImmutableMap<String, String> NULL_PLUGIN_PROPERTIES = null;
    
    PaymentMethod paymentMethodPP = accountApi.createPaymentMethod(accountId, 
                                                                   paymentMethod, 
                                                                   NULL_PLUGIN_NAMES, 
                                                                   NULL_PLUGIN_PROPERTIES, 
                                                                   requestOptions);
    
    pm             = KillBillClient::Model::PaymentMethod.new
    pm.account_id  = account.account_id
    pm.plugin_name = '__EXTERNAL_PAYMENT__'
    pm.plugin_info = nil
    
    is_default = true
    
    pm.create(is_default, 
              user, 
              reason, 
              comment,
              options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '059ecfb8-6b4d-4a89-9537-63a687e6cf10'
    body = PaymentMethod(plugin_name='__EXTERNAL_PAYMENT__', plugin_info=None)
    
    accountApi.create_payment_method(account_id, 
                                     body, 
                                     created_by, 
                                     api_key, 
                                     api_secret)
    

    Example Response:

    class PaymentMethod {
        org.killbill.billing.client.model.gen.PaymentMethod@a820eeea
        paymentMethodId: 538c5a98-879b-4735-88df-e58f7a4bf874
        externalKey: a85a3fbe-30e8-457d-8a5a-55e16bcd730b
        accountId: d751dd57-7644-469a-9e69-f98d36d86f67
        isDefault: false
        pluginName: __EXTERNAL_PAYMENT__
        pluginInfo: null
        auditLogs: []
    }
    
    {
       "paymentMethodId":"059ecfb8-6b4d-4a89-9537-63a687e6cf10",
       "externalKey":"unknown",
       "accountId":"fa488b6e-c52a-450a-94bf-6607ae8b484f",
       "isDefault":true,
       "pluginName":"__EXTERNAL_PAYMENT__",
       "pluginInfo":{
          "properties":[]
       },
       "auditLogs":[]
    }
    
    no content
    

    Query Parameters

    Name Type Required Description
    isDefault boolean true Choose true if you want to set new payment as default.
    payAllUnpaidInvoices boolean true Choose true if you want to pay all unpaid invoices.

    Returns

    Returns a payment method object.

    Retrieve account payment methods

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/paymentMethods

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("faf239a5-456a-4eb9-aef9-8d2254ef57dc");
    ImmutableMap<String, String> NULL_PLUGIN_PROPERTIES = null;
    
    List<PaymentMethod> paymentMethods = accountApi.getPaymentMethodsForAccount(accountId, 
                                                                                NULL_PLUGIN_PROPERTIES, 
                                                                                requestOptions);
    
    account_id = account.account_id
    with_plugin_info = false
    
    payment_method.find_all_by_account_id(account_id, 
                                          with_plugin_info,
                                          options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '88a5987a-1e1c-47c5-ba95-34ef14db3d46'
    
    accountApi.get_payment_methods_for_account(account_id, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class PaymentMethod {
        org.killbill.billing.client.model.gen.PaymentMethod@5528b1ed
        paymentMethodId: 1a4e5b9a-5280-4624-b2fc-2ea6d047d7fa
        externalKey: eed36074-d493-4335-839e-2adca4cb4187
        accountId: faf239a5-456a-4eb9-aef9-8d2254ef57dc
        isDefault: true
        pluginName: __EXTERNAL_PAYMENT__
        pluginInfo: null
        auditLogs: []
    }
    
    {
       "paymentMethodId":"059ecfb8-6b4d-4a89-9537-63a687e6cf10",
       "externalKey":"unknown",
       "accountId":"fa488b6e-c52a-450a-94bf-6607ae8b484f",
       "isDefault":true,
       "pluginName":"__EXTERNAL_PAYMENT__",
       "pluginInfo":{
          "properties":[]
       },
       "auditLogs":[]
    }
    
    [{'account_id': '88a5987a-1e1c-47c5-ba95-34ef14db3d46',
     'audit_logs': [],
     'external_key': 'unknown',
     'is_default': False,
     'payment_method_id': 'f49b513b-f045-46d8-9886-7f28df87e2a6',
     'plugin_info': None,
     'plugin_name': '__EXTERNAL_PAYMENT__'}]
    

    Query Parameters

    Name Type Required Description
    withPluginInfo boolean true Choose true if you want plugin info.

    Returns

    Returns a list of payment method objects.

    Set the default payment method

    HTTP Request

    PUT http://example.com/1.0/kb/accounts/{accountId}/paymentMethods/{paymentMethodId}/setDefault

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("faf239a5-456a-4eb9-aef9-8d2254ef57dc");
    UUID paymentMethodId = UUID.fromString("faf239a5-456a-4eb9-aef9-8d2254ef57dc");
    ImmutableMap<String, String> NULL_PLUGIN_PROPERTIES = null;
    
    accountApi.setDefaultPaymentMethod(accountId, 
                                       paymentMethodId, 
                                       NULL_PLUGIN_PROPERTIES, 
                                       requestOptions);
    
    account_id = account.account_id
    KillBillClient::Model::PaymentMethod.set_default(payment_method_id,
                                                     account_id,
                                                     user,
                                                     reason,
                                                     comment,
                                                     options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '88a5987a-1e1c-47c5-ba95-34ef14db3d46'
    payment_method_id = '4f124c0d-cee7-49b1-a181-3b0738c685d7'
    
    accountApi.set_default_payment_method(account_id, 
                                          payment_method_id, 
                                          created_by, 
                                          api_key, 
                                          api_secret)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    payAllUnpaidInvoices boolean true Choose true if you want to pay all unpaid invoices.

    Response

    A 204 http status without content.

    Refresh account payment methods

    HTTP Request

    PUT http://example.com/1.0/kb/accounts/{accountId}/paymentMethods/refresh

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("faf239a5-456a-4eb9-aef9-8d2254ef57dc");
    String pluginName = "__EXTERNAL_PAYMENT__";
    ImmutableMap<String, String> NULL_PLUGIN_PROPERTIES = null;
    
    accountApi.refreshPaymentMethods(accountId, 
                                     pluginName, 
                                     NULL_PLUGIN_PROPERTIES, 
                                     requestOptions);
    
    account_id = account.account_id
    
    KillBillClient::Model::PaymentMethod.refresh(account_id, 
                                                 user, 
                                                 reason, 
                                                 comment, 
                                                 options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '88a5987a-1e1c-47c5-ba95-34ef14db3d46'
    
    accountApi.refresh_payment_methods(account_id, 
                                       created_by,
                                       api_key,
                                       api_secret)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    None.

    Response

    A 204 http status without content.

    Retrieve account payments

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/payments

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("e0fe95af-7d59-4b70-8252-165e1840410c");
    Boolean withAttempts = false; // Will not reflect payment attempts
    Boolean withPluginInfo = false; // Will not reflect payment attempts
    ImmutableMap<String, String> NULL_PLUGIN_PROPERTIES = null;
    
    Payments payments = accountApi.getPaymentsForAccount(accountId,
                                                         withAttempts,
                                                         withPluginInfo
                                                         NULL_PLUGIN_PROPERTIES, 
                                                         AuditLevel.NONE,
                                                         requestOptions);
    
    account.payments(options)
    
    accountApi = killbill.api.AccountApi()
    account_id = 'b0da8392-49ba-43f2-8fac-3f9f85b8ff61'
    
    accountApi.get_payments_for_account(account_id, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class Payment {
        org.killbill.billing.client.model.gen.Payment@1445c8b6
        accountId: e0fe95af-7d59-4b70-8252-165e1840410c
        paymentId: aef920ce-6887-4a00-8d0a-52cd6120517a
        paymentNumber: 1
        paymentExternalKey: aef920ce-6887-4a00-8d0a-52cd6120517a
        authAmount: 0
        capturedAmount: 0
        purchasedAmount: 249.95
        refundedAmount: 0
        creditedAmount: 0
        currency: USD
        paymentMethodId: 9782b80d-6a0d-4051-9d05-b3fcd81c19e7
        transactions: [class PaymentTransaction {
            org.killbill.billing.client.model.gen.PaymentTransaction@40873e28
            transactionId: d04e8592-8638-4768-9ac0-87b62a3cd516
            transactionExternalKey: d04e8592-8638-4768-9ac0-87b62a3cd516
            paymentId: aef920ce-6887-4a00-8d0a-52cd6120517a
            paymentExternalKey: aef920ce-6887-4a00-8d0a-52cd6120517a
            transactionType: PURCHASE
            amount: 249.95
            currency: USD
            effectiveDate: 2012-09-26T00:00:04.000Z
            processedAmount: 249.95
            processedCurrency: USD
            status: SUCCESS
            gatewayErrorCode: 
            gatewayErrorMsg: 
            firstPaymentReferenceId: null
            secondPaymentReferenceId: null
            properties: null
            auditLogs: []
        }]
        paymentAttempts: null
        auditLogs: []
    }
    
    [
       {
          "accountId":"6577439c-b783-4c60-82b2-c23e7b46eb97",
          "paymentId":"b83132eb-1bf9-4a02-8572-376e4b1f06c9",
          "paymentNumber":"325",
          "paymentExternalKey":"b83132eb-1bf9-4a02-8572-376e4b1f06c9",
          "authAmount":0,
          "capturedAmount":0,
          "purchasedAmount":50.0,
          "refundedAmount":0,
          "creditedAmount":0,
          "currency":"USD",
          "paymentMethodId":"6041ffab-ae5f-45d3-bdf8-ce8cbfa5fd5c",
          "transactions":[
             {
                "transactionId":"be9dceca-9c5d-4038-818c-57e6fccfbe92",
                "transactionExternalKey":"be9dceca-9c5d-4038-818c-57e6fccfbe92",
                "paymentId":"b83132eb-1bf9-4a02-8572-376e4b1f06c9",
                "paymentExternalKey":"b83132eb-1bf9-4a02-8572-376e4b1f06c9",
                "transactionType":"PURCHASE",
                "amount":50.0,
                "currency":"USD",
                "effectiveDate":"2013-08-01T06:00:02.000Z",
                "processedAmount":50.0,
                "processedCurrency":"USD",
                "status":"SUCCESS",
                "auditLogs":[
    
                ]
             }
          ],
          "auditLogs":[
    
          ]
       }
    ]
    
    [{'account_id': 'b0da8392-49ba-43f2-8fac-3f9f85b8ff61',
     'audit_logs': [],
     'auth_amount': 0.0,
     'captured_amount': 0.0,
     'credited_amount': 0.0,
     'currency': 'USD',
     'payment_attempts': None,
     'payment_external_key': 'cf34a5e5-b933-4efd-8e6d-502e8ae6be81',
     'payment_id': 'cf34a5e5-b933-4efd-8e6d-502e8ae6be81',
     'payment_method_id': '58065d90-6fb1-40ff-bbcb-aa21b45c76c0',
     'payment_number': '294',
     'purchased_amount': 50.0,
     'refunded_amount': 0.0,
     'transactions': [{'amount': 50.0,
                       'audit_logs': [],
                       'currency': 'USD',
                       'effective_date': datetime.datetime(2018, 5, 4, 18, 1, 15, tzinfo=tzutc()),
                       'first_payment_reference_id': None,
                       'gateway_error_code': None,
                       'gateway_error_msg': None,
                       'payment_external_key': 'cf34a5e5-b933-4efd-8e6d-502e8ae6be81',
                       'payment_id': 'cf34a5e5-b933-4efd-8e6d-502e8ae6be81',
                       'processed_amount': 50.0,
                       'processed_currency': 'USD',
                       'properties': None,
                       'second_payment_reference_id': None,
                       'status': 'SUCCESS',
                       'transaction_external_key': 'd1d52998-dc41-4f03-93e9-7f9a59445bb7',
                       'transaction_id': 'd1d52998-dc41-4f03-93e9-7f9a59445bb7',
                       'transaction_type': 'PURCHASE'}]}]
    

    Query Parameters

    Name Type Required Description
    audit enum false level of audit logs returned
    withPluginInfo boolean false choose true if you want plugin info
    withAttempts boolean false choose true if you want payment attempts

    Returns

    Returns a list of all account payments object.

    Trigger a payment (authorization, purchase or credit)

    HTTP Request

    POST http://example.com/1.0/kb/accounts/{accountId}/payments

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("f4087a76-9f8a-4893-abbf-c5bb69975d1b");
    
    PaymentTransaction authTransaction = new PaymentTransaction();
    authTransaction.setAmount(BigDecimal.ONE);
    authTransaction.setCurrency(account.getCurrency());
    
    // TransactionType could be 'AUTHORIZE', 'PURCHASE' or 'CREDIT'
    authTransaction.setTransactionType(TransactionType.AUTHORIZE);
    
    UUID paymentMethodId = UUID.fromString("1d55ed5f-deea-4109-98b0-beb13a242f7c");
    ImmutableList<String> NULL_PLUGIN_NAMES = null;
    ImmutableMap<String, String> NULL_PLUGIN_PROPERTIES = null;
    
    Payment payment = accountApi.processPayment(accountId, 
                                                authTransaction, 
                                                paymentMethodId, 
                                                NULL_PLUGIN_NAMES,
                                                NULL_PLUGIN_PROPERTIES, 
                                                requestOptions);
    
    transaction = KillBillClient::Model::Transaction.new
    transaction.amount = '50.0'
    
    payment_method_id = payment_method.payment_method_id
    refresh_options = nil
    
    # Authorization
    transaction.auth(account.account_id,
                     payment_method_id, 
                     user, 
                     reason, 
                     comment, 
                     options, 
                     refresh_options)
    
    # Purchase
    transaction.purchase(account.account_id,
                         payment_method_id, 
                         user, 
                         reason, 
                         comment, 
                         options, 
                         refresh_options)
    
    # Credit
    transaction.credit(account.account_id,
                       payment_method_id, 
                       user, 
                       reason, 
                       comment, 
                       options, 
                       refresh_options)
    
    accountApi = killbill.api.AccountApi()
    account_id = 'b0da8392-49ba-43f2-8fac-3f9f85b8ff61'
    payment_method_id = '80c7b386-97b2-424c-bb4e-0017f92bc6eb'
    
    # transaction_type could be 'AUTHORIZE', 'PURCHASE' or 'CREDIT'
    body = PaymentTransaction(amount=50, transaction_type='AUTHORIZE')
    
    accountApi.process_payment(account_id, 
                               body, 
                               created_by, 
                               api_key, 
                               api_secret, 
                               payment_method_id=payment_method_id)
    

    Example Response:

    class Payment {
        org.killbill.billing.client.model.gen.Payment@6816b5c8
        accountId: f4087a76-9f8a-4893-abbf-c5bb69975d1b
        paymentId: 0ecd1fdc-6c3e-4e06-b36f-9833f24ca607
        paymentNumber: 1
        paymentExternalKey: 0ecd1fdc-6c3e-4e06-b36f-9833f24ca607
        authAmount: 1.00
        capturedAmount: 0
        purchasedAmount: 0
        refundedAmount: 0
        creditedAmount: 0
        currency: USD
        paymentMethodId: 1d55ed5f-deea-4109-98b0-beb13a242f7c
        transactions: [class PaymentTransaction {
            org.killbill.billing.client.model.gen.PaymentTransaction@29ef3d69
            transactionId: 3d40bc43-72ef-4aa6-8b3c-c8f1225a0971
            transactionExternalKey: 3d40bc43-72ef-4aa6-8b3c-c8f1225a0971
            paymentId: 0ecd1fdc-6c3e-4e06-b36f-9833f24ca607
            paymentExternalKey: 0ecd1fdc-6c3e-4e06-b36f-9833f24ca607
            transactionType: AUTHORIZE
            amount: 1.00
            currency: USD
            effectiveDate: 2018-09-04T03:05:35.000Z
            processedAmount: 1.00
            processedCurrency: USD
            status: SUCCESS
            gatewayErrorCode: 
            gatewayErrorMsg: 
            firstPaymentReferenceId: null
            secondPaymentReferenceId: null
            properties: null
            auditLogs: []
        }]
        paymentAttempts: null
        auditLogs: []
    }
    
    {
       "accountId":"2ad4cae9-c44a-43f9-b3f8-2e3e4e097838",
       "paymentId":"b4c5b34f-cd3e-4269-9f71-55daf8edde60",
       "paymentNumber":"333",
       "paymentExternalKey":"b4c5b34f-cd3e-4269-9f71-55daf8edde60",
       "authAmount":50.0,
       "capturedAmount":0,
       "purchasedAmount":0,
       "refundedAmount":0,
       "creditedAmount":0,
       "currency":"USD",
       "paymentMethodId":"132d59c0-8c28-4115-947d-f57d430bc458",
       "transactions":[
          {
             "transactionId":"e038a04e-5304-4570-ab89-b7f04e8f496c",
             "transactionExternalKey":"e038a04e-5304-4570-ab89-b7f04e8f496c",
             "paymentId":"b4c5b34f-cd3e-4269-9f71-55daf8edde60",
             "paymentExternalKey":"b4c5b34f-cd3e-4269-9f71-55daf8edde60",
             "transactionType":"AUTHORIZE",
             "amount":50.0,
             "currency":"USD",
             "effectiveDate":"2013-08-01T06:00:01.000Z",
             "processedAmount":50.0,
             "processedCurrency":"USD",
             "status":"SUCCESS",
             "auditLogs":[]
          }
       ],
       "auditLogs":[]
    }
    
    no content
    

    Query Parameters

    Name Type Required Description
    paymentMethodId string true payment method id

    Returns

    Returns a payment transaction object.

    Trigger a payment using the account external key (authorization, purchase or credit)

    HTTP Request

    POST http://example.com/1.0/kb/accounts/payments

    Example Request:

    TODO    
    
    TODO
    
    transaction = KillBillClient::Model::Transaction.new
    transaction.amount = '50.0'
    
    payment_method_id = '132d59c0-8c28-4115-947d-f57d430bc458'
    refresh_options = nil
    
    # Authorization
    transaction.auth_by_external_key(account.external_key,
                                     payment_method_id, 
                                     user, 
                                     reason, 
                                     comment, 
                                     options, 
                                     refresh_options)
    
    # Purchase
    transaction.purchase_by_external_key(account.external_key,
                                         payment_method_id, 
                                         user, 
                                         reason, 
                                         comment, 
                                         options, 
                                         refresh_options)
    
    # Credit
    transaction.credit_by_external_key(account.external_key,
                                       payment_method_id, 
                                       user, 
                                       reason, 
                                       comment, 
                                       options, 
                                       refresh_options)
    
    accountApi = killbill.api.AccountApi()
    account_external_key = 'sample_external_key'
    payment_method_id = '80c7b386-97b2-424c-bb4e-0017f92bc6eb'
    
    # transaction_type could be 'AUTHORIZE', 'PURCHASE' or 'CREDIT'
    body = PaymentTransaction(amount=50, transaction_type='AUTHORIZE')
    
    accountApi.process_payment_by_external_key(body,
                                               external_key,
                                               created_by,
                                               api_key,
                                               api_secret)
                                               payment_method_id=payment_method_id)
    

    Example Response:

    {
       "accountId":"2ad4cae9-c44a-43f9-b3f8-2e3e4e097838",
       "paymentId":"b4c5b34f-cd3e-4269-9f71-55daf8edde60",
       "paymentNumber":"333",
       "paymentExternalKey":"b4c5b34f-cd3e-4269-9f71-55daf8edde60",
       "authAmount":50.0,
       "capturedAmount":0,
       "purchasedAmount":0,
       "refundedAmount":0,
       "creditedAmount":0,
       "currency":"USD",
       "paymentMethodId":"132d59c0-8c28-4115-947d-f57d430bc458",
       "transactions":[
          {
             "transactionId":"e038a04e-5304-4570-ab89-b7f04e8f496c",
             "transactionExternalKey":"e038a04e-5304-4570-ab89-b7f04e8f496c",
             "paymentId":"b4c5b34f-cd3e-4269-9f71-55daf8edde60",
             "paymentExternalKey":"b4c5b34f-cd3e-4269-9f71-55daf8edde60",
             "transactionType":"AUTHORIZE",
             "amount":50.0,
             "currency":"USD",
             "effectiveDate":"2013-08-01T06:00:01.000Z",
             "processedAmount":50.0,
             "processedCurrency":"USD",
             "status":"SUCCESS",
             "auditLogs":[]
          }
       ],
       "auditLogs":[]
    }
    
    no content
    

    Query Parameters

    Name Type Required Description
    paymentMethodId string true payment method id

    Returns

    Returns a payment transaction object.

    Add tags to account

    HTTP Request

    POST http://example.com/1.0/kb/accounts/{accountId}/tags

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("f4087a76-9f8a-4893-abbf-c5bb69975d1b");
    
    UUID autoPayOffId = UUID.fromString("00000000-0000-0000-0000-000000000001");
    
    Tags result = accountApi.createAccountTags(accountId, 
                                               ImmutableList.<UUID>of(autoPayOffId), 
                                               requestOptions);
    
    tag_name = 'TEST'
    
    account.add_tag(tag_name,
                    user,
                    reason,
                    comment,
                    options)
    
    accountApi = killbill.api.AccountApi()
    account_id = 'b0da8392-49ba-43f2-8fac-3f9f85b8ff61'
    tag = ["00000000-0000-0000-0000-000000000002"]
    
    accountApi.create_account_tags(account_id, 
                                   tag, 
                                   created_by, 
                                   api_key, 
                                   api_secret)
    

    Example Response:

    //First element of the list
    class Tag {
        org.killbill.billing.client.model.gen.Tag@bd138472
        tagId: 1bb4b638-3886-4f73-90a5-89eb6d1bcf7f
        objectType: ACCOUNT
        objectId: 917992d3-5f1f-4828-9fff-799cc4211aa9
        tagDefinitionId: 00000000-0000-0000-0000-000000000001
        tagDefinitionName: AUTO_PAY_OFF
        auditLogs: []
    }
    
    [
       {
          "tagId":"a46cfeb6-e175-42db-be62-7f117326ab4e",
          "objectType":"ACCOUNT",
          "objectId":"28af3cb9-275b-4ac4-a55d-a0536e479069",
          "tagDefinitionId":"00000000-0000-0000-0000-000000000006",
          "tagDefinitionName":"TEST",
          "auditLogs":[
    
          ]
       }
    ]
    
    no content
    

    Query Parameters

    Name Type Required Description
    tagDef string true list with tag definition id's to add

    Returns

    A 201 http status without content.

    Retrieve account tags

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/tags

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("e659f0f3-745c-46d5-953c-28fe9282fc7d");
    Boolean includedDeleted = false; // Will not include deleted tags
    
    List<Tag> tags1 = accountApi.getAccountTags(accountId, 
                                                includedDeleted, 
                                                AuditLevel.FULL, 
                                                requestOptions);
    
    included_deleted = false
    audit = 'NONE'
    
    account.tags(included_deleted,
                 audit,
                 options)
    
    accountApi = killbill.api.AccountApi()
    account_id = 'b0da8392-49ba-43f2-8fac-3f9f85b8ff61'
    
    accountApi.get_account_tags(account_id, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class Tag {
        org.killbill.billing.client.model.gen.Tag@cae768d7
        tagId: d724f79d-fad1-4758-b35e-d62708450d90
        objectType: ACCOUNT
        objectId: e659f0f3-745c-46d5-953c-28fe9282fc7d
        tagDefinitionId: 00000000-0000-0000-0000-000000000001
        tagDefinitionName: AUTO_PAY_OFF
        auditLogs: [class AuditLog {
            changeType: INSERT
            changeDate: 2012-08-25T00:00:02.000Z
            objectType: TAG
            objectId: d724f79d-fad1-4758-b35e-d62708450d90
            changedBy: Toto
            reasonCode: i am god
            comments: no comment
            userToken: e36f7ba5-fb5b-41c0-b47c-77c48ab37dd9
            history: null
        }]
    }
    
    [
       {
          "tagId":"a46cfeb6-e175-42db-be62-7f117326ab4e",
          "objectType":"ACCOUNT",
          "objectId":"28af3cb9-275b-4ac4-a55d-a0536e479069",
          "tagDefinitionId":"00000000-0000-0000-0000-000000000006",
          "tagDefinitionName":"TEST",
          "auditLogs":[
    
          ]
       }
    ]
    
    [
      {
        'audit_logs': [],
        'object_id': '2501dd10-8244-4b4f-9356-8cf73f18fbf6',
        'object_type': 'ACCOUNT',
        'tag_definition_id': '00000000-0000-0000-0000-000000000002',
        'tag_definition_name': 'AUTO_INVOICING_OFF',
        'tag_id': '83df059f-7529-43d4-b77b-c91f39a60166'
      }
    ]
    

    Query Parameters

    Name Type Required Description
    audit enum false level of audit logs returned
    includedDeleted boolean false choose true if you want to include deleted tags

    Returns

    Returns a list of account tag objects.

    Remove tags from account

    HTTP Request

    DELETE http://example.com/1.0/kb/accounts/{accountId}/tags

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("e659f0f3-745c-46d5-953c-28fe9282fc7d");
    UUID autoPayOffId = UUID.fromString("00000000-0000-0000-0000-000000000001");
    
    accountApi.deleteAccountTags(accountId, 
                                 ImmutableList.<UUID>of(autoPayOffId), 
                                 requestOptions);
    
    tag_name = 'TEST'
    
    account.remove_tag(tag_name,
                       user,
                       reason,
                       comment,
                       options)
    
    accountApi = killbill.api.AccountApi()
    account_id = 'b0da8392-49ba-43f2-8fac-3f9f85b8ff61'
    tag = ["00000000-0000-0000-0000-000000000002"]
    
    accountApi.delete_account_tags(account_id, 
                                   created_by, 
                                   api_key, 
                                   api_secret, 
                                   tag_def=tag)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    tagDef string true list with tag definition id's that you want to remove it

    Response

    A 204 http status without content.

    Retrieve account timeline

    HTTP Request

    GET http://example.com/1.0/kb/accounts/{accountId}/timeline

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID accountId = UUID.fromString("16364ac4-2a77-4444-b2d8-e980c37a8954");
    Boolean parallel = false;
    
    AccountTimeline timeline = getAccountTimeline(accountId,
                                                  parallel,
                                                  AuditLevel.NONE,
                                                  requestOptions);
    
    account_id = account.account_id
    audit = 'MINIMAL'
    
    KillBillClient::Model::AccountTimeline.timeline(account_id,
                                                    audit,
                                                    options)
    
    accountApi = killbill.api.AccountApi()
    account_id = '43488882-1777-460c-bc32-e375e67d09cf'
    
    accountApi.get_account_timeline(account_id, api_key, api_secret)
    

    Example Response:

    class AccountTimeline {
        account: class Account {
            org.killbill.billing.client.model.gen.Account@15d03da
            accountId: 16364ac4-2a77-4444-b2d8-e980c37a8954
            name: 6d3aec15-0f95-4445-a4b2-03ba6f312d9f
            firstNameLength: 4
            externalKey: bf50b936-8909-442c-95d9-53302ac53a73
            email: 86aa8@349d7
            billCycleDayLocal: 25
            currency: USD
            parentAccountId: null
            isPaymentDelegatedToParent: false
            paymentMethodId: ef4e6d42-1472-4027-a991-d611701a6001
            referenceTime: 2012-04-25T00:03:42.000Z
            timeZone: UTC
            address1: 12 rue des ecoles
            address2: Poitier
            postalCode: 44 567
            company: Renault
            city: Quelque part
            state: Poitou
            country: France
            locale: fr
            phone: 81 53 26 56
            notes: notes
            isMigrated: false
            accountBalance: null
            accountCBA: null
            auditLogs: []
        }
        bundles: [class Bundle {
            org.killbill.billing.client.model.gen.Bundle@b1f3cdff
            accountId: 16364ac4-2a77-4444-b2d8-e980c37a8954
            bundleId: a077e897-3f75-47e0-af54-eb799c9ed234
            externalKey: 19149cd6-60fb-414f-a720-1b0c5d41f62a
            subscriptions: [class Subscription {
                org.killbill.billing.client.model.gen.Subscription@be14321
                accountId: 16364ac4-2a77-4444-b2d8-e980c37a8954
                bundleId: a077e897-3f75-47e0-af54-eb799c9ed234
                subscriptionId: 510470b8-4495-4215-b4ff-9dd3fb952fb6
                externalKey: 19149cd6-60fb-414f-a720-1b0c5d41f62a
                startDate: 2012-04-25
                productName: Shotgun
                productCategory: BASE
                billingPeriod: MONTHLY
                phaseType: EVERGREEN
                priceList: DEFAULT
                planName: shotgun-monthly
                state: ACTIVE
                sourceType: NATIVE
                cancelledDate: null
                chargedThroughDate: 2012-06-25
                billingStartDate: 2012-04-25
                billingEndDate: null
                billCycleDayLocal: 25
                events: [class EventSubscription {
                    org.killbill.billing.client.model.gen.EventSubscription@c5424137
                    eventId: b7220076-fe42-4fc5-9843-7296044e7f17
                    billingPeriod: MONTHLY
                    effectiveDate: 2012-04-25
                    plan: shotgun-monthly
                    product: Shotgun
                    priceList: DEFAULT
                    eventType: START_ENTITLEMENT
                    isBlockedBilling: false
                    isBlockedEntitlement: false
                    serviceName: entitlement-service
                    serviceStateName: ENT_STARTED
                    phase: shotgun-monthly-trial
                    auditLogs: []
                }, class EventSubscription {
                    org.killbill.billing.client.model.gen.EventSubscription@90c31d8f
                    eventId: 8b74b94e-a41e-4018-9f84-e86870de337b
                    billingPeriod: MONTHLY
                    effectiveDate: 2012-04-25
                    plan: shotgun-monthly
                    product: Shotgun
                    priceList: DEFAULT
                    eventType: START_BILLING
                    isBlockedBilling: false
                    isBlockedEntitlement: false
                    serviceName: billing-service
                    serviceStateName: START_BILLING
                    phase: shotgun-monthly-trial
                    auditLogs: []
                }, class EventSubscription {
                    org.killbill.billing.client.model.gen.EventSubscription@a5e22a9b
                    eventId: e0d9367c-a94d-4f9c-a068-4b21870d8919
                    billingPeriod: MONTHLY
                    effectiveDate: 2012-05-25
                    plan: shotgun-monthly
                    product: Shotgun
                    priceList: DEFAULT
                    eventType: PHASE
                    isBlockedBilling: false
                    isBlockedEntitlement: false
                    serviceName: entitlement+billing-service
                    serviceStateName: PHASE
                    phase: shotgun-monthly-evergreen
                    auditLogs: []
                }]
                priceOverrides: [class PhasePriceOverride {
                    planName: shotgun-monthly
                    phaseName: shotgun-monthly-trial
                    phaseType: TRIAL
                    fixedPrice: 0
                    recurringPrice: null
                    usagePriceOverrides: []
                }, class PhasePriceOverride {
                    planName: shotgun-monthly
                    phaseName: shotgun-monthly-evergreen
                    phaseType: EVERGREEN
                    fixedPrice: null
                    recurringPrice: 249.95
                    usagePriceOverrides: []
                }]
                auditLogs: []
            }]
            timeline: class BundleTimeline {
                org.killbill.billing.client.model.gen.BundleTimeline@8354e44a
                accountId: 16364ac4-2a77-4444-b2d8-e980c37a8954
                bundleId: a077e897-3f75-47e0-af54-eb799c9ed234
                externalKey: 19149cd6-60fb-414f-a720-1b0c5d41f62a
                events: [class EventSubscription {
                    org.killbill.billing.client.model.gen.EventSubscription@aaf34cbe
                    eventId: b7220076-fe42-4fc5-9843-7296044e7f17
                    billingPeriod: MONTHLY
                    effectiveDate: 2012-04-25
                    plan: shotgun-monthly
                    product: Shotgun
                    priceList: DEFAULT
                    eventType: START_ENTITLEMENT
                    isBlockedBilling: false
                    isBlockedEntitlement: false
                    serviceName: entitlement-service
                    serviceStateName: ENT_STARTED
                    phase: shotgun-monthly-trial
                    auditLogs: []
                }, class EventSubscription {
                    org.killbill.billing.client.model.gen.EventSubscription@719050e7
                    eventId: 8b74b94e-a41e-4018-9f84-e86870de337b
                    billingPeriod: MONTHLY
                    effectiveDate: 2012-04-25
                    plan: shotgun-monthly
                    product: Shotgun
                    priceList: DEFAULT
                    eventType: START_BILLING
                    isBlockedBilling: false
                    isBlockedEntitlement: false
                    serviceName: billing-service
                    serviceStateName: START_BILLING
                    phase: shotgun-monthly-trial
                    auditLogs: []
                }, class EventSubscription {
                    org.killbill.billing.client.model.gen.EventSubscription@a23e5a2c
                    eventId: e0d9367c-a94d-4f9c-a068-4b21870d8919
                    billingPeriod: MONTHLY
                    effectiveDate: 2012-05-25
                    plan: shotgun-monthly
                    product: Shotgun
                    priceList: DEFAULT
                    eventType: PHASE
                    isBlockedBilling: false
                    isBlockedEntitlement: false
                    serviceName: entitlement+billing-service
                    serviceStateName: PHASE
                    phase: shotgun-monthly-evergreen
                    auditLogs: []
                }]
                auditLogs: []
            }
            auditLogs: []
        }]
        invoices: [class Invoice {
            org.killbill.billing.client.model.gen.Invoice@be958014
            amount: 0.00
            currency: USD
            status: COMMITTED
            creditAdj: 0.00
            refundAdj: 0.00
            invoiceId: 94e03bc3-ef0a-4db8-9e01-e87cabcf7dfc
            invoiceDate: 2012-04-25
            targetDate: 2012-04-25
            invoiceNumber: 1
            balance: 0.00
            accountId: 16364ac4-2a77-4444-b2d8-e980c37a8954
            bundleKeys: 19149cd6-60fb-414f-a720-1b0c5d41f62a
            credits: []
            items: null
            isParentInvoice: false
            parentInvoiceId: null
            parentAccountId: null
            auditLogs: []
        }, class Invoice {
            org.killbill.billing.client.model.gen.Invoice@54f97871
            amount: 249.95
            currency: USD
            status: COMMITTED
            creditAdj: 0.00
            refundAdj: 0.00
            invoiceId: 1b547802-6d4a-41d8-ae67-fdb209c8fd8a
            invoiceDate: 2012-05-27
            targetDate: 2012-05-25
            invoiceNumber: 2
            balance: 0.00
            accountId: 16364ac4-2a77-4444-b2d8-e980c37a8954
            bundleKeys: 19149cd6-60fb-414f-a720-1b0c5d41f62a
            credits: []
            items: null
            isParentInvoice: false
            parentInvoiceId: null
            parentAccountId: null
            auditLogs: []
        }]
        payments: [class InvoicePayment {
            org.killbill.billing.client.model.gen.InvoicePayment@e8067ccf
            targetInvoiceId: 1b547802-6d4a-41d8-ae67-fdb209c8fd8a
            accountId: 16364ac4-2a77-4444-b2d8-e980c37a8954
            paymentId: ff4f3e17-708c-4f83-a648-1c45a0b9fdf0
            paymentNumber: 1
            paymentExternalKey: ff4f3e17-708c-4f83-a648-1c45a0b9fdf0
            authAmount: 0
            capturedAmount: 0
            purchasedAmount: 249.95
            refundedAmount: 0
            creditedAmount: 0
            currency: USD
            paymentMethodId: ef4e6d42-1472-4027-a991-d611701a6001
            transactions: [class PaymentTransaction {
                org.killbill.billing.client.model.gen.PaymentTransaction@868031c1
                transactionId: 50b13522-6853-4aa5-85ba-aa12bbd643cc
                transactionExternalKey: 50b13522-6853-4aa5-85ba-aa12bbd643cc
                paymentId: ff4f3e17-708c-4f83-a648-1c45a0b9fdf0
                paymentExternalKey: ff4f3e17-708c-4f83-a648-1c45a0b9fdf0
                transactionType: PURCHASE
                amount: 249.95
                currency: USD
                effectiveDate: 2012-05-27T00:03:45.000Z
                processedAmount: 249.95
                processedCurrency: USD
                status: SUCCESS
                gatewayErrorCode: 
                gatewayErrorMsg: 
                firstPaymentReferenceId: null
                secondPaymentReferenceId: null
                properties: null
                auditLogs: []
            }]
            paymentAttempts: null
            auditLogs: []
        }]
    }
    
    {
       "account":{
          "accountId":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69",
          "name":"KillBillClient",
          "externalKey":"1522173024-759445",
          "email":"kill@bill.com",
          "billCycleDayLocal":31,
          "currency":"USD",
          "isPaymentDelegatedToParent":false,
          "timeZone":"UTC",
          "address1":"7, yoyo road",
          "address2":"Apt 5",
          "postalCode":"94105",
          "company":"Unemployed",
          "city":"San Francisco",
          "state":"California",
          "country":"US",
          "locale":"fr_FR",
          "auditLogs":[
             {
                "changeType":"INSERT",
                "changeDate":"2013-08-01T06:00:01.000Z",
                "changedBy":"test_change_default",
                "userToken":"07952a10-4283-456a-830d-0b2a1e353eec"
             }
          ]
       },
       "bundles":[
          {
             "accountId":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69",
             "bundleId":"043b06e0-7d61-4891-ab58-63b02eaf0fee",
             "externalKey":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69-478447",
             "subscriptions":[
                {
                   "accountId":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69",
                   "bundleId":"043b06e0-7d61-4891-ab58-63b02eaf0fee",
                   "subscriptionId":"c1675495-e899-4e1e-8d81-8ef02b02e0a8",
                   "externalKey":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69-478447",
                   "startDate":"2013-08-01",
                   "productName":"Super",
                   "productCategory":"BASE",
                   "billingPeriod":"MONTHLY",
                   "phaseType":"TRIAL",
                   "priceList":"DEFAULT",
                   "planName":"super-monthly",
                   "state":"ACTIVE",
                   "sourceType":"NATIVE",
                   "chargedThroughDate":"2013-08-02",
                   "billingStartDate":"2013-08-01",
                   "billCycleDayLocal":31,
                   "events":[
                      {
                         "eventId":"97a0172a-cb88-467b-bbaf-28cf3a335570",
                         "billingPeriod":"MONTHLY",
                         "effectiveDate":"2013-08-01",
                         "plan":"sports-monthly",
                         "product":"Sports",
                         "priceList":"DEFAULT",
                         "eventType":"START_ENTITLEMENT",
                         "isBlockedBilling":false,
                         "isBlockedEntitlement":false,
                         "serviceName":"entitlement-service",
                         "serviceStateName":"ENT_STARTED",
                         "phase":"sports-monthly-trial",
                         "auditLogs":[
                            {
                               "changeType":"INSERT",
                               "changeDate":"2013-08-01T06:00:01.000Z",
                               "changedBy":"test_change_default",
                               "userToken":"cc3b9ec7-d55b-400b-803c-4a7f9413fe33"
                            }
                         ]
                      },
                      {
                         "eventId":"b634594b-6680-4456-a083-521301416e31",
                         "billingPeriod":"MONTHLY",
                         "effectiveDate":"2013-08-01",
                         "plan":"sports-monthly",
                         "product":"Sports",
                         "priceList":"DEFAULT",
                         "eventType":"START_BILLING",
                         "isBlockedBilling":false,
                         "isBlockedEntitlement":false,
                         "serviceName":"billing-service",
                         "serviceStateName":"START_BILLING",
                         "phase":"sports-monthly-trial",
                         "auditLogs":[
                            {
                               "changeType":"INSERT",
                               "changeDate":"2013-08-01T06:00:01.000Z",
                               "changedBy":"test_change_default",
                               "userToken":"cc3b9ec7-d55b-400b-803c-4a7f9413fe33"
                            }
                         ]
                      },
                      {
                         "eventId":"82953028-68c0-4c2e-9596-0248047d2452",
                         "billingPeriod":"MONTHLY",
                         "effectiveDate":"2013-08-02",
                         "plan":"super-monthly",
                         "product":"Super",
                         "priceList":"DEFAULT",
                         "eventType":"CHANGE",
                         "isBlockedBilling":false,
                         "isBlockedEntitlement":false,
                         "serviceName":"entitlement+billing-service",
                         "serviceStateName":"CHANGE",
                         "phase":"super-monthly-trial",
                         "auditLogs":[
                            {
                               "changeType":"INSERT",
                               "changeDate":"2013-08-02T06:00:03.000Z",
                               "changedBy":"test_change_default",
                               "userToken":"7e39f68b-c695-4d38-822b-5e4ad230f130"
                            }
                         ]
                      },
                      {
                         "eventId":"c2e120b7-af1a-42f4-b16d-2669be94c897",
                         "billingPeriod":"MONTHLY",
                         "effectiveDate":"2013-08-31",
                         "plan":"super-monthly",
                         "product":"Super",
                         "priceList":"DEFAULT",
                         "eventType":"PHASE",
                         "isBlockedBilling":false,
                         "isBlockedEntitlement":false,
                         "serviceName":"entitlement+billing-service",
                         "serviceStateName":"PHASE",
                         "phase":"super-monthly-evergreen",
                         "auditLogs":[
                            {
                               "changeType":"INSERT",
                               "changeDate":"2013-08-02T06:00:03.000Z",
                               "changedBy":"test_change_default",
                               "userToken":"7e39f68b-c695-4d38-822b-5e4ad230f130"
                            }
                         ]
                      }
                   ],
                   "priceOverrides":[
                      {
                         "planName":"sports-monthly",
                         "phaseName":"sports-monthly-trial",
                         "phaseType":"TRIAL",
                         "fixedPrice":0
                      },
                      {
                         "planName":"super-monthly",
                         "phaseName":"super-monthly-trial",
                         "phaseType":"TRIAL",
                         "fixedPrice":0
                      },
                      {
                         "planName":"super-monthly",
                         "phaseName":"super-monthly-evergreen",
                         "phaseType":"EVERGREEN",
                         "recurringPrice":1000.0
                      }
                   ],
                   "auditLogs":[
                      {
                         "changeType":"INSERT",
                         "changeDate":"2013-08-01T06:00:01.000Z",
                         "changedBy":"test_change_default",
                         "reasonCode":null,
                         "comments":null,
                         "userToken":"cc3b9ec7-d55b-400b-803c-4a7f9413fe33"
                      }
                   ]
                }
             ],
             "timeline":{
                "accountId":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69",
                "bundleId":"043b06e0-7d61-4891-ab58-63b02eaf0fee",
                "externalKey":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69-478447",
                "events":[
                   {
                      "eventId":"97a0172a-cb88-467b-bbaf-28cf3a335570",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-01",
                      "plan":"sports-monthly",
                      "product":"Sports",
                      "priceList":"DEFAULT",
                      "eventType":"START_ENTITLEMENT",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement-service",
                      "serviceStateName":"ENT_STARTED",
                      "phase":"sports-monthly-trial",
                      "auditLogs":[
                         {
                            "changeType":"INSERT",
                            "changeDate":"2013-08-01T06:00:01.000Z",
                            "changedBy":"test_change_default",
                            "reasonCode":null,
                            "comments":null,
                            "userToken":"cc3b9ec7-d55b-400b-803c-4a7f9413fe33"
                         }
                      ]
                   },
                   {
                      "eventId":"b634594b-6680-4456-a083-521301416e31",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-01",
                      "plan":"sports-monthly",
                      "product":"Sports",
                      "priceList":"DEFAULT",
                      "eventType":"START_BILLING",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"billing-service",
                      "serviceStateName":"START_BILLING",
                      "phase":"sports-monthly-trial",
                      "auditLogs":[
                         {
                            "changeType":"INSERT",
                            "changeDate":"2013-08-01T06:00:01.000Z",
                            "changedBy":"test_change_default",
                            "reasonCode":null,
                            "comments":null,
                            "userToken":"cc3b9ec7-d55b-400b-803c-4a7f9413fe33"
                         }
                      ]
                   },
                   {
                      "eventId":"82953028-68c0-4c2e-9596-0248047d2452",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-02",
                      "plan":"super-monthly",
                      "product":"Super",
                      "priceList":"DEFAULT",
                      "eventType":"CHANGE",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement+billing-service",
                      "serviceStateName":"CHANGE",
                      "phase":"super-monthly-trial",
                      "auditLogs":[
                         {
                            "changeType":"INSERT",
                            "changeDate":"2013-08-02T06:00:03.000Z",
                            "changedBy":"test_change_default",
                            "reasonCode":null,
                            "comments":null,
                            "userToken":"7e39f68b-c695-4d38-822b-5e4ad230f130"
                         }
                      ]
                   },
                   {
                      "eventId":"c2e120b7-af1a-42f4-b16d-2669be94c897",
                      "billingPeriod":"MONTHLY",
                      "effectiveDate":"2013-08-31",
                      "plan":"super-monthly",
                      "product":"Super",
                      "priceList":"DEFAULT",
                      "eventType":"PHASE",
                      "isBlockedBilling":false,
                      "isBlockedEntitlement":false,
                      "serviceName":"entitlement+billing-service",
                      "serviceStateName":"PHASE",
                      "phase":"super-monthly-evergreen",
                      "auditLogs":[
                         {
                            "changeType":"INSERT",
                            "changeDate":"2013-08-02T06:00:03.000Z",
                            "changedBy":"test_change_default",
                            "reasonCode":null,
                            "comments":null,
                            "userToken":"7e39f68b-c695-4d38-822b-5e4ad230f130"
                         }
                      ]
                   }
                ],
                "auditLogs":[
                   {
                      "changeType":"INSERT",
                      "changeDate":"2013-08-01T06:00:01.000Z",
                      "changedBy":"test_change_default",
                      "reasonCode":null,
                      "comments":null,
                      "userToken":"cc3b9ec7-d55b-400b-803c-4a7f9413fe33"
                   }
                ]
             },
             "auditLogs":[
                {
                   "changeType":"INSERT",
                   "changeDate":"2013-08-01T06:00:01.000Z",
                   "changedBy":"test_change_default",
                   "userToken":"cc3b9ec7-d55b-400b-803c-4a7f9413fe33"
                }
             ]
          }
       ],
       "invoices":[
          {
             "amount":0.0,
             "currency":"USD",
             "status":"COMMITTED",
             "creditAdj":0.0,
             "refundAdj":0.0,
             "invoiceId":"5f7edbcd-5f38-410b-93e0-d6959c44ca25",
             "invoiceDate":"2013-08-01",
             "targetDate":"2013-08-01",
             "invoiceNumber":"1631",
             "balance":0.0,
             "accountId":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69",
             "bundleKeys":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69-478447",
             "credits":[],
             "isParentInvoice":false,
             "auditLogs":[
                {
                   "changeType":"INSERT",
                   "changeDate":"2013-08-01T06:00:02.000Z",
                   "changedBy":"SubscriptionBaseTransition",
                   "userToken":"cc3b9ec7-d55b-400b-803c-4a7f9413fe33"
                }
             ]
          },
          {
             "amount":0.0,
             "currency":"USD",
             "status":"COMMITTED",
             "creditAdj":0.0,
             "refundAdj":0.0,
             "invoiceId":"c68044ed-7f94-4766-b95b-a04d1484728b",
             "invoiceDate":"2013-08-02",
             "targetDate":"2013-08-02",
             "invoiceNumber":"1632",
             "balance":0.0,
             "accountId":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69",
             "bundleKeys":"f5ac6a12-7e24-4b5b-acf0-3f16436faf69-478447",
             "credits":[],
             "isParentInvoice":false,
             "auditLogs":[
                {
                   "changeType":"INSERT",
                   "changeDate":"2013-08-02T06:00:03.000Z",
                   "changedBy":"SubscriptionBaseTransition",
                   "userToken":"7e39f68b-c695-4d38-822b-5e4ad230f130"
                }
             ]
          }
       ],
       "payments":[]
    }
    
    {'account': {'account_balance': None,
                 'account_cba': None,
                 'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                 'address1': None,
                 'address2': None,
                 'audit_logs': [],
                 'bill_cycle_day_local': 3,
                 'city': None,
                 'company': None,
                 'country': 'USA',
                 'currency': 'USD',
                 'email': None,
                 'external_key': 'hmwgix',
                 'first_name_length': None,
                 'is_migrated': False,
                 'is_notified_for_invoices': True,
                 'is_payment_delegated_to_parent': False,
                 'locale': None,
                 'name': 'John',
                 'notes': None,
                 'parent_account_id': None,
                 'payment_method_id': None,
                 'phone': None,
                 'postal_code': None,
                 'reference_time': datetime.datetime(2018, 5, 4, 19, 28, 56, tzinfo=tzutc()),
                 'state': 'CA',
                 'time_zone': 'UTC'},
     'bundles': [{'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                  'audit_logs': [],
                  'bundle_id': 'b769c9ec-0a13-4a8a-b686-c5bf1e56c158',
                  'external_key': 'b769c9ec-0a13-4a8a-b686-c5bf1e56c158',
                  'subscriptions': [{'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                                     'audit_logs': [],
                                     'bill_cycle_day_local': 3,
                                     'billing_end_date': datetime.date(2018, 5, 4),
                                     'billing_period': 'MONTHLY',
                                     'billing_start_date': datetime.date(2018, 5, 4),
                                     'bundle_id': 'b769c9ec-0a13-4a8a-b686-c5bf1e56c158',
                                     'cancelled_date': datetime.date(2018, 5, 4),
                                     'charged_through_date': datetime.date(2018, 5, 4),
                                     'events': [{'audit_logs': [],
                                                 'billing_period': 'MONTHLY',
                                                 'effective_date': datetime.date(2018, 5, 4),
                                                 'event_id': 'e2ba3b83-d04a-4128-8dea-b71d0c2a5630',
                                                 'event_type': 'START_ENTITLEMENT',
                                                 'is_blocked_billing': False,
                                                 'is_blocked_entitlement': False,
                                                 'phase': 'standard-monthly-trial',
                                                 'plan': 'standard-monthly',
                                                 'price_list': 'DEFAULT',
                                                 'product': 'Standard',
                                                 'service_name': 'entitlement-service',
                                                 'service_state_name': 'ENT_STARTED'},
                                                {'audit_logs': [],
                                                 'billing_period': 'MONTHLY',
                                                 'effective_date': datetime.date(2018, 5, 4),
                                                 'event_id': 'b6f9c977-a34d-4399-bd7b-c53a16aa56b2',
                                                 'event_type': 'START_BILLING',
                                                 'is_blocked_billing': False,
                                                 'is_blocked_entitlement': False,
                                                 'phase': 'standard-monthly-trial',
                                                 'plan': 'standard-monthly',
                                                 'price_list': 'DEFAULT',
                                                 'product': 'Standard',
                                                 'service_name': 'billing-service',
                                                 'service_state_name': 'START_BILLING'},
                                                {'audit_logs': [],
                                                 'billing_period': 'MONTHLY',
                                                 'effective_date': datetime.date(2018, 5, 4),
                                                 'event_id': 'a870def0-b47f-4513-a8fb-585df3b6b4b8',
                                                 'event_type': 'CHANGE',
                                                 'is_blocked_billing': False,
                                                 'is_blocked_entitlement': False,
                                                 'phase': 'super-monthly-trial',
                                                 'plan': 'super-monthly',
                                                 'price_list': 'DEFAULT',
                                                 'product': 'Super',
                                                 'service_name': 'entitlement+billing-service',
                                                 'service_state_name': 'CHANGE'},
                                                {'audit_logs': [],
                                                 'billing_period': 'MONTHLY',
                                                 'effective_date': datetime.date(2018, 5, 4),
                                                 'event_id': '96a74b51-7d51-4ec7-9386-63a07d007281',
                                                 'event_type': 'STOP_ENTITLEMENT',
                                                 'is_blocked_billing': False,
                                                 'is_blocked_entitlement': True,
                                                 'phase': 'super-monthly-trial',
                                                 'plan': 'super-monthly',
                                                 'price_list': 'DEFAULT',
                                                 'product': 'Super',
                                                 'service_name': 'entitlement-service',
                                                 'service_state_name': 'ENT_CANCELLED'},
                                                {'audit_logs': [],
                                                 'billing_period': 'MONTHLY',
                                                 'effective_date': datetime.date(2018, 5, 4),
                                                 'event_id': '068821fe-165c-4f67-95c1-3f14e872a27c',
                                                 'event_type': 'STOP_BILLING',
                                                 'is_blocked_billing': False,
                                                 'is_blocked_entitlement': False,
                                                 'phase': 'super-monthly-trial',
                                                 'plan': 'super-monthly',
                                                 'price_list': 'DEFAULT',
                                                 'product': 'Super',
                                                 'service_name': 'billing-service',
                                                 'service_state_name': 'STOP_BILLING'}],
                                     'external_key': 'b769c9ec-0a13-4a8a-b686-c5bf1e56c158',
                                     'phase_type': 'TRIAL',
                                     'plan_name': 'super-monthly',
                                     'price_list': 'DEFAULT',
                                     'price_overrides': [{'fixed_price': 0.0,
                                                          'phase_name': 'standard-monthly-trial',
                                                          'phase_type': 'TRIAL',
                                                          'plan_name': 'standard-monthly',
                                                          'recurring_price': None,
                                                          'usage_price_overrides': []},
                                                         {'fixed_price': 0.0,
                                                          'phase_name': 'super-monthly-trial',
                                                          'phase_type': 'TRIAL',
                                                          'plan_name': 'super-monthly',
                                                          'recurring_price': None,
                                                          'usage_price_overrides': []}],
                                     'product_category': 'BASE',
                                     'product_name': 'Super',
                                     'source_type': 'NATIVE',
                                     'start_date': datetime.date(2018, 5, 4),
                                     'state': 'CANCELLED',
                                     'subscription_id': 'dfd4af5d-a72e-420e-9e0a-ce600d108b3f'}],
                  'timeline': {'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                               'audit_logs': [],
                               'bundle_id': 'b769c9ec-0a13-4a8a-b686-c5bf1e56c158',
                               'events': [{'audit_logs': [],
                                           'billing_period': 'MONTHLY',
                                           'effective_date': datetime.date(2018, 5, 4),
                                           'event_id': 'e2ba3b83-d04a-4128-8dea-b71d0c2a5630',
                                           'event_type': 'START_ENTITLEMENT',
                                           'is_blocked_billing': False,
                                           'is_blocked_entitlement': False,
                                           'phase': 'standard-monthly-trial',
                                           'plan': 'standard-monthly',
                                           'price_list': 'DEFAULT',
                                           'product': 'Standard',
                                           'service_name': 'entitlement-service',
                                           'service_state_name': 'ENT_STARTED'},
                                          {'audit_logs': [],
                                           'billing_period': 'MONTHLY',
                                           'effective_date': datetime.date(2018, 5, 4),
                                           'event_id': 'b6f9c977-a34d-4399-bd7b-c53a16aa56b2',
                                           'event_type': 'START_BILLING',
                                           'is_blocked_billing': False,
                                           'is_blocked_entitlement': False,
                                           'phase': 'standard-monthly-trial',
                                           'plan': 'standard-monthly',
                                           'price_list': 'DEFAULT',
                                           'product': 'Standard',
                                           'service_name': 'billing-service',
                                           'service_state_name': 'START_BILLING'},
                                          {'audit_logs': [],
                                           'billing_period': 'MONTHLY',
                                           'effective_date': datetime.date(2018, 5, 4),
                                           'event_id': 'a870def0-b47f-4513-a8fb-585df3b6b4b8',
                                           'event_type': 'CHANGE',
                                           'is_blocked_billing': False,
                                           'is_blocked_entitlement': False,
                                           'phase': 'super-monthly-trial',
                                           'plan': 'super-monthly',
                                           'price_list': 'DEFAULT',
                                           'product': 'Super',
                                           'service_name': 'entitlement+billing-service',
                                           'service_state_name': 'CHANGE'},
                                          {'audit_logs': [],
                                           'billing_period': 'MONTHLY',
                                           'effective_date': datetime.date(2018, 5, 4),
                                           'event_id': '96a74b51-7d51-4ec7-9386-63a07d007281',
                                           'event_type': 'STOP_ENTITLEMENT',
                                           'is_blocked_billing': False,
                                           'is_blocked_entitlement': True,
                                           'phase': 'super-monthly-trial',
                                           'plan': 'super-monthly',
                                           'price_list': 'DEFAULT',
                                           'product': 'Super',
                                           'service_name': 'entitlement-service',
                                           'service_state_name': 'ENT_CANCELLED'},
                                          {'audit_logs': [],
                                           'billing_period': 'MONTHLY',
                                           'effective_date': datetime.date(2018, 5, 4),
                                           'event_id': '068821fe-165c-4f67-95c1-3f14e872a27c',
                                           'event_type': 'STOP_BILLING',
                                           'is_blocked_billing': False,
                                           'is_blocked_entitlement': False,
                                           'phase': 'super-monthly-trial',
                                           'plan': 'super-monthly',
                                           'price_list': 'DEFAULT',
                                           'product': 'Super',
                                           'service_name': 'billing-service',
                                           'service_state_name': 'STOP_BILLING'}],
                               'external_key': 'b769c9ec-0a13-4a8a-b686-c5bf1e56c158'}},
                 {'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                  'audit_logs': [],
                  'bundle_id': 'c3fbb8a6-f297-41e5-8aa5-8098256b624a',
                  'external_key': 'c3fbb8a6-f297-41e5-8aa5-8098256b624a',
                  'subscriptions': [{'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                                     'audit_logs': [],
                                     'bill_cycle_day_local': 3,
                                     'billing_end_date': None,
                                     'billing_period': 'MONTHLY',
                                     'billing_start_date': datetime.date(2018, 5, 4),
                                     'bundle_id': 'c3fbb8a6-f297-41e5-8aa5-8098256b624a',
                                     'cancelled_date': None,
                                     'charged_through_date': datetime.date(2018, 5, 4),
                                     'events': [{'audit_logs': [],
                                                 'billing_period': 'MONTHLY',
                                                 'effective_date': datetime.date(2018, 5, 4),
                                                 'event_id': '4d4bde32-7bb9-448d-8066-aa67dea56658',
                                                 'event_type': 'START_ENTITLEMENT',
                                                 'is_blocked_billing': False,
                                                 'is_blocked_entitlement': False,
                                                 'phase': 'standard-monthly-trial',
                                                 'plan': 'standard-monthly',
                                                 'price_list': 'DEFAULT',
                                                 'product': 'Standard',
                                                 'service_name': 'entitlement-service',
                                                 'service_state_name': 'ENT_STARTED'},
                                                {'audit_logs': [],
                                                 'billing_period': 'MONTHLY',
                                                 'effective_date': datetime.date(2018, 5, 4),
                                                 'event_id': '4d8f7354-f4f7-43c5-bfae-353b6b8c2a0c',
                                                 'event_type': 'START_BILLING',
                                                 'is_blocked_billing': False,
                                                 'is_blocked_entitlement': False,
                                                 'phase': 'standard-monthly-trial',
                                                 'plan': 'standard-monthly',
                                                 'price_list': 'DEFAULT',
                                                 'product': 'Standard',
                                                 'service_name': 'billing-service',
                                                 'service_state_name': 'START_BILLING'},
                                                {'audit_logs': [],
                                                 'billing_period': 'MONTHLY',
                                                 'effective_date': datetime.date(2018, 6, 3),
                                                 'event_id': '7d22b380-8796-420c-b0c2-3f7b71b7a171',
                                                 'event_type': 'PHASE',
                                                 'is_blocked_billing': False,
                                                 'is_blocked_entitlement': False,
                                                 'phase': 'standard-monthly-evergreen',
                                                 'plan': 'standard-monthly',
                                                 'price_list': 'DEFAULT',
                                                 'product': 'Standard',
                                                 'service_name': 'entitlement+billing-service',
                                                 'service_state_name': 'PHASE'}],
                                     'external_key': 'c3fbb8a6-f297-41e5-8aa5-8098256b624a',
                                     'phase_type': 'TRIAL',
                                     'plan_name': 'standard-monthly',
                                     'price_list': 'DEFAULT',
                                     'price_overrides': [{'fixed_price': 0.0,
                                                          'phase_name': 'standard-monthly-trial',
                                                          'phase_type': 'TRIAL',
                                                          'plan_name': 'standard-monthly',
                                                          'recurring_price': None,
                                                          'usage_price_overrides': []},
                                                         {'fixed_price': None,
                                                          'phase_name': 'standard-monthly-evergreen',
                                                          'phase_type': 'EVERGREEN',
                                                          'plan_name': 'standard-monthly',
                                                          'recurring_price': 100.0,
                                                          'usage_price_overrides': []}],
                                     'product_category': 'BASE',
                                     'product_name': 'Standard',
                                     'source_type': 'NATIVE',
                                     'start_date': datetime.date(2018, 5, 4),
                                     'state': 'ACTIVE',
                                     'subscription_id': '1a1f9e33-7720-4655-a74e-0ecf0a8f231e'}],
                  'timeline': {'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                               'audit_logs': [],
                               'bundle_id': 'c3fbb8a6-f297-41e5-8aa5-8098256b624a',
                               'events': [{'audit_logs': [],
                                           'billing_period': 'MONTHLY',
                                           'effective_date': datetime.date(2018, 5, 4),
                                           'event_id': '4d4bde32-7bb9-448d-8066-aa67dea56658',
                                           'event_type': 'START_ENTITLEMENT',
                                           'is_blocked_billing': False,
                                           'is_blocked_entitlement': False,
                                           'phase': 'standard-monthly-trial',
                                           'plan': 'standard-monthly',
                                           'price_list': 'DEFAULT',
                                           'product': 'Standard',
                                           'service_name': 'entitlement-service',
                                           'service_state_name': 'ENT_STARTED'},
                                          {'audit_logs': [],
                                           'billing_period': 'MONTHLY',
                                           'effective_date': datetime.date(2018, 5, 4),
                                           'event_id': '4d8f7354-f4f7-43c5-bfae-353b6b8c2a0c',
                                           'event_type': 'START_BILLING',
                                           'is_blocked_billing': False,
                                           'is_blocked_entitlement': False,
                                           'phase': 'standard-monthly-trial',
                                           'plan': 'standard-monthly',
                                           'price_list': 'DEFAULT',
                                           'product': 'Standard',
                                           'service_name': 'billing-service',
                                           'service_state_name': 'START_BILLING'},
                                          {'audit_logs': [],
                                           'billing_period': 'MONTHLY',
                                           'effective_date': datetime.date(2018, 6, 3),
                                           'event_id': '7d22b380-8796-420c-b0c2-3f7b71b7a171',
                                           'event_type': 'PHASE',
                                           'is_blocked_billing': False,
                                           'is_blocked_entitlement': False,
                                           'phase': 'standard-monthly-evergreen',
                                           'plan': 'standard-monthly',
                                           'price_list': 'DEFAULT',
                                           'product': 'Standard',
                                           'service_name': 'entitlement+billing-service',
                                           'service_state_name': 'PHASE'}],
                               'external_key': 'c3fbb8a6-f297-41e5-8aa5-8098256b624a'}}],
     'invoices': [{'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                   'amount': 0.0,
                   'audit_logs': [],
                   'balance': 0.0,
                   'bundle_keys': 'c3fbb8a6-f297-41e5-8aa5-8098256b624a,b769c9ec-0a13-4a8a-b686-c5bf1e56c158',
                   'credit_adj': 0.0,
                   'credits': [],
                   'currency': 'USD',
                   'invoice_date': datetime.date(2018, 5, 4),
                   'invoice_id': '0c047109-6fba-4910-af8d-a200abbba5fb',
                   'invoice_number': '798',
                   'is_parent_invoice': False,
                   'items': None,
                   'parent_account_id': None,
                   'parent_invoice_id': None,
                   'refund_adj': 0.0,
                   'status': 'COMMITTED',
                   'target_date': datetime.date(2018, 5, 4)},
                  {'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                   'amount': 0.0,
                   'audit_logs': [],
                   'balance': 0.0,
                   'bundle_keys': 'b769c9ec-0a13-4a8a-b686-c5bf1e56c158',
                   'credit_adj': 0.0,
                   'credits': [],
                   'currency': 'USD',
                   'invoice_date': datetime.date(2018, 5, 4),
                   'invoice_id': 'fa2f6484-530c-4209-884e-d09af0766663',
                   'invoice_number': '799',
                   'is_parent_invoice': False,
                   'items': None,
                   'parent_account_id': None,
                   'parent_invoice_id': None,
                   'refund_adj': 0.0,
                   'status': 'COMMITTED',
                   'target_date': datetime.date(2018, 5, 4)},
                  {'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                   'amount': 50.0,
                   'audit_logs': [],
                   'balance': 0.0,
                   'bundle_keys': '',
                   'credit_adj': 0.0,
                   'credits': [],
                   'currency': 'USD',
                   'invoice_date': datetime.date(2018, 5, 4),
                   'invoice_id': 'f12c98c1-782b-4d1a-bfb0-2e1233cf8cd7',
                   'invoice_number': '800',
                   'is_parent_invoice': False,
                   'items': None,
                   'parent_account_id': None,
                   'parent_invoice_id': None,
                   'refund_adj': 0.0,
                   'status': 'COMMITTED',
                   'target_date': datetime.date(2018, 5, 4)}],
     'payments': [{'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                   'audit_logs': [],
                   'auth_amount': 0.0,
                   'captured_amount': 0.0,
                   'credited_amount': 0.0,
                   'currency': 'USD',
                   'payment_attempts': None,
                   'payment_external_key': 'e9733c81-5d64-4d61-add2-90cb141ddf9d',
                   'payment_id': 'e9733c81-5d64-4d61-add2-90cb141ddf9d',
                   'payment_method_id': '53b35b7b-e254-4c4b-b526-202c51a6e650',
                   'payment_number': '309',
                   'purchased_amount': 50.0,
                   'refunded_amount': 0.0,
                   'target_invoice_id': 'f12c98c1-782b-4d1a-bfb0-2e1233cf8cd7',
                   'transactions': [{'amount': 50.0,
                                     'audit_logs': [],
                                     'currency': 'USD',
                                     'effective_date': datetime.datetime(2018, 5, 4, 19, 29, 5, tzinfo=tzutc()),
                                     'first_payment_reference_id': None,
                                     'gateway_error_code': None,
                                     'gateway_error_msg': None,
                                     'payment_external_key': 'e9733c81-5d64-4d61-add2-90cb141ddf9d',
                                     'payment_id': 'e9733c81-5d64-4d61-add2-90cb141ddf9d',
                                     'processed_amount': 50.0,
                                     'processed_currency': 'USD',
                                     'properties': None,
                                     'second_payment_reference_id': None,
                                     'status': 'SUCCESS',
                                     'transaction_external_key': '74a7f569-8f0f-48c9-a927-a56e5c96f95b',
                                     'transaction_id': '74a7f569-8f0f-48c9-a927-a56e5c96f95b',
                                     'transaction_type': 'PURCHASE'}]},
                  {'account_id': '43488882-1777-460c-bc32-e375e67d09cf',
                   'audit_logs': [],
                   'auth_amount': 50.0,
                   'captured_amount': 0.0,
                   'credited_amount': 0.0,
                   'currency': 'USD',
                   'payment_attempts': None,
                   'payment_external_key': 'f2c8e79f-49cc-4893-98a5-38da61564949',
                   'payment_id': 'f2c8e79f-49cc-4893-98a5-38da61564949',
                   'payment_method_id': '53b35b7b-e254-4c4b-b526-202c51a6e650',
                   'payment_number': '310',
                   'purchased_amount': 0.0,
                   'refunded_amount': 0.0,
                   'target_invoice_id': None,
                   'transactions': [{'amount': 50.0,
                                     'audit_logs': [],
                                     'currency': 'USD',
                                     'effective_date': datetime.datetime(2018, 5, 4, 19, 29, 5, tzinfo=tzutc()),
                                     'first_payment_reference_id': None,
                                     'gateway_error_code': None,
                                     'gateway_error_msg': None,
                                     'payment_external_key': 'f2c8e79f-49cc-4893-98a5-38da61564949',
                                     'payment_id': 'f2c8e79f-49cc-4893-98a5-38da61564949',
                                     'processed_amount': 50.0,
                                     'processed_currency': 'USD',
                                     'properties': None,
                                     'second_payment_reference_id': None,
                                     'status': 'SUCCESS',
                                     'transaction_external_key': '0b50c1a2-99df-48df-bd6b-38e30261c233',
                                     'transaction_id': '0b50c1a2-99df-48df-bd6b-38e30261c233',
                                     'transaction_type': 'AUTHORIZE'}]}]}
    

    Query Parameters

    Name Type Required Description
    audit enum false level of audit logs returned
    parallel boolean false parallel

    Returns

    Returns a list of account tag objects.

    Transfer a given child credit to the parent level

    HTTP Request

    PUT http://example.com/1.0/kb/accounts/{childAccountId}/transferCredit

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    UUID childAccountId = UUID.fromString("e659f0f3-745c-46d5-953c-28fe9282fc7d");
    
    accountApi.transferChildCreditToParent(childAccountId, requestOptions);
    
    account.transfer_child_credit(user,
                                  reason,
                                  comment,
                                  options)
    
    accountApi = killbill.api.AccountApi()
    child_account_id = '88a5987a-1e1c-47c5-ba95-34ef14db3d46'
    
    accountApi.transfer_child_credit_to_parent(child_account_id,
                                               created_by, 
                                               api_key, 
                                               api_secret)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    None.

    Returns

    A 204 http status without content.

    List accounts

    HTTP Request

    GET http://example.com/1.0/kb/accounts/pagination

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    Long offset = 0L;
    Long limit = 1L;
    Boolean accountWithBalance = false; // Will not include account balance
    Boolean accountWithBalanceAndCBA = false; // Will not include account balance and CBA info
    
    Accounts allAccounts = accountApi.getAccounts(offset,
                                                  limit,
                                                  accountWithBalance,
                                                  accountWithBalanceAndCBA,
                                                  AuditLevel.NONE,
                                                  requestOptions);
    
    offset = 0
    limit = 100
    with_balance = false
    with_balance_and_cba = false
    
    account.find_in_batches(offset,
                            limit,
                            with_balance,
                            with_balance_and_cba,
                            options)
    
    accountApi = killbill.api.AccountApi()
    
    accountApi.get_accounts(api_key, api_secret)
    

    Example Response:

    //First element of the list
    class Account {
        org.killbill.billing.client.model.gen.Account@f0247489
        accountId: 80e54c79-ca2b-4c82-920b-07822683e605
        name: 34bd86b6-ebc8-49ea-9a6e-6bbbd61ac745
        firstNameLength: 4
        externalKey: 23338712-3409-4ad3-8c6d-1c95241efef6
        email: f1a3a@44a80
        billCycleDayLocal: 0
        currency: USD
        parentAccountId: null
        isPaymentDelegatedToParent: false
        paymentMethodId: null
        referenceTime: 2012-08-25T00:00:01.000Z
        timeZone: UTC
        address1: 12 rue des ecoles
        address2: Poitier
        postalCode: 44 567
        company: Renault
        city: Quelque part
        state: Poitou
        country: France
        locale: fr
        phone: 81 53 26 56
        notes: notes
        isMigrated: false
        accountBalance: null
        accountCBA: null
        auditLogs: []
    }
    
    [
       {
          "accountId":"e19c6ab3-1a21-42f2-8ea2-9859c082b093",
          "name":"John Doe",
          "externalKey":"1522172592-516014",
          "email":"John@example.com",
          "billCycleDayLocal":0,
          "currency":"USD",
          "parentAccountId":"01ab962b-3c66-4b17-b391-ffcc9fe51884",
          "isPaymentDelegatedToParent":true,
          "timeZone":"UTC",
          "address1":"7, yoyo road",
          "address2":"Apt 5",
          "postalCode":"94105",
          "company":"Unemployed",
          "city":"San Francisco",
          "state":"California",
          "country":"US",
          "locale":"fr_FR",
          "auditLogs":[]
       }
    ]
    
    [{'account_balance': None,
     'account_cba': None,
     'account_id': '224a9677-735b-4902-a4a4-bf77469a0846',
     'address1': None,
     'address2': None,
     'audit_logs': [],
     'bill_cycle_day_local': 0,
     'city': None,
     'company': None,
     'country': 'USA',
     'currency': 'USD',
     'email': None,
     'external_key': 'fxelpb',
     'first_name_length': None,
     'is_migrated': False,
     'is_notified_for_invoices': False,
     'is_payment_delegated_to_parent': False,
     'locale': None,
     'name': 'John-0',
     'notes': None,
     'parent_account_id': None,
     'payment_method_id': None,
     'phone': None,
     'postal_code': None,
     'reference_time': datetime.datetime(2018, 5, 4, 19, 40, 35, tzinfo=tzutc()),
     'state': 'CA',
     'time_zone': 'UTC'}, {'account_balance': None,
     'account_cba': None,
     'account_id': '465f0295-e27e-4341-9eb7-072465e32ee5',
     'address1': None,
     'address2': None,
     'audit_logs': [],
     'bill_cycle_day_local': 0,
     'city': None,
     'company': None,
     'country': 'USA',
     'currency': 'USD',
     'email': None,
     'external_key': 'cpkwdl',
     'first_name_length': None,
     'is_migrated': False,
     'is_notified_for_invoices': False,
     'is_payment_delegated_to_parent': False,
     'locale': None,
     'name': 'John-1',
     'notes': None,
     'parent_account_id': None,
     'payment_method_id': None,
     'phone': None,
     'postal_code': None,
     'reference_time': datetime.datetime(2018, 5, 4, 19, 40, 36, tzinfo=tzutc()),
     'state': 'CA',
     'time_zone': 'UTC'}]
    

    Query Parameters

    Name Type Required Description
    offset long true offset
    limit long true limit search items
    accountWithBalance boolean false if true, returns accountBalance info
    accountWithBalanceAndCBA boolean false if true, returns accountBalance and accountCBA info

    Returns

    Returns a list with all accounts.

    Search accounts

    HTTP Request

    GET http://example.com/1.0/kb/accounts/search/{searchKey}

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.AccountApi;
    protected AccountApi accountApi;
    
    String searchKey = "John-1"
    Long offset = 0L;
    Long limit = 1L;
    Boolean accountWithBalance = false; // Will not include account balance
    Boolean accountWithBalanceAndCBA = false; // Will not include account balance and CBA info
    
    List<Account> accountsByKey = accountApi.searchAccounts(searchKey, 
                                                            offset,
                                                            limit,
                                                            accountWithBalance,
                                                            accountWithBalanceAndCBA,
                                                            requestOptions);
    
    search_key = 'example'
    offset = 0
    limit = 100
    with_balance = false
    with_balance_and_cba = false
    
    account.find_in_batches_by_search_key(search_key,
                                          offset,
                                          limit,
                                          with_balance,
                                          with_balance_and_cba,
                                          options)
    
    accountApi = killbill.api.AccountApi()
    search_key = 'John-1'
    
    accountApi.search_accounts(search_key, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class Account {
        org.killbill.billing.client.model.gen.Account@24e22684
        accountId: 80a454f3-182f-4621-812e-533d23e54cb9
        name: John-1
        firstNameLength: 4
        externalKey: 94a664a3-eea5-43fb-8788-9d3129a2c95c
        email: 33b2e@cc77b
        billCycleDayLocal: 0
        currency: USD
        parentAccountId: null
        isPaymentDelegatedToParent: false
        paymentMethodId: null
        referenceTime: 2012-08-25T00:00:02.000Z
        timeZone: UTC
        address1: 12 rue des ecoles
        address2: Poitier
        postalCode: 44 567
        company: Renault
        city: Quelque part
        state: Poitou
        country: France
        locale: fr
        phone: 81 53 26 56
        notes: notes
        isMigrated: false
        accountBalance: null
        accountCBA: null
        auditLogs: []
    }
    
    [
       {
          "accountId":"e19c6ab3-1a21-42f2-8ea2-9859c082b093",
          "name":"John Doe",
          "externalKey":"1522172592-516014",
          "email":"John@example.com",
          "billCycleDayLocal":0,
          "currency":"USD",
          "parentAccountId":"01ab962b-3c66-4b17-b391-ffcc9fe51884",
          "isPaymentDelegatedToParent":true,
          "timeZone":"UTC",
          "address1":"7, yoyo road",
          "address2":"Apt 5",
          "postalCode":"94105",
          "company":"Unemployed",
          "city":"San Francisco",
          "state":"California",
          "country":"US",
          "locale":"fr_FR",
          "auditLogs":[]
       }
    ]
    
    [{'account_balance': None,
     'account_cba': None,
     'account_id': 'c41bf53b-c6a8-48de-8012-b755e51d5d3e',
     'address1': None,
     'address2': None,
     'audit_logs': [],
     'bill_cycle_day_local': 0,
     'city': None,
     'company': None,
     'country': 'USA',
     'currency': 'USD',
     'email': None,
     'external_key': 'njisdn',
     'first_name_length': None,
     'is_migrated': False,
     'is_notified_for_invoices': False,
     'is_payment_delegated_to_parent': False,
     'locale': None,
     'name': 'John-1',
     'notes': None,
     'parent_account_id': None,
     'payment_method_id': None,
     'phone': None,
     'postal_code': None,
     'reference_time': datetime.datetime(2018, 5, 4, 19, 44, 24, tzinfo=tzutc()),
     'state': 'CA',
     'time_zone': 'UTC'}]
    

    Query Parameters

    Name Type Required Description
    searchKey string true What you want to find?
    offset long true offset
    limit long true limit search items
    accountWithBalance boolean false if true, returns accountBalance info
    accountWithBalanceAndCBA boolean false if true, returns accountBalance and accountCBA info

    Returns

    Return a list with accounts matched with the search key entered.

    Bundle

    Bundle Resource

    The Bundle resource represents a collection of subscriptions. Grouping certain subscriptions into a bundle is mostly useful to ensure that certain operations propagate to the group. A common example is upon cancellation, to ensure that when cancelling a BASE subscription, any ADD_ON subscriptions in the same bundle also end up being cancelled automatically. The Bundle is automatically created by the system when creating the intial subscription and in order to add additional subscriptions in the same bundle one must specify the bundleId previously created.

    The attributes are the following:

    Retrieve a bundle by external key

    HTTP Request

    Retrieves the details information for the Bundle using its externalKey.

    GET http://example.com/1.0/kb/bundles

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    String externalKey = "93199";
    Boolean includedDeleted = false; // Will not include deleted bundles
    
    Bundles bundles = bundleApi.getBundleByKey(externalKey, 
                                               includedDeleted,
                                               AuditLevel.NONE,
                                               requestOptions);
    
    external_key = '4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135'
    included_deleted = false
    
    bundle = KillBillClient::Model::Bundle.new
    bundle.find_by_external_key(external_key, 
                                included_deleted, 
                                options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_external_key = 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691'
    
    bundleApi.get_bundle_by_key(bundle_external_key, api_key, api_secret)
    

    Example Response:

    class Bundle {
        org.killbill.billing.client.model.gen.Bundle@2b6e1c9d
        accountId: a7c0b70d-fbc3-43cf-98e7-0af57c1a93fb
        bundleId: 4a2fcd90-7c8c-4877-93f9-9e99e8cd6953
        externalKey: 93199
        subscriptions: [class Subscription {
            org.killbill.billing.client.model.gen.Subscription@22dc8662
            accountId: a7c0b70d-fbc3-43cf-98e7-0af57c1a93fb
            bundleId: 4a2fcd90-7c8c-4877-93f9-9e99e8cd6953
            subscriptionId: 9a55b6f3-ada7-4a78-915f-373af56cbb00
            externalKey: 93199
            startDate: 2012-04-25
            productName: Shotgun
            productCategory: BASE
            billingPeriod: MONTHLY
            phaseType: TRIAL
            priceList: DEFAULT
            planName: shotgun-monthly
            state: ACTIVE
            sourceType: NATIVE
            cancelledDate: null
            chargedThroughDate: 2012-04-25
            billingStartDate: 2012-04-25
            billingEndDate: null
            billCycleDayLocal: 25
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@ebe2ab4a
                eventId: 37b7e919-08ba-4c7d-a902-8d7a10b47157
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@9e770028
                eventId: 2a994af7-8faf-444f-a1df-fd6c68a9dbab
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@54e085c2
                eventId: 95ddcc14-ea6d-4a5c-b057-3a0d33341ab9
                billingPeriod: MONTHLY
                effectiveDate: 2012-05-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: PHASE
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement+billing-service
                serviceStateName: PHASE
                phase: shotgun-monthly-evergreen
                auditLogs: []
            }]
            priceOverrides: [class PhasePriceOverride {
                planName: shotgun-monthly
                phaseName: shotgun-monthly-trial
                phaseType: TRIAL
                fixedPrice: 0
                recurringPrice: null
                usagePriceOverrides: []
            }, class PhasePriceOverride {
                planName: shotgun-monthly
                phaseName: shotgun-monthly-evergreen
                phaseType: EVERGREEN
                fixedPrice: null
                recurringPrice: 249.95
                usagePriceOverrides: []
            }]
            auditLogs: []
        }]
        timeline: class BundleTimeline {
            org.killbill.billing.client.model.gen.BundleTimeline@7ea930a8
            accountId: a7c0b70d-fbc3-43cf-98e7-0af57c1a93fb
            bundleId: 4a2fcd90-7c8c-4877-93f9-9e99e8cd6953
            externalKey: 93199
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@89e50f83
                eventId: 37b7e919-08ba-4c7d-a902-8d7a10b47157
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@cb989fa0
                eventId: 2a994af7-8faf-444f-a1df-fd6c68a9dbab
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@5fe74ae5
                eventId: 95ddcc14-ea6d-4a5c-b057-3a0d33341ab9
                billingPeriod: MONTHLY
                effectiveDate: 2012-05-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: PHASE
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement+billing-service
                serviceStateName: PHASE
                phase: shotgun-monthly-evergreen
                auditLogs: []
            }]
            auditLogs: []
        }
        auditLogs: []
    }
    
    {
       "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
       "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
       "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
       "subscriptions":[
          {
             "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
             "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
             "subscriptionId":"e29573cc-d0e6-4d26-b97e-1a9c02d520ad",
             "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
             "startDate":"2013-08-01",
             "productName":"Sports",
             "productCategory":"BASE",
             "billingPeriod":"MONTHLY",
             "phaseType":"TRIAL",
             "priceList":"DEFAULT",
             "planName":"sports-monthly",
             "state":"ACTIVE",
             "sourceType":"NATIVE",
             "chargedThroughDate":"2013-08-01",
             "billingStartDate":"2013-08-01",
             "billCycleDayLocal":31,
             "events":[
                {
                   "eventId":"e0136144-a852-4eaa-b721-c8b585dcb4a6",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"sports-monthly",
                   "product":"Sports",
                   "priceList":"DEFAULT",
                   "eventType":"START_ENTITLEMENT",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement-service",
                   "serviceStateName":"ENT_STARTED",
                   "phase":"sports-monthly-trial",
                   "auditLogs":[]
                },
                {
                   "eventId":"72a51773-9e1d-4ad7-beeb-03139f60ea3d",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"sports-monthly",
                   "product":"Sports",
                   "priceList":"DEFAULT",
                   "eventType":"START_BILLING",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"billing-service",
                   "serviceStateName":"START_BILLING",
                   "phase":"sports-monthly-trial",
                   "auditLogs":[]
                },
                {
                   "eventId":"341992e2-4565-4457-9d20-d2803d11aa61",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-31",
                   "plan":"sports-monthly",
                   "product":"Sports",
                   "priceList":"DEFAULT",
                   "eventType":"PHASE",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement+billing-service",
                   "serviceStateName":"PHASE",
                   "phase":"sports-monthly-evergreen",
                   "auditLogs":[]
                }
             ],
             "priceOverrides":[
                {
                   "planName":"sports-monthly",
                   "phaseName":"sports-monthly-trial",
                   "phaseType":"TRIAL",
                   "fixedPrice":0
                },
                {
                   "planName":"sports-monthly",
                   "phaseName":"sports-monthly-evergreen",
                   "phaseType":"EVERGREEN",
                   "recurringPrice":500.0
                }
             ],
             "auditLogs":[]
          }
       ],
       "timeline":{
          "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
          "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
          "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
          "events":[
             {
                "eventId":"e0136144-a852-4eaa-b721-c8b585dcb4a6",
                "billingPeriod":"MONTHLY",
                "effectiveDate":"2013-08-01",
                "plan":"sports-monthly",
                "product":"Sports",
                "priceList":"DEFAULT",
                "eventType":"START_ENTITLEMENT",
                "isBlockedBilling":false,
                "isBlockedEntitlement":false,
                "serviceName":"entitlement-service",
                "serviceStateName":"ENT_STARTED",
                "phase":"sports-monthly-trial",
                "auditLogs":[]
             },
             {
                "eventId":"72a51773-9e1d-4ad7-beeb-03139f60ea3d",
                "billingPeriod":"MONTHLY",
                "effectiveDate":"2013-08-01",
                "plan":"sports-monthly",
                "product":"Sports",
                "priceList":"DEFAULT",
                "eventType":"START_BILLING",
                "isBlockedBilling":false,
                "isBlockedEntitlement":false,
                "serviceName":"billing-service",
                "serviceStateName":"START_BILLING",
                "phase":"sports-monthly-trial",
                "auditLogs":[]
             },
             {
                "eventId":"341992e2-4565-4457-9d20-d2803d11aa61",
                "billingPeriod":"MONTHLY",
                "effectiveDate":"2013-08-31",
                "plan":"sports-monthly",
                "product":"Sports",
                "priceList":"DEFAULT",
                "eventType":"PHASE",
                "isBlockedBilling":false,
                "isBlockedEntitlement":false,
                "serviceName":"entitlement+billing-service",
                "serviceStateName":"PHASE",
                "phase":"sports-monthly-evergreen",
                "auditLogs":[]
             }
          ],
          "auditLogs":[]
       },
       "auditLogs":[]
    }
    
    {'account_id': '8ef95bea-9306-4b26-a43c-090de8779599',
     'audit_logs': [],
     'bundle_id': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691',
     'external_key': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691',
     'subscriptions': [{'account_id': '8ef95bea-9306-4b26-a43c-090de8779599',
                        'audit_logs': [],
                        'bill_cycle_day_local': 6,
                        'billing_end_date': None,
                        'billing_period': 'MONTHLY',
                        'billing_start_date': datetime.date(2018, 5, 7),
                        'bundle_id': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691',
                        'cancelled_date': None,
                        'charged_through_date': None,
                        'events': [{'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 5, 7),
                                    'event_id': '80ca6915-0293-4b1d-8bc6-b3c9fe1bee03',
                                    'event_type': 'START_ENTITLEMENT',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-trial',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'entitlement-service',
                                    'service_state_name': 'ENT_STARTED'},
                                   {'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 5, 7),
                                    'event_id': 'ce26b570-0a9f-463e-b65c-96a9fd67f124',
                                    'event_type': 'START_BILLING',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-trial',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'billing-service',
                                    'service_state_name': 'START_BILLING'},
                                   {'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 6, 6),
                                    'event_id': 'c7af9fa3-5465-4e69-8a84-6977c711921c',
                                    'event_type': 'PHASE',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-evergreen',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'entitlement+billing-service',
                                    'service_state_name': 'PHASE'}],
                        'external_key': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691',
                        'phase_type': 'TRIAL',
                        'plan_name': 'standard-monthly',
                        'price_list': 'DEFAULT',
                        'price_overrides': [{'fixed_price': 0.0,
                                             'phase_name': 'standard-monthly-trial',
                                             'phase_type': 'TRIAL',
                                             'plan_name': 'standard-monthly',
                                             'recurring_price': None,
                                             'usage_price_overrides': []},
                                            {'fixed_price': None,
                                             'phase_name': 'standard-monthly-evergreen',
                                             'phase_type': 'EVERGREEN',
                                             'plan_name': 'standard-monthly',
                                             'recurring_price': 100.0,
                                             'usage_price_overrides': []}],
                        'product_category': 'BASE',
                        'product_name': 'Standard',
                        'source_type': 'NATIVE',
                        'start_date': datetime.date(2018, 5, 7),
                        'state': 'ACTIVE',
                        'subscription_id': '6f6cab9d-dfe0-4b89-9a09-b16055f72f5c'}],
     'timeline': {'account_id': '8ef95bea-9306-4b26-a43c-090de8779599',
                  'audit_logs': [],
                  'bundle_id': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691',
                  'events': [{'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 5, 7),
                              'event_id': '80ca6915-0293-4b1d-8bc6-b3c9fe1bee03',
                              'event_type': 'START_ENTITLEMENT',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-trial',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'entitlement-service',
                              'service_state_name': 'ENT_STARTED'},
                             {'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 5, 7),
                              'event_id': 'ce26b570-0a9f-463e-b65c-96a9fd67f124',
                              'event_type': 'START_BILLING',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-trial',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'billing-service',
                              'service_state_name': 'START_BILLING'},
                             {'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 6, 6),
                              'event_id': 'c7af9fa3-5465-4e69-8a84-6977c711921c',
                              'event_type': 'PHASE',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-evergreen',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'entitlement+billing-service',
                              'service_state_name': 'PHASE'}],
                  'external_key': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691'}}
    

    Query Parameters

    Name Type Required Description
    includedDeleted boolean true choose true to include deleted bundles
    audit enum false level of audit logs returned

    Returns

    Returns a bundle object if a valid external key was provided.

    Retrieve a bundle by id

    Retrieves the details information for the Bundle using its bundleId.

    HTTP Request

    GET http://example.com/1.0/kb/bundles/{bundleId}

    Example Request:

    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    UUID bundleId = UUID.fromString("90ec582a-5da8-49d5-a656-c63cbc9d30fd");
    
    Bundle result = bundleApi.getBundle(bundleId, 
                                        AuditLevel.NONE, 
                                        requestOptions);
    
    bundle_id = "5b7a5f2d-4054-412f-b354-b722c2cff4ec"
    
    bundle = KillBillClient::Model::Bundle.new
    bundle.find_by_id(bundle_id, options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_id = 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691'
    
    bundleApi.get_bundle(bundle_id, api_key, api_secret)
    

    Example Response:

    **TODO**
    
    class Bundle {
        org.killbill.billing.client.model.gen.Bundle@efd93c26
        accountId: 11d96ccc-9bfb-4349-8d75-0ae5a7ed8d14
        bundleId: 90ec582a-5da8-49d5-a656-c63cbc9d30fd
        externalKey: 93199
        subscriptions: [class Subscription {
            org.killbill.billing.client.model.gen.Subscription@256a98cc
            accountId: 11d96ccc-9bfb-4349-8d75-0ae5a7ed8d14
            bundleId: 90ec582a-5da8-49d5-a656-c63cbc9d30fd
            subscriptionId: 2a95b238-719f-4c2d-a63e-f1f34f11dd53
            externalKey: 93199
            startDate: 2012-04-25
            productName: Shotgun
            productCategory: BASE
            billingPeriod: MONTHLY
            phaseType: TRIAL
            priceList: DEFAULT
            planName: shotgun-monthly
            state: CANCELLED
            sourceType: NATIVE
            cancelledDate: 2012-04-25
            chargedThroughDate: 2012-04-25
            billingStartDate: 2012-04-25
            billingEndDate: 2012-04-25
            billCycleDayLocal: 25
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@a883ef63
                eventId: 18719cae-eab1-4f75-9ea7-f1e3135a3e7c
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@856f5bdf
                eventId: 81518934-4418-491b-819c-72ab7c840bd6
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@3ced19b8
                eventId: c0a8f0ce-db27-4371-81f0-74148e36663f
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: STOP_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: true
                serviceName: entitlement-service
                serviceStateName: ENT_CANCELLED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@401111f4
                eventId: 762e80db-d75e-4b67-9ccc-b816a00181b7
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: STOP_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: STOP_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }]
            priceOverrides: [class PhasePriceOverride {
                planName: shotgun-monthly
                phaseName: shotgun-monthly-trial
                phaseType: TRIAL
                fixedPrice: 0
                recurringPrice: null
                usagePriceOverrides: []
            }]
            auditLogs: []
        }]
        timeline: class BundleTimeline {
            org.killbill.billing.client.model.gen.BundleTimeline@b8eeb095
            accountId: 11d96ccc-9bfb-4349-8d75-0ae5a7ed8d14
            bundleId: 90ec582a-5da8-49d5-a656-c63cbc9d30fd
            externalKey: 93199
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@d88c1e6d
                eventId: 18719cae-eab1-4f75-9ea7-f1e3135a3e7c
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@92c880de
                eventId: 81518934-4418-491b-819c-72ab7c840bd6
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@4871bbf6
                eventId: c0a8f0ce-db27-4371-81f0-74148e36663f
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: STOP_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: true
                serviceName: entitlement-service
                serviceStateName: ENT_CANCELLED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@3be2d635
                eventId: 762e80db-d75e-4b67-9ccc-b816a00181b7
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: STOP_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: STOP_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }]
            auditLogs: []
        }
        auditLogs: []
    }
    
    {
       "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
       "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
       "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
       "subscriptions":[
          {
             "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
             "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
             "subscriptionId":"e29573cc-d0e6-4d26-b97e-1a9c02d520ad",
             "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
             "startDate":"2013-08-01",
             "productName":"Sports",
             "productCategory":"BASE",
             "billingPeriod":"MONTHLY",
             "phaseType":"TRIAL",
             "priceList":"DEFAULT",
             "planName":"sports-monthly",
             "state":"ACTIVE",
             "sourceType":"NATIVE",
             "chargedThroughDate":"2013-08-01",
             "billingStartDate":"2013-08-01",
             "billCycleDayLocal":31,
             "events":[
                {
                   "eventId":"e0136144-a852-4eaa-b721-c8b585dcb4a6",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"sports-monthly",
                   "product":"Sports",
                   "priceList":"DEFAULT",
                   "eventType":"START_ENTITLEMENT",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement-service",
                   "serviceStateName":"ENT_STARTED",
                   "phase":"sports-monthly-trial",
                   "auditLogs":[]
                },
                {
                   "eventId":"72a51773-9e1d-4ad7-beeb-03139f60ea3d",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-01",
                   "plan":"sports-monthly",
                   "product":"Sports",
                   "priceList":"DEFAULT",
                   "eventType":"START_BILLING",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"billing-service",
                   "serviceStateName":"START_BILLING",
                   "phase":"sports-monthly-trial",
                   "auditLogs":[]
                },
                {
                   "eventId":"341992e2-4565-4457-9d20-d2803d11aa61",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-08-31",
                   "plan":"sports-monthly",
                   "product":"Sports",
                   "priceList":"DEFAULT",
                   "eventType":"PHASE",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement+billing-service",
                   "serviceStateName":"PHASE",
                   "phase":"sports-monthly-evergreen",
                   "auditLogs":[]
                }
             ],
             "priceOverrides":[
                {
                   "planName":"sports-monthly",
                   "phaseName":"sports-monthly-trial",
                   "phaseType":"TRIAL",
                   "fixedPrice":0
                },
                {
                   "planName":"sports-monthly",
                   "phaseName":"sports-monthly-evergreen",
                   "phaseType":"EVERGREEN",
                   "recurringPrice":500.0
                }
             ],
             "auditLogs":[]
          }
       ],
       "timeline":{
          "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
          "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
          "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
          "events":[
             {
                "eventId":"e0136144-a852-4eaa-b721-c8b585dcb4a6",
                "billingPeriod":"MONTHLY",
                "effectiveDate":"2013-08-01",
                "plan":"sports-monthly",
                "product":"Sports",
                "priceList":"DEFAULT",
                "eventType":"START_ENTITLEMENT",
                "isBlockedBilling":false,
                "isBlockedEntitlement":false,
                "serviceName":"entitlement-service",
                "serviceStateName":"ENT_STARTED",
                "phase":"sports-monthly-trial",
                "auditLogs":[]
             },
             {
                "eventId":"72a51773-9e1d-4ad7-beeb-03139f60ea3d",
                "billingPeriod":"MONTHLY",
                "effectiveDate":"2013-08-01",
                "plan":"sports-monthly",
                "product":"Sports",
                "priceList":"DEFAULT",
                "eventType":"START_BILLING",
                "isBlockedBilling":false,
                "isBlockedEntitlement":false,
                "serviceName":"billing-service",
                "serviceStateName":"START_BILLING",
                "phase":"sports-monthly-trial",
                "auditLogs":[]
             },
             {
                "eventId":"341992e2-4565-4457-9d20-d2803d11aa61",
                "billingPeriod":"MONTHLY",
                "effectiveDate":"2013-08-31",
                "plan":"sports-monthly",
                "product":"Sports",
                "priceList":"DEFAULT",
                "eventType":"PHASE",
                "isBlockedBilling":false,
                "isBlockedEntitlement":false,
                "serviceName":"entitlement+billing-service",
                "serviceStateName":"PHASE",
                "phase":"sports-monthly-evergreen",
                "auditLogs":[]
             }
          ],
          "auditLogs":[]
       },
       "auditLogs":[]
    }
    
    {'account_id': '8ef95bea-9306-4b26-a43c-090de8779599',
     'audit_logs': [],
     'bundle_id': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691',
     'external_key': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691',
     'subscriptions': [{'account_id': '8ef95bea-9306-4b26-a43c-090de8779599',
                        'audit_logs': [],
                        'bill_cycle_day_local': 6,
                        'billing_end_date': None,
                        'billing_period': 'MONTHLY',
                        'billing_start_date': datetime.date(2018, 5, 7),
                        'bundle_id': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691',
                        'cancelled_date': None,
                        'charged_through_date': None,
                        'events': [{'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 5, 7),
                                    'event_id': '80ca6915-0293-4b1d-8bc6-b3c9fe1bee03',
                                    'event_type': 'START_ENTITLEMENT',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-trial',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'entitlement-service',
                                    'service_state_name': 'ENT_STARTED'},
                                   {'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 5, 7),
                                    'event_id': 'ce26b570-0a9f-463e-b65c-96a9fd67f124',
                                    'event_type': 'START_BILLING',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-trial',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'billing-service',
                                    'service_state_name': 'START_BILLING'},
                                   {'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 6, 6),
                                    'event_id': 'c7af9fa3-5465-4e69-8a84-6977c711921c',
                                    'event_type': 'PHASE',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-evergreen',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'entitlement+billing-service',
                                    'service_state_name': 'PHASE'}],
                        'external_key': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691',
                        'phase_type': 'TRIAL',
                        'plan_name': 'standard-monthly',
                        'price_list': 'DEFAULT',
                        'price_overrides': [{'fixed_price': 0.0,
                                             'phase_name': 'standard-monthly-trial',
                                             'phase_type': 'TRIAL',
                                             'plan_name': 'standard-monthly',
                                             'recurring_price': None,
                                             'usage_price_overrides': []},
                                            {'fixed_price': None,
                                             'phase_name': 'standard-monthly-evergreen',
                                             'phase_type': 'EVERGREEN',
                                             'plan_name': 'standard-monthly',
                                             'recurring_price': 100.0,
                                             'usage_price_overrides': []}],
                        'product_category': 'BASE',
                        'product_name': 'Standard',
                        'source_type': 'NATIVE',
                        'start_date': datetime.date(2018, 5, 7),
                        'state': 'ACTIVE',
                        'subscription_id': '6f6cab9d-dfe0-4b89-9a09-b16055f72f5c'}],
     'timeline': {'account_id': '8ef95bea-9306-4b26-a43c-090de8779599',
                  'audit_logs': [],
                  'bundle_id': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691',
                  'events': [{'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 5, 7),
                              'event_id': '80ca6915-0293-4b1d-8bc6-b3c9fe1bee03',
                              'event_type': 'START_ENTITLEMENT',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-trial',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'entitlement-service',
                              'service_state_name': 'ENT_STARTED'},
                             {'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 5, 7),
                              'event_id': 'ce26b570-0a9f-463e-b65c-96a9fd67f124',
                              'event_type': 'START_BILLING',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-trial',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'billing-service',
                              'service_state_name': 'START_BILLING'},
                             {'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 6, 6),
                              'event_id': 'c7af9fa3-5465-4e69-8a84-6977c711921c',
                              'event_type': 'PHASE',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-evergreen',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'entitlement+billing-service',
                              'service_state_name': 'PHASE'}],
                  'external_key': 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691'}}
    

    Query Parameters

    Name Type Required Description
    audit enum false level of audit logs returned

    Returns

    Returns a bundle object if a valid identifier was provided.

    Transfer a bundle to another account

    The new account_id should be set in this object

    HTTP Request

    POST http://example.com/1.0/kb/bundles/{bundleId}

    Example Request:

    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    UUID bundleId = UUID.fromString("b84a8af9-73d4-4749-8d81-38dbcc2d7fb1");
    UUID accountId = UUID.fromString("d82d3638-fca7-4c16-9e68-8f8db75997cc");
    
    Bundle bundle = new Bundle();
    bundle.setAccountId(accountId);
    bundle.setBundleId(bundleId);
    
    LocalDate requestedDate = null;
    ImmutableMap<String, String> NULL_PLUGIN_PROPERTIES = null;
    BillingActionPolicy billingPolicy = null;
    
    Bundle result = bundleApi.transferBundle(bundleId, 
                                             bundle, 
                                             requestedDate, 
                                             billingPolicy,
                                             NULL_PLUGIN_PROPERTIES, 
                                             requestOptions);
    
    requested_date = "2013-08-01"
    billing_policy = "END_OF_TERM"
    
    bundle = KillBillClient::Model::Bundle.new
    bundle.account_id = new_account_id
    bundle.bundle_id = bundle_id
    
    bundle.transfer(requested_date, 
                    billing_policy, 
                    user, 
                    reason, 
                    comment, 
                    options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_id = 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691'
    new_account_id = '71499886-296d-4b0f-8b76-0eed352d8801'
    body = Bundle(bundle_id=bundle_id, account_id=new_account_id)
    
    bundleApi.transfer_bundle(bundle_id, 
                              body, 
                              created_by, 
                              api_key, 
                              api_secret)
    

    Example Response:

    **TODO**
    
    class Bundle {
        org.killbill.billing.client.model.gen.Bundle@222591c5
        accountId: d82d3638-fca7-4c16-9e68-8f8db75997cc
        bundleId: b84a8af9-73d4-4749-8d81-38dbcc2d7fb1
        externalKey: 93199
        subscriptions: [class Subscription {
            org.killbill.billing.client.model.gen.Subscription@a668d933
            accountId: d82d3638-fca7-4c16-9e68-8f8db75997cc
            bundleId: b84a8af9-73d4-4749-8d81-38dbcc2d7fb1
            subscriptionId: 373e7cce-0558-4c31-98af-aab54b67c4a6
            externalKey: 93199
            startDate: 2012-04-25
            productName: Shotgun
            productCategory: BASE
            billingPeriod: MONTHLY
            phaseType: TRIAL
            priceList: DEFAULT
            planName: shotgun-monthly
            state: ACTIVE
            sourceType: TRANSFERRED
            cancelledDate: null
            chargedThroughDate: null
            billingStartDate: 2012-04-25
            billingEndDate: null
            billCycleDayLocal: 25
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@1e1bbe63
                eventId: 1779fcae-a6ca-43dd-9429-85f946fa4055
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@54887921
                eventId: b242eda1-dc26-4875-b92c-a99c76084a06
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@5652e31d
                eventId: 5b59caa3-d996-4c9c-afc1-cc932e5a0ff8
                billingPeriod: MONTHLY
                effectiveDate: 2012-05-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: PHASE
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement+billing-service
                serviceStateName: PHASE
                phase: shotgun-monthly-evergreen
                auditLogs: []
            }]
            priceOverrides: [class PhasePriceOverride {
                planName: shotgun-monthly
                phaseName: shotgun-monthly-trial
                phaseType: TRIAL
                fixedPrice: 0
                recurringPrice: null
                usagePriceOverrides: []
            }, class PhasePriceOverride {
                planName: shotgun-monthly
                phaseName: shotgun-monthly-evergreen
                phaseType: EVERGREEN
                fixedPrice: null
                recurringPrice: 249.95
                usagePriceOverrides: []
            }]
            auditLogs: []
        }]
        timeline: class BundleTimeline {
            org.killbill.billing.client.model.gen.BundleTimeline@8ad5adda
            accountId: d82d3638-fca7-4c16-9e68-8f8db75997cc
            bundleId: b84a8af9-73d4-4749-8d81-38dbcc2d7fb1
            externalKey: 93199
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@49f9e293
                eventId: 1779fcae-a6ca-43dd-9429-85f946fa4055
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@55e764b4
                eventId: b242eda1-dc26-4875-b92c-a99c76084a06
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@16aec25d
                eventId: 5b59caa3-d996-4c9c-afc1-cc932e5a0ff8
                billingPeriod: MONTHLY
                effectiveDate: 2012-05-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: PHASE
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement+billing-service
                serviceStateName: PHASE
                phase: shotgun-monthly-evergreen
                auditLogs: []
            }]
            auditLogs: []
        }
        auditLogs: []
    }
    
    {
       "accountId":"71499886-296d-4b0f-8b76-0eed352d8801",
       "bundleId":"cff04ff5-19ba-4bdc-8aca-ed486d4b845c",
       "externalKey":"25f2de6b-2443-4d7c-8487-22bf6df5a5ec-73709",
       "subscriptions":[
          {
             "accountId":"71499886-296d-4b0f-8b76-0eed352d8801",
             "bundleId":"cff04ff5-19ba-4bdc-8aca-ed486d4b845c",
             "subscriptionId":"46e6fcdc-9f63-4ffc-a091-0cde70f964f0",
             "externalKey":"25f2de6b-2443-4d7c-8487-22bf6df5a5ec-73709",
             "startDate":"2013-09-01",
             "productName":"Sports",
             "productCategory":"BASE",
             "billingPeriod":"MONTHLY",
             "phaseType":"EVERGREEN",
             "priceList":"DEFAULT",
             "planName":"sports-monthly",
             "state":"ACTIVE",
             "sourceType":"TRANSFERRED",
             "billingStartDate":"2013-09-01",
             "billCycleDayLocal":1,
             "events":[
                {
                   "eventId":"605c5696-4046-4597-8a67-7e50d26856cd",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-09-01",
                   "plan":"sports-monthly",
                   "product":"Sports",
                   "priceList":"DEFAULT",
                   "eventType":"START_ENTITLEMENT",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"entitlement-service",
                   "serviceStateName":"ENT_STARTED",
                   "phase":"sports-monthly-evergreen",
                   "auditLogs":[]
                },
                {
                   "eventId":"fbc53e69-0683-4904-bc77-5d244b9ad1c9",
                   "billingPeriod":"MONTHLY",
                   "effectiveDate":"2013-09-01",
                   "plan":"sports-monthly",
                   "product":"Sports",
                   "priceList":"DEFAULT",
                   "eventType":"START_BILLING",
                   "isBlockedBilling":false,
                   "isBlockedEntitlement":false,
                   "serviceName":"billing-service",
                   "serviceStateName":"START_BILLING",
                   "phase":"sports-monthly-evergreen",
                   "auditLogs":[]
                }
             ],
             "priceOverrides":[
                {
                   "planName":"sports-monthly",
                   "phaseName":"sports-monthly-evergreen",
                   "phaseType":"EVERGREEN",
                   "recurringPrice":500.0
                }
             ],
             "auditLogs":[]
          }
       ],
       "timeline":{
          "accountId":"71499886-296d-4b0f-8b76-0eed352d8801",
          "bundleId":"cff04ff5-19ba-4bdc-8aca-ed486d4b845c",
          "externalKey":"25f2de6b-2443-4d7c-8487-22bf6df5a5ec-73709",
          "events":[
             {
                "eventId":"605c5696-4046-4597-8a67-7e50d26856cd",
                "billingPeriod":"MONTHLY",
                "effectiveDate":"2013-09-01",
                "plan":"sports-monthly",
                "product":"Sports",
                "priceList":"DEFAULT",
                "eventType":"START_ENTITLEMENT",
                "isBlockedBilling":false,
                "isBlockedEntitlement":false,
                "serviceName":"entitlement-service",
                "serviceStateName":"ENT_STARTED",
                "phase":"sports-monthly-evergreen",
                "auditLogs":[]
             },
             {
                "eventId":"fbc53e69-0683-4904-bc77-5d244b9ad1c9",
                "billingPeriod":"MONTHLY",
                "effectiveDate":"2013-09-01",
                "plan":"sports-monthly",
                "product":"Sports",
                "priceList":"DEFAULT",
                "eventType":"START_BILLING",
                "isBlockedBilling":false,
                "isBlockedEntitlement":false,
                "serviceName":"billing-service",
                "serviceStateName":"START_BILLING",
                "phase":"sports-monthly-evergreen",
                "auditLogs":[]
             }
          ],
          "auditLogs":[]
       },
       "auditLogs":[]
    }
    
    no content
    

    Query Parameters

    Name Type Required Description
    requestedDate string false requested date for transfer a bundle

    Returns

    Returns a bundle object if a valid account and bundle id's was provided.

    Block a bundle

    HTTP Request

    POST http://example.com/1.0/kb/bundles/{bundleId}/block

    Example Request:

    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    UUID bundleId = UUID.fromString("b84a8af9-73d4-4749-8d81-38dbcc2d7fb1");
    
    String stateName = "block";
    String service = "service";
    Boolean isBlockChange = false;
    Boolean isBlockEntitlement = true;
    Boolean isBlockBilling = true;
    DateTime effectiveDate = null;
    List<AuditLog> auditLogs = null;
    
    BlockingState blockingState = new BlockingState(bundleId, 
                                                    stateName, 
                                                    service, 
                                                    isBlockChange, 
                                                    isBlockEntitlement, 
                                                    isBlockBilling, 
                                                    effectiveDate, 
                                                    BlockingStateType.SUBSCRIPTION_BUNDLE, 
                                                    auditLogs);
    
    LocalDate requestedDate = clock.getToday(DateTimeZone.forID(account.getTimeZone()));
    Map<String, String> pluginProperty = ImmutableMap.<String, String>of();
    
    bundleApi.addBundleBlockingState(bundleId, 
                                     blockingState, 
                                     requestedDate, 
                                     pluginProperty, 
                                     requestOptions);
    
    state_name = "STATE1"
    service = "ServiceStateService"
    block_change = false
    block_entitlement = false
    block_billing = false
    requested_date = "2013-08-01"
    
    bundle.set_blocking_state(state_name,
                              service,
                              block_change, 
                              block_entitlement,
                              block_billing, 
                              requested_date,
                              user, 
                              reason, 
                              comment,
                              options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_id = 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691'
    body = BlockingState(state_name='STATE1', 
                         service='ServiceStateService', 
                         is_block_change=False, 
                         is_block_entitlement=False, 
                         is_block_billing=False)
    
    bundleApi.add_bundle_blocking_state(bundle_id,
                                        body,
                                        created_by,
                                        api_key,
                                        api_secret)
    

    Example Response:

    **TODO**
    
    no content
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    requestedDate string false requested date for block a bundle

    Returns

    A 201 http status without content.

    Add custom fields to bundle

    HTTP Request

    POST http://example.com/1.0/kb/bundles/{bundleId}/customFields

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    UUID bundleId = UUID.fromString("b84a8af9-73d4-4749-8d81-38dbcc2d7fb1");
    final ImmutableList<AuditLog> EMPTY_AUDIT_LOGS = ImmutableList.<AuditLog>of();
    
    CustomFields customFields = new CustomFields();
    customFields.add(new CustomField(null, 
                                     bundleId, 
                                     ObjectType.BUNDLE, 
                                     "Test Custom Field", 
                                     "test_value", 
                                     EMPTY_AUDIT_LOGS));
    
    bundleApi.createBundleCustomFields(bundleId, 
                                       customFields, 
                                       requestOptions);
    
    custom_field = KillBillClient::Model::CustomFieldAttributes.new
    custom_field.object_type = 'BUNDLE'
    custom_field.name = 'Test Custom Field'
    custom_field.value = 'test_value'
    
    bundle.add_custom_field(custom_field, 
                            user,
                            reason,
                            comment,
                            options)
    
    bundleApi = killbill.api.BundleApi()
    body = CustomField(name='Test Custom Field', value='test_value')
    
    bundleApi.create_bundle_custom_fields(bundle_id,
                                          [body],
                                          created_by,
                                          api_key,
                                          api_secret)
    

    Example Response:

    //First element of the list
    class CustomField {
        org.killbill.billing.client.model.gen.CustomField@c7d0c38a
        customFieldId: null
        objectId: 59860a0d-c032-456d-a35e-3a48fe8579e5
        objectType: BUNDLE
        name: Test Custom Field
        value: test_value
        auditLogs: []
    }
    
    [
       {
          "customFieldId":"6e571e22-b794-413c-be6f-1b2aa4bf9824",
          "objectId":"0149ffc6-fdfd-40b1-8cf4-29a66aef51d4",
          "objectType":"BUNDLE",
          "name":"Test Custom Field",
          "value":"test_value",
          "auditLogs":[]
       }
    ]
    
    no content
    

    Query Parameters

    None.

    Returns

    Returns a custom field object.

    Retrieve bundle custom fields

    HTTP Request

    GET http://example.com/1.0/kb/bundles/{bundleId}/customFields

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    UUID bundleId = UUID.fromString("59860a0d-c032-456d-a35e-3a48fe8579e5");
    
    List<CustomField> bundleCustomFields = bundleApi.getBundleCustomFields(bundleId,
                                                                           AuditLevel.NONE,
                                                                           requestOptions);
    
    audit = 'NONE'
    
    bundle.custom_fields(audit, options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_id = 'ce967207-851c-4040-bfbd-74a8924f9b8a'
    
    bundleApi.get_bundle_custom_fields(bundle_id, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class CustomField {
        org.killbill.billing.client.model.gen.CustomField@c7d0c38a
        customFieldId: null
        objectId: 59860a0d-c032-456d-a35e-3a48fe8579e5
        objectType: BUNDLE
        name: Test Custom Field
        value: test_value
        auditLogs: []
    }
    
    [
       {
          "customFieldId":"7fb3dde7-0911-4477-99e3-69d142509bb9",
          "objectId":"4927c1a2-3959-4f71-98e7-ce3ba19c92ac",
          "objectType":"BUNDLE",
          "name":"Test Custom Field",
          "value":"test_value",
          "auditLogs":[]
       }
    ]
    
    [{'audit_logs': [],
     'custom_field_id': '5670b594-9317-4aeb-bfef-2c2342ec172a',
     'name': 'Test Custom Field',
     'object_id': 'ce967207-851c-4040-bfbd-74a8924f9b8a',
     'object_type': 'BUNDLE',
     'value': 'test_value'}]
    

    Query Parameters

    Name Type Required Description
    audit enum false level of audit logs returned

    Returns

    Returns a list of custom field objects.

    Modify custom fields to bundle

    HTTP Request

    PUT http://example.com/1.0/kb/bundles/{bundleId}/customFields

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    UUID bundleId = UUID.fromString("59860a0d-c032-456d-a35e-3a48fe8579e5");
    UUID customFieldsId = UUID.fromString("9913e0f6-b5ef-498b-ac47-60e1626eba8f");
    
    CustomField customFieldModified = new CustomField();
    customFieldModified.setCustomFieldId(customFieldsId);
    customFieldModified.setValue("NewValue");
    
    bundleApi.modifyBundleCustomFields(bundleId, 
                                       customFieldModified, 
                                       requestOptions);
    
    custom_field.custom_field_id = '7fb3dde7-0911-4477-99e3-69d142509bb9'
    custom_field.name = 'Test Modify'
    custom_field.value = 'test_modify_value'
    
    bundle.modify_custom_field(custom_field,                                                                                            
                               user, 
                               reason,
                               comment, 
                               options)
    
    bundleApi = killbill.api.BundleApi()
    body = CustomField(custom_field_id=custom_field_id, 
                       name='Test Custom Field', 
                       value='test_value')
    
    bundleApi.modify_bundle_custom_fields(bundle_id, 
                                          [body], 
                                          created_by, 
                                          api_key, 
                                          api_secret)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    None.

    Returns

    A 204 http status without content.

    Remove custom fields from bundle

    HTTP Request

    DELETE http://example.com/1.0/kb/bundles/{bundleId}/customFields

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    UUID bundleId = UUID.fromString("59860a0d-c032-456d-a35e-3a48fe8579e5");
    UUID customFieldsId = UUID.fromString("9913e0f6-b5ef-498b-ac47-60e1626eba8f");
    
    bundleApi.deleteBundleCustomFields(bundleId, 
                                       customFieldsId, 
                                       requestOptions);
    
    custom_field_id = custom_field.id
    
    bundle.remove_custom_field(custom_field_id, 
                               user, 
                               reason,
                               comment, 
                               options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_id = 'ce967207-851c-4040-bfbd-74a8924f9b8a' 
    
    bundleApi.delete_bundle_custom_fields(bundle_id, 
                                          created_by, 
                                          api_key, 
                                          api_secret)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    customFieldList string true a list of custom field objects that you want to remove it

    Response

    A 204 http status without content.

    Pause a bundle

    HTTP Request

    PUT http://example.com/1.0/kb/bundles/{bundleId}/pause

    Example Request:

    bundle = KillBillClient::Model::Bundle.new
    bundle.bundle_id = bundle_id
    requested_date = "2013-08-01"
    
    bundle.pause(requested_date, 
                 user, 
                 reason, 
                 comment, 
                 options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_id = 'ce967207-851c-4040-bfbd-74a8924f9b8a'
    
    bundleApi.pause_bundle(bundle_id, 
                           created_by, 
                           api_key, 
                           api_secret)
    

    Example Response:

    **TODO**
    
    **TODO**
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    requestedDate string false requested date for pause a bundle

    Returns

    A 204 http status without content.

    Update a bundle externalKey

    HTTP Request

    PUT http://example.com/1.0/kb/bundles/{bundleId}/renameKey

    Example Request:

    bundle = KillBillClient::Model::Bundle.new
    bundle.bundle_id = bundle_id
    bundle.external_key = "new_external_key"
    
    bundle.rename_external_key(user, 
                               reason, 
                               comment, 
                               options)
    
    bundleApi = killbill.api.BundleApi()
    body = Bundle(bundle_id=bundle_id, 
                  external_key='new_external_key')
    
    bundleApi.rename_external_key(bundle_id,
                                  body,
                                  created_by,
                                  api_key,
                                  api_secret)
    

    Example Response:

    **TODO**
    
    **TODO**
    
    no content
    
    no content
    

    Query Parameters

    None.

    Returns

    A 204 http status without content.

    Resume a bundle

    HTTP Request

    PUT http://example.com/1.0/kb/bundles/{bundleId}/resume

    Example Request:

    bundle = KillBillClient::Model::Bundle.new
    bundle.bundle_id = bundle_id
    requested_date = "2013-08-01"
    
    bundle.resume(requested_date, 
                  user, 
                  reason, 
                  comment, 
                  options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_id = 'ce967207-851c-4040-bfbd-74a8924f9b8a'
    
    bundleApi.resume_bundle(bundle_id, 
                            created_by, 
                            api_key, 
                            api_secret)
    

    Example Response:

    **TODO**
    
    **TODO**
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    requestedDate string false requested date for resume a bundle

    Returns

    A 204 http status without content.

    Add tags to bundle

    HTTP Request

    POST http://example.com/1.0/kb/bundles/{bundleId}/tags

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    UUID bundleId = UUID.fromString("917992d3-5f1f-4828-9fff-799cc4211aa9");
    
    UUID autoPayOffId = UUID.fromString("00000000-0000-0000-0000-000000000001");
    
    Tags result = bundleApi.createBundleTags(bundleId, 
                                             ImmutableList.<UUID>of(autoPayOffId), 
                                             requestOptions);
    
    tag_name = 'TEST'
    
    bundle.add_tag(tag_name,
                   user,
                   reason,
                   comment,
                   options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_id = '28af3cb9-275b-4ac4-a55d-a0536e479069'
    tag = ["00000000-0000-0000-0000-000000000002"]
    
    bundleApi.create_bundle_tags(bundle_id, 
                                 tag, 
                                 created_by, 
                                 api_key, 
                                 api_secret)
    

    Example Response:

    //First element of the list
    class Tag {
        org.killbill.billing.client.model.gen.Tag@bd138472
        tagId: 1bb4b638-3886-4f73-90a5-89eb6d1bcf7f
        objectType: BUNDLE
        objectId: 917992d3-5f1f-4828-9fff-799cc4211aa9
        tagDefinitionId: 00000000-0000-0000-0000-000000000001
        tagDefinitionName: AUTO_PAY_OFF
        auditLogs: []
    }
    
    [
       {
          "tagId":"a46cfeb6-e175-42db-be62-7f117326ab4e",
          "objectType":"BUNDLE",
          "objectId":"28af3cb9-275b-4ac4-a55d-a0536e479069",
          "tagDefinitionId":"00000000-0000-0000-0000-000000000006",
          "tagDefinitionName":"TEST",
          "auditLogs":[
    
          ]
       }
    ]
    
    no content
    

    Query Parameters

    Name Type Required Description
    tagDef string true list with tag definition id's to add

    Returns

    A 201 http status without content.

    Retrieve bundle tags

    HTTP Request

    GET http://example.com/1.0/kb/bundles/{bundleId}/tags

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    UUID bundleId = UUID.fromString("917992d3-5f1f-4828-9fff-799cc4211aa9");
    Boolean includedDeleted = false; // Will not include deleted tags
    
    List<Tag> tags1 = bundleApi.getBundleTags(bundleId, 
                                              includedDeleted, 
                                              AuditLevel.FULL, 
                                              requestOptions);
    
    included_deleted = false
    audit = 'NONE'
    
    bundle.tags(included_deleted,
                audit,
                options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_id = '28af3cb9-275b-4ac4-a55d-a0536e479069'
    
    bundleApi.get_bundle_tags(bundle_id, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class Tag {
        org.killbill.billing.client.model.gen.Tag@cae768d7
        tagId: d724f79d-fad1-4758-b35e-d62708450d90
        objectType: BUNDLE
        objectId: e659f0f3-745c-46d5-953c-28fe9282fc7d
        tagDefinitionId: 00000000-0000-0000-0000-000000000001
        tagDefinitionName: AUTO_PAY_OFF
        auditLogs: [class AuditLog {
            changeType: INSERT
            changeDate: 2012-08-25T00:00:02.000Z
            objectType: TAG
            objectId: d724f79d-fad1-4758-b35e-d62708450d90
            changedBy: Toto
            reasonCode: i am god
            comments: no comment
            userToken: e36f7ba5-fb5b-41c0-b47c-77c48ab37dd9
            history: null
        }]
    }
    
    [
       {
          "tagId":"a46cfeb6-e175-42db-be62-7f117326ab4e",
          "objectType":"BUNDLE",
          "objectId":"28af3cb9-275b-4ac4-a55d-a0536e479069",
          "tagDefinitionId":"00000000-0000-0000-0000-000000000006",
          "tagDefinitionName":"TEST",
          "auditLogs":[
    
          ]
       }
    ]
    
    [{'audit_logs': [],
     'object_id': '3e94fccf-0f37-40aa-90a4-122a4f381ebc',
     'object_type': 'BUNDLE',
     'tag_definition_id': '00000000-0000-0000-0000-000000000002',
     'tag_definition_name': 'AUTO_INVOICING_OFF',
     'tag_id': 'fc7fab6e-751c-4dd3-b7fa-e93a66e42822'}]
    

    Query Parameters

    Name Type Required Description
    audit enum false level of audit logs returned
    includedDeleted boolean false choose true if you want to include deleted tags

    Returns

    Returns a list of bundle tag objects.

    Remove tags from bundle

    HTTP Request

    DELETE http://example.com/1.0/kb/bundles/{bundleId}/tags

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    UUID bundleId = UUID.fromString("917992d3-5f1f-4828-9fff-799cc4211aa9");
    
    UUID autoPayOffId = UUID.fromString("00000000-0000-0000-0000-000000000001");
    
    bundleApi.deleteBundleTags(bundleId, 
                               ImmutableList.<UUID>of(autoPayOffId), 
                               requestOptions);
    
    tag_name = 'TEST'
    
    bundle.remove_tag(tag_name,
                      user,
                      reason,
                      comment,
                      options)
    
    bundleApi = killbill.api.BundleApi()
    bundle_id = '28af3cb9-275b-4ac4-a55d-a0536e479069'
    tag = ["00000000-0000-0000-0000-000000000002"]
    
    bundleApi.delete_bundle_tags(bundle_id, 
                                 created_by, 
                                 api_key, 
                                 api_secret,
                                 tag_def=tag)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    Name Type Required Description
    tagDef string true list with tag definition id's that you want to remove it

    Response

    A 204 http status without content.

    List bundles

    HTTP Request

    GET http://example.com/1.0/kb/bundles/pagination

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    Long offset = 0L;
    Long limit = 1L;
    
    Bundles allBundles = bundleApi.getBundles(offset, 
                                              limit, 
                                              AuditLevel.NONE, 
                                              requestOptions);
    
    offset = 0
    limit = 100
    
    bundle.find_in_batches(offset,
                           limit,
                           options)
    
    bundleApi = killbill.api.BundleApi()
    
    bundleApi.get_bundles(api_key, api_secret,)
    

    Example Response:

    //First element of the list
    class Bundle {
        org.killbill.billing.client.model.gen.Bundle@2659bf49
        accountId: b99980fb-331f-4129-834b-3522e845a4e3
        bundleId: b424e3d6-d747-4309-954d-1acb41bc690c
        externalKey: 757e352e-dd97-4800-93a8-d2c38e407140
        subscriptions: [class Subscription {
            org.killbill.billing.client.model.gen.Subscription@ec70e97d
            accountId: b99980fb-331f-4129-834b-3522e845a4e3
            bundleId: b424e3d6-d747-4309-954d-1acb41bc690c
            subscriptionId: bacec1ee-7815-485f-bec2-0a875a8d68ad
            externalKey: 757e352e-dd97-4800-93a8-d2c38e407140
            startDate: 2012-08-25
            productName: Shotgun
            productCategory: BASE
            billingPeriod: MONTHLY
            phaseType: TRIAL
            priceList: DEFAULT
            planName: shotgun-monthly
            state: ACTIVE
            sourceType: NATIVE
            cancelledDate: null
            chargedThroughDate: 2012-08-25
            billingStartDate: 2012-08-25
            billingEndDate: null
            billCycleDayLocal: 24
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@324b0f94
                eventId: 9b35680c-c63c-47c8-9fe5-671b4bfa4e69
                billingPeriod: MONTHLY
                effectiveDate: 2012-08-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@a1eefba7
                eventId: b24494ca-755c-4432-8b21-6923d5fdd30f
                billingPeriod: MONTHLY
                effectiveDate: 2012-08-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@66e2bfa7
                eventId: a306143d-d2a3-4f72-95c8-91b97ee7e6ca
                billingPeriod: MONTHLY
                effectiveDate: 2012-09-24
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: PHASE
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement+billing-service
                serviceStateName: PHASE
                phase: shotgun-monthly-evergreen
                auditLogs: []
            }]
            priceOverrides: []
            auditLogs: []
        }]
        timeline: class BundleTimeline {
            org.killbill.billing.client.model.gen.BundleTimeline@d6ec82ea
            accountId: b99980fb-331f-4129-834b-3522e845a4e3
            bundleId: b424e3d6-d747-4309-954d-1acb41bc690c
            externalKey: 757e352e-dd97-4800-93a8-d2c38e407140
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@43676058
                eventId: 9b35680c-c63c-47c8-9fe5-671b4bfa4e69
                billingPeriod: MONTHLY
                effectiveDate: 2012-08-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@2e29a294
                eventId: b24494ca-755c-4432-8b21-6923d5fdd30f
                billingPeriod: MONTHLY
                effectiveDate: 2012-08-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@9c578f29
                eventId: a306143d-d2a3-4f72-95c8-91b97ee7e6ca
                billingPeriod: MONTHLY
                effectiveDate: 2012-09-24
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: PHASE
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement+billing-service
                serviceStateName: PHASE
                phase: shotgun-monthly-evergreen
                auditLogs: []
            }]
            auditLogs: []
        }
        auditLogs: []
    }
    
    [
      {
         "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
         "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
         "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
         "subscriptions":[
            {
               "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
               "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
               "subscriptionId":"e29573cc-d0e6-4d26-b97e-1a9c02d520ad",
               "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
               "startDate":"2013-08-01",
               "productName":"Sports",
               "productCategory":"BASE",
               "billingPeriod":"MONTHLY",
               "phaseType":"TRIAL",
               "priceList":"DEFAULT",
               "planName":"sports-monthly",
               "state":"ACTIVE",
               "sourceType":"NATIVE",
               "chargedThroughDate":"2013-08-01",
               "billingStartDate":"2013-08-01",
               "billCycleDayLocal":31,
               "events":[
                  {
                     "eventId":"e0136144-a852-4eaa-b721-c8b585dcb4a6",
                     "billingPeriod":"MONTHLY",
                     "effectiveDate":"2013-08-01",
                     "plan":"sports-monthly",
                     "product":"Sports",
                     "priceList":"DEFAULT",
                     "eventType":"START_ENTITLEMENT",
                     "isBlockedBilling":false,
                     "isBlockedEntitlement":false,
                     "serviceName":"entitlement-service",
                     "serviceStateName":"ENT_STARTED",
                     "phase":"sports-monthly-trial",
                     "auditLogs":[]
                  },
                  {
                     "eventId":"72a51773-9e1d-4ad7-beeb-03139f60ea3d",
                     "billingPeriod":"MONTHLY",
                     "effectiveDate":"2013-08-01",
                     "plan":"sports-monthly",
                     "product":"Sports",
                     "priceList":"DEFAULT",
                     "eventType":"START_BILLING",
                     "isBlockedBilling":false,
                     "isBlockedEntitlement":false,
                     "serviceName":"billing-service",
                     "serviceStateName":"START_BILLING",
                     "phase":"sports-monthly-trial",
                     "auditLogs":[]
                  },
                  {
                     "eventId":"341992e2-4565-4457-9d20-d2803d11aa61",
                     "billingPeriod":"MONTHLY",
                     "effectiveDate":"2013-08-31",
                     "plan":"sports-monthly",
                     "product":"Sports",
                     "priceList":"DEFAULT",
                     "eventType":"PHASE",
                     "isBlockedBilling":false,
                     "isBlockedEntitlement":false,
                     "serviceName":"entitlement+billing-service",
                     "serviceStateName":"PHASE",
                     "phase":"sports-monthly-evergreen",
                     "auditLogs":[]
                  }
               ],
               "priceOverrides":[
                  {
                     "planName":"sports-monthly",
                     "phaseName":"sports-monthly-trial",
                     "phaseType":"TRIAL",
                     "fixedPrice":0
                  },
                  {
                     "planName":"sports-monthly",
                     "phaseName":"sports-monthly-evergreen",
                     "phaseType":"EVERGREEN",
                     "recurringPrice":500.0
                  }
               ],
               "auditLogs":[]
            }
         ],
         "timeline":{
            "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
            "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
            "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
            "events":[
               {
                  "eventId":"e0136144-a852-4eaa-b721-c8b585dcb4a6",
                  "billingPeriod":"MONTHLY",
                  "effectiveDate":"2013-08-01",
                  "plan":"sports-monthly",
                  "product":"Sports",
                  "priceList":"DEFAULT",
                  "eventType":"START_ENTITLEMENT",
                  "isBlockedBilling":false,
                  "isBlockedEntitlement":false,
                  "serviceName":"entitlement-service",
                  "serviceStateName":"ENT_STARTED",
                  "phase":"sports-monthly-trial",
                  "auditLogs":[]
               },
               {
                  "eventId":"72a51773-9e1d-4ad7-beeb-03139f60ea3d",
                  "billingPeriod":"MONTHLY",
                  "effectiveDate":"2013-08-01",
                  "plan":"sports-monthly",
                  "product":"Sports",
                  "priceList":"DEFAULT",
                  "eventType":"START_BILLING",
                  "isBlockedBilling":false,
                  "isBlockedEntitlement":false,
                  "serviceName":"billing-service",
                  "serviceStateName":"START_BILLING",
                  "phase":"sports-monthly-trial",
                  "auditLogs":[]
               },
               {
                  "eventId":"341992e2-4565-4457-9d20-d2803d11aa61",
                  "billingPeriod":"MONTHLY",
                  "effectiveDate":"2013-08-31",
                  "plan":"sports-monthly",
                  "product":"Sports",
                  "priceList":"DEFAULT",
                  "eventType":"PHASE",
                  "isBlockedBilling":false,
                  "isBlockedEntitlement":false,
                  "serviceName":"entitlement+billing-service",
                  "serviceStateName":"PHASE",
                  "phase":"sports-monthly-evergreen",
                  "auditLogs":[]
               }
            ],
            "auditLogs":[]
         },
         "auditLogs":[]
      }
    ]
    
    [{'account_id': '7c86f63a-3380-4487-99e1-1865108a3e6c',
     'audit_logs': [],
     'bundle_id': 'e700381c-3af4-479a-af92-485c5ac89e41',
     'external_key': 'e700381c-3af4-479a-af92-485c5ac89e41',
     'subscriptions': [{'account_id': '7c86f63a-3380-4487-99e1-1865108a3e6c',
                        'audit_logs': [],
                        'bill_cycle_day_local': 6,
                        'billing_end_date': None,
                        'billing_period': 'MONTHLY',
                        'billing_start_date': datetime.date(2018, 5, 7),
                        'bundle_id': 'e700381c-3af4-479a-af92-485c5ac89e41',
                        'cancelled_date': None,
                        'charged_through_date': None,
                        'events': [{'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 5, 7),
                                    'event_id': '3639baf9-57a5-4c52-92da-d13432b48919',
                                    'event_type': 'START_ENTITLEMENT',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-trial',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'entitlement-service',
                                    'service_state_name': 'ENT_STARTED'},
                                   {'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 5, 7),
                                    'event_id': '2b3efee7-6cb5-4801-8abd-c11936b69439',
                                    'event_type': 'START_BILLING',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-trial',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'billing-service',
                                    'service_state_name': 'START_BILLING'},
                                   {'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 6, 6),
                                    'event_id': '2dbbf736-1c24-42f7-83fc-fbc2a8059e96',
                                    'event_type': 'PHASE',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-evergreen',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'entitlement+billing-service',
                                    'service_state_name': 'PHASE'}],
                        'external_key': 'e700381c-3af4-479a-af92-485c5ac89e41',
                        'phase_type': 'TRIAL',
                        'plan_name': 'standard-monthly',
                        'price_list': 'DEFAULT',
                        'price_overrides': [],
                        'product_category': 'BASE',
                        'product_name': 'Standard',
                        'source_type': 'NATIVE',
                        'start_date': datetime.date(2018, 5, 7),
                        'state': 'ACTIVE',
                        'subscription_id': '5ce4f7e1-5f82-4b6b-8ff6-a25ff64e7bdd'}],
     'timeline': {'account_id': '7c86f63a-3380-4487-99e1-1865108a3e6c',
                  'audit_logs': [],
                  'bundle_id': 'e700381c-3af4-479a-af92-485c5ac89e41',
                  'events': [{'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 5, 7),
                              'event_id': '3639baf9-57a5-4c52-92da-d13432b48919',
                              'event_type': 'START_ENTITLEMENT',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-trial',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'entitlement-service',
                              'service_state_name': 'ENT_STARTED'},
                             {'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 5, 7),
                              'event_id': '2b3efee7-6cb5-4801-8abd-c11936b69439',
                              'event_type': 'START_BILLING',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-trial',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'billing-service',
                              'service_state_name': 'START_BILLING'},
                             {'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 6, 6),
                              'event_id': '2dbbf736-1c24-42f7-83fc-fbc2a8059e96',
                              'event_type': 'PHASE',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-evergreen',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'entitlement+billing-service',
                              'service_state_name': 'PHASE'}],
                  'external_key': 'e700381c-3af4-479a-af92-485c5ac89e41'}}]
    

    Query Parameters

    Name Type Required Description
    offset long true offset
    limit long true limit search items

    Returns

    Returns a list with all bundles.

    Search bundles

    HTTP Request

    GET http://example.com/1.0/kb/bundles/search/{searchKey}

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.BundleApi;
    protected BundleApi bundleApi;
    
    String searchKey = "93199";
    Long offset = 0L;
    Long limit = 1L;
    
    Bundles result = bundleApi.searchBundles(searchKey, 
                                             offset, 
                                             limit, 
                                             AuditLevel.NONE, 
                                             requestOptions);
    
    search_key = 'example'
    offset = 0
    limit = 100
    
    bundle.find_in_batches_by_search_key(search_key,
                                         offset,
                                         limit,
                                         options)
    
    bundleApi = killbill.api.BundleApi()
    search_key = '7b26b0ce-a495-4c0c-9dd5-11a556f03e8c'
    
    bundleApi.search_bundles(search_key, api_key, api_secret)
    

    Example Response:

    //First element of the list
    class Bundle {
        org.killbill.billing.client.model.gen.Bundle@6c335adf
        accountId: 132f0ce0-b3ae-4e49-90fd-b265ae8515b6
        bundleId: 23a23ae2-5b41-4b88-a731-98cb6f6f3f21
        externalKey: 93199
        subscriptions: [class Subscription {
            org.killbill.billing.client.model.gen.Subscription@30aa99f
            accountId: 132f0ce0-b3ae-4e49-90fd-b265ae8515b6
            bundleId: 23a23ae2-5b41-4b88-a731-98cb6f6f3f21
            subscriptionId: bc39131f-538d-406c-96f2-38db68dd328a
            externalKey: 93199
            startDate: 2012-04-25
            productName: Shotgun
            productCategory: BASE
            billingPeriod: MONTHLY
            phaseType: TRIAL
            priceList: DEFAULT
            planName: shotgun-monthly
            state: ACTIVE
            sourceType: NATIVE
            cancelledDate: null
            chargedThroughDate: 2012-04-25
            billingStartDate: 2012-04-25
            billingEndDate: null
            billCycleDayLocal: 25
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@850eec8c
                eventId: 03b54e77-da03-4efb-823c-03d4a42557f4
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@c9d2600
                eventId: 81afc2cd-ac13-4b48-86c9-920443291ff7
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@e7c34c4e
                eventId: 0bd9e27d-50fe-4144-9b52-01a0964d2306
                billingPeriod: MONTHLY
                effectiveDate: 2012-05-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: PHASE
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement+billing-service
                serviceStateName: PHASE
                phase: shotgun-monthly-evergreen
                auditLogs: []
            }]
            priceOverrides: []
            auditLogs: []
        }]
        timeline: class BundleTimeline {
            org.killbill.billing.client.model.gen.BundleTimeline@92a9f4c7
            accountId: 132f0ce0-b3ae-4e49-90fd-b265ae8515b6
            bundleId: 23a23ae2-5b41-4b88-a731-98cb6f6f3f21
            externalKey: 93199
            events: [class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@9fa4b25a
                eventId: 03b54e77-da03-4efb-823c-03d4a42557f4
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_ENTITLEMENT
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement-service
                serviceStateName: ENT_STARTED
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@77fd66a
                eventId: 81afc2cd-ac13-4b48-86c9-920443291ff7
                billingPeriod: MONTHLY
                effectiveDate: 2012-04-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: START_BILLING
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: billing-service
                serviceStateName: START_BILLING
                phase: shotgun-monthly-trial
                auditLogs: []
            }, class EventSubscription {
                org.killbill.billing.client.model.gen.EventSubscription@b5670810
                eventId: 0bd9e27d-50fe-4144-9b52-01a0964d2306
                billingPeriod: MONTHLY
                effectiveDate: 2012-05-25
                plan: shotgun-monthly
                product: Shotgun
                priceList: DEFAULT
                eventType: PHASE
                isBlockedBilling: false
                isBlockedEntitlement: false
                serviceName: entitlement+billing-service
                serviceStateName: PHASE
                phase: shotgun-monthly-evergreen
                auditLogs: []
            }]
            auditLogs: []
        }
        auditLogs: []
    }
    
    [
      {
         "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
         "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
         "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
         "subscriptions":[
            {
               "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
               "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
               "subscriptionId":"e29573cc-d0e6-4d26-b97e-1a9c02d520ad",
               "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
               "startDate":"2013-08-01",
               "productName":"Sports",
               "productCategory":"BASE",
               "billingPeriod":"MONTHLY",
               "phaseType":"TRIAL",
               "priceList":"DEFAULT",
               "planName":"sports-monthly",
               "state":"ACTIVE",
               "sourceType":"NATIVE",
               "chargedThroughDate":"2013-08-01",
               "billingStartDate":"2013-08-01",
               "billCycleDayLocal":31,
               "events":[
                  {
                     "eventId":"e0136144-a852-4eaa-b721-c8b585dcb4a6",
                     "billingPeriod":"MONTHLY",
                     "effectiveDate":"2013-08-01",
                     "plan":"sports-monthly",
                     "product":"Sports",
                     "priceList":"DEFAULT",
                     "eventType":"START_ENTITLEMENT",
                     "isBlockedBilling":false,
                     "isBlockedEntitlement":false,
                     "serviceName":"entitlement-service",
                     "serviceStateName":"ENT_STARTED",
                     "phase":"sports-monthly-trial",
                     "auditLogs":[]
                  },
                  {
                     "eventId":"72a51773-9e1d-4ad7-beeb-03139f60ea3d",
                     "billingPeriod":"MONTHLY",
                     "effectiveDate":"2013-08-01",
                     "plan":"sports-monthly",
                     "product":"Sports",
                     "priceList":"DEFAULT",
                     "eventType":"START_BILLING",
                     "isBlockedBilling":false,
                     "isBlockedEntitlement":false,
                     "serviceName":"billing-service",
                     "serviceStateName":"START_BILLING",
                     "phase":"sports-monthly-trial",
                     "auditLogs":[]
                  },
                  {
                     "eventId":"341992e2-4565-4457-9d20-d2803d11aa61",
                     "billingPeriod":"MONTHLY",
                     "effectiveDate":"2013-08-31",
                     "plan":"sports-monthly",
                     "product":"Sports",
                     "priceList":"DEFAULT",
                     "eventType":"PHASE",
                     "isBlockedBilling":false,
                     "isBlockedEntitlement":false,
                     "serviceName":"entitlement+billing-service",
                     "serviceStateName":"PHASE",
                     "phase":"sports-monthly-evergreen",
                     "auditLogs":[]
                  }
               ],
               "priceOverrides":[
                  {
                     "planName":"sports-monthly",
                     "phaseName":"sports-monthly-trial",
                     "phaseType":"TRIAL",
                     "fixedPrice":0
                  },
                  {
                     "planName":"sports-monthly",
                     "phaseName":"sports-monthly-evergreen",
                     "phaseType":"EVERGREEN",
                     "recurringPrice":500.0
                  }
               ],
               "auditLogs":[]
            }
         ],
         "timeline":{
            "accountId":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995",
            "bundleId":"5b7a5f2d-4054-412f-b354-b722c2cff4ec",
            "externalKey":"4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135",
            "events":[
               {
                  "eventId":"e0136144-a852-4eaa-b721-c8b585dcb4a6",
                  "billingPeriod":"MONTHLY",
                  "effectiveDate":"2013-08-01",
                  "plan":"sports-monthly",
                  "product":"Sports",
                  "priceList":"DEFAULT",
                  "eventType":"START_ENTITLEMENT",
                  "isBlockedBilling":false,
                  "isBlockedEntitlement":false,
                  "serviceName":"entitlement-service",
                  "serviceStateName":"ENT_STARTED",
                  "phase":"sports-monthly-trial",
                  "auditLogs":[]
               },
               {
                  "eventId":"72a51773-9e1d-4ad7-beeb-03139f60ea3d",
                  "billingPeriod":"MONTHLY",
                  "effectiveDate":"2013-08-01",
                  "plan":"sports-monthly",
                  "product":"Sports",
                  "priceList":"DEFAULT",
                  "eventType":"START_BILLING",
                  "isBlockedBilling":false,
                  "isBlockedEntitlement":false,
                  "serviceName":"billing-service",
                  "serviceStateName":"START_BILLING",
                  "phase":"sports-monthly-trial",
                  "auditLogs":[]
               },
               {
                  "eventId":"341992e2-4565-4457-9d20-d2803d11aa61",
                  "billingPeriod":"MONTHLY",
                  "effectiveDate":"2013-08-31",
                  "plan":"sports-monthly",
                  "product":"Sports",
                  "priceList":"DEFAULT",
                  "eventType":"PHASE",
                  "isBlockedBilling":false,
                  "isBlockedEntitlement":false,
                  "serviceName":"entitlement+billing-service",
                  "serviceStateName":"PHASE",
                  "phase":"sports-monthly-evergreen",
                  "auditLogs":[]
               }
            ],
            "auditLogs":[]
         },
         "auditLogs":[]
      }
    ]
    
    [{'account_id': '7b26b0ce-a495-4c0c-9dd5-11a556f03e8c',
     'audit_logs': [],
     'bundle_id': '69328cf3-f088-4684-b440-4e2969531930',
     'external_key': '69328cf3-f088-4684-b440-4e2969531930',
     'subscriptions': [{'account_id': '7b26b0ce-a495-4c0c-9dd5-11a556f03e8c',
                        'audit_logs': [],
                        'bill_cycle_day_local': 6,
                        'billing_end_date': None,
                        'billing_period': 'MONTHLY',
                        'billing_start_date': datetime.date(2018, 5, 7),
                        'bundle_id': '69328cf3-f088-4684-b440-4e2969531930',
                        'cancelled_date': None,
                        'charged_through_date': None,
                        'events': [{'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 5, 7),
                                    'event_id': '8a449d77-6894-4903-a048-e625bfec0acd',
                                    'event_type': 'START_ENTITLEMENT',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-trial',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'entitlement-service',
                                    'service_state_name': 'ENT_STARTED'},
                                   {'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 5, 7),
                                    'event_id': '996d3548-110c-4870-afa6-a8f0d448b184',
                                    'event_type': 'START_BILLING',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-trial',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'billing-service',
                                    'service_state_name': 'START_BILLING'},
                                   {'audit_logs': [],
                                    'billing_period': 'MONTHLY',
                                    'effective_date': datetime.date(2018, 6, 6),
                                    'event_id': 'e8d24a7d-d463-44dc-ac9d-b41ebbb16a91',
                                    'event_type': 'PHASE',
                                    'is_blocked_billing': False,
                                    'is_blocked_entitlement': False,
                                    'phase': 'standard-monthly-evergreen',
                                    'plan': 'standard-monthly',
                                    'price_list': 'DEFAULT',
                                    'product': 'Standard',
                                    'service_name': 'entitlement+billing-service',
                                    'service_state_name': 'PHASE'}],
                        'external_key': '69328cf3-f088-4684-b440-4e2969531930',
                        'phase_type': 'TRIAL',
                        'plan_name': 'standard-monthly',
                        'price_list': 'DEFAULT',
                        'price_overrides': [],
                        'product_category': 'BASE',
                        'product_name': 'Standard',
                        'source_type': 'NATIVE',
                        'start_date': datetime.date(2018, 5, 7),
                        'state': 'ACTIVE',
                        'subscription_id': '24f54c5b-ee87-407d-a079-22b5d359f2fd'}],
     'timeline': {'account_id': '7b26b0ce-a495-4c0c-9dd5-11a556f03e8c',
                  'audit_logs': [],
                  'bundle_id': '69328cf3-f088-4684-b440-4e2969531930',
                  'events': [{'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 5, 7),
                              'event_id': '8a449d77-6894-4903-a048-e625bfec0acd',
                              'event_type': 'START_ENTITLEMENT',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-trial',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'entitlement-service',
                              'service_state_name': 'ENT_STARTED'},
                             {'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 5, 7),
                              'event_id': '996d3548-110c-4870-afa6-a8f0d448b184',
                              'event_type': 'START_BILLING',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-trial',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'billing-service',
                              'service_state_name': 'START_BILLING'},
                             {'audit_logs': [],
                              'billing_period': 'MONTHLY',
                              'effective_date': datetime.date(2018, 6, 6),
                              'event_id': 'e8d24a7d-d463-44dc-ac9d-b41ebbb16a91',
                              'event_type': 'PHASE',
                              'is_blocked_billing': False,
                              'is_blocked_entitlement': False,
                              'phase': 'standard-monthly-evergreen',
                              'plan': 'standard-monthly',
                              'price_list': 'DEFAULT',
                              'product': 'Standard',
                              'service_name': 'entitlement+billing-service',
                              'service_state_name': 'PHASE'}],
                  'external_key': '69328cf3-f088-4684-b440-4e2969531930'}}]
    

    Query Parameters

    Name Type Required Description
    searchKey string true What you want to find?
    offset long true offset
    limit long true limit search items

    Returns

    Return a list with bundles matched with the search key entered.

    Catalog

    Catalog Resource

    The Catalog is at the heart of the billing system, it captures the core configuration of the billing system. At a very high level, configuring the catalog is about defining the inventory available:

    In practice, Kill Bill offers a powerful configuration, which goes beyond the definition of the inventory and includes rules for customizing the invoice generation. Please refer to our Billing Manual for more details.

    Also, it is important to understand that the catalog is versionned to provide the ability to deprecate old products, add new ones, or change prices for existing products. The catalog configuration is stored on a per tenant basis, meaning that 2 tenants may have completely different catalogs.

    In terms of api, we offer basic CRUD operations, where catalog (versions) are fetched/uploaded using XML. We also offer the ability to retrieve JSON, and have also added support to modify a given catalog version to add new plans - so called simple plan - mostly to easy the testing, and provide an easy way to play with the system - KAUI, our admin UI provides a nice integration for that purpose.

    Delete all versions for a per tenant catalog

    HTTP Request

    DELETE http://example.com/1.0/kb/catalog

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.CatalogApi;
    protected CatalogApi catalogApi;
    
    catalogApi.deleteCatalog(requestOptions);
    
    KillBillClient::Model::Catalog.delete_catalog(user,
                                                  reason,
                                                  comment,
                                                  options)
    
    catalogApi = killbill.api.CatalogApi()
    
    catalogApi.delete_catalog(created_by, api_key, api_secret)
    

    Example Response:

    no content
    
    no content
    
    no content
    

    Query Parameters

    None.

    Returns

    A 204 http status without content.

    Retrieve the catalog as JSON

    HTTP Request

    GET http://example.com/1.0/kb/catalog

    Example Request:

    TODO    
    
    import org.killbill.billing.client.api.gen.CatalogApi;
    protected CatalogApi catalogApi;
    
    DateTime requestedDate = null;
    UUID accountId = null;
    
    Catalogs catalogsJson = catalogApi.getCatalogJson(requestedDate, 
                                                      accountId, 
                                                      requestOptions);
    
    requested_date = nil
    
    KillBillClient::Model::Catalog.get_tenant_catalog_json.(requested_date, 
                                                            options)
    
    catalogApi = killbill.api.CatalogApi()
    
    catalogApi.get_catalog_json(api_key, api_secret)
    

    Example Response:

    class Catalog {
        name: Firearms
        effectiveDate: 2011-01-01T00:00:00.000Z
        currencies: [USD, EUR, GBP]
        units: [class Unit {
            name: bullets
            prettyName: bullets
        }, class Unit {
            name: stones
            prettyName: stones
        }]
        products: [class Product {
            type: BASE
            name: Assault-Rifle
            prettyName: Assault-Rifle
            plans: [class Plan {
                name: assault-rifle-annual
                prettyName: assault-rifle-annual
                billingPeriod: ANNUAL
                phases: [class Phase {
                    type: TRIAL
                    prices: []
                    fixedPrices: []
                    duration: class Duration {
                        unit: DAYS
                        number: 30
                    }
                    usages: []
                }, class Phase {
                    type: EVERGREEN
                    prices: [class Price {
                        currency: USD
                        value: 5999.95
                    }, class Price {
                        currency: EUR
                        value: 3499.95
                    }, class Price {
                        currency: GBP
                        value: 3999.95
                    }]
                    fixedPrices: []
                    duration: class Duration {
                        unit: UNLIMITED
                        number: -1
                    }
                    usages: []
                }]
            }, class Plan {
                name: assault-rifle-annual-gunclub-discount
                prettyName: assault-rifle-annual-gunclub-discount
                billingPeriod: ANNUAL
                phases: [class Phase {
                    type: TRIAL
                    prices: []
                    fixedPrices: []
                    duration: class Duration {
                        unit: DAYS
                        number: 30
                    }
                    usages: []
                }, class Phase {
                    type: DISCOUNT
                    prices: [class Price {
                        currency: USD
                        value: 99.95
                    }, class Price {
                        currency: EUR
                        value: 99.95
                    }, class Price {
                        currency: GBP
                        value: 99.95
                    }]
                    fixedPrices: []
                    duration: class Duration {
                        unit: MONTHS
                        number: 6
                    }
                    usages: []
                }, class Phase {
                    type: EVERGREEN
                    prices: [class Price {
                        currency: USD
                        value: 5999.95
                    }, class Price {
                        currency: EUR
                        value: 3499.95
                    }, class Price {
                        currency: GBP
                        value: 3999.95
                    }]
                    fixedPrices: []
                    duration: class Duration {
                        unit: UNLIMITED
                        number: -1
                    }
                    usages: []
                }]
            }, class Plan {
                name: assault-rifle-annual-rescue
                prettyName: assault-rifle-annual-rescue
                billingPeriod: ANNUAL
                phases: [class Phase {
                    type: DISCOUNT
                    prices: [class Price {
                        currency: USD
                        value: 5999.95
                    }, class Price {
                        currency: EUR
                        value: 3499.95
                    }, class Price {
                        currency: GBP
                        value: 3999.95
                    }]
                    fixedPrices: []
                    duration: class Duration {
                        unit: YEARS
                        number: 1
                    }
                    usages: []
                }, class Phase {
                    type: EVERGREEN
                    prices: [class Price {
                        currency: USD
                        value: 5999.95
                    }, class Price {
                        currency: EUR
                        value: 3499.95
                    }, class Price {
                        currency: GBP
                        value: 3999.95
                    }]
                    fixedPrices: []
                    duration: class Duration {
                        unit: UNLIMITED
                        number: -1
                    }
                    usages: []
                }]
            }, class Plan {
                name: assault-rifle-monthly
                prettyName: assault-rifle-monthly
                billingPeriod: MONTHLY
                phases: [class Phase {
                    type: TRIAL
                    prices: []
                    fixedPrices: []
                    duration: class Duration {
                        unit: DAYS
                        number: 30
                    }
                    usages: []
                }, class Phase {
                    type: EVERGREEN
                    prices: [class Price {
                        currency: USD
                        value: 599.95
                    }, class Price {
                        currency: EUR
                        value: 349.95
                    }, class Price {
                        currency: GBP
                        value: 399.95
                    }]
                    fixedPrices: []
                    duration: class Duration {
                        unit: UNLIMITED
                        number: -1
                    }
                    usages: []
                }]
            }]
            included: [Cleaning, Telescopic-Scope]
            available: [Bullets, Laser-Scope]
        }, class Product {
            type: ADD_ON
            name: Holster
            prettyName: Holster
            plans: [class Plan {
                name: holster-monthly-regular
                prettyName: holster-monthly-regular
                billingPeriod: MONTHLY
                phases: [class Phase {
                    type: TRIAL
                    prices: []
                    fixedPrices: []
                    duration: class Duration {
                        unit: DAYS
                        number: 30
                    }
                    usages: []
                }, class Phase {
                    type: EVERGREEN
                    prices: [class Price {
                        currency: USD
                        value: 199.95
                    }, class Price {
                        currency: EUR
                        value: 199.95
                    }, class Price {
                        currency: GBP
                        value: 199.95
                    }]
                    fixedPrices: []
                    duration: class Duration {
                        unit: UNLIMITED
                        number: -1
                    }
                    usages: []
                }]
            }, class Plan {
                name: holster-monthly-special
                prettyName: holster-monthly-special
                billingPeriod: ANNUAL
                phases: [class Phase {
                    type: TRIAL
                    prices: []
                    fixedPrices: []
                    duration: class Duration {
                        unit: DAYS
                        number: 30
                    }
                    usages: []
                }, class Phase {
                    type: EVERGREEN
                    prices: [class Price {
                        currency: USD
                        value: 199.95
                    }, class Price {
                        currency: EUR
                        value: 199.95
                    }, class Price {
                        currency: GBP
                        value: 199.95
                    }]
                    fixedPrices: