Increase Ruby API library

The Increase Ruby library provides convenient access to the Increase REST API from any Ruby 3.0+ application.


Documentation for the most recent version of this gem can be found on RubyDoc.

The underlying REST API documentation can be found on


To use this gem during the beta, install directly from GitHub with Bundler by adding the following to your application's Gemfile:

gem "increase", git: "", branch: "main"

To fetch an initial copy of the gem:

bundle install

To update the version used by your application when updates are pushed to GitHub:

bundle update increase


require "increase"

increase =
  api_key: "My API Key", # defaults to ENV["INCREASE_API_KEY"]
  environment: "sandbox" # defaults to 'production'

 = increase.accounts.create(name: "My First Increase Account")

puts .id


Functionality in this library is organized around the resources exposed by the Increase API. Methods on those resources correspond to endpoints on the API, e.g.:

card ={
  account_id: "account_in71c4a4ph0vgo2ql3ky",
  description: "Card for Alice"

Methods that reference an object will take an identifier for that object as the first argument:

card ="card_ou2s0hwk5rn6kn2e7xg2")

When data beyond an identifier is needed for a request, such as with create or update, pass a Hash with Symbol keys:

updated_card =
  {description: "New description"}

All methods take request options as their last argument. These can be used to modify the behaviour of the client for that particular request. This argument can always be omitted if not needed. See the Increase::RequestOptions docs for details:

card =
  {description: "New description"},
  {max_retires: 1}

Detailed documentation for all resources can be found in the Increase::Resources namespace.


The library provides Ruby classes for all responses returned by the API. Instances of these classes allow convenient access to parsed response data:

card ={
  account_id: "account_in71c4a4ph0vgo2ql3ky",
  description: "Card for Bob"
#=> 2028

You can also access model attribute data using key lookup syntax:

#=> 2028

To get all parsed data as a Hash, use to_h:

card_data = card.to_h
#=> [:id, :account_id, :created_at, :description, ...]

See the Increase::Models docs for details.


When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of Increase::HTTP::Error will be thrown:

   = increase.accounts.create
rescue Increase::HTTP::Error => e
  puts e.code # 400

Error codes are as followed:

Status Code Error Type
400 BadRequestError
401 AuthenticationError
403 PermissionDeniedError
404 NotFoundError
409 ConflictError
422 UnprocessableEntityError
429 RateLimitError
>=500 InternalServerError
(else) APIStatusError
N/A APIConnectionError


Certain errors will be automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors will all be retried by default.

You can use the max_retries option to configure or disable this:

# Configure the default for all requests:
increase =
  max_retries: 0 # default is 2

# Or, configure per-request:
increase.accounts.create(name: "Jack", max_retries: 5)


This package follows SemVer conventions. As the library is in initial development and has a major version of 0, APIs may change at any time.


Ruby 3.0 or higher.