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

Returns Create Order

This API is used to create a return for an order.

Method= POST

Headers

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

Field Description:

Field name Description Mandatory
Header - “Authorization” Access token is passed to identify the user. Eg- ”Bearer bc1f461de4f193" Yes
Header - “Content-Type” Input Content Type here it would be “application/json" Yes

Field Description:

Params Description
"action":"1", -> It denotes Return.
"action":"2", -> It denotes Refund.

Field Description:

Field name Description Mandatory
shipping_mode field to get whether will customer will send the product by its own. No

Note : order_id ,reason , (if picture_req = 'Y' then upload_rma_pic is mandatory) action ,returns , (if payment_id is 6 then bank details should be mandatory)

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

Sample JSON Request:

{   
  "order_id":"103936516",
  "action":"1",
  "refund_mode" : "refund_in_cb",
  "items" : ["1246269369"],
  "shipping_mode": "cust_will_send_product",
  "comment":"not satisfactory",
  "returns" : {"1235031006" : { "product_id" : "81903152","amount" : "1","chosen" : "Y","reason" : "4","available_amount" : "6" }},
  "bank_details" :{"username":"kamal","bank_name":"3","other_bank":"","bank_type":"Savings","account_no":"265555585455","ifsc_code":"HDFC0000456","bank_branch":"Bank of Bahrain & Kuwait"},
  "apv_req":"Y",
  "sc_apv_req":"Y",
  "mc_apv_req":"N",
  "picture_req":"N",
  "payment_id":6,
  "cust_msg":"",
  "upload_rma_pic": ["http://www.planwallpaper.com/static/images/desktop-year-of-the-tiger-images-wallpaper.jpg","https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTHL8VuKbvWui_lz6avDQXbZkAExcc5rBBCGdVxzGYFNbY986Ud"],
  "source_key" :"532c28d5412dd75bf975fb951c740a30"
}

Sample JSON Response:

{
  "status": 1,
  "code": 200,
  "message": "success",
  "data": {
    "return_info": {
      "return_id": "3364687",
      "order_id": "103936516",
      "user_id": "60",
      "timestamp": "1483534464",
      "action": "1",
      "status": "R",
      "total_amount": "1",
      "comment": "Helloo everyone",
      "extra": null,
      "refund_in_ac": "",
      "refund_in_cb": "",
      "cust_will_send_product": "",
      "pick_up_frm_my_shipping_add": "",
      "product_pic_url": "http://www.planwallpaper.com/static/images/desktop-year-of-the-tiger-images-wallpaper.jpg",
      "customer_action": "1",
      "processing_queue": "0",
      "ticket_id": "0",
      "carrier_id": null,
      "manifest_id": null,
      "tracking_no": null,
      "return_source": "desktop",
      "return_address_id": "0",
      "is_partial": "N",
      "items": {
        "A": {
          "1235031006": {
            "return_id": "3364687",
            "item_id": "1235031006",
            "product_id": "81903152",
            "reason": "4",
            "customer_reason": "0",
            "amount": "1",
            "type": "A",
            "price": "1249.00",
            "product_options": [
              {
                "variant_id": "5464601",
                "option_id": "482246",
                "position": "0",
                "modifier": "0.000",
                "modifier_type": "A",
                "weight_modifier": "0.000",
                "weight_modifier_type": "A",
                "point_modifier": "0.000",
                "point_modifier_type": "A",
                "variant_name": "Black/Green",
                "option_name": "Color"
              }
            ],
            "product": "Sansui A11",
            "merchant_action": "0",
            "resolution_id": "0",
            "approved_by": "",
            "original_product_id": "81903152"
          }
        }
      }
    }
  },
  "extra": []
}

Failure case:

1) if order id is missing

{
  "status": 0,
  "code": 200,
  "message": "OK",
  "data": {
    "message": "order id is missing"
  },
  "extra": []
}

2) if shipping_mode is missing

{
  "status": 0,
  "code": 200,
  "message": "OK",
  "data": {
    "message": "shipping_mode is missing"
  },
  "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/Returns",
  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":"103936516",
  "action":"1",
  "refund_mode" : "refund_in_cb",
  "items" : ["1246269369"],
  "shipping_mode": "cust_will_send_product",
  "comment":"not satisfactory",
  "returns" : {"1235031006" : { "product_id" : "81903152","amount" : "1","chosen" : "Y","reason" : "4","available_amount" : "6" }},
  "bank_details" :{"username":"kamal","bank_name":"3","other_bank":"","bank_type":"Savings","account_no":"265555585455","ifsc_code":"HDFC0000456","bank_branch":"Bank of Bahrain & Kuwait"},
  "apv_req":"Y",
  "sc_apv_req":"Y",
  "mc_apv_req":"N",
  "picture_req":"N",
  "payment_id":6,
  "cust_msg":"",
  "upload_rma_pic": ["http://www.planwallpaper.com/static/images/desktop-year-of-the-tiger-images-wallpaper.jpg","https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTHL8VuKbvWui_lz6avDQXbZkAExcc5rBBCGdVxzGYFNbY986Ud"],
  "source_key" :"532c28d5412dd75bf975fb951c740a30"
}',
  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.