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.
Path Parameters
The hash ID of the document that needs to be updated.
Body
Type of document to create. One of the enum values listed below; use 'invoice' for a standard GST invoice.
invoice, subscription, pro_forma_invoice, estimate, sales_return, purchase_return, delivery_challan "invoice"
DD-MM-YYYY
"11-06-2024"
Array of Products/Services, refer Item Object below for parameters
Show child attributes
Show child attributes
Serial Number (deprecated, please use New Serial Number)
"INV123"
Show child attributes
Show child attributes
{
"prefix": "INV",
"doc_number": 1,
"suffix": "2024"
}
Party. If there are any changes made to the party details, we will update those details and any documents linked to this party ID will be updated to reflect the changes.
Show child attributes
Show child attributes
DD-MM-YYYY
"11-06-2024"
Any references you want to add to the doc
"Reference Text"
Notes to show in invoice - please check template in swipe application to see where this is displayed
"Notes for the document"
Terms to show in invoice - please check template in swipe application to see where this is displayed
"Terms and Conditions"
Adjustment on overall invoice, doesn’t effect any tax amounts.
20
Should Round Off total amount
true
Bank Details, it is used to display bank details in document PDFs. No payments are associated with these bank details.
Show child attributes
Show child attributes
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
Array of Charges and Deductions, refer Additional Charges Deductions Object for parameters
Show child attributes
Show child attributes
Company shipping from Address, refer Shipping Address Object for parameters
Show child attributes
Show child attributes
Company billing Address, refer Billing Address Object for parameters
Show child attributes
Show child attributes
Is Export
false
Is Multi Currency
false
Export Invoice Details
Show child attributes
Show child attributes
Is Subscription
false
Subscription Details
Show child attributes
Show child attributes
Convert Document. Needed only when the document is already created and you want to convert it to another document
Show child attributes
Show child attributes
Document Custom Headers. Custom headers should already be added in Swipe Portal.
Show child attributes
Show child attributes
[
{
"label": "Custom Header 1",
"value": "Value 1"
}
]
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

