Documente Academic
Documente Profesional
Documente Cultură
Version 4.01
31st January, 2019
By Nalin Agrawal (nalin@snapmint.com)
1. Website integration
1 Implement the integration
Testing https://sandbox.snapmint.com/merchants/sign_in
When user selects Snapmint as payment options, the url should be redirected to the following
url along with the POST parameters mentioned in section 1.4
Environment POST URL
Testing https://sandboxapi.snapmint.com/v1/public/online_checkout
· Please go to your production or testing environment. The javascript code for testing and
production environment are the same.
You will be able to access the Javascript at :
https://console.snapmint.com/merchants/my_account
· Copy the Javascript code and place it on all the pages of the website where you would
like to communicate EMI pricing to the customer
· Javascript can be modified after a consultation with your team
<!--Order Details-->
<input type="hidden" name=shipping_fees” value="Optional"/>
<input type="hidden" name=discount_code” value="Optional"/>
<input type="hidden" name=order_id” value="Compulsory"/>
<input type="hidden" name=order_value” value="Compulsory"/>
<!--User Details-->
<!--Basic Details-->
<input type="hidden" name=full_name” value="Compulsory"/>
<input type="hidden" name=email” value="Compulsory"/>
<input type="hidden" name=mobile” value="Compulsory"/>
<!--shipping address-->
<input type="hidden" name="shipping_full_name” value="Compulsory"/>
<input type="hidden" name="shipping_address_line1” value="Compulsory"/>
<input type="hidden" name="shipping_address_line2” value="Compulsory"/>
<input type="hidden" name="shipping_city” value="Compulsory"/>
<input type="hidden" name="shipping_zip” value="Compulsory"/>
<!--billing address-->
<input type="hidden" name="billing_full_name” value="Compulsory"/>
<input type="hidden" name="billing_address_line1” value="Compulsory"/>
<input type="hidden" name="billing_address_line2” value="Compulsory"/>
<input type="hidden" name="billing_city” value="Compulsory"/>
<input type="hidden" name="billing_zip” value="Compulsory"/>
<!--User details End-->
<!--Product details-->
<!--Product 1-->
<input type="hidden" name="products[][sku]" value="Compulsory"/>
<input type="hidden" name="products[][name]" value=" Compulsory"/>
<input type="hidden" name="products[][quantity]" value="Compulsory"/>
<input type="hidden" name="products[][item_url]" value="Optional"/>
<input type="hidden" name="products[][unit_price]" value="Compulsory"/>
<input type="hidden" name="products[][udf1]" value="Optional"/>
<input type="hidden" name="products[][udf2]" value="Optional"/>
<input type="hidden" name="products[][udf3]" value="Optional"/>
<!--Product 2-->
<input type="hidden" name="products[][sku]" value="Compulsory"/>
<input type="hidden" name="products[][name]" value="Compulsory"/
<input type="hidden" name="products[][quantity]" value="Compulsory"/>
<input type="hidden" name="products[][item_url]" value="Optional"/>
<input type="hidden" name="products[][unit_price]" value="Compulsory"/>
<input type="hidden" name="products[][udf1]" value="Optional"/>
<input type="hidden" name="products[][udf2]" value="Optional"/>
<input type="hidden" name="products[][udf3]" value="Optional"/>
<!--Product details End-->
** In the merchant initiated POST request, one of the mandatory parameters is the checksum
hash, mentioned in the section later. It is extremely critical for the merchant to calculate this
hash correctly before sending the request to Snapmint servers. The details for the same are in
section 2.1.4.2
Order Details order_value Compulsory Order value after all discounts and
taxes in float
** Please add all the products in the cart. We verify the total order value with quantity and unit
price of the product for processing the loan application
1.5 Response
Order Details order_value Order value after all discounts and taxes in float
This section describes the API's which we use for integration when any application is in
authorized state and which can be further processed for merchant inventory check and
shipment of the product to the end customer.
Testing http://sandbox.snapmint.com/api/orders/getAuthorizedOrders?token=
merchant_token
"status": "Error",
"message": "Unauthorized or Incorrect parameters"
Testing http://sandbox.snapmint.com/api/orders/captureOrder?token=mercha
nt_token
{ "status": "success",
"order_id": "145000926",
"loan_serial": "004CD00002497APP",
"snapmint_id": 2497,
"order_status": "Captured",
"order_value": 22568,
"lender_name": "AU bank Ltd.",
"emi_amount": 2628,
"tenure": 6,
"down_payment_amt": 6800,
"processing_fees": 343,
"down_payment_status": "none",
"emi_starts_from": "2017-03-10T17:30:00.000+05:30",
"created_at": "2017-02-15T18:18:10.000+05:30"
}
"status": "Error",
"message": "Please pass the order Id/ Multiple authorized orders with same Order ID "
Testing http://sandbox.snapmint.com/api/orders/voidOrder?token=merchant_
token
{
"status": "success",
"order_status": "Cancelled",
"order_id": "145000926",
"loan_serial": "004CD00002497APP",
"snapmint_id": 2497
}
{
"status": "Error",
"message": "Order does not exist or order cannot be cancelled at this time/ Unauthorized or
Incorrect parameters "
}
Testing http://sandbox.snapmint.com/api/orders/check_preapproved_limit?mo
bile=1234567890&token=merchant_token
{
"status": "success",
"is_pre_approved": True/False,
"pre_approved_limit": 2497
}
{
"status": "Error",
"message": "User does not exist."
}
Testing http://sandbox.snapmint.com/api/orders/getOrderStatus?order_id=123
45&token=merchant_token
{
"status": "Success",
"order_id": "abc12345"
"loan_serial": "100CD00023974APP",
"order_status": "authorized"
"snapmint_id": "123456",
"emi_amount": "12345"
"tenure": "3",
"down_payment_amt": "10000"
"processing_fees": "100",
"down_payment_status": "success"
"emi_starts_from": "Sun, 10 Mar 2019 12:00:00 UTC +00:00",
"cashback": "100",
"created_at": "Sun, 10 Mar 2019 12:00:00 UTC +00:00"
}
{
"status": "Error",
"message": "Order does not exist/ Please pass order id"
}
2.6 Get and Sign Agreement
This API is only relevant for merchants where ticket sizes exceed 1L and they use their own
platforms for completing the transactions.
Testing http://sandbox.snapmint.com/api/orders/get_agreement?loan_id=123
45&token=merchant_token
{
"status": "Error",
"message": "Incorrect Loan Id"
}
2.6.3 GET URL for Test/Production
Testing http://sandbox.snapmint.com/api/orders/signed_agreement?loan_id=1
2345&merchant_user_id=123&ip_address=xxx.xxx.xxx.xxx&domain=
www.domain.com&token=merchant_token
{
"status": "Error",
"message": "Incorrect Loan Id"
}