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.
Customer id and Product id should be unique, if a new id is sent, a new
Customer/Product with given details will be automatically created. For
Product If an existing id is sent, the details will not override the
original product details. They will be applicable only to the current
document. For updating the product details, use the update product API
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.
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.
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.
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
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Swipe","colors":{"primary":"#2045D1","light":"#538DFF","dark":"#2045D1"},"logo":{"light":"https://mintcdn.com/swipe/DQkaOg10KeYQlKIu/logo/logo_g_light.webp?fit=max\u0026auto=format\u0026n=DQkaOg10KeYQlKIu\u0026q=85\u0026s=44d5e4b626518cb3542e8ef16e85f182","dark":"https://mintcdn.com/swipe/DQkaOg10KeYQlKIu/logo/logo_g_dark.webp?fit=max\u0026auto=format\u0026n=DQkaOg10KeYQlKIu\u0026q=85\u0026s=84cf20e2bc4f85a8fea2938d2f43412e","href":"/"},"favicon":"https://mintcdn.com/swipe/ZOyvFX50eH4DT_Wr/favicon.svg?fit=max\u0026auto=format\u0026n=ZOyvFX50eH4DT_Wr\u0026q=85\u0026s=9f4476cef1667d0c527f72dd6036726b","api":{"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","python","javascript"]}},"navbar":{"links":[{"href":"https://app.getswipe.in/user?tab=api_integration","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.getswipe.in"}},"footer":{"socials":{"x":"https://twitter.com/swipebilling","instagram":"https://www.instagram.com/swipebilling","linkedin":"https://www.linkedin.com/company/swipebilling"}},"search":{"prompt":"Search the Swipe API docs..."},"seo":{"metatags":{"og:site_name":"Swipe API Documentation","og:type":"website"}},"errors":{"404":{"redirect":true}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Run in Postman","icon":{"style":"thin","name":"user-astronaut"},"href":"https://god.gw.postman.com/run-collection/43895811-b7327b9d-1e50-4fed-af6f-660a918aa817?action=collection%2Ffork\u0026source=rip_markdown\u0026collection-url=entityId%3D43895811-b7327b9d-1e50-4fed-af6f-660a918aa817%26entityType%3Dcollection%26workspaceId%3D5d3fc3f0-668c-499e-833b-03222666ba2a"},{"anchor":"Blog","icon":"newspaper","href":"https://getswipe.in/blog"},{"anchor":"Community","icon":"slack","href":"https://community.getswipe.in/c/api-integration/14"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"swipe","hasAudioNarration":false,"actualSubdomain":"swipe","customDomains":["developers.getswipe.in"],"gitSource":{"type":"github","owner":"swipe-yc21","repo":"partner-api-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6aa158f50379420e6579534a","clientVersion":"0.0.4117","searchFilterCounts":[{"language":"default","tag":"Documentation","count":74},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Customers","count":7},{"language":"default","tag":"Customer","count":7},{"language":"default","tag":"Vendors","count":7},{"language":"default","tag":"Documents","count":6},{"language":"default","tag":"Products","count":6},{"language":"default","tag":"Product","count":6},{"language":"default","tag":"Get Started","count":5},{"language":"default","tag":"Resources","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/document/create-a-document","slug":"/api-reference/document/create-a-document","pageMetadata":{"openapi":"post /v1/doc","title":"Create a document","description":"**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.","href":"/api-reference/document/create-a-document"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n strong: \"strong\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"v1 is deprecated — use the v2 endpoint instead.\"\n }), \" Creates a document — an invoice, purchase, estimate, return, delivery challan, or subscription — based on \", _jsx(_components.code, {\n children: \"document_type\"\n }), \". Unknown \", _jsx(_components.code, {\n children: \"party\"\n }), \" and \", _jsx(_components.code, {\n children: \"items\"\n }), \" IDs are created automatically from the details you send; existing IDs are reused. Returns the document’s \", _jsx(_components.code, {\n children: \"hash_id\"\n }), \", which addresses the document in every subsequent call, plus the IRN and QR code when \", _jsx(_components.code, {\n children: \"einvoice\"\n }), \" is set. Send your own \", _jsx(_components.code, {\n children: \"serial_number\"\n }), \" to make retries safe — a duplicate fails with \", _jsx(_components.code, {\n children: \"DUPLICATE_DOC_SERIAL_NUMBER\"\n }), \" instead of creating a second document.\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={p:`p`,..._provideComponents(),...props.components},{Note}=_components;if(!Note)_missingMdxReference(`Note`,true);return _jsx(Note,{children:_jsx(_components.p,{children:`Customer id and Product id should be unique, if a new id is sent, a new\nCustomer/Product with given details will be automatically created. For\nProduct If an existing id is sent, the details will not override the\noriginal product details. They will be applicable only to the current\ndocument. For updating the product details, use the update product API`})})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi":"post /v1/doc","title":"Create a document","description":"**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.","href":"/api-reference/document/create-a-document"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Create a document","operationId":"post_invoice_resource","tags":["Document"],"requestBody":"3d89a3e9-3b69-48d3-ba46-e1b6e809a084","responses":{"200":"bb28773a-c75f-4d40-825d-b23ed2a67156","400":"e2583aad-3d57-41a9-b4c4-15b029fde147","401":"b5779d8f-0b62-4a36-a7b1-9e52507bca29","500":"91c3c943-a393-47f3-a793-f7053baf7935"},"description":"**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.","method":"post","type":"path","servers":["82b38fec-7303-4b6e-86bb-63d990b1e4ef"],"security":["13576f02-530d-4f08-aab7-91987ee153ab"],"path":"/v1/doc","baseUrlOptions":["https://app.getswipe.in/api/partner"],"title":"Create a document","codeSamples":[],"requestExampleLanguages":["bash","python","javascript"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"required":["document_date","document_type","items"],"properties":{"document_type":{"type":"string","description":"Type of document to create. One of the enum values listed below; use 'invoice' for a standard GST invoice.","example":"invoice","enum":["invoice","subscription","pro_forma_invoice","estimate","sales_return","purchase_return"],"isRequired":true,"uniqueKey":"document_type","typeLabel":"enum\u003cstring>"},"document_date":{"type":"string","description":"DD-MM-YYYY, Invoice date (Ex: 11-06-2024 Need not to the current date)","example":"11-06-2024","isRequired":true,"uniqueKey":"document_date","typeLabel":"string"},"items":{"type":"array","description":"Array of Products/Services, refer Item Object below for parameters","items":{"required":["id","item_type","name","net_amount","price_with_tax","quantity","total_amount","unit_price"],"properties":{"id":{"type":"string","description":"Unique id for each item. If a new id is sent, a new Item with the below details will be automatically created. if existing Item id is sent the details will not override the original item details. They will be applicable only to the current documents. Use update item to actually update the item details in swipe","example":"ITEM123","isRequired":true,"uniqueKey":"\\items.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","description":"Name of the Product","example":"Item Name","isRequired":true,"uniqueKey":"\\items.items.[INDEX].name","typeLabel":"string"},"quantity":{"type":"number","description":"Quantity","example":1,"isRequired":true,"uniqueKey":"\\items.items.[INDEX].quantity","typeLabel":"number"},"unit_price":{"type":"number","description":"Price per item without Tax","example":100,"isRequired":true,"uniqueKey":"\\items.items.[INDEX].unit_price","typeLabel":"number"},"price_with_tax":{"type":"number","description":"Price per item with Tax","example":118,"isRequired":true,"uniqueKey":"\\items.items.[INDEX].price_with_tax","typeLabel":"number"},"net_amount":{"type":"number","description":"Net Amount","example":100,"isRequired":true,"uniqueKey":"\\items.items.[INDEX].net_amount","typeLabel":"number"},"total_amount":{"type":"number","description":"Item total amount (Net Amount + Tax)","example":118,"isRequired":true,"uniqueKey":"\\items.items.[INDEX].total_amount","typeLabel":"number"},"item_type":{"type":"string","description":"Product or Service enum","example":"Product","enum":["Product","Service"],"isRequired":true,"uniqueKey":"\\items.items.[INDEX].item_type","typeLabel":"enum\u003cstring>"},"tax_rate":{"type":"number","description":"Tax percentage for each item . Only valid tax rates are accepted","example":18,"uniqueKey":"\\items.items.[INDEX].tax_rate","typeLabel":"number"},"discount_percent":{"type":"number","description":"Discount Percent","default":0,"example":10,"uniqueKey":"\\items.items.[INDEX].discount_percent","typeLabel":"number"},"discount_amount":{"type":"number","description":"Discount Amount, will be ignored if discount_percent is provided","default":0,"example":10,"uniqueKey":"\\items.items.[INDEX].discount_amount","typeLabel":"number"},"description":{"type":"string","description":"Item Description","example":"Item Description","uniqueKey":"\\items.items.[INDEX].description","typeLabel":"string"},"hsn_code":{"type":"string","description":"HSN Code","example":"1234","uniqueKey":"\\items.items.[INDEX].hsn_code","typeLabel":"string"},"unit":{"type":"string","description":"Item quantity unit. You can find the GST-approved units in the UQC Codes section at: https://einvoice1.gst.gov.in/Others/MasterCodes.","example":"kg","uniqueKey":"\\items.items.[INDEX].unit","typeLabel":"string"},"category":{"type":"string","description":"Category","example":"Electronics","uniqueKey":"\\items.items.[INDEX].category","typeLabel":"string"}},"type":"object","uniqueKey":"\\items.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"\\items","typeLabel":"object[]"},"serial_number":{"type":"string","description":"Serial Number, if not sent will be auto generated based on the default prefix.","example":"INV123","uniqueKey":"serial_number","typeLabel":"string"},"customer":{"type":"object","description":"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.","required":["id","name"],"properties":{"id":{"type":"string","description":"Unique id for each customer. If a new id is sent, a new Customer with the below details will be automatically created.\n If existing Customer id is sent the details will not override the original customer details.\n They will be applicable only to the current invoice","example":"CUST123","isRequired":true,"uniqueKey":"customer.id","typeLabel":"string"},"name":{"type":"string","description":"Name of the Customer","example":"John Doe","isRequired":true,"uniqueKey":"customer.name","typeLabel":"string"},"country_code":{"type":"string","description":"Customer Phone Number Country code","example":"91","uniqueKey":"customer.country_code","typeLabel":"string"},"phone_number":{"type":"string","description":"Customer Phone Number","example":"1234567890","uniqueKey":"customer.phone_number","typeLabel":"string"},"company_name":{"type":"string","description":"Company Name","example":"Company Name","uniqueKey":"customer.company_name","typeLabel":"string"},"email":{"type":"string","description":"Customer Email","example":"johndoe@example.com","uniqueKey":"customer.email","typeLabel":"string"},"gstin":{"type":"string","description":"GSTIN","example":"27AARCS7202C1ZD","uniqueKey":"customer.gstin","typeLabel":"string"}},"uniqueKey":"customer","typeLabel":"object"},"party":{"type":"object","description":"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.","required":["id","name","type"],"properties":{"id":{"type":"string","description":"Unique id for each party.","example":"CUST123","isRequired":true,"uniqueKey":"party.id","typeLabel":"string"},"type":{"type":"string","description":"Party type, use only specified values","example":"customer","enum":["customer","vendor"],"isRequired":true,"uniqueKey":"party.type","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"Name of the Party","example":"John Doe","isRequired":true,"uniqueKey":"party.name","typeLabel":"string"},"country_code":{"type":"string","description":"Party Phone Number Country code","example":"91","uniqueKey":"party.country_code","typeLabel":"string"},"phone_number":{"type":"string","description":"Party Phone Number","example":"1234567890","uniqueKey":"party.phone_number","typeLabel":"string"},"company_name":{"type":"string","description":"Company Name","example":"Company Name","uniqueKey":"party.company_name","typeLabel":"string"},"email":{"type":"string","description":"Party Email","example":"johndoe@example.com","uniqueKey":"party.email","typeLabel":"string"},"gstin":{"type":"string","description":"GSTIN","example":"27AARCS7202C1ZD","uniqueKey":"party.gstin","typeLabel":"string"}},"uniqueKey":"party","typeLabel":"object"},"due_date":{"type":"string","description":"DD-MM-YYYY, Payment Due date for the invoice (Ex: 11-06-2024)","example":"11-06-2024","uniqueKey":"due_date","typeLabel":"string"},"reference":{"type":"string","description":"Any references you want to add to the doc","example":"Reference Text","uniqueKey":"reference","typeLabel":"string"},"notes":{"type":"string","description":"Notes to show in invoice","example":"Notes for the document","uniqueKey":"notes","typeLabel":"string"},"terms":{"type":"string","description":"Terms to show in invoice","example":"Terms and Conditions","uniqueKey":"terms","typeLabel":"string"},"extra_discount":{"type":"number","description":"Adjustment on overall invoice, doesn’t effect any tax amounts.","default":0,"example":20,"uniqueKey":"extra_discount","typeLabel":"number"},"round_off":{"type":"boolean","description":"Should Round Off total amount","default":false,"example":true,"uniqueKey":"round_off","typeLabel":"boolean"},"payments":{"type":"array","description":"Array of Payments, refer Payment Object for parameters","items":{"required":["amount","method"],"properties":{"amount":{"type":"number","description":"Payment Amount","example":100,"isRequired":true,"uniqueKey":"payments.items.[INDEX].amount","typeLabel":"number"},"method":{"type":"string","description":"Payment method, use only specified values","example":"upi","enum":["cash","card","upi","netBanking","cheque","emi"],"isRequired":true,"uniqueKey":"payments.items.[INDEX].method","typeLabel":"enum\u003cstring>"},"notes":{"type":"string","description":"Any internal notes for payment","example":"Payment notes","uniqueKey":"payments.items.[INDEX].notes","typeLabel":"string"}},"type":"object","uniqueKey":"payments.items.[INDEX]","typeLabel":"object"},"uniqueKey":"payments","typeLabel":"object[]"},"bank_details":{"type":"object","description":"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","required":["account_number","bank_name","branch","ifsc"],"properties":{"account_number":{"type":"string","description":"Account Number","example":"1234567890","isRequired":true,"uniqueKey":"bank_details.account_number","typeLabel":"string"},"ifsc":{"type":"string","description":"IFSC Code","example":"SBIN0000001","isRequired":true,"uniqueKey":"bank_details.ifsc","typeLabel":"string"},"bank_name":{"type":"string","description":"Bank Name","example":"State Bank of India","isRequired":true,"uniqueKey":"bank_details.bank_name","typeLabel":"string"},"branch":{"type":"string","description":"Branch","example":"Mumbai","isRequired":true,"uniqueKey":"bank_details.branch","typeLabel":"string"}},"uniqueKey":"bank_details","typeLabel":"object"},"tds_id":{"type":"integer","description":"You can check the tds id and details mapping from https://developers.getswipe.in/api-reference/references#tds-tax-deducted-at-source","uniqueKey":"tds_id","typeLabel":"integer"},"tcs_id":{"type":"integer","description":"You can copy the tcs id and details mapping from https://developers.getswipe.in/api-reference/references#tcs-tax-collected-at-source","uniqueKey":"tcs_id","typeLabel":"integer"},"company_shipping_address":{"type":"object","description":"Company shipping from Address, refer Shipping Address Object for parameters","required":["address_line1","address_line2","city","country","pincode","state"],"properties":{"address_line1":{"type":"string","description":"Address Line 1","example":"123 Street","isRequired":true,"uniqueKey":"company_shipping_address.address_line1","typeLabel":"string"},"address_line2":{"type":"string","description":"Address Line 2","example":"Apt 4B","isRequired":true,"uniqueKey":"company_shipping_address.address_line2","typeLabel":"string"},"city":{"type":"string","description":"City","example":"City Name","isRequired":true,"uniqueKey":"company_shipping_address.city","typeLabel":"string"},"state":{"type":"string","description":"State. You can copy the state details from https://developers.getswipe.in/api-reference/references#state-details","example":"State Name","enum":["JAMMU AND KASHMIR","HIMACHAL PRADESH","PUNJAB","CHANDIGARH","UTTARAKHAND","HARYANA","DELHI","RAJASTHAN","UTTAR PRADESH","BIHAR","SIKKIM","ARUNACHAL PRADESH","NAGALAND","MANIPUR","MIZORAM","TRIPURA","MEGHALAYA","ASSAM","WEST BENGAL","JHARKHAND","ODISHA","CHHATTISGARH","MADHYA PRADESH","GUJARAT","DADRA \u0026 NAGAR HAVELI \u0026 DAMAN \u0026 DIU","MAHARASHTRA","ANDHRAPRADESH(BEFOREADDED)","KARNATAKA","GOA","LAKSHWADEEP","KERALA","TAMIL NADU","PUDUCHERRY","ANDAMAN \u0026 NICOBAR","TELANGANA","ANDHRA PRADESH","LADAKH(NEWLYADDED)","LADAKH(NEWLY ADDED)","OTHER TERRITORY"],"isRequired":true,"uniqueKey":"company_shipping_address.state","typeLabel":"enum\u003cstring>"},"country":{"type":"string","description":"Country. You can copy the country details from https://developers.getswipe.in/api-reference/references#country-array","example":"Country Name","isRequired":true,"uniqueKey":"company_shipping_address.country","typeLabel":"string"},"pincode":{"type":"string","description":"Pincode","example":"123456","isRequired":true,"uniqueKey":"company_shipping_address.pincode","typeLabel":"string"}},"uniqueKey":"company_shipping_address","typeLabel":"object"},"customer_shipping_address":{"type":"object","description":"Customer shipping to Address, refer Shipping Address Object for parameters","required":["address_line1","address_line2","city","country","pincode","state"],"properties":{"address_line1":{"type":"string","description":"Address Line 1","example":"123 Street","isRequired":true,"uniqueKey":"customer_shipping_address.address_line1","typeLabel":"string"},"address_line2":{"type":"string","description":"Address Line 2","example":"Apt 4B","isRequired":true,"uniqueKey":"customer_shipping_address.address_line2","typeLabel":"string"},"city":{"type":"string","description":"City","example":"City Name","isRequired":true,"uniqueKey":"customer_shipping_address.city","typeLabel":"string"},"state":{"type":"string","description":"State. You can copy the state details from https://developers.getswipe.in/api-reference/references#state-details","example":"State Name","enum":["JAMMU AND KASHMIR","HIMACHAL PRADESH","PUNJAB","CHANDIGARH","UTTARAKHAND","HARYANA","DELHI","RAJASTHAN","UTTAR PRADESH","BIHAR","SIKKIM","ARUNACHAL PRADESH","NAGALAND","MANIPUR","MIZORAM","TRIPURA","MEGHALAYA","ASSAM","WEST BENGAL","JHARKHAND","ODISHA","CHHATTISGARH","MADHYA PRADESH","GUJARAT","DADRA \u0026 NAGAR HAVELI \u0026 DAMAN \u0026 DIU","MAHARASHTRA","ANDHRAPRADESH(BEFOREADDED)","KARNATAKA","GOA","LAKSHWADEEP","KERALA","TAMIL NADU","PUDUCHERRY","ANDAMAN \u0026 NICOBAR","TELANGANA","ANDHRA PRADESH","LADAKH(NEWLYADDED)","LADAKH(NEWLY ADDED)","OTHER TERRITORY"],"isRequired":true,"uniqueKey":"customer_shipping_address.state","typeLabel":"enum\u003cstring>"},"country":{"type":"string","description":"Country. You can copy the country details from https://developers.getswipe.in/api-reference/references#country-array","example":"Country Name","isRequired":true,"uniqueKey":"customer_shipping_address.country","typeLabel":"string"},"pincode":{"type":"string","description":"Pincode","example":"123456","isRequired":true,"uniqueKey":"customer_shipping_address.pincode","typeLabel":"string"}},"uniqueKey":"customer_shipping_address","typeLabel":"object"},"customer_billing_address":{"type":"object","description":"Customer billing to Address, refer Shipping Address Object for parameters","required":["address_line1","address_line2","city","country","pincode","state"],"properties":{"address_line1":{"type":"string","description":"Address Line 1","example":"123 Street","isRequired":true,"uniqueKey":"customer_billing_address.address_line1","typeLabel":"string"},"address_line2":{"type":"string","description":"Address Line 2","example":"Apt 4B","isRequired":true,"uniqueKey":"customer_billing_address.address_line2","typeLabel":"string"},"city":{"type":"string","description":"City","example":"City Name","isRequired":true,"uniqueKey":"customer_billing_address.city","typeLabel":"string"},"state":{"type":"string","description":"State. You can copy the state details from https://developers.getswipe.in/api-reference/references#state-details","example":"State Name","enum":["JAMMU AND KASHMIR","HIMACHAL PRADESH","PUNJAB","CHANDIGARH","UTTARAKHAND","HARYANA","DELHI","RAJASTHAN","UTTAR PRADESH","BIHAR","SIKKIM","ARUNACHAL PRADESH","NAGALAND","MANIPUR","MIZORAM","TRIPURA","MEGHALAYA","ASSAM","WEST BENGAL","JHARKHAND","ODISHA","CHHATTISGARH","MADHYA PRADESH","GUJARAT","DADRA \u0026 NAGAR HAVELI \u0026 DAMAN \u0026 DIU","MAHARASHTRA","ANDHRAPRADESH(BEFOREADDED)","KARNATAKA","GOA","LAKSHWADEEP","KERALA","TAMIL NADU","PUDUCHERRY","ANDAMAN \u0026 NICOBAR","TELANGANA","ANDHRA PRADESH","LADAKH(NEWLYADDED)","LADAKH(NEWLY ADDED)","OTHER TERRITORY"],"isRequired":true,"uniqueKey":"customer_billing_address.state","typeLabel":"enum\u003cstring>"},"country":{"type":"string","description":"Country. You can copy the country details from https://developers.getswipe.in/api-reference/references#country-array","example":"Country Name","isRequired":true,"uniqueKey":"customer_billing_address.country","typeLabel":"string"},"pincode":{"type":"string","description":"Pincode","example":"123456","isRequired":true,"uniqueKey":"customer_billing_address.pincode","typeLabel":"string"}},"uniqueKey":"customer_billing_address","typeLabel":"object"},"is_subscription":{"type":"boolean","description":"Is Subscription","example":false,"uniqueKey":"is_subscription","typeLabel":"boolean"},"subscription_details":{"type":"object","description":"Subscription Details","properties":{"start_time":{"type":"string","format":"date","description":"Start Time [DD-MM-YYYY]","example":"14-02-2024","uniqueKey":"subscription_details.start_time","typeLabel":"string\u003cdate>"},"end_time":{"type":"string","format":"date","description":"End Time [DD-MM-YYYY]","example":"14-02-2025","uniqueKey":"subscription_details.end_time","typeLabel":"string\u003cdate>"},"repeat":{"type":"integer","description":"Repeat in value, Frequency of the repetition ","example":1,"uniqueKey":"subscription_details.repeat","typeLabel":"integer"},"repeat_type":{"type":"string","description":"Repeat type, Entity of the repetition","example":"days","enum":["days","weeks","months","years"],"uniqueKey":"subscription_details.repeat_type","typeLabel":"enum\u003cstring>"},"send_email":{"type":"boolean","uniqueKey":"subscription_details.send_email","typeLabel":"boolean"},"send_sms":{"type":"boolean","uniqueKey":"subscription_details.send_sms","typeLabel":"boolean"},"send_wtsp":{"type":"boolean","uniqueKey":"subscription_details.send_wtsp","typeLabel":"boolean"}},"uniqueKey":"subscription_details","typeLabel":"object"},"einvoice":{"type":"boolean","description":"Generate einvoice","example":false,"uniqueKey":"einvoice","typeLabel":"boolean"},"is_export":{"type":"boolean","description":"Is Export","example":false,"uniqueKey":"is_export","typeLabel":"boolean"},"export_invoice_details":{"type":"object","description":"Export Invoice Details","required":["conversion_factor","export_type"],"properties":{"export_type":{"type":"string","description":"Export Type","example":"With Payment of Tax","enum":["Export under bond/LUT","Export with IGST","SEZ with IGST Payment","SEZ without IGST Payment","Deemed Export"],"isRequired":true,"uniqueKey":"export_invoice_details.export_type","typeLabel":"enum\u003cstring>"},"conversion_factor":{"type":"number","isRequired":true,"uniqueKey":"export_invoice_details.conversion_factor","typeLabel":"number"},"shipping_bill_date":{"type":"string","uniqueKey":"export_invoice_details.shipping_bill_date","typeLabel":"string"},"shipping_bill_number":{"type":"string","uniqueKey":"export_invoice_details.shipping_bill_number","typeLabel":"string"},"shipping_port_code":{"type":"string","uniqueKey":"export_invoice_details.shipping_port_code","typeLabel":"string"},"country_id":{"type":"string","description":"Country ID","example":"Afghanistan","enum":["Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cabo Verde","Cambodia","Cameroon","Canada","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo, Democratic Republic of the","Congo, Republic of the","Costa Rica","Croatia","Cuba","Cyprus","Czechia","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Fiji","Finland","France","Gabon","Gambia","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Republic of Korea (South Korea)","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","North Macedonia","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Sudan","Spain","Sri Lanka","Sudan","Suriname","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor-Leste","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe"],"uniqueKey":"export_invoice_details.country_id","typeLabel":"enum\u003cstring>"}},"uniqueKey":"export_invoice_details","typeLabel":"object"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","value":{"document_type":"invoice","document_date":"01-04-2024","customer":{"id":"cus123","name":"Charan Cus"},"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}]}},"advanced":{"title":"advanced","value":{"document_type":"invoice","document_date":"11-06-2024","customer":{"id":"CUST123","name":"John Doe","country_code":"91","phone_number":"1234567890","email":"johndoe@example.com"},"due_date":"11-06-2024","reference":"Reference Text","notes":"Notes for the document","terms":"Terms and Conditions","items":[{"id":"ITEM123","name":"Item Name","quantity":10,"unit_price":100,"tax_rate":18,"cess_rate":10,"price_with_tax":128,"tax_amount":252,"discount_percent":10,"discount_amount":100,"net_amount":900,"total_amount":1152,"description":"Item Description","hsn_code":"1234","item_type":"goods","unit":"kg","category":"Electronics"}],"extra_discount":20,"round_off":0,"payments":[{"amount":100,"method":"upi","notes":"Payment notes"}],"bank_details":{"account_number":"1234567890","bank_name":"Example Bank","branch":"Main Branch","ifsc":"IFSC0001234"},"company_shipping_address":{"address_line1":"123 Street","address_line2":"Apt 4B","city":"City Name","state":"State Name","country":"Country Name","pincode":"123456"},"customer_shipping_address":{"address_line1":"123 Street","address_line2":"Apt 4B","city":"City Name","state":"State Name","country":"Country Name","pincode":"123456"}}},"subscription":{"title":"subscription","value":{"document_type":"subscription","document_date":"11-06-2024","customer":{"id":"CUST1","name":"Charan","country_code":"91","phone_number":"8768906785","email":"charanrockstar@gmail.com"},"due_date":"11-06-2024","reference":"Example Subcsription for API's","notes":"Example Note","terms":"Terms and Conditions","items":[{"id":"ITEM123","name":"Item Name","quantity":10,"unit_price":100,"tax_rate":18,"cess_rate":10,"price_with_tax":128,"tax_amount":252,"discount_percent":10,"discount_amount":100,"net_amount":900,"total_amount":1152,"description":"Item Description","hsn_code":"1234","item_type":"goods","unit":"kg","category":"Electronics"}],"extra_discount":20,"round_off":0,"bank_details":{"account_number":"1234567890","bank_name":"Example Bank","branch":"Main Branch","ifsc":"IFSC0001234"},"company_shipping_address":{"address_line1":"123 Street","address_line2":"Apt 4B","city":"City Name","state":"State Name","country":"Country Name","pincode":"123456"},"customer_shipping_address":{"address_line1":"C/o Swipe","address_line2":"Red Steert 40","city":"Kansar","state":"Kansar","country":"India","pincode":"000007"},"is_subscription":true,"subscription_details":{"start_time":"13-06-2024","end_time":"14-07-2024","repeat":1,"repeat_type":"days","send_email":true,"send_sms":true}}},"e-invoice":{"title":"e-invoice","value":{"document_type":"invoice","document_date":"11-06-2024","customer":{"id":"236","name":"Vasu","country_code":"91","phone_number":"1234567890","email":"johndoe@example.com","company_name":"Vason Company","gstin":"36ACZPT7516P1ZA"},"due_date":"11-06-2024","reference":"Reference Text","notes":"Notes for the document","terms":"Terms and Conditions","items":[{"id":"ac_1.56","name":"Ac 1.56 Ton 5 Star","quantity":1,"unit_price":100,"tax_rate":18,"price_with_tax":118,"tax_amount":16.2,"discount_percent":10,"discount_amount":10,"net_amount":90,"total_amount":106.2,"description":"Item Description","hsn_code":"04022910","item_type":"Product","unit":"kg","category":"Electronics"}],"extra_discount":20,"round_off":true,"payments":[{"amount":100,"method":"upi","notes":"Payment notes"}],"bank_details":{"account_number":"1234567890","bank_name":"Example Bank","branch":"Main Branch","ifsc":"IFSC0001234"},"company_shipping_address":{"address_line1":"123 Street","address_line2":"","city":"Banglore","state":"KARNATAKA","country":"India","pincode":"560001"},"customer_shipping_address":{"address_line1":"5-11, vema street","address_line2":"","city":"Hyderabad South East","state":"TELANGANA","country":"India","pincode":"500030"},"customer_billing_address":{"address_line1":"5-11, vema street","address_line2":"","city":"Hyderabad","state":"TELANGANA","country":"India","pincode":"500032"},"einvoice":true,"is_export":true,"export_invoice_details":{"shipping_bill_date":"27-08-2024","shipping_bill_number":"","shipping_port_code":"","export_type":"SEZ without IGST Payment","conversion_factor":1,"country_id":"India"}}}},"exampleType":"examples"}},"required":true,"exampleType":"examples"},"responses":{"bb28773a-c75f-4d40-825d-b23ed2a67156":{"description":"Success","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean","description":"Success","example":true,"uniqueKey":"success","typeLabel":"boolean"},"message":{"type":"string","description":"Message","example":"Document created successfully","uniqueKey":"message","typeLabel":"string"},"serialNumber":{"type":"string","description":"Serial Number","example":"SL123","uniqueKey":"serialNumber","typeLabel":"string"},"hashId":{"type":"string","description":"Hash ID","example":"SL123","uniqueKey":"hashId","typeLabel":"string"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":true,"message":"Document created successfully","serialNumber":"SL123","hashId":"SL123"}}},"exampleType":"generated"}},"exampleType":"generated"},"e2583aad-3d57-41a9-b4c4-15b029fde147":{"description":"Error","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean","default":false,"example":false,"uniqueKey":"success","typeLabel":"boolean"},"error_code":{"type":"string","description":"Error Code unique for a specific error. For e-invoice portal errors, error_code will be PORTAL_ERROR_[einvoice_portal_errorcode] ex: PORTAL_ERROR_2247, we can refer description for error code from here https://einv-apisandbox.nic.in/api-error-codes-list.html","example":"INVALID_HASH_ID","uniqueKey":"error_code","typeLabel":"string"},"message":{"type":"string","description":"Error message","example":"Some error occurred","uniqueKey":"message","typeLabel":"string"},"errors":{"type":"object","description":"Error details","uniqueKey":"errors","typeLabel":"object"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error_code":"INVALID_HASH_ID","message":"Some error occurred","errors":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"b5779d8f-0b62-4a36-a7b1-9e52507bca29":{"description":"Unauthorized","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean","default":false,"example":false,"uniqueKey":"success","typeLabel":"boolean"},"error_code":{"type":"string","description":"Error Code unique for a specific error. For e-invoice portal errors, error_code will be PORTAL_ERROR_[einvoice_portal_errorcode] ex: PORTAL_ERROR_2247, we can refer description for error code from here https://einv-apisandbox.nic.in/api-error-codes-list.html","example":"INVALID_HASH_ID","uniqueKey":"error_code","typeLabel":"string"},"message":{"type":"string","description":"Error message","example":"Some error occurred","uniqueKey":"message","typeLabel":"string"},"errors":{"type":"object","description":"Error details","uniqueKey":"errors","typeLabel":"object"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error_code":"INVALID_HASH_ID","message":"Some error occurred","errors":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"91c3c943-a393-47f3-a793-f7053baf7935":{"description":"Server Error","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean","default":false,"example":false,"uniqueKey":"success","typeLabel":"boolean"},"error_code":{"type":"string","description":"Error Code unique for a specific error. For e-invoice portal errors, error_code will be PORTAL_ERROR_[einvoice_portal_errorcode] ex: PORTAL_ERROR_2247, we can refer description for error code from here https://einv-apisandbox.nic.in/api-error-codes-list.html","example":"INVALID_HASH_ID","uniqueKey":"error_code","typeLabel":"string"},"message":{"type":"string","description":"Error message","example":"Some error occurred","uniqueKey":"message","typeLabel":"string"},"errors":{"type":"object","description":"Error details","uniqueKey":"errors","typeLabel":"object"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error_code":"INVALID_HASH_ID","message":"Some error occurred","errors":{}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"13576f02-530d-4f08-aab7-91987ee153ab":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is an API key from the [API Integration](https://app.getswipe.in/user?tab=api_integration) section of your dashboard. Keys are scoped to the company they are generated in — for testing, [add a separate test company](https://community.getswipe.in/t/how-to-add-new-company-on-web/1191) and generate the key there, so requests never touch your real books.","scopes":[]}}},"servers":{"82b38fec-7303-4b6e-86bb-63d990b1e4ef":{"url":"https://app.getswipe.in/api/partner"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is an API key from the [API Integration](https://app.getswipe.in/user?tab=api_integration) section of your dashboard. Keys are scoped to the company they are generated in — for testing, [add a separate test company](https://community.getswipe.in/t/how-to-add-new-company-on-web/1191) and generate the key there, so requests never touch your real books.","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is an API key from the [API Integration](https://app.getswipe.in/user?tab=api_integration) section of your dashboard. Keys are scoped to the company they are generated in — for testing, [add a separate test company](https://community.getswipe.in/t/how-to-add-new-company-on-web/1191) and generate the key there, so requests never touch your real books.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"swipe","siteName":"Swipe","title":"Create a document - Swipe","navMaps":{"firstHrefInVersion":{"v2":{"href":"/api-reference/document-v2/create-a-document","matchLevel":1},"v1 (Deprecated)":{"href":"/api-reference/document/create-a-document","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-08-27T07:51:51.971Z","originalFileLocation":"api-reference/document/create-a-document.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"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\u0026#x27;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.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Swipe\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/swipe/c1cYpNBFxkNdbDrf/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/swipe/c1cYpNBFxkNdbDrf/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/swipe/c1cYpNBFxkNdbDrf/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/swipe/c1cYpNBFxkNdbDrf/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/swipe/c1cYpNBFxkNdbDrf/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/swipe/c1cYpNBFxkNdbDrf/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/swipe/c1cYpNBFxkNdbDrf/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/swipe/c1cYpNBFxkNdbDrf/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/swipe/c1cYpNBFxkNdbDrf/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a document - Swipe\">\u003cmeta data-mint-head property=\"og:description\" content=\"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\u0026#x27;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.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Swipe API Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.getswipe.in/api-reference/document/create-a-document\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://swipe.mintlify.site/_mintlify/api/og/v2?division=Document\u0026amp;title=Create+a+document\u0026amp;description=**v1+is+deprecated+%E2%80%94+use+the+v2+endpoint+instead.**+Creates+a+document+%E2%80%94+an+invoice%2C+purchase%2C+estimate%2C+return%2C+delivery+challan%2C+or+subscription+%E2%80%94+based+on+%60d\u0026amp;theme=d92d74ff6d74cfcc3f2c1ceb\u0026amp;signature=99881aa1475d5be97d2a306045fcb906a8e9ec9e333fbbd8430846da49f385d9\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create a document - Swipe\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"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\u0026#x27;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.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://swipe.mintlify.site/_mintlify/api/og/v2?division=Document\u0026amp;title=Create+a+document\u0026amp;description=**v1+is+deprecated+%E2%80%94+use+the+v2+endpoint+instead.**+Creates+a+document+%E2%80%94+an+invoice%2C+purchase%2C+estimate%2C+return%2C+delivery+challan%2C+or+subscription+%E2%80%94+based+on+%60d\u0026amp;theme=d92d74ff6d74cfcc3f2c1ceb\u0026amp;signature=99881aa1475d5be97d2a306045fcb906a8e9ec9e333fbbd8430846da49f385d9\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/swipe/c1cYpNBFxkNdbDrf/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Swipe\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2045D1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.getswipe.in/api-reference/document/create-a-document\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/document/create-a-document.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developers.getswipe.in/#organization\",\"name\":\"Swipe\",\"url\":\"https://developers.getswipe.in\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/swipe/DQkaOg10KeYQlKIu/logo/logo_g_light.webp?fit=max\u0026auto=format\u0026n=DQkaOg10KeYQlKIu\u0026q=85\u0026s=44d5e4b626518cb3542e8ef16e85f182\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developers.getswipe.in#website\",\"name\":\"Swipe\",\"url\":\"https://developers.getswipe.in\",\"publisher\":{\"@id\":\"https://developers.getswipe.in/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.getswipe.in/api-reference/document/create-a-document#webpage\",\"url\":\"https://developers.getswipe.in/api-reference/document/create-a-document\",\"name\":\"Create a document\",\"description\":\"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.\",\"dateModified\":\"2026-08-27T07:51:51.971Z\",\"isPartOf\":{\"@id\":\"https://developers.getswipe.in#website\"},\"breadcrumb\":{\"@id\":\"https://developers.getswipe.in/api-reference/document/create-a-document#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.getswipe.in/api-reference/document/create-a-document#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Swipe\",\"item\":\"https://developers.getswipe.in\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a document\",\"item\":\"https://developers.getswipe.in/api-reference/document/create-a-document\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://developers.getswipe.in/api-reference/document/create-a-document#apireference\",\"headline\":\"Create a document\",\"name\":\"Create a document\",\"description\":\"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.\",\"url\":\"https://developers.getswipe.in/api-reference/document/create-a-document\",\"mainEntityOfPage\":{\"@id\":\"https://developers.getswipe.in/api-reference/document/create-a-document#webpage\"},\"dateModified\":\"2026-08-27T07:51:51.971Z\",\"publisher\":{\"@id\":\"https://developers.getswipe.in/#organization\"},\"isPartOf\":{\"@id\":\"https://developers.getswipe.in#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Swipe\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Swipe\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/document/create-a-document.md","siteName":"Swipe","nav":{"global":{"anchors":[{"anchor":"Run in Postman","icon":{"style":"thin","name":"user-astronaut"},"href":"https://god.gw.postman.com/run-collection/43895811-b7327b9d-1e50-4fed-af6f-660a918aa817?action=collection%2Ffork\u0026source=rip_markdown\u0026collection-url=entityId%3D43895811-b7327b9d-1e50-4fed-af6f-660a918aa817%26entityType%3Dcollection%26workspaceId%3D5d3fc3f0-668c-499e-833b-03222666ba2a"},{"anchor":"Blog","icon":"newspaper","href":"https://getswipe.in/blog"},{"anchor":"Community","icon":"slack","href":"https://community.getswipe.in/c/api-integration/14"}]},"versions":[{"version":"v2","pages":[{"title":"v2","href":"/api-reference/document-v2/create-a-document"}]},{"version":"v1 (Deprecated)","anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"Get Started","pages":[{"title":"Introduction","icon":"rocket","href":"/introduction"},{"title":"Quickstart","icon":"play","href":"/quickstart"},{"title":"Authentication","icon":"key","href":"/authentication"},{"title":"API Conventions","icon":"list-check","href":"/api-conventions"},{"title":"Build with AI","icon":"robot","href":"/build-with-ai"}]},{"group":"Guides","pages":[{"title":"Documents","icon":"file-invoice","href":"/document"},{"title":"Customers","icon":"users","href":"/customer"},{"title":"Vendors","icon":"building","href":"/vendor"},{"title":"Payments","icon":"credit-card","href":"/payment"},{"title":"Products","icon":"boxes-stacked","href":"/product"},{"title":"Inventory","icon":"warehouse","href":"/inventory"},{"title":"Subscriptions","icon":"repeat","href":"/subscriptions"},{"title":"E-Way Bills","icon":"truck-fast","href":"/ewaybills"},{"title":"E-Invoices","icon":"file-circle-check","href":"/einvoices"},{"title":"Webhooks","icon":"bolt","href":"/webhooks"}]},{"group":"Resources","pages":[{"title":"Error Codes","icon":"triangle-exclamation","href":"/api-reference/error-codes"},{"title":"Tax Codes (TDS \u0026 TCS)","icon":"percent","href":"/api-reference/tax-codes"},{"title":"Currencies, States \u0026 Countries","icon":"globe","href":"/api-reference/reference-data"},{"title":"Change Log","icon":"clock-rotate-left","description":"Updates and changes to the Swipe API","href":"/api-reference/change-log"}]},{"group":"Document","pages":[{"openapi":"post /v1/doc","title":"Create a document","href":"/api-reference/document/create-a-document"},{"openapi":"get /v1/doc/pdf/{doc_hash_id}","title":"Get document PDF","description":"**v1 is deprecated — use the v2 endpoint instead.** Returns the rendered PDF file for a document. The PDF uses the invoice templates and document settings configured on your Swipe account. Pass `delivery_challan=1` to get a delivery-challan copy instead.","href":"/api-reference/document/get-document-pdf"},{"openapi":"delete /v1/doc/{doc_hash_id}","title":"Cancel a document","href":"/api-reference/document/cancel-a-document"}]},{"group":"Payment","pages":[{"openapi":"post /v1/payment","title":"Record payment","href":"/api-reference/payment/record-payment"}]},{"group":"Customer","pages":[{"openapi":"post /v1/customer","title":"Add a customer","href":"/api-reference/customer/add-a-customer"},{"openapi":"get /v1/customer/{customer_id}","title":"Get a customer","href":"/api-reference/customer/get-a-customer"},{"openapi":"put /v1/customer","title":"Update a customer","href":"/api-reference/customer/update-a-customer"},{"openapi":"delete /v1/customer/{customer_id}","title":"Delete a customer","href":"/api-reference/customer/delete-a-customer"},{"openapi":"get /v1/customer/ledger","title":"Get payment ledger","href":"/api-reference/customer/get-payment-ledger"},{"openapi":"get /v1/customer/list","title":"Get list of customers","href":"/api-reference/customer/get-list-of-customers"},{"openapi":"post /v1/customer/list","title":"Update customer mapping","href":"/api-reference/customer/update-customer-mapping"}]},{"group":"Product","pages":[{"openapi":"post /v1/product","title":"Add an item","href":"/api-reference/product/add-an-item"},{"openapi":"get /v1/product/{item_id}","title":"Get item details","href":"/api-reference/product/get-item-details"},{"openapi":"put /v1/product","title":"Update an item","href":"/api-reference/product/update-an-item"},{"openapi":"delete /v1/product/{item_id}","title":"Delete an item","href":"/api-reference/product/delete-an-item"},{"openapi":"get /v1/product/list","title":"Get list of items","href":"/api-reference/product/get-list-of-items"},{"openapi":"post /v1/product/list","title":"Update items mapping","href":"/api-reference/product/update-items-mapping"}]},{"group":"Subscriptions","pages":[{"openapi":"get /v1/subscriptions/list","title":"List of subscriptions","href":"/api-reference/subscriptions/list-of-subscriptions"},{"openapi":"get /v1/subscriptions/{subscription_hash_id}","title":"Get subscription details","href":"/api-reference/subscriptions/get-subscription-details"}]},{"group":"Utility","pages":[{"openapi":"get /v1/utils/gstin/{gstin}","title":"Get GSTIN details","href":"/api-reference/utility/get-gstin"}]},{"group":"EwayBill","pages":[{"openapi":"get /v2/ewaybill/pdf/{doc_hash_id}","title":"Get e-way bill PDF","href":"/api-reference/ewaybill/get-ewaybill-pdf"},{"openapi":"post /v2/ewaybill/{doc_hash_id}","title":"Create e-way bill","href":"/api-reference/ewaybill/create-eway-bill"}]}]}]}]},"basePath":"","title":"Create a document - Swipe","buildId":"dpl_41S5Z2jG9QnfDRwN1KZrLdBwj7DM","deploymentId":"dpl_41S5Z2jG9QnfDRwN1KZrLdBwj7DM","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DDP9JXtj.js","utils-8yQyvEtx.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CBCFR8Sn.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-rQaXkUHa.js","snippetPresets-J5KpBTgV.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BVxVH4Cj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BxdQ2vIi.js","shallow-BjV2tFiD.js","getApiPlaygroundDisplay-C_55tL4O.js","CodeSnippet-C0JpiCOC.js","CodeSnippets-w9Ps7djG.js","Page-DTNSD-0M.js","getPastedJson-BDfB-H8d.js","icon-g-kUkkO9.js","MethodPill-v4l6fq0h.js","DuplicateIcon-CvLo-CfU.js","createIcon-165clrrV.js","DynamicMarkdown-D3RQ-fEj.js","SectionHeading-vvo-3yLf.js","axios-vUo_bRtp.js","Markdown-CMT1uFWQ.js","clsx-C8f2yC9R.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CI2D8R2Y.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-k78Wrw_e.js"]}