Ruby implementation of the Slimpay Hypermedia API.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status Gem Version


Ruby implementation of the Slimpay Hypermedia API.

Slimpay website :


Add this line to your application's Gemfile:

gem 'slimpay'

And then execute:

$ bundle

Or install it yourself as:

$ gem install slimpay


API Docs:


If you use Rails place this code in config/initializers/slimpay.rb:

Slimpay.configure do |config|
  config.client_id = "your_client_id"
  config.client_secret = "your_client_secret"
  config.creditor_reference = "your_creditor_reference"
  config.sandbox = true
  config.notify_url = 'you_notifications_url'
  config.return_url = 'your_return_url'

Notification and return URLs

The notification URL is the point of your application where Slimpay will send a POST request with the result of the current order. The state of the order will be either close.completed or closed.aborted.aborted_byclient if everything worked normally, or one of those quoted in the API Order documentation.

The return URL is the point of your application where your user/customer will be redirected to when he will have finish signing its mandate with Slimpay.

The root endpoint:

The Slimpay API uses self-discovery. It means that each time you will perform a request, the answer will be a Hash of links to follow in order to perform more requestq.

The more you do requests, the more methods will appear.

When you emplement any class, it will inherits from the root-endpoint and thus already have available methods.

slimpay = = '1234', client_secret = '987654321', creditor_reference = 'azerty')

⚠️ If you call without arguments, the Sandbox credentials will be used.

Result will be a Hash:


The keys of this Hash are the methods name you can call on the class instance (here Slimpay::Base). The value is the URL that will be used, with its arguments.



The arguments will be creditorReference and reference. You can give them as a Hash. See below for an example.

Some methods as been added to this gem as shortcuts to these root methods.

Available resources :

Order, Mandate, App

Each resource inherit from Resource wich itself inherits from Base. Base defines root methods according to the Slimpay API.


The official API method:

orders = = '1234', client_secret = '987654321', creditor_reference = 'azerty')
orders.get_orders({creditorReference: 'mysellername', reference: 1234})

The shortcut:

orders = = '1234', client_secret = '987654321', creditor_reference = 'azerty')

Result will be a Hash:


Now you can call new methods : get_creditor, get_subscriber, user_approval, get_order_items, get_mandate

NB: Note that the methods in the resulting Hash are dashed-named, but the generated methods are camelcased.


The sanbox let you test credentials connection and few methods.

You will need a test environment setted up by Slimpay to go further.


  • client_id = 'democreditor01'
  • client_secret = 'demosecret01'
  • creditor_reference : democreditor


  • IBAN : FR1420041010050500013M02606
  • Code for phone verification : 0000


After checking out the repo, run bin/setup to install dependencies. Then, run rake rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to


Bug reports and pull requests are welcome on GitHub at This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.


The gem is available as open source under the terms of the MIT License.