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
header
required

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

Body

application/json
document_date
string
required

DD-MM-YYYY

document_type
enum<string>
required

Value should always be the string 'invoice'

Available options:
invoice,
subscription,
pro_forma_invoice,
estimate,
sales_return,
purchase_return
items
object[]
required

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

bank_details
object

Bank Details, it is used to display bank details in document PDFs. No payments are associated with these bank details.

charges_and_deductions
object[]

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

company_billing_address
object

Company billing Address, refer Billing Address Object for parameters

company_shipping_address
object

Company shipping from Address, refer Shipping Address Object for parameters

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.

due_date
string

DD-MM-YYYY

einvoice
boolean

Generate einvoice

export_invoice_details
object

Export Invoice Details

extra_discount
number

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

is_export
boolean

Is Export

is_subscription
boolean

Is Subscription

notes
string

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

party
object

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.

payments
object[]

Array of Payments, refer Payment Object for parameters

reference
string

Any references you want to add to the doc

round_off
boolean
default:
false

Should Round Off total amount

serial_number
string

Serial Number (deprecated, please use New Serial Number)

serial_number_v2
object
subscription_details
object

Subscription Details

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

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

terms
string

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

Response

200 - application/json
data
object
error_code
string

Error Code

errors
object

Error details

message
string

Success Message

success
boolean
default:
true