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.
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 "invoice"
DD-MM-YYYY
"11-06-2024"
Array of Products/Services, refer Item Object below for parameters
Serial Number (deprecated, please use New Serial Number)
"INV123"
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.
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"
Warehouse ID
-1
Adjustment on overall invoice, doesn’t effect any tax amounts.
20
Should Round Off total amount
true
Array of Payments, refer Payment Object for parameters
Bank Details, it is used to display bank details in document PDFs. No payments are associated with these bank details.
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
Company shipping from Address, refer Shipping Address Object for parameters
Company billing Address, refer Billing Address Object for parameters
Generate einvoice
false
Is Export
false
Is Multi Currency
false
Export Invoice Details
Is Subscription
false
Subscription Details
Convert Document. Needed only when the document is already created and you want to convert it to another document
Document Custom Headers. Custom headers should already be added in Swipe Portal.

