---
title: "Create a document"
method: POST
path: "/v1/doc"
tags: ["Document"]
---

# Create a document

`POST /v1/doc`

## Request

- Base URL: `https://app.getswipe.in/api/partner`
- URL: `https://app.getswipe.in/api/partner/v1/doc`
- Auth: HTTP bearer

**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.

## Request body

- BaseDocument
  - `serial_number` string: Serial Number, if not sent will be auto generated based on the default prefix.
  - `document_type` 'invoice' | 'subscription' | 'pro_forma_invoice' | 'estimate' | 'sales_return' | 'purchase_return', required: Type of document to create. One of the enum values listed below; use 'invoice' for a standard GST invoice.
  - `document_date` string, required: DD-MM-YYYY, Invoice date (Ex: 11-06-2024 Need not to the current date)
  - `customer` CustomerV1
    - `id` string, required: Unique id for each customer. If a new id is sent, a new Customer with the below details will be automatically created. If existing Customer id is sent the details will not override the original customer details. They will be applicable only to the current invoice
    - `name` string, required: Name of the Customer
    - `country_code` string: Customer Phone Number Country code
    - `phone_number` string: Customer Phone Number
    - `company_name` string: Company Name
    - `email` string: Customer Email
    - `gstin` string: GSTIN
  - `party` PartyV1
    - `id` string, required: Unique id for each party.
    - `type` 'customer' | 'vendor', required: Party type, use only specified values
    - `name` string, required: Name of the Party
    - `country_code` string: Party Phone Number Country code
    - `phone_number` string: Party Phone Number
    - `company_name` string: Company Name
    - `email` string: Party Email
    - `gstin` string: GSTIN
  - `due_date` string: DD-MM-YYYY, Payment Due date for the invoice (Ex: 11-06-2024)
  - `reference` string: Any references you want to add to the doc
  - `notes` string: Notes to show in invoice
  - `terms` string: Terms to show in invoice
  - `items` DocItem[], required: Array of Products/Services, refer Item Object below for parameters
    - `id` string, required: 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
    - `name` string, required: Name of the Product
    - `quantity` number, required: Quantity
    - `unit_price` number, required: Price per item without Tax
    - `tax_rate` number: Tax percentage for each item . Only valid tax rates are accepted
    - `price_with_tax` number, required: Price per item with Tax
    - `net_amount` number, required: Net Amount
    - `total_amount` number, required: Item total amount (Net Amount + Tax)
    - `discount_percent` number: Discount Percent
    - `discount_amount` number: Discount Amount, will be ignored if discount_percent is provided
    - `description` string: Item Description
    - `hsn_code` string: HSN Code
    - `item_type` 'Product' | 'Service', required: Product or Service enum
    - `unit` string: Item quantity unit. You can find the GST-approved units in the UQC Codes section at: https://einvoice1.gst.gov.in/Others/MasterCodes.
    - `category` string: Category
  - `extra_discount` number: Adjustment on overall invoice, doesn’t effect any tax amounts.
  - `round_off` boolean: Should Round Off total amount
  - `payments` Payment[]: Array of Payments, refer Payment Object for parameters
    - `amount` number, required: Payment Amount
    - `method` 'cash' | 'card' | 'upi' | 'netBanking' | 'cheque' | 'emi', required: Payment method, use only specified values
    - `notes` string: Any internal notes for payment
  - `bank_details` BankDetails
    - `account_number` string, required: Account Number
    - `ifsc` string, required: IFSC Code
    - `bank_name` string, required: Bank Name
    - `branch` string, required: Branch
  - `tds_id` integer: You can check the tds id and details mapping from https://developers.getswipe.in/api-reference/references#tds-tax-deducted-at-source
  - `tcs_id` integer: You can copy the tcs id and details mapping from https://developers.getswipe.in/api-reference/references#tcs-tax-collected-at-source
  - `company_shipping_address` ShippingAddress
    - `address_line1` string, required: Address Line 1
    - `address_line2` string, required: Address Line 2
    - `city` string, required: City
    - `state` '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 & NAGAR HAVELI & DAMAN & DIU' | 'MAHARASHTRA' | 'ANDHRAPRADESH(BEFOREADDED)' | 'KARNATAKA' | 'GOA' | 'LAKSHWADEEP' | 'KERALA' | 'TAMIL NADU' | 'PUDUCHERRY' | 'ANDAMAN & NICOBAR' | 'TELANGANA' | 'ANDHRA PRADESH' | 'LADAKH(NEWLYADDED)' | 'LADAKH(NEWLY ADDED)' | 'OTHER TERRITORY', required: State. You can copy the state details from https://developers.getswipe.in/api-reference/references#state-details
    - `country` string, required: Country. You can copy the country details from https://developers.getswipe.in/api-reference/references#country-array
    - `pincode` string, required: Pincode
  - `customer_shipping_address` ShippingAddress
    - `address_line1` string, required: Address Line 1
    - `address_line2` string, required: Address Line 2
    - `city` string, required: City
    - `state` '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 & NAGAR HAVELI & DAMAN & DIU' | 'MAHARASHTRA' | 'ANDHRAPRADESH(BEFOREADDED)' | 'KARNATAKA' | 'GOA' | 'LAKSHWADEEP' | 'KERALA' | 'TAMIL NADU' | 'PUDUCHERRY' | 'ANDAMAN & NICOBAR' | 'TELANGANA' | 'ANDHRA PRADESH' | 'LADAKH(NEWLYADDED)' | 'LADAKH(NEWLY ADDED)' | 'OTHER TERRITORY', required: State. You can copy the state details from https://developers.getswipe.in/api-reference/references#state-details
    - `country` string, required: Country. You can copy the country details from https://developers.getswipe.in/api-reference/references#country-array
    - `pincode` string, required: Pincode
  - `customer_billing_address` ShippingAddress
    - `address_line1` string, required: Address Line 1
    - `address_line2` string, required: Address Line 2
    - `city` string, required: City
    - `state` '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 & NAGAR HAVELI & DAMAN & DIU' | 'MAHARASHTRA' | 'ANDHRAPRADESH(BEFOREADDED)' | 'KARNATAKA' | 'GOA' | 'LAKSHWADEEP' | 'KERALA' | 'TAMIL NADU' | 'PUDUCHERRY' | 'ANDAMAN & NICOBAR' | 'TELANGANA' | 'ANDHRA PRADESH' | 'LADAKH(NEWLYADDED)' | 'LADAKH(NEWLY ADDED)' | 'OTHER TERRITORY', required: State. You can copy the state details from https://developers.getswipe.in/api-reference/references#state-details
    - `country` string, required: Country. You can copy the country details from https://developers.getswipe.in/api-reference/references#country-array
    - `pincode` string, required: Pincode
  - `is_subscription` boolean: Is Subscription
  - `subscription_details` Subscription
    - `start_time` string, date: Start Time [DD-MM-YYYY]
    - `end_time` string, date: End Time [DD-MM-YYYY]
    - `repeat` integer: Repeat in value, Frequency of the repetition
    - `repeat_type` 'days' | 'weeks' | 'months' | 'years': Repeat type, Entity of the repetition
    - `send_email` boolean
    - `send_sms` boolean
    - `send_wtsp` boolean
  - `einvoice` boolean: Generate einvoice
  - `is_export` boolean: Is Export
  - `export_invoice_details` ExportInvoiceDetails
    - `shipping_bill_date` string
    - `shipping_bill_number` string
    - `shipping_port_code` string
    - `export_type` 'Export under bond/LUT' | 'Export with IGST' | 'SEZ with IGST Payment' | 'SEZ without IGST Payment' | 'Deemed Export', required: Export Type
    - `conversion_factor` number, required
    - `country_id` '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': Country ID

## Response `200`

Success

- SuccessResponse
  - `success` boolean: Success
  - `message` string: Message
  - `serialNumber` string: Serial Number
  - `hashId` string: Hash ID

## Other responses

- `400`: Error
- `401`: Unauthorized
- `500`: Server Error

## Changes

- **2026-11-03** `0bcdbc62187b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/getswipe/apis/swipeapi/changes/v1/doc/post.md)

---

[API](https://skmtc.dev/getswipe/apis/swipeapi.md) - [All operations](https://skmtc.dev/getswipe/apis/swipeapi/llms.txt) - [OpenAPI document](https://skmtc.dev/getswipe/apis/swipeapi/revisions/0bcdbc62187b?raw)
