Sales Returns

A Return Material Authorization (RMA) or Sales Return is the process of a seller accepting a purchased item back from the consumer. In turn, the customer receives credit, cash refund or a replacement.

Attribute

  • salesreturn_idlong

    Unique ID generated by the server for the Sales Return.

  • salesreturn_numberstring

    Return Merchandise Authorisation (RMA) number of the Sales Return.

  • datestring

    Date on which the entity was created.

  • reasonstring

    The reason for raising a Sales Return.

  • line_itemsarray

    The underlying items in a Sales Return

    Show Sub-Attributes

    • line_item_idlong

      Unique ID generated by the server for each line item. This is used as an identifier.

    • item_idlong

      Unique ID generated by the server for the item. This is used as an identifier.

    • namestring

      Name of the line item.

    • descriptionstring

      Description of the line item.

    • unitstring

      Measurement unit of the line item.

    • ratedouble

      Price of the line item in an entity.

    • salesorder_item_idlong

      Unique ID generated by the server for each line item in a sales order.

    • quantitydouble

      The quantity that can be received for the line item.

    • non_receive_quantitydouble

      The quantity that cannot be received for the line item.

    • warehouse_idlong

      Unique ID generated by the server for each warehouse

    • warehouse_namestring

      Name of the warehouse

  • commentsarray

    History related to the Sales Return.

    Show Sub-Attributes

    • comment_idlong

      Unique ID generated by the server for the comment(history). This is used as an identifier.

    • salesreturn_idlong

      Unique ID generated by the server for the Sales Return.

    • commented_bystring

      Indicates the user who performed the action on the purchase order.

    • comment_typestring

      Indicates the type of the action

    • datestring

      Date on which the entity was created.

    • date_descriptionstring

      Indicates the time duration since the action was performed

    • timestring

      Indicates the time when the action was performed

    • operation_typestring

      Type of operation performed on the transaction

    • transaction_idlong

      Unique ID generated by the server for the transaction. This is used as an identifier.

    • transaction_typestring

      Indicates the type of transaction.

  • salesreturn_statusstring

    Status of the Sales Return.

  • salesorder_idlong

    Unique ID generated by the server for the Sales Order from which the Sales Return is created.

  • salesorder_numberstring

    Unique sales order number for each sales order.

ExampleCopy
{
    "salesreturn_id": 4815000000044972,
    "salesreturn_number": "RMA-00001",
    "date": "2015-05-28",
    "reason": "Sample Note",
    "line_items": [
        {
            "line_item_id": 4815000000044897,
            "item_id": 4815000000044100,
            "name": "Laptop-white/15inch/dell",
            "description": "Just a sample description.",
            "unit": "qty",
            "rate": 122,
            "salesorder_item_id": 4815000000044892,
            "quantity": 3,
            "non_receive_quantity": 2,
            "warehouse_id": 130426000000664020,
            "warehouse_name": "WarehouseName"
        }
    ],
    "comments": [
        {
            "comment_id": 16115000000097016,
            "salesreturn_id": 4815000000044972,
            "commented_by": "John",
            "comment_type": "string",
            "date": "2015-05-28",
            "date_description": "few seconds ago",
            "time": "2:18 PM",
            "operation_type": "Updated",
            "transaction_id": 1232423434,
            "transaction_type": "salesreturn"
        }
    ],
    "salesreturn_status": "approved",
    "salesorder_id": 4815000000044936,
    "salesorder_number": "SO-00032"
}

Create a Sales Return

Creation of Sales Return. Sales return can be created for all the shipped units of the items in a sales order.

OAuth Scope : ZakyaAPI.salesreturns.CREATE

Arguments

  • salesreturn_numberstring

    Return Merchandise Authorisation (RMA) number of the Sales Return.

  • datestring

    Date on which the entity was created.

  • reasonstring

    The reason for raising a Sales Return.

  • line_itemsarray (Required)

    The underlying items in a Sales Return

    Show Sub-Attributes

    • item_idlong

      Unique ID generated by the server for the item. This is used as an identifier.

    • salesorder_item_idlong

      Unique ID generated by the server for each line item in a sales order.

    • quantitydouble

      The quantity that can be received for the line item.

    • non_receive_quantitydouble

      The quantity that cannot be received for the line item.

    • warehouse_idlong

      Unique ID generated by the server for each warehouse

Query Parameters

  • salesorder_idUnique ID generated by the server for the Sales Order from which the Sales Return is created.

    undefined

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/salesreturns?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/salesreturns?organization_id=10234695"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/salesreturns?organization_id=10234695")
  .post(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/salesreturns?organization_id=10234695",
  "headers": {
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    "content-type": "application/json"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/salesreturns?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("POST", "/inventory/v1/salesreturns?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "salesreturn_number": "RMA-00001",
    "date": "2015-05-28",
    "reason": "Sample Note",
    "line_items": [
        {
            "item_id": 4815000000044100,
            "salesorder_item_id": 4815000000044892,
            "quantity": 3,
            "non_receive_quantity": 2,
            "warehouse_id": 130426000000664020
        }
    ]
}
Response ExampleCopy
{
    "code": 0,
    "message": "Return created successfully",
    "salesreturn": {
        "salesreturn_id": 4815000000044972,
        "salesreturn_number": "RMA-00001",
        "date": "2015-05-28",
        "reason": "Sample Note",
        "line_items": [
            {
                "line_item_id": 4815000000044897,
                "item_id": 4815000000044100,
                "name": "Laptop-white/15inch/dell",
                "description": "Just a sample description.",
                "unit": "qty",
                "rate": 122,
                "salesorder_item_id": 4815000000044892,
                "quantity": 3,
                "non_receive_quantity": 2,
                "warehouse_id": 130426000000664020,
                "warehouse_name": "WarehouseName"
            }
        ],
        "comments": [
            {
                "comment_id": 16115000000097016,
                "salesreturn_id": 4815000000044972,
                "commented_by": "John",
                "comment_type": "string",
                "date": "2015-05-28",
                "date_description": "few seconds ago",
                "time": "2:18 PM",
                "operation_type": "Updated",
                "transaction_id": 1232423434,
                "transaction_type": "salesreturn"
            }
        ],
        "salesreturn_status": "approved",
        "salesorder_id": 4815000000044936,
        "salesorder_number": "SO-00032"
    }
}

List all Sales Returns

Lists all the Sales Returns present in Zakya.

OAuth Scope : ZakyaAPI.salesreturns.GET

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/salesreturns?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/salesreturns?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/salesreturns?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/salesreturns?organization_id=10234695",
  "headers": {
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/salesreturns?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/salesreturns?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "success",
    "salesreturns": {
        "salesreturn_id": 4815000000044972,
        "salesreturn_number": "RMA-00001",
        "date": "2015-05-28",
        "salesorder_id": 4815000000044936,
        "salesorder_number": "SO-00032",
        "customer_id": 4815000000044080,
        "customer_name": "Molly",
        "salesreturn_status": "approved",
        "receive_status": "received",
        "refund_status": "refunded",
        "quantity": 5,
        "refunded_amount": 2670
    }
}

Update a Sales Return

Updation of Sales Return.

OAuth Scope : ZakyaAPI.salesreturns.UPDATE

Arguments

  • salesreturn_numberstring

    Return Merchandise Authorisation (RMA) number of the Sales Return.

  • datestring

    Date on which the entity was created.

  • reasonstring

    The reason for raising a Sales Return.

  • line_itemsarray (Required)

    The underlying items in a Sales Return

    Show Sub-Attributes

    • line_item_idlong

      Unique ID generated by the server for each line item. This is used as an identifier.

    • item_idlong

      Unique ID generated by the server for the item. This is used as an identifier.

    • salesorder_item_idlong

      Unique ID generated by the server for each line item in a sales order.

    • quantitydouble

      The quantity that can be received for the line item.

    • non_receive_quantitydouble

      The quantity that cannot be received for the line item.

    • warehouse_idlong

      Unique ID generated by the server for each warehouse

Query Parameters

  • salesorder_id 

    Unique ID generated by the server for the Sales Order from which the Sales Return is created.

Request ExampleCopy
curl --request PUT \
  --url 'https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695")
  .put(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "PUT",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/salesreturns/4815000000044972?organization_id=10234695",
  "headers": {
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    "content-type": "application/json"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("PUT", "/inventory/v1/salesreturns/4815000000044972?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "salesreturn_number": "RMA-00001",
    "date": "2015-05-28",
    "reason": "Sample Note",
    "line_items": [
        {
            "line_item_id": 4815000000044897,
            "item_id": 4815000000044100,
            "salesorder_item_id": 4815000000044892,
            "quantity": 3,
            "non_receive_quantity": 2,
            "warehouse_id": 130426000000664020
        }
    ]
}
Response ExampleCopy
{
    "code": 0,
    "message": "Return updated successfully",
    "salesreturn": {
        "salesreturn_id": 4815000000044972,
        "salesreturn_number": "RMA-00001",
        "date": "2015-05-28",
        "reason": "Sample Note",
        "line_items": [
            {
                "line_item_id": 4815000000044897,
                "item_id": 4815000000044100,
                "name": "Laptop-white/15inch/dell",
                "description": "Just a sample description.",
                "unit": "qty",
                "rate": 122,
                "salesorder_item_id": 4815000000044892,
                "quantity": 3,
                "non_receive_quantity": 2,
                "warehouse_id": 130426000000664020,
                "warehouse_name": "WarehouseName"
            }
        ],
        "comments": [
            {
                "comment_id": 16115000000097016,
                "salesreturn_id": 4815000000044972,
                "commented_by": "John",
                "comment_type": "string",
                "date": "2015-05-28",
                "date_description": "few seconds ago",
                "time": "2:18 PM",
                "operation_type": "Updated",
                "transaction_id": 1232423434,
                "transaction_type": "salesreturn"
            }
        ],
        "salesreturn_status": "approved",
        "receive_status": "received",
        "refund_status": "refunded",
        "salesorder_id": 4815000000044936,
        "salesorder_number": "SO-00032",
        "salesreturnreceives": [
            {
                "receive_id": 4815000000045035,
                "receive_number": "PR-00002",
                "date": "2015-05-28",
                "notes": "Sample Note",
                "line_items": [
                    {
                        "line_item_id": 4815000000044897,
                        "item_id": 4815000000044100,
                        "name": "Laptop-white/15inch/dell",
                        "description": "Just a sample description.",
                        "unit": "qty",
                        "quantity": 3
                    }
                ]
            }
        ],
        "creditnotes": [
            {
                "creditnote_id": 90300000072369,
                "creditnote_number": "CN-0029",
                "status": "closed",
                "date": "2015-05-28",
                "total": 2670
            }
        ]
    }
}

Retrieve a Sales Return

Retrieves the details for an existing Sales Return.

OAuth Scope : ZakyaAPI.salesreturns.GET

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/salesreturns/4815000000044972?organization_id=10234695",
  "headers": {
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/salesreturns/4815000000044972?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "success",
    "salesreturn": {
        "salesreturn_id": 4815000000044972,
        "salesreturn_number": "RMA-00001",
        "date": "2015-05-28",
        "reason": "Sample Note",
        "line_items": [
            {
                "line_item_id": 4815000000044897,
                "item_id": 4815000000044100,
                "name": "Laptop-white/15inch/dell",
                "description": "Just a sample description.",
                "unit": "qty",
                "rate": 122,
                "salesorder_item_id": 4815000000044892,
                "quantity": 3,
                "non_receive_quantity": 2,
                "warehouse_id": 130426000000664020,
                "warehouse_name": "WarehouseName"
            }
        ],
        "comments": [
            {
                "comment_id": 16115000000097016,
                "salesreturn_id": 4815000000044972,
                "commented_by": "John",
                "comment_type": "string",
                "date": "2015-05-28",
                "date_description": "few seconds ago",
                "time": "2:18 PM",
                "operation_type": "Updated",
                "transaction_id": 1232423434,
                "transaction_type": "salesreturn"
            }
        ],
        "salesreturn_status": "approved",
        "receive_status": "received",
        "refund_status": "refunded",
        "salesorder_id": 4815000000044936,
        "salesorder_number": "SO-00032",
        "salesreturnreceives": [
            {
                "receive_id": 4815000000045035,
                "receive_number": "PR-00002",
                "date": "2015-05-28",
                "notes": "Sample Note",
                "line_items": [
                    {
                        "line_item_id": 4815000000044897,
                        "item_id": 4815000000044100,
                        "name": "Laptop-white/15inch/dell",
                        "description": "Just a sample description.",
                        "unit": "qty",
                        "quantity": 3
                    }
                ]
            }
        ],
        "creditnotes": [
            {
                "creditnote_id": 90300000072369,
                "creditnote_number": "CN-0029",
                "status": "closed",
                "date": "2015-05-28",
                "total": 2670
            }
        ]
    }
}

Delete a Sales Return

Deletes a Sales Return from Zakya.

OAuth Scope : ZakyaAPI.salesreturns.DELETE

Request ExampleCopy
curl --request DELETE \
  --url 'https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695"
type: DELETE
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695")
  .delete(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "DELETE",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/salesreturns/4815000000044972?organization_id=10234695",
  "headers": {
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const options = {
  method: 'DELETE',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/salesreturns/4815000000044972?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("DELETE", "/inventory/v1/salesreturns/4815000000044972?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "The Sales Return has been deleted."
}

Create a Sales Return Receive

Creating a sales return receive to mark the receivable goods as received.

OAuth Scope : ZakyaAPI.salesreturnreceives.CREATE

Arguments

  • datestring

    Date on which the entity was created.

  • line_itemsarray (Required)

    The underlying items in a Sales Return

    Show Sub-Attributes

    • line_item_id 

      Unique ID generated by the server for each line item. This is used as an identifier.

    • quantitydouble

      The quantity that can be received for the line item.

  • notesstring

    Notes for the current entity.

Query Parameters

  • salesreturn_id 

    Unique ID generated by the server for the Sales Return.

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/salesreturnreceives?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/salesreturnreceives?organization_id=10234695"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/salesreturnreceives?organization_id=10234695")
  .post(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/salesreturnreceives?organization_id=10234695",
  "headers": {
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    "content-type": "application/json"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/salesreturnreceives?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("POST", "/inventory/v1/salesreturnreceives?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "date": "2015-05-28",
    "line_items": [
        {
            "line_item_id": null,
            "quantity": 3
        }
    ],
    "notes": "Sample Note"
}
Response ExampleCopy
{
    "code": 0,
    "message": "Sales Return Receive Created Successfully",
    "salesreturn": {
        "receive_id": 4815000000045035,
        "receive_number": "PR-00002",
        "salesreturn_id": 4815000000044972,
        "salesreturn_number": "RMA-00001",
        "date": "2015-05-28",
        "line_items": [
            {
                "line_item_id": 4815000000044897,
                "item_id": 4815000000044100,
                "name": "Laptop-white/15inch/dell",
                "description": "Just a sample description.",
                "unit": "qty",
                "quantity": 3
            }
        ],
        "notes": "Sample Note"
    }
}

Delete a Sales Return Receive

Deletes the sales return receive of a sales return.

OAuth Scope : ZakyaAPI.salesreturnreceives.DELETE

Request ExampleCopy
curl --request DELETE \
  --url 'https://api.zakya.com/inventory/v1/salesreturnreceives/?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/salesreturnreceives/?organization_id=10234695"
type: DELETE
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/salesreturnreceives/?organization_id=10234695")
  .delete(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "DELETE",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/salesreturnreceives/?organization_id=10234695",
  "headers": {
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const options = {
  method: 'DELETE',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/salesreturnreceives/?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("DELETE", "/inventory/v1/salesreturnreceives/?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "Sales Return Receive Deleted Successfully."
}