Top
Developers Your place to code all things handmade

Welcome to the Shopclues Developer Platform

We believe in code as craft. Join the community of developers, creators and build tools that enrich the ways you can shop, sell and connect with the India's largest merchant base most easily.

Get Started

Register, Upload, Search and Connect

Explore Shopclues' marketplace of over 8.5 million products from over 3.5 lakh merchants. Connect buyers with the items they'll love.

Learn More About Catalog Management

Login, Integrate and Create

Build the best tools for Shopclues merchants. Simply login, Integrate and start developing you own apps.

Learn More About Start Developing
<
>
Jump to: navigation, search

Payment Service

Note: Access token is required to call this API. Click here to know more about access token (OAUTH2).

This API represents our payment collection flow. It provides payment collection link where applications can redirect for payment. After hitting this API, you will get payment_url (as shown below) in the response which is used to redirect to the payment page.

Method – POST, Supported format = JSON

Headers

Authorization : “Bearer bc1f461de4f193”
Content-Type : ”application/json”

Details of request parameters:

Field Name Description
order_id order_id for which payment has to be done
email email id of the user who has placed the order
returnurl_success link to redirect after sucessfull payment
returnurl_fail link to redirect after payment failure

Field name Description Mandatory
Header - “Authorization” Token with token type to identify user created using above API call.”Bearer bc1f461de” Yes
Header - “Content-Type” Input Content Type here, it would be “application/json” Yes

  • JSON
  • PHP
Production Url
http://developer.shopclues.com/api/v1/paymentservice
Sandbox Url
 http://sandbox.shopclues.com/api/v1/paymentservice

Sample JSON request

{
  "order_id": "77828381",
  "email": "test310@gmail.com",
  "returnurl_success": "index.php?dispatch=payment_complete.php",
  "returnurl_fail": "index.php?dispatch=payment_complete.php"
}

Sample JSON response

{
  "status": 1,
  "code": 200,
  "message": "success",
  "data": {
    "payment_url": "https://sandbox.shopclues.com/frontend/index.php?dispatch=payment_service.php&token=36f0459a7eaaadbd24220344955affe787f344da6f5810acbc5fbe607ad0e0942a761fb88b3750d749af391aa729c563c6163ca0f6fddef17ff45746de961ea6"
  },


  "extra": null
}

Sample error JSON response

{
  "status": 0,
  "code": 200,
  "message": "OK",
  "data": {
    "message": "specify valid order_id"
  },
  "extra": [
    
  ]
}

Click here for access token documentation.

<?php
$curl = curl_init();
$token="<token>";
curl_setopt_array($curl, array(
  CURLOPT_URL => " http://sandbox.shopclues.com/api/v1/paymentservice",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => '{
  "order_id": "77828381",
  "email": "test310@gmail.com",
  "returnurl_success": "index.php?dispatch=payment_complete.php",
  "returnurl_fail": "index.php?dispatch=payment_complete.php"
}',
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer .$token",
    "content-type: application/json",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
?>

Looking for ShopClues Apps?

Check out our new
App Gallery!

It's the best way to find cool and useful tools built upon Shopclues's API.