curl --request POST \
--url https://app.getswipe.in/api/partner/v1/doc \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_type": "invoice",
"document_date": "01-04-2024",
"items": [
{
"id": "p123",
"name": "Book",
"item_type": "goods",
"quantity": 1,
"unit_price": 100,
"tax_rate": 18,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118
}
]
}
'{
"success": true,
"message": "Document created successfully",
"serialNumber": "SL123",
"hashId": "SL123"
}{
"success": false,
"error_code": "INVALID_HASH_ID",
"message": "Some error occurred",
"errors": {}
}{
"success": false,
"error_code": "INVALID_HASH_ID",
"message": "Some error occurred",
"errors": {}
}{
"success": false,
"error_code": "INVALID_HASH_ID",
"message": "Some error occurred",
"errors": {}
}Create a document
v1 is deprecated — use the v2 endpoint instead. 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/v1/doc \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_type": "invoice",
"document_date": "01-04-2024",
"items": [
{
"id": "p123",
"name": "Book",
"item_type": "goods",
"quantity": 1,
"unit_price": 100,
"tax_rate": 18,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118
}
]
}
'{
"success": true,
"message": "Document created successfully",
"serialNumber": "SL123",
"hashId": "SL123"
}{
"success": false,
"error_code": "INVALID_HASH_ID",
"message": "Some error occurred",
"errors": {}
}{
"success": false,
"error_code": "INVALID_HASH_ID",
"message": "Some error occurred",
"errors": {}
}{
"success": false,
"error_code": "INVALID_HASH_ID",
"message": "Some error occurred",
"errors": {}
}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 "invoice"
DD-MM-YYYY, Invoice date (Ex: 11-06-2024 Need not to the current date)
"11-06-2024"
Array of Products/Services, refer Item Object below for parameters
Show child attributes
Show child attributes
Serial Number, if not sent will be auto generated based on the default prefix.
"INV123"
Customer (deprecated, please use Party). If there are any changes made to the customer's details, we will update those details and any documents linked to this customer's ID will be updated to reflect the changes.
Show child attributes
Show child attributes
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, Payment Due date for the invoice (Ex: 11-06-2024)
"11-06-2024"
Any references you want to add to the doc
"Reference Text"
Notes to show in invoice
"Notes for the document"
Terms to show in invoice
"Terms and Conditions"
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
Show child attributes
Show child attributes
Bank Details, refer Bank Details Object below for parameters, If account_number, ifsc matched with existing bank details, it will be used, else new bank details will be added to your swipe account
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 copy the tcs id and details mapping from https://developers.getswipe.in/api-reference/references#tcs-tax-collected-at-source
Company shipping from Address, refer Shipping Address Object for parameters
Show child attributes
Show child attributes
Customer shipping to Address, refer Shipping Address Object for parameters
Show child attributes
Show child attributes
Customer billing to Address, refer Shipping Address Object for parameters
Show child attributes
Show child attributes
Is Subscription
false
Subscription Details
Show child attributes
Show child attributes
Generate einvoice
false
Is Export
false
Export Invoice Details
Show child attributes
Show child attributes

