API documentation API console

API navigation

General information Describes entry point, request method and allowed formats
Authorization API Authorization guide. How to use and acquire API credentials
Create order Register your order information
Get order Get your registered order information
Delete order Delete your registered order information
Search orders Search for your registered orders using various filters
Create return Register a return and acquire a shipping label
Search returns Search for your registered returns using various filters
Get return Get a complete information about your registered return, including shipping label
Get returned items Get a information about returned items using various filters
Request for prices Request for prices
Cancel return Cancel a previously created return
Get Tracking Get all tracking events by providing a tracking number
Get Tracking events by date range Get all tracking events which occurred between a given date range
Get Tracking status codes description Description of digital tracking statuses
Get drop off points location Get list off drop off points location for services by address
Carrier Services IDs A list of all possible carrier services IDs
Check Availability Simple method for checking that API service available now
Code examples Code example in PHP

General information

Following API is designed to provide a complete set of tools to integrate with Intelligent Return
API entry point https://intelligentreturns.net/api
Request and response formats format depends on url path. Can be JSON or XML. JSON by default
Request Method Request method must always be POST
XML special characters & should be replaced by &
< should be replaced by &lt;
> should be replaced by &gt;
Text fields length Each text field must not exceed 255 symbols length
Request Encoding Must be UTF-8
Server Timezone UTC
Type Input data Output data

Authorization

Each API request requires login and api key keys sent via POST
Login is the same as admin panel login. API key can be generated on client's profile page

Incorrect login or API key

{"error":{"code":"access_denied","message":["Access denied"]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>access_denied</code>
    <message>Access denied</message>
</error>

Create order

Order info (* required)

Key Desc
order_reference * Order reference. Must be unique if "overwrite_data" flag set as FALSE.
order_date * mm/dd/yyyy, yyyy/mm/dd, Unix timestamp
currency_code * Currency code(3 letters) ISO_4217
overwrite_data Boolean value. TRUE: "1" or "true". FALSE(default): omit this field, "0" or "false".
Use this field as TRUE to overwrite existing order's data. If order does not exists, then new order will be created.
Please note, that you can add or remove order's items using this field by providing a new items list. However, items that have already been returned cannot be removed
rma Code that will allow a customer to return an item after return policy has been expired
phone Phone
email Email
export_date Unix timestamp of export date. Default value, will be applied to all items, if not specified in corresponding item field
export_awb Export air waybill. Default value, will be applied to all items, if not specified in corresponding item field
export_carrier_name Exporter company. Default value, will be applied to all items, if not specified in corresponding item field

Address info

Key Desc
contact_name Customer full name (Person)
company_name Company name
country Country code (ISO 3166-1 alpha-2)
state State
zip Zip/Post code
city City
addr1 Address line 1
addr2 Address line 2
addr3 Address line 3
neighborhood Neighborhood. Available only for Mexico

Item info (* required)

Key Desc
sku_code * Item SKU code
sku_desc * Item SKU description
quantity * Number of items sold
price * Price of 1 item
weight Weight of 1 item. Default value: 1 (K/L).
weight_uom K / L (1 letter). Default value: K
length Length of 1 item
width Width of 1 item
height Height of 1 item
dimensions_uom cm, mm, in
country_code Country manufacturer code(2 letters)
hs_code Harmonization code
img_path Link to item image
dangerous_goods Possible values: Yes/No
export_date Unix timestamp of export date
export_awb Export air waybill
export_carrier_name Exporter company

You can provide an order data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/orders/create/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "order":
    {
        "order_reference":"1000000000000",
        "order_date":"10/20/2015",
        "rma": "12345",
        "contact_name":"John Smith",
        "company_name":"",
        "addr1":"6 Semaphore Close Mount Pleasant",
        "addr2":"",
        "addr3":"",
        "city":"Christchurch",
        "zip":"8081",
        "state":"qwe",
        "country":"NZ",
        "phone":"+102030405060",
        "email":"john.smith@googlemail.com",
        "currency_code":"AUD",
        "export_awb":"32153454GB",
        "export_carrier_name":"USPS",
        "item":[
            {
                "sku_code":"QWE123",
                "sku_desc":"Black Sculpting & Smoothing Shapewear Body Suit-EUR 38 (M)",
                "quantity":"5",
                "price":"100",
                "weight":"1",
                "length":"2",
                "width":"3",
                "height":"4",
                "dimensions_uom":"mm",
                "hs_code":"999999",
                "country_code":"GB",
                "img_path":"https://intelligentreturns.net/assets/frontend/img/rebound_logo.png",
                "dangerous_goods":"Yes",
                "export_date": "946677600",
                "export_awb": "32153454GB",
                "export_carrier_name": "USPS"
            },
            {
                "sku_code":"QWE456",
                "sku_desc":"Black Halterneck Corset",
                "quantity":"10",
                "price":"200",
                "weight":"0.86",
                "length":"10",
                "width":"10",
                "height":"10",
                "dimensions_uom":"mm",
                "hs_code":"999999",
                "country_code":"GB",
                "img_path":"https://intelligentreturns.net/assets/frontend/img/rebound_logo.png",
                "dangerous_goods":"Yes",
                "export_date": "946677600",
                "export_awb": "32153454GB",
                "export_carrier_name": "USPS"
            }
        ]
    }
}

XML

URL:
https://intelligentreturns.net/api/orders/create/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<order>
    <order_reference>12312355</order_reference>
    <order_date>2015/05/30</order_date>
    <contact_name>John Doe</contact_name>
    <company_name></company_name>
    <addr1>address line</addr1>
    <addr2></addr2>
    <addr3></addr3>
    <city>some address</city>
    <zip>20000</zip>
    <state>NY</state>
    <country>GB</country>
    <phone>+010557779</phone>
    <email>doe@gmail.com</email>
    <currency_code>EUR</currency_code>
    <export_awb>444444US</export_awb>
    <export_carrier_name>USPS</export_carrier_name>
    <item>
        <sku_code>ASD111</sku_code>
        <sku_desc>Black Sculpting &amp; Smoothing Shapewear Body Suit-EUR 38 (M)</sku_desc>
        <quantity>5</quantity>
        <price>100</price>
        <weight>0.3</weight>
        <length>10</length>
        <width>10</width>
        <height>10</height>
        <dimensions_uom>mm</dimensions_uom>
        <hs_code>5905954</hs_code>
        <country_code>CN</country_code>
        <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
        <dangerous_goods>No</dangerous_goods>
        <export_date>946677600</export_date>
        <export_awb>32153454GB</export_awb>
        <export_carrier_name>USPS</export_carrier_name>
    </item>
    <item>
        <sku_code>UN-12322;28</sku_code>
        <sku_desc>Black Halterneck &gt; Corset</sku_desc>
        <quantity>10</quantity>
        <price>200</price>
        <weight>0.86</weight>
        <length>10</length>
        <width>10</width>
        <height>10</height>
        <dimensions_uom>mm</dimensions_uom>
        <hs_code>4331767</hs_code>
        <country_code>GB</country_code>
        <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
        <dangerous_goods>No</dangerous_goods>
        <export_date>946677600</export_date>
        <export_awb>32153454GB</export_awb>
        <export_carrier_name>USPS</export_carrier_name>
    </item>
</order>

Order created successfully:

{"success":{"message":"Order successfully created", "order_reference": "1000000000000", "order_id": 10000}}
<?xml version="1.0" encoding="UTF-8"?>
<success>
    <message>Order successfully created</message>
    <order_reference>12312355</order_reference>
    <order_id>10000000</order_id>
</success>

Incorrect order data:

{"error":{"code":"order_incorrect","message":["Incorrect order data. Check fields: quantity,price"]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>order_incorrect</code>
    <message>Incorrect order data. Check fields: quantity,price</message>
</error>

Order reference is already exists:

{"error":{"code":"order_exists","message":["Order reference is already exists"]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>order_exists</code>
    <message>Order reference is already exists</message>
</error>

JSON is not valid:

{"error":{"code":"json_invalid","message":["JSON is not valid"]}}

XML is not valid:

<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>xml_invalid</code>
    <message>XML is not valid</message>
</error>

Get order

Order info

Key Value
type Can be 'id' or 'reference'
val id or reference value to search
You can get order by internal id or reference

You can provide an order data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/orders/get/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "order":
    {
        "type":"reference",
        "val":"600090343"
    }
}

XML

URL:
https://intelligentreturns.net/api/orders/get/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<order>
    <type>reference</type>
    <val>600090343</val>
</order>

Data found:

If order was found, you will receive data in success field of JSON or XML format (depends on what format you've been requested)
You can see the description of the fields in the previous method. Create order

JSON response example:

{
    "success": {
        "id": "3103",
        "order_reference": "12312359",
        "order_date": "1432958400",
        "contact_name": "John Doe",
        "company_name": "",
        "addr1": "address line",
        "addr2": "",
        "addr3": "",
        "city": "some address",
        "zip": "20000",
        "state": "NY",
        "country": "GB",
        "phone": "+010557779",
        "email": "doe@gmail.com",
        "currency_code": "EUR",
        "rma": "",
        "export_awb": "444444US",
        "export_carrier_name": "USPS",
        "item": [
            {
                "sku_code": "ASD111",
                "sku_desc": "Black Sculpting  Smoothing Shapewear Body Suit-EUR 38 (M)",
                "quantity": "5",
                "price": "100",
                "weight": "0.3",
                "weight_uom": "",
                "length": "0",
                "width": "0",
                "height": "0",
                "dimensions_uom": "mm",
                "hs_code": "5905954",
                "country_code": "CN",
                "img_path": "",
                "dangerous_goods":"Yes",
                "export_date": "946677600",
                "export_awb": "32153454GB"
            },
            {
                "sku_code": "UN-12322;28",
                "sku_desc": "Black Halterneck  Corset",
                "quantity": "10",
                "price": "200",
                "weight": "0.86",
                "weight_uom": "",
                "length": "0",
                "width": "0",
                "height": "0",
                "dimensions_uom": "mm",
                "hs_code": "4331767",
                "country_code": "GB",
                "img_path": "",
                "dangerous_goods":"No",
                "export_date": "946677600",
                "export_awb": "32153454GB"
            }
        ]
    }
}

XML response example:

<?xml version="1.0" encoding="UTF-8"?>
<success>
    <id>3103</id>
    <order_reference>12312359</order_reference>
    <order_date>1432958400</order_date>
    <contact_name>John Doe</contact_name>
    <company_name></company_name>
    <addr1>address line</addr1>
    <addr2></addr2>
    <addr3></addr3>
    <city>some address</citygt;
    <zip>20000</zip>
    <state>NY</state>
    <country>GB</country>
    <phone>+010557779</phone>
    <email>doe@gmail.com</email>
    <currency_code>EUR</currency_code>
    <rma></rma>
    <export_awb>444444US</export_awb>
    <export_carrier_name>USPS</export_carrier_name>
    <item>
        <sku_code>ASD111</sku_code>
        <sku_desc>Black Sculpting  Smoothing Shapewear Body Suit-EUR 38 (M)</sku_desc>
        <quantity>5</quantity>
        <price>100</price>
        <weight>0.3</weight>
        <weight_uom></weight_uom>
        <length>10</length>
        <width>10</width>
        <height>10</height>
        <dimensions_uom>mm</dimensions_uom>
        <hs_code>5905954</hs_code>
        <country_code>CN</country_code>
        <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
        <dangerous_goods>No</dangerous_goods>
        <export_date>946677600</export_date>
        <export_awb>32153454GB</export_awb>
    </item>
    <item>
        <sku_code>UN-12322;28</sku_code>
        <sku_desc>Black Halterneck  Corset</sku_desc>
        <quantity>10</quantity>
        <price>200</price>
        <weight>0.86</weight>
        <weight_uom></weight_uom>
        <length>10</length>
        <width>10</width>
        <height>10</height>
        <dimensions_uom>mm</dimensions_uom>
        <hs_code>4331767</hs_code>
        <country_code>GB</country_code>
        <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
        <dangerous_goods>No</dangerous_goods>
        <export_date>946677600</export_date>
        <export_awb>32153454GB</export_awb>
    </item>
</success>

Order not found:

{"error":{"code":"order_nx","message":["Order not found"]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>order_nx</code>
    <message>Order not found</message>
</error>

Delete order

You can delete order by internal id or reference
URL:
https://intelligentreturns.net/api/orders/delete
Key Value
type Can be 'id' or 'reference'
val id or reference value to search

You can provide an order data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/orders/delete/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "order":
    {
        "type":"reference",
        "val":"600090343"
    }
}

XML

URL:
https://intelligentreturns.net/api/orders/delete/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<order>
    <type>reference</type>
    <val>600090343</val>
</order>

Order successfully deleted:

{"success":{"message":"Order successfully deleted"}}
<?xml version="1.0" encoding="UTF-8"?>
<success>
    <message>Order successfully deleted</message>
</success>

Order not found:

{"error":{"code":"order_nx","message":["Order not found"]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>order_nx</code>
    <message>Order not found</message>
</error>

Search orders

URL:
https://intelligentreturns.net/api/orders/search
Filter data:
Key Value
date_from Allowed date formats: mm/dd/yyyy, yyyy/mm/dd, Unix timestamp
date_to Allowed date formats: mm/dd/yyyy, yyyy/mm/dd, Unix timestamp
quick_search Keywords divided by space. Each new keyword will narrow search results

You can provide a filter data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/orders/search/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "filter":
    {
        "date_from":"10/15/2015",
        "date_to":"12/01/2015",
        "quick_search":"GB"
    }
}

XML

URL:
https://intelligentreturns.net/api/orders/search/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<filter>
    <date_from>10/15/2015</date_from>
    <date_to>12/01/2015</date_to>
    <quick_search>GB</quick_search>
</filter>

JSON response example:

{"success":{"id":["21","25","58","57","59","42","41","39","38","37"]}}

XML response example:

<?xml version="1.0" encoding="UTF-8"?>
<success>
    <id>2901</id>
    <id>2902</id>
    <id>2903</id>
    <id>2904</id>
    <id>2906</id>
</success>

Nothing found:

{"error":{"code":"empty","message":["Nothing found."]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>empty</code>
    <message>Nothing found.</message>
</error>

Create return

Information of return (* required)

Key Desc
order_reference * order reference
date_added Return booking date, current time by default. Allowed date formats: mm/dd/yyyy hh:mm:ss, yyyy/mm/dd hh:mm:ss, Unix timestamp
carrier Deprecated. Consider to use service_id field instead
service Deprecated. Consider to use service_id field instead
Shipping service type. Required is one of the following carriers was chosen:
  • 'ACP':
    • 'Ground'
    • 'Priority'
  • 'ASM':
    • 'home_collection'
  • 'Hermes':
    • 'home_collection'
    • 'drop_off'
service_id (Preferred) Shipping service id.
Refer to the Request for prices method to get a service_id
View list of all carrier services
Please note, carrier and service fields will be ignored in case service_id is populated
Either service_id or carrier must be provided
label_format Shipping label format output.
Available for following carriers:
  • Royal Mail
    • pdf_6x4 (by default)
    • pdf_a4
    • png
  • MyPack
    • pdf_6x4 (by default)
    • pdf_a4
    • png
  • Direct Link
    • pdf_6x4 (by default)
    • pdf_a4
    • png
  • nzpost
    • pdf_6x4 (by default)
    • pdf_a4
    • png
  • AnPost
    • pdf_6x4 (by default)
    • pdf_a4
    • png
  • Royale
    • pdf_6x4 (by default)
    • pdf_a4
    • png
Please note, that other carriers have default label format, provided by carrier's internal API. API error will be raised when incorrect label format requested. Please, use this field only to specify format for carriers listed above
tracking Tracking number.
Please, note! This field has to be provided if a return has been already booked/registered without using the Intelligentreturns software.
In this case, return will be saved and thereafter will receive tracking updates, but the booking process will be omitted.
-
Otherwise, omit this field or leave it blank, then a return will registered by the Intelligentreturns software and will acquire tracking number automatically.
currency_code Currency code(3 letters) ISO_4217
phone Phone
email Email
display_id An additional information, which will be displayed on the shipping label (if it is possible). Max length 32 characters
external_id Alphanumeric value. Must be unique for each return. This field can be used in /returns/get/ method
add_items_data_to_order Boolean value. TRUE: "1" or "true". FALSE(default): omit this field, "0" or "false".
    Please, set as TRUE in the following cases:
  • You do not provide us orders information. In this case our system will automatically populate orders items information based on returned items
  • You need to to add this return's items to the correspondent order.
If this field is set to "1" or "true", then items difference between order and return will not be checked. All items from the current request will be added into the corresponding order instead. Such order will be found by the "order_reference" field.
export_date Unix timestamp of export date. Default value, will be applied to all items, if not specified in corresponding item field
export_awb Export air waybill. Default value, will be applied to all items, if not specified in corresponding item field
export_carrier_name Exporter company. Default value, will be applied to all items, if not specified in corresponding item field
verification_entity Boolean value. TRUE: "1" or "true". FALSE(default): omit this field, "0" or "false".
dangerous_goods Possible values: Yes/No. Default value, will be applied to all items, if not specified in corresponding item field
final_disposition Can be 'return' or 'destroy'. Default value, will be applied to all items, if not specified in corresponding item field

Address Info

Key Desc
name * Customer full name (Person)
company_name Company name
country * Customer's country code (ISO 3166-1 alpha-2)
state * Customer's state.
Not required for following countries:
  • GB
  • UK
  • IL
  • DE
  • FR
  • NL
  • IE
  • SE
  • IT
  • DK
  • AT
  • LU
  • CZ
  • BE
  • BG
  • HR
  • CY
  • FI
  • GR
  • HU
  • MT
  • PL
  • PT
  • RO
  • SK
  • SI
  • EE
  • LV
  • LT
  • NZ
zip * Zip/Post code
Not required for following countries:
  • HK
  • IE
  • IL
city * City
addr1 * Address line 1
addr2 Address line 2
addr3 Address line 3
neighborhood Neighborhood. Available only for Mexico
final_dest_name Final destination contact name
final_dest_company_name Final destination company name
final_dest_id Final destination address ID. Can be provided instead of full final destination address (fields below), in this case destination address fields will be ignored.
final_dest_country Final destination country code (ISO 3166-1 alpha-2)
final_dest_state Final destination State
final_dest_zip Final destination Zip/Post code
final_dest_city Final destination City
final_dest_addr1 Final destination Address line 1
final_dest_addr2 Final destination Address line 2
final_dest_addr3 Final destination Address line 3
final_dest_neighborhood Final destination neighborhood. Available only for Mexico

Item info (Not Required)

Key Desc
sku_code * Item SKU code
sku_desc * Item SKU description
quantity * Number of items sold
price * Price of 1 item
weight Weight of 1 item. Default value: 1 (K/L).
weight_uom K / L (1 letter). Default value: K
length Length of 1 item
width Width of 1 item
height Height of 1 item
dimensions_uom cm, mm, in
country_code Country manufacturer code(2 letters)
hs_code Harmonization code
img_path Link to item image
dangerous_goods Possible values: Yes/No
export_date Unix timestamp of export date
export_awb Export air waybill
export_carrier_name Exporter company
sku_url URL to assist in verification
final_dest_name Final destination contact name
final_dest_company_name Final destination company name
final_dest_id Final destination address ID. Can be provided instead of full final destination address (fields below), in this case destination address fields will be ignored.
final_dest_country Final destination country code (ISO 3166-1 alpha-2)
final_dest_state Final destination State
final_dest_zip Final destination Zip/Post code
final_dest_city Final destination City
final_dest_addr1 Final destination Address line 1
final_dest_addr2 Final destination Address line 2
final_dest_addr3 Final destination Address line 3
final_dest_neighborhood Final destination neighborhood. Available only for Mexico
verification_entity Boolean value. TRUE: "1" or "true". FALSE(default): omit this field, "0" or "false".
final_disposition Can be 'return' or 'destroy'.

You can provide a return data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/returns/create/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "return":
    {
        "order_reference":"12312355",
        "name":"John Doe",
        "phone":"+010557779",
        "email":"doe@gmail.com",
        "addr1":"City Hall",
        "addr2":"24 Eagle Street, Room 102",
        "addr3":"",
        "city":"Albany",
        "zip":"12207",
        "state":"NY",
        "country":"US",
        "display_id":"123123123",
        "final_dest_id": "Default",
        "final_dest_addr1":"Telford Transport Solutions Ltd",
        "final_dest_addr2":"Stafford Park 12",
        "final_dest_addr3":"",
        "final_dest_city":"Telford",
        "final_dest_zip":"TF3 3BJ",
        "final_dest_state":"West Midlands",
        "final_dest_country":"UK",
        "carrier":"acp",
        "service":"ground",
        "item":[
            {
                "sku_code":"ASD111",
                "sku_desc":"Black Sculpting & Smoothing Shapewear Body Suit-EUR 38 (M)",
                "quantity":"5",
                "price":"100",
                "weight":"0.3",
                "length":"10",
                "width":"10",
                "height":"10",
                "dimensions_uom":"mm",
                "hs_code":"5905954",
                "country_code":"CN",
                "img_path":"https://intelligentreturns.net/assets/frontend/img/rebound_logo.png",
                "dangerous_goods":"Yes",
                "export_date": "946677600",
                "export_awb": "32153454GB",
                "export_carrier_name": "USPS"
            },{
                "sku_code":"UN-12322;28",
                "sku_desc":"Black Halterneck > Corset",
                "quantity":"10",
                "price":"200",
                "weight":"0.86",
                "length":"10",
                "width":"10",
                "height":"10",
                "dimensions_uom":"mm",
                "hs_code":"4331767",
                "country_code":"GB",
                "img_path":"https://intelligentreturns.net/assets/frontend/img/rebound_logo.png",
                "dangerous_goods":"No",
                "export_date": "946677600",
                "export_awb": "32153454GB",
                "export_carrier_name": "USPS"
            }
        ]
    }
}

XML

URL:
https://intelligentreturns.net/api/returns/create/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<return>
    <order_reference>12312355</order_reference>
    <name>John Doe</name>
    <phone>+010557779</phone>
    <email>doe@gmail.com</email>
    <addr1>City Hall</addr1>
    <addr2>24 Eagle Street, Room 102</addr2>
    <addr3></addr3>
    <city>Albany</city>
    <zip>12207</zip>
    <state>NY</state>
    <country>US</country>
    <display_id>123123123</display_id>
    <final_dest_id>Default</final_dest_id>
    <final_dest_addr1>Telford Transport Solutions Ltd</final_dest_addr1>
    <final_dest_addr2>Stafford Park 12</final_dest_addr2>
    <final_dest_addr3></final_dest_addr3>
    <final_dest_city>Telford</final_dest_city>
    <final_dest_zip>TF3 3BJ</final_dest_zip>
    <final_dest_state>West Midlands</final_dest_state>
    <final_dest_country>UK</final_dest_country>
    <carrier>acp</carrier>
    <service>ground</service>
    <item>
        <sku_code>ASD111</sku_code>
        <sku_desc>Black Sculpting &amp; Smoothing Shapewear Body Suit-EUR 38 (M)</sku_desc>
        <quantity>5</quantity>
        <price>100</price>
        <weight>0.3</weight>
        <length>10</length>
        <width>10</width>
        <height>10</height>
        <dimensions_uom>mm</dimensions_uom>
        <hs_code>5905954</hs_code>
        <country_code>CN</country_code>
        <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
        <dangerous_goods>No</dangerous_goods>
        <export_date>946677600</export_date>
        <export_awb>32153454GB</export_awb>
        <export_carrier_name>USPS</export_carrier_name>
    </item>
    <item>
        <sku_code>UN-12322;28</sku_code>
        <sku_desc>Black Halterneck &gt; Corset</sku_desc>
        <quantity>10</quantity>
        <price>200</price>
        <weight>0.86</weight>
        <length>10</length>
        <width>10</width>
        <height>10</height>
        <dimensions_uom>mm</dimensions_uom>
        <hs_code>4331767</hs_code>
        <country_code>GB</country_code>
        <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
        <dangerous_goods>No</dangerous_goods>
        <export_date>946677600</export_date>
        <export_awb>32153454GB</export_awb>
        <export_carrier_name>USPS</export_carrier_name>
    </item>
</return>

Return created successfully:

{"success":{"label":"base64 from pdf label file","tracking":"526u8we", "first_mile_address": {"addr1":"Telford Transport Solutions Ltd","addr2":"Stafford Park 12","city":"Telford","zip":"TF3 3BJ","state":"Shropshire ","country":"GB","additional_address":[]}}}
<?xml version="1.0" encoding="UTF-8"?>
<success>
    <label>base64 from pdf label file</label>
    <tracking>526u8we</tracking>
    <first_mile_address>
        <addr1>BTG c/o Laser Transport</addr1>
        <addr2>Flosshafenstrasse 10</addr2>
        <city>Neuss</city>
        <zip>41460</zip>
        <state>Neuss</state>
        <country>DE</country>
        <additional_address></additional_address>
    </first_mile_address>
</success>

Incorrect return data:

{"error":{"code":"return_invalid","message":["Field order_reference can not be empty."]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>return_invalid</code>
    <message>Field order_reference can not be empty.</message>
</error>

JSON is not valid:

{"error":{"code":"json_invalid", ""message":["JSON is not valid"]}}

XML is not valid:

<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>xml_invalid</code>
    <message>XML is not valid</message>
</error>

Search returns

URL:
https://intelligentreturns.net/api/returns/search
Filter data:
Key Value
tracking Tracking code
date_from Allowed date formats: mm/dd/yyyy, yyyy/mm/dd, Unix timestamp
date_to Allowed date formats: mm/dd/yyyy, yyyy/mm/dd, Unix timestamp
quick_search Keywords divided by space. Each new keyword will narrow search results
order_reference Order reference

You can provide a filter data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/returns/search/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "filter":
    {
        "tracking": "",
        "date_from":"10/15/2015",
        "date_to":"12/01/2015"
    }
}

XML

URL:
https://intelligentreturns.net/api/returns/search/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<filter>
    <tracking></tracking>
    <date_from>10/15/2015</date_from>
    <date_to>12/01/2015</date_to>
</filter>

JSON response example:

{"success":{"id":["2901","2902","2903","2904","2906"]}}

XML response example:

<?xml version="1.0" encoding="UTF-8"?>
<success>
    <id>2901</id>
    <id>2902</id>
    <id>2903</id>
    <id>2904</id>
    <id>2906</id>
</success>

Nothing found:

{"error":{"code":"empty","message":["Nothing found."]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>empty</code>
    <message>Nothing found.</message>
</error>

Get return

Return info

Key Value
id
    Can be one of the following:
  • id
  • order_reference
  • external_id
You can get return information by internal id, external id or reference

You can provide a return data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/returns/get/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "return":
    {
        "id":"2901"
    }
}

XML

URL:
https://intelligentreturns.net/api/returns/get/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<return>
    <id>2901</id>
</return>

Data found:

If return was found, you will receive data in success field of JSON or XML format (depends on what format you've been requested).

Response fields. Return info.

Key Value
id ID of return
order_reference Order reference
date_added Unix timestamp of date when return was created.
phone Customer's phone
email Customer's email
display_id An additional information, which will be displayed on the shipping label (if it is possible). Order reference as default.
tracking Tracking code
tracking_last_update Unix timestamp of date when tracking status was updated.
current_tracking_status Digital code of current tracking status.
carrier Carrier name
label Base64 from pdf file with label
item Items of return. Can be empty.
verification_entity Boolean value. 1: true. 0: false

Address Info

Key Desc
name Customer full name (Person)
company_name Company name
country Customer's country code (ISO 3166-1 alpha-2)
state Customer's state
zip Zip/Post code
city City
addr1 Address line 1
addr2 Address line 2
addr3 Address line 3
neighborhood Neighborhood. Available only for Mexico
final_dest_name Final destination contact name
final_dest_company_name Final destination company name
final_dest_id Final destination address ID. Can be provided instead of full final destination address (fields below), in this case destination address fields will be ignored.
final_dest_country Final destination country code (ISO 3166-1 alpha-2)
final_dest_state Final destination State
final_dest_zip Final destination Zip/Post code
final_dest_city Final destination City
final_dest_addr1 Final destination Address line 1
final_dest_addr2 Final destination Address line 2
final_dest_addr3 Final destination Address line 3
final_dest_neighborhood Final destination neighborhood. Available only for Mexico

Item info

Key Desc
sku_code Item SKU code
sku_desc Item SKU description
quantity Number of items sold
price Price of 1 item
weight Weight of 1 item. Default value: 1 (K/L).
weight_uom K / L (1 letter). Default value: K
length Length of 1 item
width Width of 1 item
height Height of 1 item
dimensions_uom cm, mm, in
country_code Country manufacturer code(2 letters)
hs_code Harmonization code
img_path Link to item image
dangerous_goods Possible values: Yes/No
reason Reasons for item
reason/action Action
reason/reason Reason of return
reason/wish Wish
reason/additional Additional information
reason/additional/title Title of information
reason/additional/value value of information
export_awb Export air waybill
export_carrier_name Exporter company
sku_url URL to assist in verification
final_dest_name Final destination contact name
final_dest_company_name Final destination company name
final_dest_id Final destination address ID. Can be provided instead of full final destination address (fields below), in this case destination address fields will be ignored.
final_dest_country Final destination country code (ISO 3166-1 alpha-2)
final_dest_state Final destination State
final_dest_zip Final destination Zip/Post code
final_dest_city Final destination City
final_dest_addr1 Final destination Address line 1
final_dest_addr2 Final destination Address line 2
final_dest_addr3 Final destination Address line 3
final_dest_neighborhood Final destination neighborhood. Available only for Mexico
verification_entity Boolean value. 1: true. 0: false
final_disposition Can be 'return' or 'destroy'.

JSON response example:

{
    "success": {
        "id": "111495",
        "order_reference": "12312355",
        "date_added": "1465397894",
        "name": "John Doe",
        "zip": "12207",
        "email": "doe@gmail.com",
        "addr1": "City Hall",
        "addr2": "24 Eagle Street, Room 102",
        "addr3": "",
        "city": "Albany",
        "state": "NY",
        "country": "US",
        "phone": "+010557779",
        "tracking": "9202490112676104136413",
        "tracking_last_update": "1465397894",
        "current_tracking_status": "10",
        "final_dest_id": "Default",
        "final_dest_addr1": "Telford Transport Solutions Ltd",
        "final_dest_addr2": "Stafford Park 12",
        "final_dest_addr3": "",
        "final_dest_city": "Telford",
        "final_dest_zip": "TF3 3BJ",
        "final_dest_state": "West Midlands",
        "final_dest_country": "UK",
        "verification_entity": 0,
        "item": [
            {
                "sku_code": "ASD111",
                "sku_desc": "Black Sculpting Smoothing Shapewear Body Suit-EUR 38 (M)",
                "quantity": "2",
                "price": "100",
                "weight": "0.3",
                "weight_uom": "",
                "length": "",
                "width": "",
                "height": "",
                "dimensions_uom": "mm",
                "hs_code": "5905954",
                "country_code": "CN",
                "img_path": "",
                "dangerous_goods":"No",
                "export_date": "946677600",
                "export_awb": "32153454GB",
                "export_carrier_name": "USPS",
                "sku_url": "",
                "final_dest_name": "",
                "final_dest_company_name": "",
                "final_dest_id": "",
                "final_dest_country":"",
                "final_dest_state":"",
                "final_dest_zip":"",
                "final_dest_city":"",
                "final_dest_addr1":"",
                "final_dest_addr2":"",
                "final_dest_addr3":"",
                "final_dest_neighborhood":"",
                "verification_entity": 0,
                "final_disposition": "",
                "reason": [
                    {
                        "action": "Exchange",
                        "reason": "Too small",
                        "wish": "",
                        "additional": {
                            "title": "New size",
                            "value": "L"
                        }
                    },
                    {
                        "action": "Refund",
                        "reason": "Faulty",
                        "wish": "",
                        "additional": {
                            "title": "",
                            "value": ""
                        }
                    }
                ]
            },
            {
                "sku_code": "UN-12322;28",
                "sku_desc": "Black Halterneck Corset",
                "quantity": "1",
                "price": "200",
                "weight": "0.86",
                "weight_uom": "",
                "length": "",
                "width": "",
                "height": "",
                "dimensions_uom": "mm",
                "hs_code": "4331767",
                "country_code": "GB",
                "img_path": "",
                "dangerous_goods":"No",
                "export_date": "946677600",
                "export_awb": "32153454GB",
                "export_carrier_name": "USPS",
                "sku_url": "",
                "final_dest_name": "",
                "final_dest_company_name": "",
                "final_dest_id": "",
                "final_dest_country":"",
                "final_dest_state":"",
                "final_dest_zip":"",
                "final_dest_city":"",
                "final_dest_addr1":"",
                "final_dest_addr2":"",
                "final_dest_addr3":"",
                "final_dest_neighborhood":"",
                "verification_entity": 0,
                "final_disposition": "",
                "reason": [
                    {
                        "action": "Exchange",
                        "reason": "Too small",
                        "wish": "",
                        "additional": {
                            "title": "New size",
                            "value": "L"
                        }
                    }
                ]
            }
        ],
        "carrier": "ACP",
        "label": "base64 code from label"
    }
}

XML response example:

<?xml version="1.0" encoding="UTF-8"?>
<success>
    <id>111495</id>
    <order_reference>12312355</order_reference>
    <date_added>1465397894</date_added>
    <name>John Doe</name>
    <zip>12207</zip>
    <email>doe@gmail.com</email>
    <addr1>City Hall</addr1>
    <addr2>24 Eagle Street, Room 102</addr2>
    <addr3></addr3>
    <city>Albany</city>
    <state>NY</state>
    <country>US</country>
    <phone>+010557779</phone>
    <tracking>9202490112676104136413</tracking>
    <tracking_last_update>1465397894</tracking_last_update>
    <current_tracking_status>10</current_tracking_status>
    <final_dest_id>Default</final_dest_id>
    <final_dest_addr1>Telford Transport Solutions Ltd</final_dest_addr1>
    <final_dest_addr2>Stafford Park 12</final_dest_addr2>
    <final_dest_addr3></final_dest_addr3>
    <final_dest_city>Telford</final_dest_city>
    <final_dest_zip>TF3 3BJ</final_dest_zip>
    <final_dest_state>West Midlands</final_dest_state>
    <final_dest_country>UK</final_dest_country>
    <verification_entity>0</verification_entity>
    <item>
        <sku_code>ASD111</sku_code>
        <sku_desc>Black Sculpting Smoothing Shapewear Body Suit-EUR 38 (M)</sku_desc>
        <quantity>2</quantity>
        <price>100</price>
        <weight>0.3</weight>
        <weight_uom></weight_uom>
        <length></length>
        <width></width>
        <height></height>
        <dimensions_uom>mm</dimensions_uom>
        <hs_code>5905954</hs_code>
        <country_code>CN</country_code>
        <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
        <dangerous_goods>No</dangerous_goods>
        <export_date>946677600</export_date>
        <export_awb>32153454GB</export_awb>
        <export_carrier_name>USPS</export_carrier_name>
        <sku_url></sku_url>
        <final_dest_name></final_dest_name>
        <final_dest_company_name></final_dest_company_name>
        <final_dest_id></final_dest_id>
        <final_dest_country></final_dest_country>
        <final_dest_state></final_dest_state>
        <final_dest_zip></final_dest_zip>
        <final_dest_city></final_dest_city>
        <final_dest_addr1></final_dest_addr1>
        <final_dest_addr2></final_dest_addr2>
        <final_dest_addr3></final_dest_addr3>
        <final_dest_neighborhood></final_dest_neighborhood>
        <verification_entity>0</verification_entity>
        <final_disposition></final_disposition>
        <reason>
            <action>Exchange</action>
            <reason>Too small</reason>
            <wish></wish>
            <additional>
                <title>New size</title>
                <value>L</value>
            </additional>
        </reason>
        <reason>
            <action>Refund</action>
            <reason>Faulty</reason>
            <wish></wish>
            <additional>
                <title></title>
                <value></value>
            </additional>
        </reason>
    </item>
    <item>
        <sku_code>UN-12322;28</sku_code>
        <sku_desc>Black Halterneck Corset</sku_desc>
        <quantity>1</quantity>
        <price>200</price>
        <weight>0.86</weight>
        <weight_uom></weight_uom>
        <length></length>
        <width></width>
        <height></height>
        <dimensions_uom>mm</dimensions_uom>
        <hs_code>4331767</hs_code>
        <country_code>GB</country_code>
        <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
        <dangerous_goods>No</dangerous_goods>
        <export_date>946677600</export_date>
        <export_awb>32153454GB</export_awb>
        <export_carrier_name>USPS</export_carrier_name>
        <sku_url></sku_url>
        <final_dest_name></final_dest_name>
        <final_dest_company_name></final_dest_company_name>
        <final_dest_id></final_dest_id>
        <final_dest_country></final_dest_country>
        <final_dest_state></final_dest_state>
        <final_dest_zip></final_dest_zip>
        <final_dest_city></final_dest_city>
        <final_dest_addr1></final_dest_addr1>
        <final_dest_addr2></final_dest_addr2>
        <final_dest_addr3></final_dest_addr3>
        <final_dest_neighborhood></final_dest_neighborhood>
        <reason>
            <action>Exchange</action>
            <reason>Too small</reason>
            <wish></wish>
            <additional>
                <title>New size</title>
                <value>L</value>
            </additional>
        </reason>
    </item>
    <carrier>ACP</carrier>
    <label>base64 code from label</label>
</success>

Return not found:

{"error":{"code":"return_nx","message":["Return not found"]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>return_nx</code>
    <message>Return not found</message>
</error>

Returned items

Filter data

Key Value
order_reference Order reference
date_from Allowed date formats: mm/dd/yyyy, yyyy/mm/dd, Unix timestamp
date_to Allowed date formats: mm/dd/yyyy, yyyy/mm/dd, Unix timestamp
quick_search Keywords divided by space. Each new keyword will narrow search results
status Digital code for status of return. Available values:
  • 0 - Unprocessed
  • 1 - Delivered to Retailer
  • 2 - Declined
  • 3 - Has warnings
  • 5 - Refunded by Retailer
  • 4 - Delivery payment refunded
  • 900 - Processed on hub
  • 22 - On Quarantine
  • 23 - Removed from Quarantine
  • 32 - Return RMA verified
  • 33 - Return RMA verification failed
current_tracking_status Digital code of current tracking status.
carrier Carrier. The list of available couriers:
  • 'ACP'
  • 'AnPost'
  • 'Business Reply'
  • 'Correos'
  • 'DHL'
  • 'Direct Link'
  • 'Kiala'
  • 'MyPack'
country Customer's country code (ISO 3166-1 alpha-2)
id_last Last ID from previous request.
You can get order by internal id or reference

You can provide an order data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/returns/items/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "filter":
    {
        "date_from":"10/15/2015",
        "date_to":"12/01/2015"
    }
}

XML

URL:
https://intelligentreturns.net/api/returns/items/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<filter>
    <date_from>10/15/2015</date_from>
    <date_to>12/01/2015</date_to>
</order>

Data found:

If returns was found, you will receive data in success field of JSON or XML format (depends of what format you've been requested).
This method return maximum 1000 records. All returns are sorted by ID in descending order. If you need next page, use field id_last in filter.

Response fields. Return info.

Key Value
total The number of records that meet the filter.
return Data of returns. Description for fields of return you can see in Get return method.
* This method don't return label field.

JSON response example:

{
    "success": {
        "total": "2",
        "return": [
            {
                "id": "111495",
                "order_reference": "12312355",
                "date_added": "1465397894",
                "name": "John Doe",
                "zip": "12207",
                "email": "doe@gmail.com",
                "addr1": "City Hall",
                "addr2": "24 Eagle Street, Room 102",
                "addr3": "",
                "city": "Albany",
                "state": "NY",
                "country": "US",
                "phone": "+010557779",
                "tracking": "9202490112676104136413",
                "tracking_last_update": "1465397894",
                "current_tracking_status": "10",
                "verification_entity": 0,
                "item": [
                    {
                        "sku_code": "ASD111",
                        "sku_desc": "Black Sculpting Smoothing Shapewear Body Suit-EUR 38 (M)",
                        "quantity": "2",
                        "price": "100",
                        "weight": "0.3",
                        "weight_uom": "",
                        "length": "",
                        "width": "",
                        "height": "",
                        "dimensions_uom": "mm",
                        "hs_code": "5905954",
                        "country_code": "CN",
                        "img_path": "",
                        "dangerous_goods":"No",
                        "export_date": "946677600",
                        "export_awb": "32153454GB",
                        "export_carrier_name": "USPS",
                        "sku_url": "",
                        "final_dest_name": "",
                        "final_dest_company_name": "",
                        "final_dest_id": "",
                        "final_dest_country":"",
                        "final_dest_state":"",
                        "final_dest_zip":"",
                        "final_dest_city":"",
                        "final_dest_addr1":"",
                        "final_dest_addr2":"",
                        "final_dest_addr3":"",
                        "final_dest_neighborhood":"",
                        "verification_entity": 0,
                        "final_disposition": "",
                        "reason": [
                            {
                                "action": "Exchange",
                                "reason": "Too small",
                                "wish": "",
                                "additional": {
                                    "title": "New size",
                                    "value": "L"
                                }
                            },
                            {
                                "action": "Refund",
                                "reason": "Faulty",
                                "wish": "",
                                "additional": {
                                    "title": "",
                                    "value": ""
                                }
                            }
                        ]
                    },
                    {
                        "sku_code": "UN-12322;28",
                        "sku_desc": "Black Halterneck Corset",
                        "quantity": "1",
                        "price": "200",
                        "weight": "0.86",
                        "weight_uom": "",
                        "length": "",
                        "width": "",
                        "height": "",
                        "dimensions_uom": "mm",
                        "hs_code": "4331767",
                        "country_code": "GB",
                        "img_path": "",
                        "dangerous_goods":"No",
                        "export_date": "946677600",
                        "export_awb": "32153454GB",
                        "export_carrier_name": "USPS",
                        "sku_url": "",
                        "final_dest_name": "",
                        "final_dest_company_name": "",
                        "final_dest_id": "",
                        "final_dest_country":"",
                        "final_dest_state":"",
                        "final_dest_zip":"",
                        "final_dest_city":"",
                        "final_dest_addr1":"",
                        "final_dest_addr2":"",
                        "final_dest_addr3":"",
                        "final_dest_neighborhood":"",
                        "verification_entity": 0,
                        "final_disposition": "",
                        "reason": [
                            {
                                "action": "Exchange",
                                "reason": "Too small",
                                "wish": "",
                                "additional": {
                                    "title": "New size",
                                    "value": "L"
                                }
                            }
                        ]
                    }
                ],
                "carrier": "ACP"
            },
            {
                "id": "111494",
                "order_reference": "12312355",
                "date_added": "1465397745",
                "name": "John Doe",
                "zip": "12207",
                "email": "doe@gmail.com",
                "addr1": "City Hall",
                "addr2": "24 Eagle Street, Room 102",
                "city": "Albany",
                "state": "NY",
                "country": "US",
                "phone": "+010557779",
                "tracking": "9202490112676104136369",
                "tracking_last_update": "1465397745",
                "current_tracking_status": "10",
                "verification_entity": 0,
                "item": [
                    {
                        "sku_code": "ASD111",
                        "sku_desc": "Black Sculpting & Smoothing Shapewear Body Suit-EUR 38 (M)",
                        "quantity": "2",
                        "price": "100",
                        "weight": "0.3",
                        "weight_uom": "",
                        "length": "",
                        "width": "",
                        "height": "",
                        "dimensions_uom": "mm",
                        "hs_code": "5905954",
                        "country_code": "CN",
                        "img_path": "",
                        "dangerous_goods":"No",
                        "export_date": "946677600",
                        "export_awb": "32153454GB",
                        "export_carrier_name": "USPS",
                        "sku_url": "",
                        "final_dest_name": "",
                        "final_dest_company_name": "",
                        "final_dest_id": "",
                        "final_dest_country":"",
                        "final_dest_state":"",
                        "final_dest_zip":"",
                        "final_dest_city":"",
                        "final_dest_addr1":"",
                        "final_dest_addr2":"",
                        "final_dest_addr3":"",
                        "final_dest_neighborhood":"",
                        "verification_entity": 0,
                        "final_disposition": "",
                        "reason": [
                            {
                                "action": "Exchange",
                                "reason": "Too small",
                                "wish": "",
                                "additional": {
                                    "title": "New size",
                                    "value": "L"
                                }
                            },
                            {
                                "action": "Refund",
                                "reason": "Faulty",
                                "wish": "",
                                "additional": {
                                    "title": "",
                                    "value": ""
                                }
                            }
                        ]
                    },
                    {
                        "sku_code": "UN-12322;28",
                        "sku_desc": "Black Halterneck > Corset",
                        "quantity": "1",
                        "price": "200",
                        "weight": "0.86",
                        "weight_uom": "",
                        "length": "",
                        "width": "",
                        "height": "",
                        "dimensions_uom": "mm",
                        "hs_code": "4331767",
                        "country_code": "GB",
                        "img_path": "",
                        "dangerous_goods":"No",
                        "export_date": "946677600",
                        "export_awb": "32153454GB",
                        "export_carrier_name": "USPS",
                        "sku_url": "",
                        "final_dest_name": "",
                        "final_dest_company_name": "",
                        "final_dest_id": "",
                        "final_dest_country":"",
                        "final_dest_state":"",
                        "final_dest_zip":"",
                        "final_dest_city":"",
                        "final_dest_addr1":"",
                        "final_dest_addr2":"",
                        "final_dest_addr3":"",
                        "final_dest_neighborhood":"",
                        "verification_entity": 0,
                        "final_disposition": "",
                        "reason": [
                            {
                                "action": "Exchange",
                                "reason": "Too small",
                                "wish": "",
                                "additional": {
                                    "title": "New size",
                                    "value": "L"
                                }
                            }
                        ]
                    }
                ],
                "carrier": "ACP"
            }
        ]
    }
}

XML response example:

<?xml version="1.0" encoding="UTF-8"?>
<success>
    <total>2</total>
    <return>
        <id>111495</id>
        <order_reference>12312355</order_reference>
        <date_added>1465397894</date_added>
        <name>John Doe</name>
        <zip>12207</zip>
        <email>doe@gmail.com</email>
        <addr1>City Hall</addr1>
        <addr2>24 Eagle Street, Room 102</addr2>
        <addr3></addr3>
        <city>Albany</city>
        <state>NY</state>
        <country>US</country>
        <phone>+010557779</phone>
        <tracking>9202490112676104136413</tracking>
        <tracking_last_update>1465397894</tracking_last_update>
        <current_tracking_status>10</current_tracking_status>
        <verification_entity>0</verification_entity>
        <item>
            <sku_code>ASD111</sku_code>
            <sku_desc>Black Sculpting Smoothing Shapewear Body Suit-EUR 38 (M)</sku_desc>
            <quantity>2</quantity>
            <price>100</price>
            <weight>0.3</weight>
            <weight_uom></weight_uom>
            <length></length>
            <width></width>
            <height></height>
            <dimensions_uom>mm</dimensions_uom>
            <hs_code>5905954</hs_code>
            <country_code>CN</country_code>
            <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
            <dangerous_goods>No</dangerous_goods>
            <export_date>946677600</export_date>
            <export_awb>32153454GB</export_awb>
            <export_carrier_name>USPS</export_carrier_name>
            <sku_url></sku_url>
            <final_dest_name></final_dest_name>
            <final_dest_company_name></final_dest_company_name>
            <final_dest_id></final_dest_id>
            <final_dest_country></final_dest_country>
            <final_dest_state></final_dest_state>
            <final_dest_zip></final_dest_zip>
            <final_dest_city></final_dest_city>
            <final_dest_addr1></final_dest_addr1>
            <final_dest_addr2></final_dest_addr2>
            <final_dest_addr3></final_dest_addr3>
            <final_dest_neighborhood></final_dest_neighborhood>
            <verification_entity>0</verification_entity>
            <final_disposition></final_disposition>
            <reason>
                <action>Exchange</action>
                <reason>Too small</reason>
                <wish></wish>
                <additional>
                    <title>New size</title>
                    <value>L</value>
                </additional>
            </reason>
            <reason>
                <action>Refund</action>
                <reason>Faulty</reason>
                <wish></wish>
                <additional>
                    <title></title>
                    <value></value>
                </additional>
            </reason>
        </item>
        <item>
            <sku_code>UN-12322;28</sku_code>
            <sku_desc>Black Halterneck Corset</sku_desc>
            <quantity>1</quantity>
            <price>200</price>
            <weight>0.86</weight>
            <weight_uom></weight_uom>
            <length></length>
            <width></width>
            <height></height>
            <dimensions_uom>mm</dimensions_uom>
            <hs_code>4331767</hs_code>
            <country_code>GB</country_code>
            <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
            <dangerous_goods>No</dangerous_goods>
            <export_date>946677600</export_date>
            <export_awb>32153454GB</export_awb>
            <export_carrier_name>USPS</export_carrier_name>
            <sku_url></sku_url>
            <final_dest_name></final_dest_name>
            <final_dest_company_name></final_dest_company_name>
            <final_dest_id></final_dest_id>
            <final_dest_country></final_dest_country>
            <final_dest_state></final_dest_state>
            <final_dest_zip></final_dest_zip>
            <final_dest_city></final_dest_city>
            <final_dest_addr1></final_dest_addr1>
            <final_dest_addr2></final_dest_addr2>
            <final_dest_addr3></final_dest_addr3>
            <final_dest_neighborhood></final_dest_neighborhood>
            <verification_entity>0</verification_entity>
            <final_disposition></final_disposition>
            <reason>
                <action>Exchange</action>
                <reason>Too small</reason>
                <wish></wish>
                <additional>
                    <title>New size</title>
                    <value>L</value>
                </additional>
            </reason>
        </item>
        <carrier>ACP</carrier>
    </return>
    <return>
        <id>111494</id>
        <order_reference>12312355</order_reference>
        <date_added>1465397745</date_added>
        <name>John Doe</name>
        <zip>12207</zip>
        <email>doe@gmail.com</email>
        <addr1>City Hall</addr1>
        <addr2>24 Eagle Street, Room 102</addr2>
        <addr3></addr3>
        <city>Albany</city>
        <state>NY</state>
        <country>US</country>
        <phone>+010557779</phone>
        <tracking>9202490112676104136369</tracking>
        <tracking_last_update>1465397745</tracking_last_update>
        <current_tracking_status>10</current_tracking_status>
        <verification_entity>0</verification_entity>
        <item>
            <sku_code>ASD111</sku_code>
            <sku_desc>Black Sculpting &amp; Smoothing Shapewear Body Suit-EUR 38 (M)</sku_desc>
            <quantity>2</quantity>
            <price>100</price>
            <weight>0.3</weight>
            <weight_uom></weight_uom>
            <length></length>
            <width></width>
            <height></height>
            <dimensions_uom>mm</dimensions_uom>
            <hs_code>5905954</hs_code>
            <country_code>CN</country_code>
            <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
            <dangerous_goods>No</dangerous_goods>
            <export_date>946677600</export_date>
            <export_awb>32153454GB</export_awb>
            <export_carrier_name>USPS</export_carrier_name>
            <sku_url></sku_url>
            <final_dest_name></final_dest_name>
            <final_dest_company_name></final_dest_company_name>
            <final_dest_id></final_dest_id>
            <final_dest_country></final_dest_country>
            <final_dest_state></final_dest_state>
            <final_dest_zip></final_dest_zip>
            <final_dest_city></final_dest_city>
            <final_dest_addr1></final_dest_addr1>
            <final_dest_addr2></final_dest_addr2>
            <final_dest_addr3></final_dest_addr3>
            <final_dest_neighborhood></final_dest_neighborhood>
            <verification_entity>0</verification_entity>
            <final_disposition></final_disposition>
            <reason>
                <action>Exchange</action>
                <reason>Too small</reason>
                <wish></wish>
                <additional>
                    <title>New size</title>
                    <value>L</value>
                </additional>
            </reason>
            <reason>
                <action>Refund</action>
                <reason>Faulty</reason>
                <wish></wish>
                <additional>
                    <title></title>
                    <value></value>
                </additional>
            </reason>
        </item>
        <item>
            <sku_code>UN-12322;28</sku_code>
            <sku_desc>Black Halterneck &gt; Corset</sku_desc>
            <quantity>10</quantity>
            <price>200</price>
            <weight>0.86</weight>
            <weight_uom></weight_uom>
            <length></length>
            <width></width>
            <height></height>
            <dimensions_uom>mm</dimensions_uom>
            <hs_code>4331767</hs_code>
            <country_code>GB</country_code>
            <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
            <dangerous_goods>No</dangerous_goods>
            <export_date>946677600</export_date>
            <export_awb>32153454GB</export_awb>
            <export_carrier_name>USPS</export_carrier_name>
            <sku_url></sku_url>
            <final_dest_name></final_dest_name>
            <final_dest_company_name></final_dest_company_name>
            <final_dest_id></final_dest_id>
            <final_dest_country></final_dest_country>
            <final_dest_state></final_dest_state>
            <final_dest_zip></final_dest_zip>
            <final_dest_city></final_dest_city>
            <final_dest_addr1></final_dest_addr1>
            <final_dest_addr2></final_dest_addr2>
            <final_dest_addr3></final_dest_addr3>
            <final_dest_neighborhood></final_dest_neighborhood>
            <verification_entity>0</verification_entity>
            <final_disposition></final_disposition>
            <reason>
                <action>Exchange</action>
                <reason>Too small</reason>
                <wish></wish>
                <additional>
                    <title>New size</title>
                    <value>L</value>
                </additional>
            </reason>
        </item>
        <carrier>ACP</carrier>
    </return>
</success>

Return not found:

{"error":{"code":"return_nx","message":["Return not found"]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>return_nx</code>
    <message>Return not found</message>
</error>

Request for prices

Following method can be used for:
  • To retrieve pricing quotes and service coverage by providing a complete information of return
  • To retrieve only a service coverage. In this case, you can ignore a "Information of return" field set.
    Address and items information, however, remain mandatory.
Response format will be the same for both cases.

Information of return

Key Desc
order_reference Order reference
date_added Return booking date, current time by default. Allowed date formats: mm/dd/yyyy hh:mm:ss, yyyy/mm/dd hh:mm:ss, Unix timestamp
tracking Tracking number.
Please, note! This field has to be provided if a return has been already booked/registered without using the Intelligentreturns software.
In this case, return will be saved and thereafter will receive tracking updates, but the booking process will be omitted.
-
Otherwise, omit this field or leave it blank, then a return will registered by the Intelligentreturns software and will acquire tracking number automatically.
currency_code Currency code(3 letters) ISO_4217. This indicates a currency in which the original order was placed.
phone Phone
email Email
display_id An additional information, which will be displayed on the shipping label (if it is possible). Max length 32 characters
external_id Alphanumeric value. Must be unique for each return. This field can be used in /returns/get/ method
add_items_data_to_order Boolean value. TRUE: "1" or "true". FALSE(default): omit this field, "0" or "false".
Please, refer to the Create return section for detailed description.
export_date Unix timestamp of export date. Default value, will be applied to all items, if not specified in corresponding item field
export_awb Export air waybill. Default value, will be applied to all items, if not specified in corresponding item field
export_carrier_name Exporter company. Default value, will be applied to all items, if not specified in corresponding item field
verification_entity Boolean value. TRUE: "1" or "true". FALSE(default): omit this field, "0" or "false".
dangerous_goods Possible values: Yes/No. Default value, will be applied to all items, if not specified in corresponding item field
final_disposition Can be 'return' or 'destroy'. Default value, will be applied to all items, if not specified in corresponding item field

Address Info

Key Desc
name Customer full name (Person)
company_name Company name
country * Customer's country code (ISO 3166-1 alpha-2)
state * Customer's state
Not required for following countries:
  • GB
  • UK
  • IL
  • DE
  • FR
  • NL
  • IE
  • SE
  • IT
  • DK
  • AT
  • LU
  • CZ
  • BE
  • BG
  • HR
  • CY
  • FI
  • GR
  • HU
  • MT
  • PL
  • PT
  • RO
  • SK
  • SI
  • EE
  • LV
  • LT
  • NZ
zip * Zip/Post code
Not required for following countries:
  • HK
  • IE
  • IL
city * City
addr1 * Address line 1
addr2 Address line 2
addr3 Address line 3
neighborhood Neighborhood. Available only for Mexico
lat and lng fields can be provided instead of required address fields: country, city, state, zip, addr1.
Address fields have a priority over coordinates(lat, lng) in case both are provided.
Either of the following sets must be provided:
  • country, city, state, zip, addr1
  • lat, lng
lat Latitude. Required if address was not provided
lng Longitude. Required if address was not provided
final_dest_name Final destination contact name
final_dest_company_name Final destination company name
final_dest_id Final destination address ID. Can be provided instead of full final destination address (fields below), in this case destination address fields will be ignored.
final_dest_country Final destination country code (ISO 3166-1 alpha-2)
final_dest_state Final destination State
final_dest_zip Final destination Zip/Post code
final_dest_city Final destination City
final_dest_addr1 Final destination Address line 1
final_dest_addr2 Final destination Address line 2
final_dest_addr3 Final destination Address line 3
final_dest_neighborhood Final destination neighborhood. Available only for Mexico

Item info

Key Desc
sku_code * Item SKU code
sku_desc * Item SKU description
quantity * Number of items sold
price * Price of 1 item
weight Weight of 1 item. Default value: 1 (K/L).
weight_uom K / L (1 letter). Default value: K
length Length of 1 item
width Width of 1 item
height Height of 1 item
dimensions_uom cm, mm, in
country_code Country manufacturer code(2 letters)
hs_code Harmonization code
img_path Link to item image
dangerous_goods Possible values: Yes/No
export_date Unix timestamp of export date
export_awb Export air waybill
export_carrier_name Exporter company
sku_url URL to assist in verification
final_dest_name Final destination contact name
final_dest_company_name Final destination company name
final_dest_id Final destination address ID. Can be provided instead of full final destination address (fields below), in this case destination address fields will be ignored.
final_dest_country Final destination country code (ISO 3166-1 alpha-2)
final_dest_state Final destination State
final_dest_zip Final destination Zip/Post code
final_dest_city Final destination City
final_dest_addr1 Final destination Address line 1
final_dest_addr2 Final destination Address line 2
final_dest_addr3 Final destination Address line 3
final_dest_neighborhood Final destination neighborhood. Available only for Mexico
verification_entity Boolean value. TRUE: "1" or "true". FALSE(default): omit this field, "0" or "false".
final_disposition Can be 'return' or 'destroy'.

You can provide data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/returns/request_for_prices/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "return":
    {
        "order_reference":"12312355",
        "name":"John Doe",
        "phone":"+010557779",
        "email":"doe@gmail.com",
        "addr1":"City Hall",
        "addr2":"24 Eagle Street, Room 102",
        "addr3":"",
        "city":"Albany",
        "zip":"12207",
        "state":"NY",
        "country":"US",
        "final_dest_id": "Default",
        "final_dest_addr1":"Telford Transport Solutions Ltd",
        "final_dest_addr2":"Stafford Park 12",
        "final_dest_addr3":"",
        "final_dest_city":"Telford",
        "final_dest_zip":"TF3 3BJ",
        "final_dest_state":"West Midlands",
        "final_dest_country":"UK",
        "currency_code":"USD",
        "item":[
            {
                "sku_code":"ASD111",
                "sku_desc":"Black Sculpting & Smoothing Shapewear Body Suit-EUR 38 (M)",
                "quantity":"5",
                "price":"100",
                "weight":"0.3",
                "length":"10",
                "width":"10",
                "height":"10",
                "dimensions_uom":"mm",
                "hs_code":"5905954",
                "country_code":"CN",
                "img_path":"https://intelligentreturns.net/assets/frontend/img/rebound_logo.png",
                "dangerous_goods":"No",
                "export_date": "946677600",
                "export_awb": "32153454GB",
                "export_carrier_name": "USPS"
            },{
                "sku_code":"UN-12322;28",
                "sku_desc":"Black Halterneck > Corset",
                "quantity":"10",
                "price":"200",
                "weight":"0.86",
                "length":"10",
                "width":"10",
                "height":"10",
                "dimensions_uom":"mm",
                "hs_code":"4331767",
                "country_code":"GB",
                "img_path":"https://intelligentreturns.net/assets/frontend/img/rebound_logo.png",
                "dangerous_goods":"Yes",
                "export_date": "946677600",
                "export_awb": "32153454GB",
                "export_carrier_name": "USPS"
            }
        ]
    }
}

XML

URL:
https://intelligentreturns.net/api/returns/request_for_prices/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<return>
    <order_reference>12312355</order_reference>
    <name>John Doe</name>
    <phone>+010557779</phone>
    <email>doe@gmail.com</email>
    <addr1>City Hall</addr1>
    <addr2>24 Eagle Street, Room 102</addr2>
    <addr3></addr3>
    <city>Albany</city>
    <zip>12207</zip>
    <state>NY</state>
    <country>US</country>
    <final_dest_id>Default</final_dest_id>
    <final_dest_addr1>Telford Transport Solutions Ltd</final_dest_addr1>
    <final_dest_addr2>Stafford Park 12</final_dest_addr2>
    <final_dest_addr3></final_dest_addr3>
    <final_dest_city>Telford</final_dest_city>
    <final_dest_zip>TF3 3BJ</final_dest_zip>
    <final_dest_state>West Midlands</final_dest_state>
    <final_dest_country>UK</final_dest_country>
    <currency_code>USD</currency_code>
    <item>
        <sku_code>ASD111</sku_code>
        <sku_desc>Black Sculpting &amp; Smoothing Shapewear Body Suit-EUR 38 (M)</sku_desc>
        <quantity>5</quantity>
        <price>100</price>
        <weight>0.3</weight>
        <length>10</length>
        <width>10</width>
        <height>10</height>
        <dimensions_uom>mm</dimensions_uom>
        <hs_code>5905954</hs_code>
        <country_code>CN</country_code>
        <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
        <dangerous_goods>Yes</dangerous_goods>
        <export_date>946677600</export_date>
        <export_awb>32153454GB</export_awb>
        <export_carrier_name>USPS</export_carrier_name>
    </item>
    <item>
        <sku_code>UN-12322;28</sku_code>
        <sku_desc>Black Halterneck &gt; Corset</sku_desc>
        <quantity>10</quantity>
        <price>200</price>
        <weight>0.86</weight>
        <length>10</length>
        <width>10</width>
        <height>10</height>
        <dimensions_uom>mm</dimensions_uom>
        <hs_code>4331767</hs_code>
        <country_code>GB</country_code>
        <img_path>https://intelligentreturns.net/assets/frontend/img/rebound_logo.png</img_path>
        <dangerous_goods>No</dangerous_goods>
        <export_date>946677600</export_date>
        <export_awb>32153454GB</export_awb>
        <export_carrier_name>USPS</export_carrier_name>
    </item>
</return>

Successful request for prices:

{
   "success": {
      "result": [
         {
            "carrier": "royal mail",
            "service": "drop_off",
            "service_id": "5",
            "service_name": "Tracked Returns 48",
            "type": "drop_off",
            "description": "Take your parcel to the nearest Post Office",
            "max_weight": "15kg",
            "max_dim": "61x46x46cm",
            "avg_delivery_info": "1 to 2 days",
            "first_mile_price": "8.76 USD",
            "parcel_processing_price": "0 USD",
            "final_mile_price": "4.33 USD",
            "customs_price": "0 USD",
            "government_duty_price": "0 USD"
         }
      ]
   }
}
                    
<?xml version="1.0" encoding="UTF-8"?>
<success>
   <result>
      <carrier>royal mail</carrier>
      <service>drop_off</service>
      <service_id>5</service_id>
      <service_name>Tracked Returns 48</service_name>
      <type>drop_off</type>
      <description>Take your parcel to the nearest Post Office</description>
      <max_weight>15kg</max_weight>
      <max_dim>61x46x46cm</max_dim>
      <avg_delivery_info>1 to 2 days</avg_delivery_info>
      <first_mile_price>8.76 USD</first_mile_price>
      <parcel_processing_price>0 USD</parcel_processing_price>
      <final_mile_price>4.33 USD</final_mile_price>
      <customs_price>0 USD</customs_price>
      <government_duty_price>0 USD</government_duty_price>
   </result>
</success>

Incorrect return data:

{"error":{"code":"return_invalid","message":["Field order_reference cannot be empty."]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>return_invalid</code>
    <message>Field order_reference cannot be empty.</message>
</error>

JSON is not valid:

{"error":{"code":"json_invalid", ""message":["JSON is not valid"]}}

XML is not valid:

<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>xml_invalid</code>
    <message>XML is not valid</message>
</error>

Cancel return

Return info

Key Value
external_id Unique ID, which can be populated using Create return method
tracking Tracking number
Either 'external_id' or 'tracking' is required. If both are provided, then a result must match both.

You can provide a return data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/returns/cancel/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "return":
    {
        "tracking":"00350559268103460351"
    }
}
                                    

XML

URL:
https://intelligentreturns.net/api/returns/cancel/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<return>
    <tracking>00350559268103460351</tracking>
</return>
                                    

Return cancel requested successfully:

{
   "success": {
      "result": {
         "message": "Return cancel requested"
      }
   }
}
                            
<?xml version="1.0" encoding="UTF-8"?>
<success>
   <result>
      <message>Return cancel requested</message>
   </result>
</success>
                            

Return not found:

{"error":{"code":"return_nx","message":["Return not found"]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>return_nx</code>
    <message>Return not found</message>
</error>
                        

Get Tracking (single return)

URL:
https://intelligentreturns.net/api/tracking/get
Filter data:
Key Value
tracking Tracking code

You can provide a filter data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/tracking/get/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "tracking":
    {
        "code": "514500294005"
    }
}

XML

URL:
https://intelligentreturns.net/api/tracking/get/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<tracking>
    <code>514500294005</code>
</tracking>

Response fields. Full tracking data.

Key Value
dt Tracking event date in unix timestamp format.
status Digital code of current tracking status.
location Location. Contains: country, state, city. Please note, that it may be empty.
pallet_number Pallet tracking number. Empty if parcel has not been added to a pallet
source_country Country from which a parcel was consigned. (ISO 3166-1 alpha-2)
carrier_name Carrier name (E.G. DHL)
service_id Internal service id, which can be used to determine carrier's service
external_id Unique ID, which can be populated using Create return method

Location

Key Value
country Country code (ISO 3166-1 alpha-2)
state State
city City

JSON response example:

{
   "success": {
      "track": [
         {
            "dt": "1488469413",
            "status": "10",
            "location": {
               "country": "CZ",
               "state": "ČR",
               "city": "Praha"
            }
         },
         {
            "dt": "1488482100",
            "status": "20",
            "location": {
               "country": "CZ",
               "state": "",
               "city": ""
            }
         },
         {
            "dt": "1488526560",
            "status": "30",
            "location": {
               "country": "CZ",
               "state": "",
               "city": ""
            }
         },
         {
            "dt": "1488561000",
            "status": "30",
            "location": {
               "country": "DE",
               "state": "Radefeld",
               "city": ""
            }
         },
         {
            "dt": "1488566460",
            "status": "30",
            "location": {
               "country": "DE",
               "state": "Radefeld",
               "city": ""
            }
         },
         {
            "dt": "1488603900",
            "status": "30",
            "location": {
               "country": "DE",
               "state": "Börnicke",
               "city": ""
            }
         },
         {
            "dt": "1488603960",
            "status": "40",
            "location": {
               "country": "DE",
               "state": "Großbeeren",
               "city": ""
            }
         },
         {
            "dt": "1488758400",
            "status": "50",
            "location": {
               "country": "DE",
               "state": "",
               "city": ""
            }
         },
         {
            "dt": "1488758400",
            "status": "60",
            "location": {
               "country": "GB",
               "state": "Selby",
               "city": "Selby"
            }
         }
      ],
      "pallet_number": "1000",
      "source_country": "CZ",
      "carrier_name": "DHL",
      "service_id": "23",
      "external_id": "999"
   }
}

XML response example:

<?xml version="1.0" encoding="UTF-8"?>
<success>
   <track>
      <dt>1488469413</dt>
      <status>10</status>
      <location>
         <country>CZ</country>
         <state>ČR</state>
         <city>Praha</city>
      </location>
   </track>
   <track>
      <dt>1488482100</dt>
      <status>20</status>
      <location>
         <country>CZ</country>
         <state />
         <city />
      </location>
   </track>
   <track>
      <dt>1488526560</dt>
      <status>30</status>
      <location>
         <country>CZ</country>
         <state />
         <city />
      </location>
   </track>
   <track>
      <dt>1488561000</dt>
      <status>30</status>
      <location>
         <country>DE</country>
         <state>Radefeld</state>
         <city />
      </location>
   </track>
   <track>
      <dt>1488566460</dt>
      <status>30</status>
      <location>
         <country>DE</country>
         <state>Radefeld</state>
         <city />
      </location>
   </track>
   <track>
      <dt>1488603900</dt>
      <status>30</status>
      <location>
         <country>DE</country>
         <state>Börnicke</state>
         <city />
      </location>
   </track>
   <track>
      <dt>1488603960</dt>
      <status>40</status>
      <location>
         <country>DE</country>
         <state>Großbeeren</state>
         <city />
      </location>
   </track>
   <track>
      <dt>1488758400</dt>
      <status>50</status>
      <location>
         <country>DE</country>
         <state />
         <city />
      </location>
   </track>
   <track>
      <dt>1488758400</dt>
      <status>60</status>
      <location>
         <country>GB</country>
         <state>Selby</state>
         <city>Selby</city>
      </location>
   </track>
   <pallet_number>1000</pallet_number>
   <source_country>CZ</source_country>
   <carrier_name>DHL</carrier_name>
   <service_id>23</service_id>
   <external_id>999</external_id>
</success>

Nothing found:

{"error":{"code":"empty","message":["Nothing found."]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>empty</code>
    <message>Nothing found.</message>
</error>

Tracking events by date range

URL:
https://intelligentreturns.net/api/tracking/get_by_date_range
Filter data:
Key Value
date_from * mm/dd/yyyy hh:mm:ss, yyyy/mm/dd hh:mm:ss, Unix timestamp
date_to * mm/dd/yyyy hh:mm:ss, yyyy/mm/dd hh:mm:ss, Unix timestamp
source_country Country from which a parcel was consigned. (ISO 3166-1 alpha-2)

You can provide a filter data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/tracking/get_by_date_range/json
POST:
Key Value
login your login
api_key your API key
request JSON example.
Always apply urlencode to json data!
{
    "filter":
    {
        "date_from": "2017/04/29 20:24:47",
        "date_to": "2017/04/30 20:24:47"
    }
}

XML

URL:
https://intelligentreturns.net/api/tracking/get_by_date_range/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<filter>
    <date_from>2017/04/29 20:24:47</date_from>
    <date_to>2017/04/30 20:24:47</date_to>
</filter>
Please note, this method allows to get up to 20000 events. Make sure that a date range provided is not too wide.

Response fields. Tracking events grouped by tracking numbers.

Key Value
tracking_number Tracking number
pallet_number Pallet tracking number. Empty if parcel has not been added to a pallet
source_country Country from which a parcel was consigned. (ISO 3166-1 alpha-2)
carrier_name Carrier name (E.G. DHL)
service_id Internal service id, which can be used to determine carrier's service
external_id Unique ID, which can be populated using Create return method
events Tracking events. Contains: status, dt, location

Events

Key Value
status Digital code of current tracking status.
dt Tracking event date in unix timestamp format.
location Location. Contains: country, state, city. Please note, that it may be empty.

Location

Key Value
country Country code (ISO 3166-1 alpha-2)
state State
city City

JSON response example:

{
   "success": {
      "tracking_data": [
         {
            "tracking_number": "00350559268102004358",
            "pallet_number": "",
            "source_country": "SE",
            "carrier_name": "MyPack",
            "service_id": "40",
            "external_id": "",
            "events": [
               {
                  "status": "20",
                  "dt": "1475087880",
                  "location": {
                     "country": "SE",
                     "state": "",
                     "city": "Uppsala"
                  }
               },
               {
                  "status": "30",
                  "dt": "1475087880",
                  "location": {
                     "country": "SE",
                     "state": "",
                     "city": "Uppsala"
                  }
               }
            ]
         },
         {
            "tracking_number": "00350559268102018270",
            "pallet_number": "",
            "source_country": "SE",
            "carrier_name": "MyPack",
            "service_id": "40",
            "external_id": "",
            "events": [
               {
                  "status": "30",
                  "dt": "1475087880",
                  "location": {
                     "country": "SE",
                     "state": "",
                     "city": "Landvetter"
                  }
               }
            ]
         },
         {
            "tracking_number": "00350559268102009469",
            "pallet_number": "",
            "source_country": "SE",
            "carrier_name": "MyPack",
            "service_id": "40",
            "external_id": "",
            "events": [
               {
                  "status": "30",
                  "dt": "1475087940",
                  "location": {
                     "country": "SE",
                     "state": "",
                     "city": "Järfälla"
                  }
               }
            ]
         },
         {
            "tracking_number": "512902293586",
            "pallet_number": "",
            "source_country": "RO",
            "carrier_name": "DHL",
            "service_id": "31",
            "external_id": "",
            "events": [
               {
                  "status": "20",
                  "dt": "1475087940",
                  "location": {
                     "country": "RO",
                     "state": "",
                     "city": ""
                  }
               }
            ]
         },
         {
            "tracking_number": "00350559268102026343",
            "pallet_number": "",
            "source_country": "SE",
            "carrier_name": "MyPack",
            "service_id": "40",
            "external_id": "",
            "events": [
               {
                  "status": "20",
                  "dt": "1475087940",
                  "location": {
                     "country": "SE",
                     "state": "",
                     "city": "Stockholm"
                  }
               },
               {
                  "status": "30",
                  "dt": "1475087940",
                  "location": {
                     "country": "SE",
                     "state": "",
                     "city": "Stockholm"
                  }
               }
            ]
         }
      ]
   }
}

XML response example:

<?xml version="1.0" encoding="UTF-8"?>
<success>
   <tracking_data>
      <tracking_number>00350559268102004358</tracking_number>
      <pallet_number />
      <source_country>SE</source_country>
      <carrier_name>MyPack</carrier_name>
      <service_id>40</service_id>
      <external_id />
      <events>
         <status>20</status>
         <dt>1475087880</dt>
         <location>
            <country>SE</country>
            <state />
            <city>Uppsala</city>
         </location>
      </events>
      <events>
         <status>30</status>
         <dt>1475087880</dt>
         <location>
            <country>SE</country>
            <state />
            <city>Uppsala</city>
         </location>
      </events>
   </tracking_data>
   <tracking_data>
      <tracking_number>00350559268102018270</tracking_number>
      <pallet_number />
      <source_country>SE</source_country>
      <carrier_name>MyPack</carrier_name>
      <service_id>40</service_id>
      <external_id />
      <events>
         <status>30</status>
         <dt>1475087880</dt>
         <location>
            <country>SE</country>
            <state />
            <city>Landvetter</city>
         </location>
      </events>
   </tracking_data>
   <tracking_data>
      <tracking_number>00350559268102009469</tracking_number>
      <pallet_number />
      <source_country>SE</source_country>
      <carrier_name>MyPack</carrier_name>
      <service_id>40</service_id>
      <external_id />
      <events>
         <status>30</status>
         <dt>1475087940</dt>
         <location>
            <country>SE</country>
            <state />
            <city>Järfälla</city>
         </location>
      </events>
   </tracking_data>
   <tracking_data>
      <tracking_number>512902293586</tracking_number>
      <pallet_number />
      <source_country>RO</source_country>
      <carrier_name>DHL</carrier_name>
      <service_id>31</service_id>
      <external_id />
      <events>
         <status>20</status>
         <dt>1475087940</dt>
         <location>
            <country>RO</country>
            <state />
            <city />
         </location>
      </events>
   </tracking_data>
   <tracking_data>
      <tracking_number>00350559268102026343</tracking_number>
      <pallet_number />
      <source_country>SE</source_country>
      <carrier_name>MyPack</carrier_name>
      <service_id>40</service_id>
      <external_id />
      <events>
         <status>20</status>
         <dt>1475087940</dt>
         <location>
            <country>SE</country>
            <state />
            <city>Stockholm</city>
         </location>
      </events>
      <events>
         <status>30</status>
         <dt>1475087940</dt>
         <location>
            <country>SE</country>
            <state />
            <city>Stockholm</city>
         </location>
      </events>
   </tracking_data>
</success>

Nothing found:

{"error":{"code":"empty","message":["Nothing found."]}}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>empty</code>
    <message>Nothing found.</message>
</error>

Check Availability

URL:
https://intelligentreturns.net/api/check/available
POST request body will be ignored and may be passed empty. No authorization required

You can receive a response in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/check/available/json

XML

URL:
https://intelligentreturns.net/api/check/available/xml

Response fields.

Key Value
date Server datetime in unix timestamp format.

JSON SUCCESS response example:

{
    "success": {
        "date": "1474467743"
    }
}

XML SUCCESS response example:

<?xml version="1.0" encoding="UTF-8"?>
<success>
    <date>
        1474467743
    </date>
</success>

JSON UNAVAILABLE response example:

{
    "error": {
        "code": "unavailable",
        "message":["Server is temporary unavailable."]
    }
}

XML UNAVAILABLE response example:

<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>
        unavailable
    </code>
    <message>
        Server is temporary unavailable.
    </message>
</error>

Drop off points location

URL:
https://intelligentreturns.net/api/services/get_drop_off_points

Request data (* required)

Key Value
address Address, which will be used to find nearest drop-off points.
Address has a priority over coordinates in case both are provided.
Please, find fields description below
Mandatory if coordinates empty
coordinates Coordinates, which will be used to find nearest drop-off points
Please, find fields description below
Mandatory if address empty
services Array of service IDs
radius Search radius in km (kilometers)

Address info

Key Value
country * Country code (ISO 3166-1 alpha-2)
state State/County
Required for Hong Kong
zip (Preferred) Zip/Post code
city (Preferred) City
addr1 (Preferred) Address line 1
addr2 Address line 2

Coordinates

Key Value
lat * Latitude
lng * Longitude

You can provide a request data in 2 formats: JSON, XML

JSON

URL:
https://intelligentreturns.net/api/services/get_drop_off_points/json
POST:
Key Value
login your login
api_key your API key
request JSON example
Always apply urlencode to json data!
{
    "request": {
        "services": [
            1,
            2
        ],
        "address": {
            "country": "CA",
            "state": "ON",
            "zip": "M6H 2X5",
            "city": "Toronto",
            "addr1": "926 Dovercourt Rd",
            "addr2": ""
        },
        "coordinates": {
            "lat": "43.6657253",
            "lng": "-79.4313081"
        },
        "radius": "10"
    }
}

XML

URL:
https://intelligentreturns.net/api/services/get_drop_off_points/xml
POST:
Key Value
login your login
api_key your API key
request XML Example
Warning! Before send xml data:
  1. Convert xml special characters
  2. Apply urlencode to xml data
<request>
    <services>1</services>
    <services>2</services>
    <address>
        <country>CA</country>
        <state>ON</state>
        <zip>M6H 2X5</zip>
        <city>Toronto</city>
        <addr1>926 Dovercourt Rd</addr1>
        <addr2></addr2>
    </address>
    <coordinates>
        <lat>43.6657253</lat>
        <lng>-79.4313081</lng>
    </coordinates>
    <radius>10</radius>
</request>

JSON response example:

{
   "success": {
      "carriers": [
         {
            "id": 6,
            "name": "MyPack",
            "services": [
               {
                  "id": 40,
                  "name": "MyPack Drop Off",
                  "points": [
                     {
                        "title": "Adlibris Regeringsgatan",
                        "address_detail": {
                           "country": "SE",
                           "state": "",
                           "zip": "11156",
                           "city": "STOCKHOLM",
                           "addr1": "Regeringsgatan 55",
                           "addr2": ""
                        },
                        "hours": "monday-friday 10:00-20:00 saturday 10:00-18:00 sunday 11:00-17:00",
                        "lat": 59.333485,
                        "lng": 18.067364
                     },
                     {
                        "title": "Hemköp Stockholm City",
                        "address_detail": {
                           "country": "SE",
                           "state": "",
                           "zip": "11121",
                           "city": "STOCKHOLM",
                           "addr1": "Mäster Samuelsgatan 57",
                           "addr2": ""
                        },
                        "hours": "monday-thursday 10:00-19:00 friday 10:00-20:00 saturday 10:00-17:00 sunday 10:00-16:00",
                        "lat": 59.332485,
                        "lng": 18.061296
                     },
                     {
                        "title": "Coop Nära Järntorget",
                        "address_detail": {
                           "country": "SE",
                           "state": "",
                           "zip": "11129",
                           "city": "STOCKHOLM",
                           "addr1": "Järntorget 80",
                           "addr2": ""
                        },
                        "hours": "monday-friday 07:00-22:00 saturday-sunday 09:00-22:00",
                        "lat": 59.322628,
                        "lng": 18.072813
                     },
                     {
                        "title": "Mail Boxes Etc Östermalmstorg",
                        "address_detail": {
                           "country": "SE",
                           "state": "",
                           "zip": "11442",
                           "city": "STOCKHOLM",
                           "addr1": "Östermalmstorg 2",
                           "addr2": ""
                        },
                        "hours": "monday-friday 08:30-19:00 saturday 10:00-16:00",
                        "lat": 59.335636,
                        "lng": 18.078724
                     },
                     {
                        "title": "Mail Boxes Etc Birger Jarlsg.",
                        "address_detail": {
                           "country": "SE",
                           "state": "",
                           "zip": "11145",
                           "city": "STOCKHOLM",
                           "addr1": "Birger Jarlsgatan 39",
                           "addr2": ""
                        },
                        "hours": "monday-friday 09:00-19:00 saturday 10:00-14:00",
                        "lat": 59.33875,
                        "lng": 18.068035
                     }
                  ]
               }
            ]
         }
      ]
   }
}

XML response example:

<?xml version="1.0" encoding="UTF-8"?>
<success>
   <carriers>
      <id>6</id>
      <name>MyPack</name>
      <services>
         <id>40</id>
         <name>MyPack Drop Off</name>
         <points>
            <title>Adlibris Regeringsgatan</title>
            <address_detail>
               <country>SE</country>
               <state />
               <zip>11156</zip>
               <city>STOCKHOLM</city>
               <addr1>Regeringsgatan 55</addr1>
               <addr2 />
            </address_detail>
            <hours>monday-friday 10:00-20:00 saturday 10:00-18:00 sunday 11:00-17:00</hours>
            <lat>59.333483</lat>
            <lng>18.067363</lng>
         </points>
         <points>
            <title>Hemköp Stockholm City</title>
            <address_detail>
               <country>SE</country>
               <state />
               <zip>11121</zip>
               <city>STOCKHOLM</city>
               <addr1>Mäster Samuelsgatan 57</addr1>
               <addr2 />
            </address_detail>
            <hours>monday-thursday 10:00-19:00 friday 10:00-20:00 saturday 10:00-17:00 sunday 10:00-16:00</hours>
            <lat>59.332484</lat>
            <lng>18.061296</lng>
         </points>
         <points>
            <title>Coop Nära Järntorget</title>
            <address_detail>
               <country>SE</country>
               <state />
               <zip>11129</zip>
               <city>STOCKHOLM</city>
               <addr1>Järntorget 80</addr1>
               <addr2 />
            </address_detail>
            <hours>monday-friday 07:00-22:00 saturday-sunday 09:00-22:00</hours>
            <lat>59.322628</lat>
            <lng>18.072813</lng>
         </points>
         <points>
            <title>Mail Boxes Etc Östermalmstorg</title>
            <address_detail>
               <country>SE</country>
               <state />
               <zip>11442</zip>
               <city>STOCKHOLM</city>
               <addr1>Östermalmstorg 2</addr1>
               <addr2 />
            </address_detail>
            <hours>monday-friday 08:30-19:00 saturday 10:00-16:00</hours>
            <lat>59.335638</lat>
            <lng>18.078724</lng>
         </points>
         <points>
            <title>Mail Boxes Etc Birger Jarlsg.</title>
            <address_detail>
               <country>SE</country>
               <state />
               <zip>11145</zip>
               <city>STOCKHOLM</city>
               <addr1>Birger Jarlsgatan 39</addr1>
               <addr2 />
            </address_detail>
            <hours>monday-friday 09:00-19:00 saturday 10:00-14:00</hours>
            <lat>59.338749</lat>
            <lng>18.068035</lng>
         </points>
      </services>
   </carriers>
</success>

Nothing found:

{
    "error": {
        "code": "carrier_empty",
        "message": [
            "Missing required field 'address->country'."
        ]
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>carrier_empty</code>
    <message>Missing required field 'address->country'.</message>
</error>

Carrier Services list

service_id Carrier name Service name Is trackable
1 ACP USPS Ground Service Yes
2 ACP USPS Priority Yes
3 Canada Post Canada Post Tracked Return Yes
4 InPost Canada InPost Parcel Locker Return Yes
5 Royal Mail Tracked Returns 48 Yes
6 Hermes UK Home Collection Yes
7 Hermes UK Parcel Shop Yes
8 Hermes UK Hermes Parcel Shop Yes
9 PMP Pass my Parcel Mobile Yes
10 Temando Couriers Please Yes
11 Temando Australia Post Yes
12 Kiala Kiala Drop Off Point Yes
13 Correos Correos Drop Off Yes
14 Correos Correos Mobile Yes
15 AnPost AnPost Drop Off Yes
16 ASM Home Collection Yes
17 DHL Deutsche Post Tracked Parcel Yes
18 DHL Bpost Tracked Return Yes
19 DHL Eesti Post Tracked Return Yes
20 DHL Elta Tracked Return Yes
21 DHL Österreichische Post Tracked Parcel Yes
22 DHL Bulgarian Post Tracked Return Yes
23 DHL Ceska Posta Tracked Return Yes
24 DHL Cyprus Post Tracked Return Yes
25 DHL Colissimo Tracked Parcel Yes
26 DHL Magyar Posta Tracked Return Yes
27 DHL Poste Italiane Tracked Return Yes
28 DHL Latvijas Pasts Tracked Return Yes
29 DHL P&T Luxembourg Tracked Return Yes
30 DHL PostNL Tracked Return Yes
31 DHL Poşta Română Tracked Return Yes
32 DHL Slovenská Pošta Tracked Return Yes
33 DHL CTT Correios Tracked Parcel Yes
34 DHL Pošta Slovenije Tracked Return Yes
35 DHL Poczta Polska Tracked Return Yes
36 DHL Lietuvos Paštas Tracked Return Yes
37 DHL Posti Finland Tracked Return Yes
38 DHL Post Danmark Tracked Return Yes
39 DHL DHL Service Point Yes
40 MyPack MyPack Drop Off Yes
41 MyPack Pakke Drop Off Yes
42 Direct Link Untracked Return No
43 Self Post Self-Post Return No
44 Royale Parcel Shop Return Yes
45 CTT Correios Tracked Parcel Yes
46 Business Reply Royal Mail Business Reply Yes
47 nzpost Tracked Return Yes
48 Hermes Europe Hermes Parcel Shop Yes
49 Bring Posti Tracked Parcel Yes
50 Bring Tracked parcel Yes
51 Bring Tracked parcel No
52 Box It Parcel Locker Yes
53 Box It Parcel Shop Yes
54 Hermes Germany Parcel Shop Yes
55 Swiss Post Swiss Post Yes
56 DHL/USPS USPS Ground Service Yes
57 DHL/USPS USPS Priority Yes
58 BoxBerry Parcel Shop Yes
59 InPost UK InPost Return Yes
60 Estafeta estafeta test Yes
61 Bring Bring UK Yes
62 Direct Link Malta Post Untracked Return No
Please note, that a carrier service availability is determined by a geographical coverage and your account settings.

Tracking status list

Code Description
10 Return registered online
20 Received by the carrier
30 In transit to our local hub
40 Received at our local hub
43 Processed by hub
45 Parcel has been added to pallet
90 Parcel has been extracted from pallet
50 In transit to the retailer
60 Delivered to the retailer
70 Parcel refunded by retailer
100 Parcel delayed
110 Parcel lost
200 Parcel under investigation
120 Collection attempt failed
300 tracking_cancel_requested
A list of all possible tracking status codes.

Code Examples

"Create order" request example.


<?php

$login = 'demo_api';
$api_key = 'api_key';

$order = array (
    'order_reference' => '1000000000000',
    'order_date' => '10/20/2015',
    'rma' => '12345',
    'contact_name' => 'John Smith',
    'company_name' => '',
    'addr1' => '6 Semaphore Close Mount Pleasant',
    'addr2' => '',
    'addr3' => 'Christchurch',
    'zip' => '8081',
    'state' => 'qwe',
    'country' => 'NZ',
    'phone' => '+102030405060',
    'email' => 'john.smith@googlemail.com',
    'currency_code' => 'AUD',
    'export_awb' => '32153454GB',
    'export_carrier_name' => 'USPS',
    'item' => array (
        array (
            'sku_code' => 'QWE123',
            'sku_desc' => 'Black Sculpting & Smoothing Shapewear Body Suit-EUR 38 (M)',
            'quantity' => '5',
            'price' => '100',
            'weight' => '1',
            'length' => '2',
            'width' => '3',
            'height' => '4',
            'dimensions_uom' => 'mm',
            'hs_code' => '',
            'country_code' => 'GB',
            'img_path' => '',
        ),
        array (
            'sku_code' => 'QWE456',
            'sku_desc' => 'Black Halterneck Corset',
            'quantity' => '10',
            'price' => '200',
            'weight' => '0.86',
            'length' => '0',
            'width' => '0',
            'height' => '0',
            'dimensions_uom' => 'mm',
            'hs_code' => '',
            'country_code' => 'GB',
            'img_path' => '',
        ),
    ),
);

// Production API entry point
$entryPoint = 'https://intelligentreturns.net/api/';
// Test API entry point
$entryPoint = 'http://test.intelligentreturns.net/api/';
$method = 'orders/create/';
$format = 'json';

$post = array(
    'login' => $login,
    'api_key' => $api_key,
    'request' => json_encode(array('order' => $order))
);

$ch = curl_init($entryPoint . $method . $format);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post, '', '&'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
if ($result === false) {
    // cURL error
    die(curl_error($ch));
}
curl_close($ch);

$response = json_decode($result, true);

if ($response === null) {
    // Not json response
    die($result);
}

if (!empty($response['success'])) {
    // Order created
    $order_id = $response['success']['order_id'];
    die('Ok. Order ID: '. $order_id);
} elseif (!empty($response['error'])) {
    // Order was not created
    $error_code = $response['error']['code'];
    $messages = $response['error']['message'];
    die('Error code: ' . $error_code. '. Messages: '.implode("\r\n", $messages));
}

die('Unknown response format.');

"Check availability" method example.


<?php
// Production API entry point
$entryPoint = 'https://intelligentreturns.net/api/';
// Test API entry point
$entryPoint = 'http://test.intelligentreturns.net/api/';
$method = 'check/available/';
$format = 'json';

$post = array(
   'request' => ''
);

$ch = curl_init($entryPoint . $method . $format);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post, '', '&'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);

$result = curl_exec($ch);
if ($result === false) {
    // cURL error
    die(curl_error($ch));
}
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($http_code != 200) {
    die('Temporary unavailable');
}

$response = json_decode($result, true);

if ($response === null) {
    // Not json response, check your request
    die($result);
}

if (!empty($response['success'])) {
    if(!empty($response['success']['date'])) {
        die('Ok. Service is available.');
    } else {
        // Check the online documentation https://intelligentreturns.net/api/
        var_dump($response);
        die('Unknown response format.');
    }
} elseif (!empty($response['error'])) {
    // Temporary unavailable
    $error_code = $response['error']['code'];
    $messages = $response['error']['message'];
    die('Error code: ' . $error_code. '. Messages: '.implode("\r\n", $messages));
}
// Check the online documentation https://intelligentreturns.net/api/
var_dump($response);
die('Unknown response format.');