Zuora_api

Gem Version

This gem provides an easy integration with Zuora

Installation

Add this line to your application's Gemfile:

gem 'zuora_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install zuora

Usage

In order to make API calls a Zuora Login object must be created by running

zuora_client = Zuora:API:Login.new(:username =>"username", :password => "password", :url => "endpoint")

Available Fields

  • username
  • password
  • url
  • wsdl_number
  • status
  • current_session
  • environment
  • status
  • errors
  • current_error
  • user_info
  • tenant_id
  • tenant_name

Rest Call

zuora_client.rest_call(method: :get, body: {}, url: rest_endpoint("catalog/products?pageSize=4"),headers: {}, **keyword_args)

SOAP Call

soap_call(ns1: 'ns1', ns2: 'ns2', batch_size: nil, single_transaction: false, debug: false , **keyword_args)

Example:

output_xml, input_xml = zuora_client.soap_call() do |xml, args|
       xml['ns1'].query do
        xml['ns1'].queryString "select id, name from account"
       end
    end

Query

zuora_client.query(query)

Data export

zuora_client.getDataSourceExport(query)

Describe Call

response = zuora_client.describe_call()

This returns all available objects from the describe call as a hash. This response can be accessed by using response["Account"] to retrieve all related data about that object.

response = zuora_client.describe_call("Account")

This returns all information and fields related to that object model as a hash.

Journal Run

zuora_client.createJournalRun(call)