v1

latestOpenAPI 3.0.12026-07-263591116.9 KB
Document V2

Create a document

post/v2/doc

Request body

serial_numberstring

Serial Number (deprecated, please use New Serial Number)

document_type'invoice' | 'subscription' | 'pro_forma_invoice' | 'estimate' | 'sales_return' | 'purchase_return' | 'delivery_challan' | 'purchase' required

Value should always be the string 'invoice'

document_datestring required

DD-MM-YYYY

due_datestring

DD-MM-YYYY

referencestring

Any references you want to add to the doc

notesstring

Notes to show in invoice - please check template in swipe application to see where this is displayed

termsstring

Terms to show in invoice - please check template in swipe application to see where this is displayed

warehouse_idinteger

Warehouse ID

extra_discountnumber

Adjustment on overall invoice, doesn’t effect any tax amounts.

round_offboolean

Should Round Off total amount

tds_idinteger
tcs_idinteger
einvoiceboolean

Generate einvoice

is_exportboolean

Is Export

is_multi_currencyboolean

Is Multi Currency

is_subscriptionboolean

Is Subscription

Example request

{
  "serial_number": "INV123",
  "serial_number_v2": {
    "prefix": "INV-, INV/2024, INV-2024/25, INV/2024-25",
    "doc_number": 1,
    "suffix": "-suffix, /-suffix,-/suffix, /suffix"
  },
  "document_type": "invoice",
  "document_date": "11-06-2024",
  "party": {
    "id": "CUST123",
    "type": "customer",
    "name": "John Doe",
    "country_code": "91",
    "phone_number": "1234567890",
    "company_name": "Company Name",
    "email": "johndoe@example.com",
    "gstin": "27AARCS7202C1ZD",
    "shipping_address": {
      "addr_id": -1,
      "addr_id_v2": "addr1",
      "address_line1": "123 Street",
      "address_line2": "Apt 4B",
      "city": "City Name",
      "state": "State Name",
      "country": "Country Name",
      "pincode": "123456"
    },
    "billing_address": {
      "addr_id": -1,
      "addr_id_v2": "addr1",
      "address_line1": "123 Street",
      "address_line2": "Apt 4B",
      "city": "City Name",
      "state": "State Name",
      "country": "Country Name",
      "pincode": "123456"
    }
  },
  "due_date": "11-06-2024",
  "reference": "Reference Text",
  "notes": "Notes for the document",
  "terms": "Terms and Conditions",
  "items": [
    {
      "id": "ITEM123",
      "name": "Item Name",
      "quantity": 1,
      "unit_price": 100,
      "tax_rate": 18,
      "price_with_tax": 118,
      "net_amount": 100,
      "total_amount": 118,
      "discount_percent": 10,
      "discount_amount": 10,
      "description": "Item Description",
      "hsn_code": "1234",
      "item_type": "Product",
      "unit": "kg",
      "category": "Electronics",
      "custom_columns": [
        {
          "label": "Custom Field 1",
          "value": "Value 1"
        }
      ]
    }
  ],
  "warehouse_id": -1,
  "extra_discount": 20,
  "round_off": true,
  "payments": [
    {
      "amount": 100,
      "method": "upi",
      "notes": "Payment notes",
      "bank_details": {
        "account_number": "1234567890",
        "ifsc": "SBIN0000001",
        "bank_name": "State Bank of India",
        "branch": "Mumbai"
      }
    }
  ],
  "bank_details": {
    "account_number": "1234567890",
    "ifsc": "SBIN0000001",
    "bank_name": "State Bank of India",
    "branch": "Mumbai"
  },
  "charges_and_deductions": [
    {
      "id": 1,
      "name": "Delivery Charge",
      "amount": 100,
      "tax_rate": 18,
      "sac_code": "1234",
      "type": "charge"
    }
  ],
  "company_shipping_address": {
    "addr_id": -1,
    "addr_id_v2": "addr1",
    "address_line1": "123 Street",
    "address_line2": "Apt 4B",
    "city": "City Name",
    "state": "State Name",
    "country": "Country Name",
    "pincode": "123456"
  },
  "company_billing_address": {
    "addr_id": -1,
    "addr_id_v2": "addr1",
    "address_line1": "123 Street",
    "address_line2": "Apt 4B",
    "city": "City Name",
    "state": "State Name",
    "country": "Country Name",
    "pincode": "123456"
  },
  "export_invoice_details": {
    "shipping_bill_date": "14-02-2024",
    "shipping_bill_number": "123456",
    "shipping_port_code": "123456",
    "export_type": "With Payment of Tax",
    "country_id": "Afghanistan",
    "currency_id": "AED"
  },
  "subscription_details": {
    "start_time": "0019-08-17",
    "end_time": "0019-08-18",
    "repeat": 1,
    "repeat_type": "days"
  },
  "convert": {
    "convert_from": "invoice",
    "hash_id": "SL123"
  },
  "custom_headers": [
    {
      "label": "Custom Header 1",
      "value": "Value 1"
    }
  ]
}

Response

Success

successboolean
messagestring

Success Message

error_codestring

Error Code

errorsobject

Error details

Example response

{
  "success": true,
  "message": "Message",
  "data": {
    "hash_id": "SL123",
    "serial_number": "SL123"
  }
}