Add an Item
curl --request POST \
--url https://app.getswipe.in/api/partner/v1/product \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"item_type": "Product",
"tax_rate": 18,
"discount_percent": 10,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"category": "Electronics",
"status": "Active"
}
'import requests
url = "https://app.getswipe.in/api/partner/v1/product"
payload = {
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"item_type": "Product",
"tax_rate": 18,
"discount_percent": 10,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"category": "Electronics",
"status": "Active"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'ITEM123',
name: 'Item Name',
quantity: 1,
unit_price: 100,
price_with_tax: 118,
item_type: 'Product',
tax_rate: 18,
discount_percent: 10,
description: 'Item Description',
hsn_code: '1234',
unit: 'kg',
category: 'Electronics',
status: 'Active'
})
};
fetch('https://app.getswipe.in/api/partner/v1/product', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.getswipe.in/api/partner/v1/product",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'ITEM123',
'name' => 'Item Name',
'quantity' => 1,
'unit_price' => 100,
'price_with_tax' => 118,
'item_type' => 'Product',
'tax_rate' => 18,
'discount_percent' => 10,
'description' => 'Item Description',
'hsn_code' => '1234',
'unit' => 'kg',
'category' => 'Electronics',
'status' => 'Active'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.getswipe.in/api/partner/v1/product"
payload := strings.NewReader("{\n \"id\": \"ITEM123\",\n \"name\": \"Item Name\",\n \"quantity\": 1,\n \"unit_price\": 100,\n \"price_with_tax\": 118,\n \"item_type\": \"Product\",\n \"tax_rate\": 18,\n \"discount_percent\": 10,\n \"description\": \"Item Description\",\n \"hsn_code\": \"1234\",\n \"unit\": \"kg\",\n \"category\": \"Electronics\",\n \"status\": \"Active\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.getswipe.in/api/partner/v1/product")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"ITEM123\",\n \"name\": \"Item Name\",\n \"quantity\": 1,\n \"unit_price\": 100,\n \"price_with_tax\": 118,\n \"item_type\": \"Product\",\n \"tax_rate\": 18,\n \"discount_percent\": 10,\n \"description\": \"Item Description\",\n \"hsn_code\": \"1234\",\n \"unit\": \"kg\",\n \"category\": \"Electronics\",\n \"status\": \"Active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.getswipe.in/api/partner/v1/product")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"ITEM123\",\n \"name\": \"Item Name\",\n \"quantity\": 1,\n \"unit_price\": 100,\n \"price_with_tax\": 118,\n \"item_type\": \"Product\",\n \"tax_rate\": 18,\n \"discount_percent\": 10,\n \"description\": \"Item Description\",\n \"hsn_code\": \"1234\",\n \"unit\": \"kg\",\n \"category\": \"Electronics\",\n \"status\": \"Active\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Product added successfully"
}{
"success": false,
"error_code": "INVALID_PRODUCT_ID",
"message": "Error Message",
"errors": "List of errors"
}{
"success": false,
"error_code": "INVALID_PRODUCT_ID",
"message": "Error Message",
"errors": "List of errors"
}Product
Add an Item
POST
/
v1
/
product
Add an Item
curl --request POST \
--url https://app.getswipe.in/api/partner/v1/product \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"item_type": "Product",
"tax_rate": 18,
"discount_percent": 10,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"category": "Electronics",
"status": "Active"
}
'import requests
url = "https://app.getswipe.in/api/partner/v1/product"
payload = {
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"item_type": "Product",
"tax_rate": 18,
"discount_percent": 10,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"category": "Electronics",
"status": "Active"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'ITEM123',
name: 'Item Name',
quantity: 1,
unit_price: 100,
price_with_tax: 118,
item_type: 'Product',
tax_rate: 18,
discount_percent: 10,
description: 'Item Description',
hsn_code: '1234',
unit: 'kg',
category: 'Electronics',
status: 'Active'
})
};
fetch('https://app.getswipe.in/api/partner/v1/product', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.getswipe.in/api/partner/v1/product",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'ITEM123',
'name' => 'Item Name',
'quantity' => 1,
'unit_price' => 100,
'price_with_tax' => 118,
'item_type' => 'Product',
'tax_rate' => 18,
'discount_percent' => 10,
'description' => 'Item Description',
'hsn_code' => '1234',
'unit' => 'kg',
'category' => 'Electronics',
'status' => 'Active'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.getswipe.in/api/partner/v1/product"
payload := strings.NewReader("{\n \"id\": \"ITEM123\",\n \"name\": \"Item Name\",\n \"quantity\": 1,\n \"unit_price\": 100,\n \"price_with_tax\": 118,\n \"item_type\": \"Product\",\n \"tax_rate\": 18,\n \"discount_percent\": 10,\n \"description\": \"Item Description\",\n \"hsn_code\": \"1234\",\n \"unit\": \"kg\",\n \"category\": \"Electronics\",\n \"status\": \"Active\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.getswipe.in/api/partner/v1/product")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"ITEM123\",\n \"name\": \"Item Name\",\n \"quantity\": 1,\n \"unit_price\": 100,\n \"price_with_tax\": 118,\n \"item_type\": \"Product\",\n \"tax_rate\": 18,\n \"discount_percent\": 10,\n \"description\": \"Item Description\",\n \"hsn_code\": \"1234\",\n \"unit\": \"kg\",\n \"category\": \"Electronics\",\n \"status\": \"Active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.getswipe.in/api/partner/v1/product")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"ITEM123\",\n \"name\": \"Item Name\",\n \"quantity\": 1,\n \"unit_price\": 100,\n \"price_with_tax\": 118,\n \"item_type\": \"Product\",\n \"tax_rate\": 18,\n \"discount_percent\": 10,\n \"description\": \"Item Description\",\n \"hsn_code\": \"1234\",\n \"unit\": \"kg\",\n \"category\": \"Electronics\",\n \"status\": \"Active\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Product added successfully"
}{
"success": false,
"error_code": "INVALID_PRODUCT_ID",
"message": "Error Message",
"errors": "List of errors"
}{
"success": false,
"error_code": "INVALID_PRODUCT_ID",
"message": "Error Message",
"errors": "List of errors"
}Authorizations
Bearer authentication header of the form Bearer , where is your auth token.
Body
application/json
Unique id for each item.
Example:
"ITEM123"
Name of the Product
Example:
"Item Name"
Opening Quantity
Example:
1
Price per item without Tax
Example:
100
Price per item with Tax
Example:
118
Product or Service enum
Available options:
Product, Service Example:
"Product"
Tax percentage for each item . Only valid tax rates are accepted
Example:
18
Default Discount Percent
Example:
10
Item Description
Example:
"Item Description"
HSN Code
Example:
"1234"
Item quantity unit. You can find the GST-approved units in the UQC Codes section at: https://einvoice1.gst.gov.in/Others/MasterCodes.
Example:
"kg"
Category
Example:
"Electronics"
Status of the Item
Example:
"Active"
⌘I