NAV Navbar
Logo
curl javascript

Introduction

Welcome to Gane Loans API reference. This guide is for merchants who want to offer financing for purchases.

To use these API’s you must have developer credentials you can get here.

The credentials will include:

Credential Description
key key that identifies your merchant in the Gane system
short_url a short url link that can be provided anywhere on your website for easy integration

A shopping cart should allow for a user to flow to loan application process in which case, if the user is approved, they will receive a MasterCard credential that they will insert into their browser to pay for the currect shopping cart total at your website. The restful session integration method will allow your website to receive the card information without the user inserting card data after the loan has been approved.

This guide will provide a simple method to get “as low as” pricing for Gane Loans and also 2 integration method options:

  1. Just place HTML code snippit on your site
  1. create (start) a session
  2. update a session with the callback_url
  3. redirect user to short_url
  4. on callback get session details to retrieve card data
  5. process payment on the card delivered in session

“As Low As” Pricing

This API request will respond with basic loan details including “as low as” amount that can be used inside shopping cart user interface

Get “as low as” pricing information:

curl 'https://api.gane.io/loan/your_merchant_id?amount=623.23' -X GET 

Make sure to replace your_merchant_id with your developer credentials.

HTTP Request

GET https://api.gane.io/loan/your_merchant_id?amount=623.23

returns JSON structured like this:

{
    "payments": 12,
    "apr": 15.0,
    "as_low_as": "51.94"
}

HTTP Response

Loan object details about the potential loan are returned, including “as low as” pricing details.

Basic Integration

The easiest integration is to simply place the hyperlink on your website. The URL is the short_url from your credentials. Example:

<a href=http://credit.gane.io/Qnk5r6E?loan_amount_request=623.23&image_url=https%3A%2F%2Fwww.myshoppingcard.com%3Fpic.png&description=awesomestuff&callback_url=https%3A%2F%2Fwww.myshoppingcard.com%3Fcardid%3D1234>Pay with Gane!</a>

The parameters passsed to the link:

Parameter Description Required
loan_amount_request loan request in USD no (user will enter if not supplied)
callback_url url where the customer is directed after the loan application process no
image_url url of an image no
description cart description no

RESTful integration

Start a session

create a session

When a customer is presented with checkout options. This API allows you to create a customized user flow to allow that customer to apply for fiancing and then the API will redirect back to your specified callback_url

Start a session:

curl https://api.gane.io/session \
  -X POST \
  -d '{"loan_amount_request":"623.23","key":"your_merchant_key"}'

Make sure to replace your_merchant_key with your developer credentials.

HTTP Request

POST https://api.gane.io/session

JSON Parameters

Parameter Description Required
key the merchant key assigned to you yes
loan_request_amount the total USD amount in the shopping cart yes
callback_url the URL to return back to after user loan qualification flow no
image_url the URL of the image of item in shopping cart no
description the description of item in shopping cart no

returns JSON structured like this:

{
        "id": "78b7d646-4d36-11e7-865c-6923b14e2832",
        "merchant": "4c4ab3ac-4ae4-11e7-95be-d0cdc9d9bed6",
        "short_url": "https://credit.gane.io/QxgBPkW",
        "image_url": null,
        "description": null,
        "loan_amount_request": "623.23",
        "callback_url": null
        "loan": null
        "card": null
        "stripe_card_token": null
}

HTTP Response

Session object details about the session are returned. The next step in the flow is to redirect the customer to the short_url.

JSON session Object Parameters

Parameter Description
id the session id
loan_request_amount the amount being requested for financing
callback_url the URL to return back to after user loan qualification flow
image_url the URL of the image of item in shopping cart
description the description of item in shopping cart
short_url the redirect link for the next step in the flow

Update a session

update a session

it may be necessary to update the callback_url to include the session id returned in session creation before sending the user for loan approval.

Update a session:

curl https://api.gane.io/session \
  -X PUT \
  -d '{"id":"78b7d646-4d36-11e7-865c-6923b14e2832","callback_url":"your_callback_url?session=xxxxxwhateveryoursessionidis"}'

HTTP Request

PUT https://api.gane.io/session

JSON Parameters

Parameter Description Required
id session id yes
loan_request_amount the total USD amount in the shopping cart no
callback_url the URL to return back to after user loan qualification flow no
image_url the URL of the image of item in shopping cart no
description the description of item in shopping cart no
loan_request_amount the total USD amount in the shopping cart no
process_payment the description of the payment transaction for stripe payment no
close close the session object no

Get session details

get session details

After the callback returns the user to your domain, you can get the session details to process the payment.

Get session details:

curl https://api.gane.io/session/your_session_id -X GET 

Make sure to replace your_session_id with the current session id.

HTTP Request

GET https://api.gane.io/session/your_session_id

returns JSON structured like this:

{
        "loan": {
            "status": "approved",
            "approved_amount": "623.23"
        },
        "callback_url": "your_callback_url?session=xxxxxwhateveryoursessionidis",
        "short_url": "https://go.gane.io/QBaNJ5W",
        "image_url": null,
        "description": null,
        "merchant": "8acb1dac-3c15-11e7-8d75-d277cd1f50c0",
        "id": "df75dd94-4253-11e7-90ea-52ab2ac53d1a",
        "loan_amount_request": "623.23",
        "stripe_card_token": null,
        "card": {
            "full_card_number": "5242424242424242",
            "address": "7200 SPURLOCK DR",
            "exp_mon": "10",
            "last_name": "Yeager",
            "exp_year": "19",
            "first_name": "Charles",
            "cvv": "751",
            "zip": "78731"
        }
}

HTTP Response

Session object details about the session are returned, including loan approval and payment details. The next step in the flow is to process the payment with the MasterCard information returned.

JSON session Object Parameters

Parameter Description
id the session id
loan_request_amount the amount being requested for financing
callback_url the URL to return back to after user loan qualification flow
image_url the URL of the image of item in shopping cart
description the description of item in shopping cart
short_url the redirect link for the next step in the flow
loan loan object associated to this session if state
card payment card object associated to this session - returned if not a stripe integration
stripe_card_token stripe token if this is a stripe integration

JSON loan Object Parameters

Parameter Description Options
status current loan status pending, approved or declined
approved_amount the amount that was approved

JSON card Object Parameters

Parameter Description
full_card_number 16 digit mastercard number
address card address line 1
exp_mon card expiration month (XX format)
last_name card holder last name
exp_year card expiration year (XX format)
first_name card holder first name
cvv card cvv (magic 3 digits on back of card)
zip card zip code

Errors

The Gane Loans API uses the following error codes:

Error Code Meaning
400 Bad Request – Bad request
404 Not Found – Could not find object
500 Internal Server Error – We had a problem with our server. Try again later.