Get Started
Document V2
Payment V2
Customer V2
Vendor V2
Product V2
Subscriptions V2
Utility V2
Document V2
Edit a document
PUT
/
v2
/
doc
/
{doc_hash_id}
curl --request PUT \
--url https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"serial_number": "INV123",
"serial_number_v2": {
"prefix": "INV",
"doc_number": 1,
"suffix": "2024"
},
"document_type": "invoice",
"document_date": "11-06-2024",
"party": {
"id": "CUST123",
"type": "customer",
"name": "John Doe",
"country_code": "91",
"phone_number": "1234567890",
"company_name": "Company Name",
"email": "johndoe@example.com",
"gstin": "27AARCS7202C1ZD",
"shipping_address": {
"addr_id": -1,
"addr_id_v2": "addr1",
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
},
"billing_address": {
"addr_id": -1,
"addr_id_v2": "addr1",
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
}
},
"due_date": "11-06-2024",
"reference": "Reference Text",
"notes": "Notes for the document",
"terms": "Terms and Conditions",
"items": [
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"tax_rate": 18,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118,
"discount_percent": 10,
"discount_amount": 10,
"description": "Item Description",
"hsn_code": "1234",
"item_type": "Product",
"unit": "kg",
"category": "Electronics",
"custom_columns": [
{
"label": "Custom Field 1",
"value": "Value 1"
}
]
}
],
"extra_discount": 20,
"round_off": true,
"bank_details": {
"account_number": "1234567890",
"ifsc": "SBIN0000001",
"bank_name": "State Bank of India",
"branch": "Mumbai"
},
"tds_id": 123,
"tcs_id": 123,
"charges_and_deductions": [
{
"id": 1,
"name": "Delivery Charge",
"amount": 100,
"tax_rate": 18,
"sac_code": "1234",
"type": "charge"
}
],
"company_shipping_address": {
"addr_id": -1,
"addr_id_v2": "addr1",
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
},
"company_billing_address": {
"addr_id": -1,
"addr_id_v2": "addr1",
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
},
"is_export": false,
"export_invoice_details": {
"shipping_bill_date": "14-02-2024",
"shipping_bill_number": "123456",
"shipping_port_code": "123456",
"export_type": "With Payment of Tax",
"conversion_factor": 123,
"country_id": "Afghanistan",
"currency_id": "AED"
}
}'
{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123",
"serial_number": "SL123",
"irn": "<string>",
"qr_code": "<string>"
}
}
To update a document, include the document’s unique 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 your auth token.
Path Parameters
The hash ID of the document that needs to be updated.
Body
application/json
Response
200
application/json
Success
The response is of type object
.
curl --request PUT \
--url https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"serial_number": "INV123",
"serial_number_v2": {
"prefix": "INV",
"doc_number": 1,
"suffix": "2024"
},
"document_type": "invoice",
"document_date": "11-06-2024",
"party": {
"id": "CUST123",
"type": "customer",
"name": "John Doe",
"country_code": "91",
"phone_number": "1234567890",
"company_name": "Company Name",
"email": "johndoe@example.com",
"gstin": "27AARCS7202C1ZD",
"shipping_address": {
"addr_id": -1,
"addr_id_v2": "addr1",
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
},
"billing_address": {
"addr_id": -1,
"addr_id_v2": "addr1",
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
}
},
"due_date": "11-06-2024",
"reference": "Reference Text",
"notes": "Notes for the document",
"terms": "Terms and Conditions",
"items": [
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"tax_rate": 18,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118,
"discount_percent": 10,
"discount_amount": 10,
"description": "Item Description",
"hsn_code": "1234",
"item_type": "Product",
"unit": "kg",
"category": "Electronics",
"custom_columns": [
{
"label": "Custom Field 1",
"value": "Value 1"
}
]
}
],
"extra_discount": 20,
"round_off": true,
"bank_details": {
"account_number": "1234567890",
"ifsc": "SBIN0000001",
"bank_name": "State Bank of India",
"branch": "Mumbai"
},
"tds_id": 123,
"tcs_id": 123,
"charges_and_deductions": [
{
"id": 1,
"name": "Delivery Charge",
"amount": 100,
"tax_rate": 18,
"sac_code": "1234",
"type": "charge"
}
],
"company_shipping_address": {
"addr_id": -1,
"addr_id_v2": "addr1",
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
},
"company_billing_address": {
"addr_id": -1,
"addr_id_v2": "addr1",
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
},
"is_export": false,
"export_invoice_details": {
"shipping_bill_date": "14-02-2024",
"shipping_bill_number": "123456",
"shipping_port_code": "123456",
"export_type": "With Payment of Tax",
"conversion_factor": 123,
"country_id": "Afghanistan",
"currency_id": "AED"
}
}'
{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123",
"serial_number": "SL123",
"irn": "<string>",
"qr_code": "<string>"
}
}
Assistant
Responses are generated using AI and may contain mistakes.