Returns

(ms.returns)

Returns allow the user to return an order if the order is delivered.



Fields

ValueDescription
order_id   
Type: string
Required
This field stores the id of the order.
OID-123
return_type   
Type: string
Required
This field stores the type of the return. The value of this field can be Full and Partial.
full
items   
Type: array
Required
Array of objects containing the details of items at the time of return.
{ 
  "items": [
  {
 	"_id": "59d605da64abe444540ee6e0",
    "name": "mustard sweater",
 	"quantity": 1,
    "weight": 500,
  }
 ]
}
_id
Type: string
It contains the product id.
name
Type: string
It contains the name of the product.
sku
Type: string
It contains the SKU of the product.
quantity
Type: integer
Required
It contains the quantity of the product.
weight
Type: string
It contains the weight of the product.
price
Type: string
It contains the the price of the product.
total
Type: integer
item_condition   
Type: string
Required
This field stores the condition of the items. The value of item condition can be Unopened, Opened, Damaged.
unopened
return_reason   
Type: string
Required
This field stores the reason for the return.
Does not fit.
shipping_status   
Type: string
The field stores the shipping status of the order.
Delivered
user_id   
Type: string
It stores the id of the user of the order.
5b83a011cb2b6406c6273a9a
user_email   
Type: string
It stores the email id of the user of the order.
rma_number   
Type: string
It stores the RMA number for the return order.
RMA2
status   
Type: string
It stores the status of the returned order.
user_id   
Type: string
It stores the id of the user of the order.
5b83a011cb2b6406c6273a9a
seller   
Type: string
It stores the id of the seller of the product.
5a834e9606302b3934dac143

Commands (Endpoints)

POST /api/1.1/entity/ms.returns   
This command is used to add returns order.

Examples

Return type is full and item condition is unopened

Request
{
  "data": {
     "item_condition": "unopened",
     "items": [{"_id": "5c6597b151f0fc16d9866e23", "quantity": 2}],
     "order_id": "5c6507b124f0fc15d8366e28",
     "return_reason": "Any reason",
     "return_type": "full"
  }
}
Response
{
  data: {
    _id: '5c6507b154f0fc16d8866e23'
  }
}

Return type is full and item condition is opened

Request
{
  "data": {
     "item_condition": "opened",
     "items": [{"_id": "5c6597b151f0fc16d9866e23", "quantity": 2}],
     "order_id": "5c6507b124f0fc15d8366e28",
     "return_reason": "Any reason",
     "return_type": "full"
  }
}
Response
{
  data: {
    _id: '5c6507b154f0fc16d8866e23'
  }
}

Return type is full and item condition is damaged

Request
{
  "data": {
     "item_condition": "damaged",
     "items": [{"_id": "5c6597b151f0fc16d9866e23", "quantity": 2}],
     "order_id": "5c6507b124f0fc15d8366e28",
     "return_reason": "Any reason",
     "return_type": "full"
  }
}
Response
{
  data: {
    _id: '5c6507b154f0fc16d8866e23'
  }
}

Return type is partial and item condition is unopened

Request
{
  "data": {
     "item_condition": "unopened",
     "items": [{"_id": "5c6597b151f0fc16d9866e23", "quantity": 1}],
     "order_id": "5c6507b124f0fc15d8366e28",
     "return_reason": "Any reason",
     "return_type": "partial"
  }
}
Response
{
  data: {
    _id: '5c6507b154f0fc16d8866e23'
  }
}

Return type is partial and item condition is opened

Request
{
  "data": {
     "item_condition": "opened",
     "items": [{"_id": "5c6597b151f0fc16d9866e23", "quantity": 1}],
     "order_id": "5c6507b124f0fc15d8366e28",
     "return_reason": "Any reason",
     "return_type": "partial"
  }
}
Response
{
  data: {
    _id: '5c6507b154f0fc16d8866e23'
  }
}

Return type is partial and item condition is damaged

Request
{
  "data": {
     "item_condition": "damaged",
     "items": [{"_id": "5c6597b151f0fc16d9866e23", "quantity": 1}],
     "order_id": "5c6507b124f0fc15d8366e28",
     "return_reason": "Any reason",
     "return_type": "partial"
  }
}
Response
{
  data: {
    _id: '5c6507b154f0fc16d8866e23'
  }
}
GET /api/1.1/entity/ms.returns/_/authorized   
This command is used to authorized the added returns order.

Examples

authorized

Request
{
  "data": {
    "_id": "5c6506b154f0fc16d8866e28"
  }
}
Response
{
  data: 'Successfully Authorized!'
}
DEL /api/1.1/entity/ms.returns/{resource_id}   
Deletes a return
PUT /api/1.1/entity/ms.returns/{resource_id}   
Updates an existing return
GET /api/1.1/entity/ms.returns/{resource_id}   
Retrieves a single return
GET /api/1.1/entity/ms.returns   
Retrieves a list of returns
GET /api/1.1/entity/ms.returns/_/markAsReceived   
This API takes return id, used to mark as received returns order after authorized. This is the final stage of returns order.

Examples

markAsReceived

Request
{
  "data": {
    "order_delivered": "1",
    "shipping_status": "Delivered"
  }
}
Response
{
  data: 'updated successfully'
}