curl --request POST \
--url https://app.getswipe.in/api/partner/v2/doc \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_type": "invoice",
"document_date": "15-11-2024",
"items": [
{
"id": "ITEM123455667ghg",
"name": "Item Namgergggree",
"quantity": 1,
"unit_price": 200,
"tax_rate": 18,
"price_with_tax": 236,
"net_amount": 200,
"total_amount": 236,
"item_type": "Product"
}
]
}
'{
"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>"
}
}{
"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>"
}
}Create a document
Creates a document — an invoice, purchase, estimate, return, delivery challan, or subscription — based on document_type. Unknown party and items IDs are created automatically from the details you send; existing IDs are reused. Returns the document’s hash_id, which addresses the document in every subsequent call, plus the IRN and QR code when einvoice is set. Send your own serial_number to make retries safe — a duplicate fails with DUPLICATE_DOC_SERIAL_NUMBER instead of creating a second document.
curl --request POST \
--url https://app.getswipe.in/api/partner/v2/doc \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_type": "invoice",
"document_date": "15-11-2024",
"items": [
{
"id": "ITEM123455667ghg",
"name": "Item Namgergggree",
"quantity": 1,
"unit_price": 200,
"tax_rate": 18,
"price_with_tax": 236,
"net_amount": 200,
"total_amount": 236,
"item_type": "Product"
}
]
}
'{
"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>"
}
}{
"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>"
}
}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
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, purchase, purchase_order, sales_order, sales_debit_note "invoice"
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 derive it automatically from the item tax amounts. Composition-scheme companies are always forced to false.
true

