PUT
/
v2
/
doc
/
{doc_hash_id}
curl --request PUT \
  --url https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "serial_number": "INV123",
  "serial_number_v2": {
    "prefix": "INV",
    "doc_number": 1,
    "suffix": "2024"
  },
  "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,
      "address_line1": "123 Street",
      "address_line2": "Apt 4B",
      "city": "City Name",
      "state": "State Name",
      "country": "Country Name",
      "pincode": "123456"
    },
    "billing_address": {
      "addr_id": -1,
      "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"
        }
      ]
    }
  ],
  "extra_discount": 20,
  "round_off": true,
  "bank_details": {
    "account_number": "1234567890",
    "ifsc": "SBIN0000001",
    "bank_name": "State Bank of India",
    "branch": "Mumbai"
  },
  "tds_id": 123,
  "tcs_id": 123,
  "charges_and_deductions": [
    {
      "id": 1,
      "name": "Delivery Charge",
      "amount": 100,
      "tax_rate": 18,
      "sac_code": "1234",
      "type": "charge"
    }
  ],
  "company_shipping_address": {
    "addr_id": -1,
    "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,
    "address_line1": "123 Street",
    "address_line2": "Apt 4B",
    "city": "City Name",
    "state": "State Name",
    "country": "Country Name",
    "pincode": "123456"
  },
  "is_export": false,
  "export_invoice_details": {
    "shipping_bill_date": "14-02-2024",
    "shipping_bill_number": "123456",
    "shipping_port_code": "123456",
    "export_type": "With Payment of Tax",
    "conversion_factor": 123,
    "country_id": "Afghanistan",
    "currency_id": "AED"
  }
}'
{
  "success": true,
  "message": "Message",
  "error_code": "",
  "errors": {},
  "data": {
    "hash_id": "SL123",
    "serial_number": "SL123",
    "irn": "<string>",
    "qr_code": "<string>"
  }
}

To update a document, include the document’s unique doc_hash_id in the request URL and send all the keys with their updated values in the request body, ensuring the document is updated correctly with the provided data.

Authorizations

Authorization
string
header
required

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

Path Parameters

doc_hash_id
string
required

The hash ID of the document that needs to be updated.

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
Example:

"invoice"

document_date
string
required

DD-MM-YYYY

Example:

"11-06-2024"

items
object[]
required

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

serial_number
string

Serial Number (deprecated, please use New Serial Number)

Example:

"INV123"

serial_number_v2
object
Example:
{
  "prefix": "INV",
  "doc_number": 1,
  "suffix": "2024"
}
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.

due_date
string

DD-MM-YYYY

Example:

"11-06-2024"

reference
string

Any references you want to add to the doc

Example:

"Reference Text"

notes
string

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

Example:

"Notes for the document"

terms
string

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

Example:

"Terms and Conditions"

extra_discount
number

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

Example:

20

round_off
boolean
default:false

Should Round Off total amount

Example:

true

bank_details
object

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

tds_id
integer
tcs_id
integer
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

is_export
boolean

Is Export

Example:

false

export_invoice_details
object

Export Invoice Details

Response

200
application/json
Success
success
boolean
default:true
Example:

true

message
string

Success Message

Example:

"Message"

error_code
string

Error Code

Example:

""

errors
object

Error details

data
object