Returns API

 In API/Developers

API RETURNS

 

Method: CreateReturn

Creates a return from an order sent from ShipEdge.

HTTP: POST /API/Returns/CreateReturn

 

Format: JSON

 

ParameterType Description
ApiKey (*)varcharUnique key. This will be found in your ShipEdge account. Preferences>API Integration> Key.
AccountID   (*)intID of your account. This will be found in your ShipEdge account. Preferences>API Integration>AccountID
ShippingNum (*)intShipping # of the order that you wish to request the return. Only orders with the “shipped” status can be requested.
CommentvarcharYou can use comments to give some special information to the warehouse.
LabelEnum (YES,NO)If you wish to generate a return labels to send to your client. Is only valid for orders sent to the US.
Sku   (*)varcharThe sku’s name is unique by product. It has to be included in your inventory. Also it has to be included in the order which you are requesting the return.
QtyGood   (*)intQuantity of the product in good quality which is expected to return. This quantity must be minor or the same amount sent to the solicited order.
QtyHurt   (*)intQuantity of the product in hurt quality which is expected to return. This quantity must be minor or the same amount sent to the solicited order.

 

(*) Required Parameters

– In the request doesn’t require a QtyGood or QtyHurt you can send the information with zero value.

 

Request:

 

{

“ApiKey”:”08d5546a598eac012a042702161d9b62″,

“AccountID”:”123″,

“ShippingNum”:”10001″,

“Comment”:”Any Comment”,

“Label”:”NO”,

“Items”:[

{“Sku”:”sku1″,”QtyGood”:”1″,”QtyHurt”:”0″},

{“Sku”:”sku2″,”QtyGood”:”0″,”QtyHurt”:”1″},

{“Sku”:”sku3″,”QtyGood”:”1″,”QtyHurt”:”1″}

]

}

 

Answers:

1.{“Status”:”Error”,”Description”:”InvalidAcountID”}

 

StatusDescription
ErrorInvalidAcountIDInvalidApiKeyThereturnalreadyexists

InvalidShippingNum

InvalidSku

InvalidQtyGoodorQtyHurt

 

2.{“Status”:”Successful”,”Rma”:”123″}

 

StatusRma
SuccessfulUnique Return ID created in Shipedge.

 

Example: In Php.

 

<?php

$data = array(

ApiKey” => “08d5546a598eac012a042702161d9b62”,

AccountID” => “123”,

ShippingNum” => “10001”,

Comment” => “Hello”,

Label” => “NO”,

Items” =>array(

array(“Sku” => “sku1″ ,”QtyGood” => “1”,”QtyHurt” => “0”),

array(“Sku” => “sku1″ ,”QtyGood” => “0”,”QtyHurt” => “1”),

array(“Sku” => “sku1″ ,”QtyGood” => “1”,”QtyHurt” => “1”)

)

);

$data = json_encode($data);

$url =”https://demo.shipedge.com/API/Returns/CreateReturn”;

$curl = curl_init();

curl_setopt($curl, CURLOPT_HEADER, false);

curl_setopt($curl, CURLOPT_POST, 1);

curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

curl_setopt($curl, CURLOPT_HTTPHEADER, array(‘Content-Type: application/json’,’Content-Length: ‘ . strlen($data)));                                                                      

curl_setopt($curl, CURLOPT_URL, $url);

curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$x = curl_exec($curl);

print_r($x)

?>

 

(*) The URL depends on the warehouse were the order was sent. In the example we are using a Demo test server.

Contact Us

Send us an email and we'll get back to you, ASAP.