tillit v0.0.6
Tillit Node.js Library
The Tillit Node Library provides convenient access to Tillit Checkout APIs.
It helps merchants/webshops to integrate with Tillit
Documentation
See the https://tillit.stoplight.io/docs/tillit-checkout-api-docs/docs/1.%20Introduction.md
Requirements
Node 8, 10 or higher
Installation
Install the package with:
npm install tillit --save
Usage
The package needs to be configured with merchant api key befor calling any other function
const Tillit = require('tillit');
const tillit = new Tillit();
tillit.setVariables({
baseUrl: "https://staging.api.tillit.ai/v1",
merchantAPIKey: "secret_prod_...."
});
tillit.getOrderList((err, response) => {
if (err) {
console.log(err);
} else {
console.log(JSON.parse(response.body));
}
});
Or ES Modules and async/await: Coming Soon
import Tillit from 'tillit';
const tillit = new Tillit();
Available Functions
Create Order
SDK Function Name:
createOrder
Method:
POST
Endpiont Url: https://api.tillit.ai/v1/order
Description: Create an order.
Get order details
SDK Function Name:
getOrderDetails
Method:
GET
Endpoint Url: https://api.tillit.ai/v1/order/{{order_id}}
Description: Retrieve a previously created order.
Provide invoice details
SDK Function Name:
provideInvoiceDetails
Method:
POST
Endpoint Url: https://api.tillit.ai/v1/order/{{order_id}}/invoice_details
Description:
Invoice details are provided by:
- The merchant via Merchant Portal for
Order.invoice_type == DIRECT_INVOICE
- Tillit Bank or a 3rd-party bank for
Order.invoice_type == FUNDED_INVOICE
Void for
Order.invoice_type == CARD
The merchant can provide the invoice_details when creating an order, when updating an order, or by using this endpoint directly.
- The merchant via Merchant Portal for
Get list of orders
SDK Function Name:
getOrderList
Method:
GET
Endpoint Url: https://api.tillit.ai/v1/orders
Description: Retrieve all orders made by a given merchant or buyer.
Edit order
SDK Function Name:
editOrder
Method:
PUT
Endpoint Url: https://api.tillit.ai/v1/order/{{order_id}}
Description: Edit a previously created order.
Update order when fulfilled
SDK Function Name:
fulfilOrder
Method:
POST
Endpoint Url: https://api.tillit.ai/v1/order/{{order_id}}/fulfilled
Description:
Set the order status to
FULFILLED
. Fulfilled requests should normally have empty request body. Only for partial capture, the post body is as below.
Update order when delivered
SDK Function Name:
deliverOrder
Method:
POST
Endpoint Url: https://api.tillit.ai/v1/order/{{order_id}}/delivered
Description:
Optional order update: Set the order status to
DELIVERED
.
Cancel the order
SDK Function Name:
cancelOrder
Method:
POST
Endpoint Url: https://api.tillit.ai/v1/order/{{order_id}}/cancel
Description:
Endpoint to cancel the order and void the invoice.
Get verification information for order
SDK Function Name:
getOrderVerificationInfo
Method:
GET
Endpoint Url: https://api.tillit.ai/v1/order/{{order_id}}/verification
Description:
Create order intent
SDK Function Name:
orderIntent
Method:
POST
Endpoint Url: https://api.tillit.ai/v1/order_intent
Description:
The endpoint enables the merchant to check in advance whether an invoice payment is applicable as a payment method for the
Buyer
.Tillit will perform a risk assessment and credit check using the data provided in the
OrderIntent
before a boolean is returned as a result.If
line_items
are provided Tillit will be able to do a more accurate assessment and the approval rate will in general increase.
Create partner merchant
SDK Function Name:
createPartnerMerchant
Method:
POST
Endpoint Url: https://api.tillit.ai/v1/partner/merchant
Description:
Get partner merchant
SDK Function Name:
getPartnerMerchant
Method:
GET
Endpoint Url: https://api.tillit.ai/v1/partner/merchant/{{merchant_id}}
Description: