curl --request PUT \
--url https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_type": "invoice",
"document_date": "11-06-2024",
"items": [
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118,
"item_type": "Product",
"tax_rate": 18,
"discount_percent": 10,
"discount_amount": 10,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"category": "Electronics",
"custom_columns": [
{
"label": "Custom Field 1",
"value": "Value 1"
}
]
}
]
}
'import requests
url = "https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}"
payload = {
"document_type": "invoice",
"document_date": "11-06-2024",
"items": [
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118,
"item_type": "Product",
"tax_rate": 18,
"discount_percent": 10,
"discount_amount": 10,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"category": "Electronics",
"custom_columns": [
{
"label": "Custom Field 1",
"value": "Value 1"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
document_type: 'invoice',
document_date: '11-06-2024',
items: [
{
id: 'ITEM123',
name: 'Item Name',
quantity: 1,
unit_price: 100,
price_with_tax: 118,
net_amount: 100,
total_amount: 118,
item_type: 'Product',
tax_rate: 18,
discount_percent: 10,
discount_amount: 10,
description: 'Item Description',
hsn_code: '1234',
unit: 'kg',
category: 'Electronics',
custom_columns: [{label: 'Custom Field 1', value: 'Value 1'}]
}
]
})
};
fetch('https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123",
"serial_number": "SL123",
"irn": "<string>",
"qr_code": "<string>"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123",
"serial_number": "SL123",
"irn": "<string>",
"qr_code": "<string>"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123",
"serial_number": "SL123",
"irn": "<string>",
"qr_code": "<string>"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123",
"serial_number": "SL123",
"irn": "<string>",
"qr_code": "<string>"
}
}Edit a document
Replaces the contents of an existing document. Send the complete payload with every field’s updated value — this is a full replacement, not a partial update. The document keeps its hash_id.
curl --request PUT \
--url https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_type": "invoice",
"document_date": "11-06-2024",
"items": [
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118,
"item_type": "Product",
"tax_rate": 18,
"discount_percent": 10,
"discount_amount": 10,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"category": "Electronics",
"custom_columns": [
{
"label": "Custom Field 1",
"value": "Value 1"
}
]
}
]
}
'import requests
url = "https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}"
payload = {
"document_type": "invoice",
"document_date": "11-06-2024",
"items": [
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118,
"item_type": "Product",
"tax_rate": 18,
"discount_percent": 10,
"discount_amount": 10,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"category": "Electronics",
"custom_columns": [
{
"label": "Custom Field 1",
"value": "Value 1"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
document_type: 'invoice',
document_date: '11-06-2024',
items: [
{
id: 'ITEM123',
name: 'Item Name',
quantity: 1,
unit_price: 100,
price_with_tax: 118,
net_amount: 100,
total_amount: 118,
item_type: 'Product',
tax_rate: 18,
discount_percent: 10,
discount_amount: 10,
description: 'Item Description',
hsn_code: '1234',
unit: 'kg',
category: 'Electronics',
custom_columns: [{label: 'Custom Field 1', value: 'Value 1'}]
}
]
})
};
fetch('https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123",
"serial_number": "SL123",
"irn": "<string>",
"qr_code": "<string>"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123",
"serial_number": "SL123",
"irn": "<string>",
"qr_code": "<string>"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123",
"serial_number": "SL123",
"irn": "<string>",
"qr_code": "<string>"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123",
"serial_number": "SL123",
"irn": "<string>",
"qr_code": "<string>"
}
}doc_hash_id in the request URL and send all the keys with their updated values in the request body, ensuring the document is updated correctly with the provided data.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.
Body
You can check the tds id and details mapping from https://developers.getswipe.in/api-reference/references#tds-tax-deducted-at-source
You can check the tcs id and details mapping from https://developers.getswipe.in/api-reference/references#tcs-tax-collected-at-source
Controls whether the document is titled Invoice or Bill of Supply. true -> Invoice (tax charged); false -> Bill of Supply (no tax; the document's tax amount and item GST fields are zeroed). Omit to keep the document's current value unchanged. Composition-scheme companies are always forced to false.
true

