Giter Site home page Giter Site logo

zuora_rest_client's Introduction

ZuoraRestClient

This is a simple Zuora client for Ruby. It mainly consists of methods that wrap the operations described in the Zuora API Reference (https://www.zuora.com/developer/api-reference), as well as a few helper methods.

Most of the methods take either the query parameters and/or a hash representing the JSON request body as arguments. The methods return a ZuoraRestClient::Result object which represents ths JSON response.

Installation

Add this line to your application's Gemfile:

gem 'zuora_rest_client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install zuora_rest_client

Usage

First, construct a client object:

username = '[email protected]'
password = 'mypassword'
client = ZuoraRestClient::Client.new(username, password)  # Create a production client

For a sandbox tenant, you can specify the following:

client = ZuoraRestClient::Client.new(username, password, :api_sandbox)  # Create an api sandbox client

For a "serivcesNNN" tenant, where NNN is the number that follows "services", you may also need an API proxy port number to invoke calls to /action/* and /object/*. Assuming your services tenant is services000 and your API proxy port number is 1234, you can specify the following:

client = ZuoraRestClient::Client.new(username, password, :services000, api_proxy_port: 1234)  # Create an api services000 client

Call one of the client methods. For example, to create an account:

account_to_create = {
    Batch: 'Batch1',
    BillCycleDay: 15,
    Currency: 'USD',
    Name: 'Test Account',
    PaymentTerm: 'Due Upon Receipt',
    Status: 'Draft' }
result = client.create_account_object(account_to_create) # Returns an object representation of the JSON response

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/FronteraConsulting/zuora_rest_client.

zuora_rest_client's People

Contributors

mbandrewfoster avatar

Watchers

 avatar  avatar

Forkers

mbandrewfoster

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.