Add an item
curl --request POST \
--url https://app.getswipe.in/api/partner/v2/product \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form product_images=@example-fileimport requests
url = "https://app.getswipe.in/api/partner/v2/product"
files = { "product_images": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('product_images', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.getswipe.in/api/partner/v2/product', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"item_type": "Product",
"tax_rate": 18,
"purchase_price_with_tax": 118,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"cess_rate": 0,
"cess_amount": 0,
"barcode": "2273546838467",
"category": "Electronics",
"alternative_units": [
{
"alternative_unit": "g",
"conversion_rate": 1000
}
],
"custom_columns": [
{
"label": "Custom Label",
"value": "Custom Value"
}
],
"preferences": {
"not_for_sale": false,
"low_stock_alert": 0,
"show_online": false,
"discount_percent": 10
},
"visibility": 1,
"swipe_id": 1
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"message": "No data found!"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"message": "No data found!"
}
}Products
Add an item
Creates an item in your catalog keyed by your own id. Sending an ID that already exists fails with PRODUCT_ALREADY_EXISTS — use Update an item to change the catalog record. Items are also created automatically when a document references an unknown item id.
POST
/
v2
/
product
Add an item
curl --request POST \
--url https://app.getswipe.in/api/partner/v2/product \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form product_images=@example-fileimport requests
url = "https://app.getswipe.in/api/partner/v2/product"
files = { "product_images": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('product_images', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.getswipe.in/api/partner/v2/product', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"item_type": "Product",
"tax_rate": 18,
"purchase_price_with_tax": 118,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"cess_rate": 0,
"cess_amount": 0,
"barcode": "2273546838467",
"category": "Electronics",
"alternative_units": [
{
"alternative_unit": "g",
"conversion_rate": 1000
}
],
"custom_columns": [
{
"label": "Custom Label",
"value": "Custom Value"
}
],
"preferences": {
"not_for_sale": false,
"low_stock_alert": 0,
"show_online": false,
"discount_percent": 10
},
"visibility": 1,
"swipe_id": 1
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"message": "No data found!"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"message": "No data found!"
}
}Uploading Product ImagesTo upload product images, use
multipart/form-data instead of application/json. All the regular JSON fields are supported as form fields, plus:product_images: Array of image files (JPEG, PNG, etc.)- For complex fields like
custom_columns,alternative_units, andpreferences, send them as JSON strings
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is an API key from the API Integration section of your dashboard. Keys are scoped to the company they are generated in — for testing, add a separate test company and generate the key there, so requests never touch your real books.

