POST
/
v2
/
doc
curl --request POST \
  --url https://app.getswipe.in/api/partner/v2/doc \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "document_type": "invoice",
  "document_date": "15-11-2024",
  "party": {
    "id": "CUST123",
    "type": "customer",
    "name": "John Doe",
    "due_date": "15-11-2024"
  },
  "items": [
    {
      "id": "ITEM123455667ghg",
      "name": "Item Namgergggree",
      "quantity": 1,
      "unit_price": 200,
      "tax_rate": 18,
      "price_with_tax": 236,
      "net_amount": 200,
      "total_amount": 236,
      "item_type": "Product"
    }
  ]
}'

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

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
document_type
enum<string>
required

Value should always be the string 'invoice'

Available options:
invoice,
subscription,
pro_forma_invoice,
estimate,
sales_return,
purchase_return
document_date
string
required

DD-MM-YYYY

items
object[]
required

Array of Products/Services, refer Item Object below for parameters

serial_number
string

Serial Number (deprecated, please use New Serial Number)

serial_number_v2
object
party
object

Party

due_date
string

DD-MM-YYYY

reference
string

Any references you want to add to the doc

notes
string

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

terms
string

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

extra_discount
number

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

round_off
boolean
default: false

Should Round Off total amount

payments
object[]

Array of Payments, refer Payment Object for parameters

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 check the tcs id and details mapping from https://developers.getswipe.in/api-reference/references#tcs-tax-collected-at-source

charges_and_deductions
object[]

Array of Charges and Deductions, refer Additional Charges Deductions Object for parameters

company_shipping_address
object

Company shipping from Address, refer Shipping Address Object for parameters

company_billing_address
object

Company billing Address, refer Billing Address Object for parameters

einvoice
boolean

Generate einvoice

is_export
boolean

Is Export

export_invoice_details
object

Export Invoice Details

is_subscription
boolean

Is Subscription

subscription_details
object

Subscription Details

convert
object

Convert Document. Needed only when the document is already created and you want to convert it to another document

custom_headers
object[]

Document Custom Headers. Custom headers should already be added in Swipe Portal.

Response

200 - application/json
success
boolean
default: true
message
string

Success Message

error_code
string

Error Code

errors
object

Error details

data
object