Divido API
=======
This is the documentation for the Divido API.
Sign up for an account to get instant access to our sandbox environment.
*Current version: v1.9*
Getting started
---------------
There are several distinct parts of a complete integration with the Divido API:
* Deal Calculator
* Finances
* Credit Request
* Finalize Credit Request
* Activation
* Cancellation
* Refund
* List all applications
* Retrieve an application
* Reporting / List all payment batches
* Reporting / Retrieve records from a payment batch
### Deal Calculator
Calculate APR, monthly repayments, duration etc
### Finances
List Rate Card and all financial products available for a specific merchant.
### Credit Request
Create a new credit proposal and return an url to application form
### Finalize Credit Request
Finalize an existing accepted credit application, will update the loan agreement and return an url to the contract signing.
### Activation
Activate whole or part of application
### Cancellation
Cancel a deactivated application
### Refund
Refund a part or whole of an activated application
### List all applications
Returns a list of your applications. The applications are returned sorted by creation date, with the most recently created applications appearing first.
### Retrieve an application
Retrieves the details of an existing application. Supply the application ID and the API will return the corresponding application.
### Reporting / List all payment batches
Retrieves all payment batches.
### Reporting / Retrieve records from a payment batch
Retrieves the content of a payment batch. Supply the batch ID and the API will return all records.
Change log
------------
#### 2016-12-20
- Added Deal Calculator
- Added directSign to Credit Request
- Added Finalize Credit Request
- Added activation status
#### 2016-11-28
- Added reference on activate and refund
- Security enhancement: Added support for signing all api calls with a shared secret, contact Divido Support for more info.
#### 2016-11-16
- Added filter on proposal for List all applications
- Updated the webhook response
- Added reference in Credit Request
#### 2016-11-07
- Added product amount for refund and activation
#### 2016-11-02
- Added product lines for refund and activation
#### 2016-11-01
- Renamed fulfillment to activation
- Added reporting
#### 2016-10-30
- Added refunds, fulfillments, fulfillmentStatus to respones
#### 2016-10-18
- Removed Deal Calculator
- Added new statuses
- Changed the product dataset
- Updated the responses from the API
#### 2016-09-27
- Added partial fulfillment
- Added refund
- Added list all applications
- Added retrieve an application
- Added new statuses
- Bug fixes
#### 2016-06-28
- Added cancellation method
- Checkout URL
- Bug fixes
- Added more community libraries
#### 2016-01-28
- Added fulfillment method
#### 2015-06-21
- Added product to credit request
- Campaigns changed to Finances
Offical Libraries
---------------
We strongly encourage use of our official libraries for accessing the Divido API. Our official libraries are listed below, as well as community supported libraries.
#### PHP
Install from source
`git clone https://github.com/DividoFinancialServices/divido-api-php.git`
Community libraries
---------------
Please submit a pull request to this page to add any missing libraries that should be featured here. Please note that Divido does not offer any support for community libraries.
#### Magento 1.*
- [Divido for Magento 1.*](https://github.com/DividoFinancialServices/divido-magento)
#### Magento 2
- [Divido for Magento 2](https://github.com/DividoFinancialServices/magento2-module)
#### WooCommerce
- [Divido for WooCommerce](https://wordpress.org/plugins/divido-for-woocommerce/)
#### OpenCart
- [Divido for OpenCart](https://github.com/DividoFinancialServices/divido-opencart)
Using the API
===========
API endpoints
---------------
To use the Divido API to query data, you will need to send a request to the correct endpoint. Request endpoints should depend on whether you wish to query the live or sandbox environment:
- Sandbox: `https://secure.sandbox.divido.com/v1/`
- Live: `https://secure.divido.com/v1/`
HTTP response codes
---------------
You may encounter the following response codes. Any unsuccessful response codes will contain more information to help you identify the cause of the problem.
- `200` The request has succeeded.
- `201` The request has been fulfilled and resulted in a new resource being created. The newly created resource can be referenced by the URI(s) returned in the entity of the response, with the most specific URI for the resource given by a Location header field.
- `404` Not Found. The requested resource was not found. The response body will explain which resource was not found.
- `500` Internal Server Error. The server encountered an error while processing your request and failed. Please report this to the Divido support team.
Webhooks
===========
To alert you of any changes in the status of your resources, Divido provides webhooks. These are POST requests to your server that are sent as soon as a resource changes status. The body of the request contains details of the change.
Request
---------------
The API server will send a POST request to the `response_url` associated with the application or `webhook_url` set by Divido support team.
#### Parameters
`application` Application ID
`proposal` Proposal ID
`reference` Third party reference (if supplied as part of the application)
`status` New status
`metadata` Metadata (if supplied as part of the application)
#### Example Request
JSON example
``` json
{
"application": "C84047A6D-89B2-FECF-D2B4-168444F5178C",
"event": "application-status-update",
"metadata": {
"Invoice Number": "844001",
"Order Number": "100019"
},
"name": "John Doe",
"proposal": "PAA717844-EE9D-78AF-D11C-EDCC1D180F87",
"reference": "100019",
"status": "ACCEPTED"
}
```
Possible statuses
---------------
- `DRAFT` - Proposal send to Underwriter, waiting for decision
- `ACCEPTED` - Application accepted by Underwriter
- `DECLINED` - Applicaiton declined by Underwriter
- `REFERRED` - Application referred by Underwriter, waiting for new status
- `INFO-NEEDED` - More information is required before decision
- `ACTION-CUSTOMER` - Waiting for more information from Customer
- `ACTION-RETAILER` - Waiting for more information from Merchant
- `ACTION-LENDER` - Waiting for more information from Underwriter
- `DEPOSIT-PAID` - Deposit paid by customer
- `SIGNED` - Customer has signed all contracts
- `AWAITING-ACTIVATION` - Waiting for confirmation from Underwriter
- `AWAITING-CANCELLATION` - Waiting for confirmation from Underwriter
- `PARTIALLY-ACTIVATED` - Application partially activated by merchant
- `ACTIVATED` - Application activated and confirmed by Underwriter
- `CANCELLED` - Application cancelled
- `REFUNDED` - Whole Application refunded
- `DISPUTED` - Dispute raised by Merchant or Underwriter
- `LOAN-REVERSAL` - Loan reversal in progress
- `COMPLETED` - Application completed (after cool down period)
Resources
===========
Finances
------------------
Returns an array with all finance options available for merchant
#### Example Request
`GET` https://secure.divido.com/v1/finances?merchant={MERCHANT}&country={COUNTRY} `HTTP/1.1`
#### Example Response
JSON example
``` json
{
"finances": [
{
"agreement_duration": 6,
"country": "GB",
"deferral_period": 0,
"id": "F06895E17-EE96-926E-7137-37BCABB9DCF7",
"interest_rate": 0,
"max_deposit": 50,
"min_amount": 150,
"min_deposit": 0,
"text": "6 Month 0% Interest Free"
},
{
"agreement_duration": 12,